text:
<?php
namespace CallFire\Generator;

use CallFire\Generator\Rest as RestGenerator;
use Zend\Code\Generator\ClassGenerator;

require __DIR__."/../vendor/autoload.php";

$name = "Client";
$namespace = "CallFire\Api";
$restNamespace = "Rest";
$extendedClass = "AbstractClient";
$swaggerUrl = 'https://www.callfire.com/api/1.1/wsdl/swagger';

$requestNamespacePart = RestGenerator::REQUEST_NAMESPACE_ALIAS;
$requestNamespace = "{$namespace}\Rest\\{$requestNamespacePart}";

$responseNamespacePart = RestGenerator::RESPONSE_NAMESPACE_ALIAS;
$responseNamespace = "{$namespace}\Rest\\{$responseNamespacePart}";

$structureNamespacePart = RestGenerator::STRUCTURE_NAMESPACE_ALIAS;
$structureNamespace = "{$namespace}\Rest\\{$structureNamespacePart}";

$sourceDirectory = realpath(__DIR__."/../src").'/'.str_replace('\\', '/', $namespace);

$generator = new RestGenerator($swaggerUrl);

$classGenerator = new ClassGenerator($name, "{$namespace}\\{$restNamespace}\Client", null, $extendedClass);
$classGenerator->addUse("{$namespace}\\{$restNamespace}\\{$extendedClass}");
$generator->setClassGenerator($classGenerator);

$generator->generateClasses($requestNamespace, $responseNamespace, $structureNamespace);
$classFiles = $generator->generateClassFiles();
$requestClassFiles = $generator->generateRequestClassFiles();

if (!is_dir($sourceDirectory)) {
    mkdir($sourceDirectory, 0777, true);
}
if (!is_dir("{$sourceDirectory}/{$restNamespace}")) {
    mkdir("{$sourceDirectory}/{$restNamespace}", 0777, true);
}
if (!is_dir("{$sourceDirectory}/{$restNamespace}/Client")) {
    mkdir("{$sourceDirectory}/{$restNamespace}/Client", 0777, true);
}
if (!is_dir("{$sourceDirectory}/{$restNamespace}/Request")) {
    mkdir("{$sourceDirectory}/{$restNamespace}/Request", 0777, true);
}

foreach ($classFiles as $classFile) {
    $classFile->setFilename("{$sourceDirectory}/{$restNamespace}/Client/{$classFile->getClass()->getName()}.php");
    $classFile->write();
}

foreach ($requestClassFiles as $requestClassFile) {
    $requestClassFile->getClass()->setNamespacename("{$namespace}\\{$restNamespace}\Request");
    $requestClassFile->getClass()->addUse("{$namespace}\\{$restNamespace}\Request", RestGenerator::ABSTRACT_REQUEST_ALIAS);
    $requestClassFile->setFilename("{$sourceDirectory}/{$restNamespace}/Request/{$requestClassFile->getClass()->getName()}.php");
    $requestClassFile->write();
}

passthru('php '.__DIR__.'/../vendor/fabpot/php-cs-fixer/php-cs-fixer fix '.__DIR__.'/../src/CallFire/Api/Rest/ --level=all');


text:
package util

import (
	"fmt"
	"os"
	"os/exec"
	"path/filepath"
	"time"
)

var (
	exiftoolName = "exiftool"
)

func ExiftoolPath(toolPath string) (myPath string, err error) {
	if toolPath == "" {
		// provided path is empty, search PATH, it is not an error
		// if exiftool isn't found
		myPath, _ = ExiftoolPathFind()
	} else {
		myPath, err = ExiftoolPathValidate(toolPath)
	}
	return
}

// ExiftoolPathValidate validates the provided path to exiftool exists,
// and if so, returns the absolute path to it.
func ExiftoolPathValidate(toolPath string) (myPath string, err error) {
	_, err = os.Stat(toolPath)
	if err != nil {
		return
	}
	myPath, err = filepath.Abs(toolPath)
	return
}

// ExiftoolPathFind searches PATH for exiftool and returns the absolute
// path to it if found.
func ExiftoolPathFind() (myPath string, err error) {
	myPath, err = exec.LookPath(exiftoolName)
	if err != nil {
		return
	}
	myPath, err = filepath.Abs(myPath)
	return
}

// YYYY:MM:DD HH:MM:SS
func ExifTags() map[string]string {
	now := time.Now()
	return map[string]string{
		"ResolutionUnit": "inches",
		"XResolution":    "300",
		"YResolution":    "300",
		"Software":       "https://github.com/atongen/gosaic",
		"DateTime":       now.Format("2006:01:02 15:04:05"),
	}
}

// ExifCp copies exif data from src image to dst image.
// It excludes Orientation tag because the orientation has been
// normalized in the processed images.
func ExifCp(toolPath string, src, dst string) (string, error) {
	args := []string{"-overwrite_original_in_place", "-tagsFromFile", src, "-x", "Orientation"}
	for key, value := range ExifTags() {
		args = append(args, fmt.Sprintf("-%s=\"%s\"", key, value))
	}
	args = append(args, dst)
	cmd := exec.Command(toolPath, args...)
	out, err := cmd.CombinedOutput()
	return string(out), err
}

redpajama_set_name: RedPajamaGithub


text:
package identity

import (
	"io/ioutil"
	"net/http"
	"strings"
	"testing"
)

const (
	USERNAME    = "joe_user"
	PASSWORD    = "joe_user_api_key_opaque_string"
	TOKEN       = "aaaaa-bbbbb-ccccc-dddd"
	EXPIRES     = "2012-04-13T13:15:00.000-05:00"
	TENANT_ID   = "12345"
	TENANT_NAME = "Opaque Name Here"

	// Example taken from http://docs.rackspace.com/auth/api/v2.0/auth-client-devguide/content/Sample_Request_Response-d1e64.html
	// and then removed extraneous records.
	SUCCESSFUL_LOGIN_RESPONSE = `{
	"access": {
		"serviceCatalog": [{
			"endpoints": [{
				"publicURL": "https://ord.servers.api.rackspacecloud.com/v2/12345",
				"region": "ORD",
				"tenantId": "12345",
				"versionId": "2",
				"versionInfo": "https://ord.servers.api.rackspacecloud.com/v2",
				"versionList": "https://ord.servers.api.rackspacecloud.com/"
			},{
				"publicURL": "https://dfw.servers.api.rackspacecloud.com/v2/12345",
				"region": "DFW",
				"tenantId": "12345",
				"versionId": "2",
				"versionInfo": "https://dfw.servers.api.rackspacecloud.com/v2",
				"versionList": "https://dfw.servers.api.rackspacecloud.com/"
			}],
			"name": "cloudServersOpenStack",
			"type": "compute"
		},{
			"endpoints": [{
				"publicURL": "https://ord.databases.api.rackspacecloud.com/v1.0/12345",
				"region": "ORD",
				"tenantId": "12345"
			}],
			"name": "cloudDatabases",
			"type": "rax:database"
		}],
		"token": {
			"expires": "2012-04-13T13:15:00.000-05:00",
			"id": "aaaaa-bbbbb-ccccc-dddd"
		},
		"user": {
			"RAX-AUTH:defaultRegion": "DFW",
			"id": "161418",
			"name": "demoauthor",
			"roles": [{
				"description": "User Admin Role.",
				"id": "3",
				"name": "identity:user-admin"
			}]
		}
	}
}
`
	// Same as above, but includes 'tenant' block in the Token chunk.
	SUCCESSFUL_LOGIN_RESPONSE_WITH_TENANT_IDS = `{
	"access": {
		"serviceCatalog": [{
			"endpoints": [{
				"publicURL": "https://ord.servers.api.rackspacecloud.com/v2/12345",
				"region": "ORD",
				"tenantId": "12345",
				"versionId": "2",
				"versionInfo": "https://ord.servers.api.rackspacecloud.com/v2",
				"versionList": "https://ord.servers.api.rackspacecloud.com/"
			},{
				"publicURL": "https://dfw.servers.api.rackspacecloud.com/v2/12345",
				"region": "DFW",
				"tenantId": "12345",
				"versionId": "2",
				"versionInfo": "https://dfw.servers.api.rackspacecloud.com/v2",
				"versionList": "https://dfw.servers.api.rackspacecloud.com/"
			}],
			"name": "cloudServersOpenStack",
			"type": "compute"
		},{
			"endpoints": [{
				"publicURL": "https://ord.databases.api.rackspacecloud.com/v1.0/12345",
				"region": "ORD",
				"tenantId": "12345"
			}],
			"name": "cloudDatabases",
			"type": "rax:database"
		}],
		"token": {
			"expires": "2012-04-13T13:15:00.000-05:00",
			"id": "aaaaa-bbbbb-ccccc-dddd",
			"tenant": {
				"id": "12345",
				"name": "Opaque Name Here"
			}
		},
		"user": {
			"RAX-AUTH:defaultRegion": "DFW",
			"id": "161418",
			"name": "demoauthor",
			"roles": [{
				"description": "User Admin Role.",
				"id": "3",
				"name": "identity:user-admin"
			}]
		}
	}
}
`
)

func TestNewIdentity(t *testing.T) {
	id := NewIdentity(USERNAME, PASSWORD, "")
	if id.Username() != USERNAME {
		t.Error("NewIdentity: expected properly set username")
		return
	}
	if id.Password() != PASSWORD {
		t.Error("NewIdentity: expected password to be set")
		return
	}
	if id.Region() != "" {
		t.Error("NewIdentity: expected no specific region to be set")
		return
	}
	if id.AuthEndpoint() != US_ENDPOINT {
		t.Error("NewIdentity: expected US endpoint used for authentication")
		return
	}
	if id.IsAuthenticated() {
		t.Error("NewIdentity: new identities are not authenticated by default")
		return
	}

	id2 := NewIdentity(USERNAME, PASSWORD, "lon")
	if id2.AuthEndpoint() != UK_ENDPOINT {
		t.Error("NewIdentity: LON region must use UK endpoint")
		return
	}
}

type testTransport struct {
	response string
	called   uint
}

func (t *testTransport) RoundTrip(req *http.Request) (rsp *http.Response, err error) {
	t.called++

	headers := make(http.Header)
	headers.Add("Content-Type", "application/xml; charset=UTF-8")

	body := ioutil.NopCloser(strings.NewReader(t.response))

	rsp = &http.Response{
		Status:           "204 OK",
		StatusCode:       200,
		Proto:            "HTTP/1.1",
		ProtoMajor:       1,
		ProtoMinor:       1,
		Header:           headers,
		Body:             body,
		ContentLength:    -1,
		TransferEncoding: nil,
		Close:            true,
		Trailer:          nil,
		Request:          req,
	}
	return
}

func TestAuthenticationWithTenant(t *testing.T) {
	transport := &testTransport{
		response: SUCCESSFUL_LOGIN_RESPONSE_WITH_TENANT_IDS,
	}
	id := NewIdentity(USERNAME, PASSWORD, "")
	id.UseClient(&http.Client{
		Transport: transport,
	})
	err := id.Authenticate()
	if err != nil {
		t.Error("Auth:", err)
		return
	}
	if transport.called != 1 {
		t.Error("Auth: Expected HTTP request to be issued")
		return
	}
	if !id.IsAuthenticated() {
		t.Error("Auth: Expected authentication to succeed")
		return
	}
	tok, _ := id.Token()
	if tok != TOKEN {
		t.Error("Auth: Misparsed token: expected", TOKEN, "got:", tok)
		return
	}
	tenantId, _ := id.TenantId()
	if tenantId != TENANT_ID {
		t.Error("Auth: Expected tenant ID", TENANT_ID, "got:", tenantId)
		return
	}
	tenantName, _ := id.TenantName()
	if tenantName != TENANT_NAME {
		t.Error("Auth: Expected tenant name", TENANT_NAME, "got:", tenantName)
		return
	}
}

func TestAuthentication(t *testing.T) {
	transport := &testTransport{
		response: SUCCESSFUL_LOGIN_RESPONSE,
	}
	id := NewIdentity(USERNAME, PASSWORD, "")
	id.UseClient(&http.Client{
		Transport: transport,
	})
	err := id.Authenticate()
	if err != nil {
		t.Error("Auth:", err)
		return
	}
	if transport.called != 1 {
		t.Error("Auth: Expected HTTP request to be issued")
		return
	}
	if !id.IsAuthenticated() {
		t.Error("Auth: Expected authentication to succeed")
		return
	}
	tok, _ := id.Token()
	if tok != TOKEN {
		t.Error("Auth: Misparsed token: expected", TOKEN, "got:", tok)
		return
	}
	exp, _ := id.Expires()
	if exp != EXPIRES {
		t.Error("Auth: Misparsed expiration timestamp: expected", EXPIRES, "got:", exp)
		return
	}
	tenantId, _ := id.TenantId()
	if tenantId != "" {
		t.Error("Auth: unexpected tenant ID")
		return
	}
	tenantName, _ := id.TenantName()
	if tenantName != "" {
		t.Error("Auth: unexpected tenant name")
		return
	}
	svc, _ := id.ServiceCatalog()
	if len(svc) != 2 {
		t.Error("Auth: Heuristic -- service catalog count doesn't match 2; got", len(svc))
		return
	}
	roles, _ := id.Roles()
	if len(roles) != 1 {
		t.Error("Auth: Heuristic -- roles length isn't 1; got", len(roles))
		return
	}
}


text:
package ro.ase.cts.lab4.factories;

import ro.ase.cts.lab4.superheroes.ISuperhero;
import ro.ase.cts.lab4.superheroes.SuperHeroesType;

public abstract class AbstractSuperHeroFactory {
	protected String engine;
	public AbstractSuperHeroFactory(String engineName){
		this.engine = engineName;
	}

	public abstract ISuperhero getSuperHero(SuperHeroesType type);
}


text:
package com.renault.rnet.idp.samlconsumer;

import javax.servlet.http.HttpServletRequest;

public class SamlUrl {

	private final String SAML_RESPONSE = "SAMLResponse";
	private final String RELAYSTATE = "RelayState";

	private String saml64 =null;
	private String relay = null;

	public SamlUrl(HttpServletRequest request){
		this.setSaml64(request.getParameter(SAML_RESPONSE));
		this.setRelay(request.getParameter(RELAYSTATE));
	}

	public String getSaml64() {
		return saml64;
	}

	public void setSaml64(String saml64) {
		this.saml64 = saml64;
	}

	public String getRelay() {
		return relay;
	}

	public void setRelay(String relay) {
		this.relay = relay;
	}
}


text:
#ifndef EXDISPID_H_
#define EXDISPID_H_

#define DISPID_BEFORENAVIGATE 100
#define DISPID_NAVIGATECOMPLETE 101
#define DISPID_STATUSTEXTCHANGE 102
#define DISPID_QUIT 103
#define DISPID_DOWNLOADCOMPLETE 104
#define DISPID_COMMANDSTATECHANGE 105
#define DISPID_DOWNLOADBEGIN 106
#define DISPID_NEWWINDOW 107
#define DISPID_PROGRESSCHANGE 108
#define DISPID_WINDOWMOVE 109
#define DISPID_WINDOWRESIZE 110
#define DISPID_WINDOWACTIVATE 111
#define DISPID_PROPERTYCHANGE 112
#define DISPID_TITLECHANGE 113
#define DISPID_TITLEICONCHANGE 114

#define DISPID_FRAMEBEFORENAVIGATE 200
#define DISPID_FRAMENAVIGATECOMPLETE 201
#define DISPID_FRAMENEWWINDOW 204

#define DISPID_BEFORENAVIGATE2 250
#define DISPID_NEWWINDOW2 251
#define DISPID_NAVIGATECOMPLETE2 252
#define DISPID_ONQUIT 253
#define DISPID_ONVISIBLE 254
#define DISPID_ONTOOLBAR 255
#define DISPID_ONMENUBAR 256
#define DISPID_ONSTATUSBAR 257
#define DISPID_ONFULLSCREEN 258
#define DISPID_DOCUMENTCOMPLETE 259
#define DISPID_ONTHEATERMODE 260
#define DISPID_ONADDRESSBAR 261
#define DISPID_WINDOWSETRESIZABLE 262
#define DISPID_WINDOWCLOSING 263
#define DISPID_WINDOWSETLEFT 264
#define DISPID_WINDOWSETTOP 265
#define DISPID_WINDOWSETWIDTH 266
#define DISPID_WINDOWSETHEIGHT 267
#define DISPID_CLIENTTOHOSTWINDOW 268
#define DISPID_SETSECURELOCKICON 269
#define DISPID_FILEDOWNLOAD 270
#define DISPID_NAVIGATEERROR 271
#define DISPID_PRIVACYIMPACTEDSTATECHANGE 272
#define DISPID_NEWWINDOW3 273

#define DISPID_PRINTTEMPLATEINSTANTIATION 225
#define DISPID_PRINTTEMPLATETEARDOWN 226
#define DISPID_UPDATEPAGESTATUS 227

#define DISPID_WINDOWREGISTERED 200
#define DISPID_WINDOWREVOKED 201

#define DISPID_RESETFIRSTBOOTMODE 1
#define DISPID_RESETSAFEMODE 2
#define DISPID_REFRESHOFFLINEDESKTOP 3
#define DISPID_ADDFAVORITE 4
#define DISPID_ADDCHANNEL 5
#define DISPID_ADDDESKTOPCOMPONENT 6
#define DISPID_ISSUBSCRIBED 7
#define DISPID_NAVIGATEANDFIND 8
#define DISPID_IMPORTEXPORTFAVORITES 9
#define DISPID_AUTOCOMPLETESAVEFORM 10
#define DISPID_AUTOSCAN 11
#define DISPID_AUTOCOMPLETEATTACH 12
#define DISPID_SHOWBROWSERUI 13
#define DISPID_SHELLUIHELPERLAST 13

#define DISPID_ADVANCEERROR 10
#define DISPID_RETREATERROR 11
#define DISPID_CANADVANCEERROR 12
#define DISPID_CANRETREATERROR 13
#define DISPID_GETERRORLINE 14
#define DISPID_GETERRORCHAR 15
#define DISPID_GETERRORCODE 16
#define DISPID_GETERRORMSG 17
#define DISPID_GETERRORURL 18
#define DISPID_GETDETAILSSTATE 19
#define DISPID_SETDETAILSSTATE 20
#define DISPID_GETPERERRSTATE 21
#define DISPID_SETPERERRSTATE 22
#define DISPID_GETALWAYSSHOWLOCKSTATE 23

#define DISPID_FAVSELECTIONCHANGE 1
#define DISPID_SELECTIONCHANGE 2
#define DISPID_DOUBLECLICK 3
#define DISPID_INITIALIZED 4

#define DISPID_MOVESELECTIONUP 1
#define DISPID_MOVESELECTIONDOWN 2
#define DISPID_RESETSORT 3
#define DISPID_NEWFOLDER 4
#define DISPID_SYNCHRONIZE 5
#define DISPID_IMPORT 6
#define DISPID_EXPORT 7
#define DISPID_INVOKECONTEXTMENU 8
#define DISPID_MOVESELECTIONTO 9
#define DISPID_SUBSCRIPTIONSENABLED 10
#define DISPID_CREATESUBSCRIPTION 11
#define DISPID_DELETESUBSCRIPTION 12
#define DISPID_SETROOT 13
#define DISPID_ENUMOPTIONS 14
#define DISPID_SELECTEDITEM 15
#define DISPID_ROOT 16
#define DISPID_DEPTH 17
#define DISPID_MODE 18
#define DISPID_FLAGS 19
#define DISPID_TVFLAGS 20
#define DISPID_NSCOLUMNS 21
#define DISPID_COUNTVIEWTYPES 22
#define DISPID_SETVIEWTYPE 23
#define DISPID_SELECTEDITEMS 24
#define DISPID_EXPAND 25
#define DISPID_UNSELECTALL 26

#endif


text:
package org.jboss.migration.wfly10.config.task.update;

import org.jboss.migration.core.env.MigrationEnvironment;
import org.jboss.migration.core.jboss.JBossServer;
import org.jboss.migration.core.jboss.JBossServerConfiguration;
import org.jboss.migration.core.task.ServerMigrationTask;
import org.jboss.migration.core.task.ServerMigrationTaskName;
import org.jboss.migration.core.task.ServerMigrationTaskResult;
import org.jboss.migration.core.task.TaskContext;
import org.jboss.migration.core.task.component.SimpleComponentTask;
import org.jboss.migration.core.util.xml.XMLFileFilter;
import org.jboss.migration.core.util.xml.XMLFiles;
import org.jboss.migration.wfly10.config.task.ServerConfigurationMigration;

import javax.xml.namespace.QName;
import javax.xml.stream.events.Attribute;
import java.util.Collections;
import java.util.HashSet;
import java.util.Set;

import static org.jboss.migration.core.task.component.TaskSkipPolicy.skipIfDefaultTaskSkipPropertyIsSet;

/**
 * @author emmartins
 */
public class RemoveUnsupportedExtensions<S extends JBossServer<S>> implements ServerConfigurationMigration.XMLConfigurationSubtaskFactory<JBossServerConfiguration<S>> {

    public interface EnvironmentProperties {
        /**
         * the prefix for the name of extensions related properties
         */
        String PREFIX = "extensions.";

        /**
         * a list with extensions to include, i.e. not remove from config
         */
        String INCLUDES = PREFIX + "includes";

        /**
         * a list with extensions to exclude, i.e. remove from config
         */
        String EXCLUDES = PREFIX + "excludes";
    }

    public static final String TASK_NAME = "extensions.remove-unsupported-extensions";
    public static final String SUBTASK_NAME = TASK_NAME +".remove-unsupported-extension";
    public static final String SUBTASK_NAME_ATTRIBUTE_MODULE = "module";

    @Override
    public ServerMigrationTask getTask(final JBossServerConfiguration<S> source, final JBossServerConfiguration targetConfigurationPath) {
        return new SimpleComponentTask.Builder()
                .name(TASK_NAME)
                .skipPolicy(skipIfDefaultTaskSkipPropertyIsSet())
                .runnable(context -> {
                    context.getLogger().debugf("Searching for extensions not supported by the target server...");
                    removeExtensions(source, targetConfigurationPath, context);
                    if (!context.hasSucessfulSubtasks()) {
                        context.getLogger().debugf("No unsupported extensions found.");
                    }
                    return ServerMigrationTaskResult.SUCCESS;
                })
                .build();
    }

    protected void removeExtensions(final JBossServerConfiguration<S> source, final JBossServerConfiguration targetConfigurationPath, final TaskContext context) {
        // gather the module names of extensions to accept (env property includes + target server extensions - env property excludes)
        final Set<String> accepted = new HashSet<>(targetConfigurationPath.getServer().getExtensions().getExtensionModuleNames());
        final MigrationEnvironment environment = context.getMigrationEnvironment();
        accepted.addAll(environment.getPropertyAsList(EnvironmentProperties.INCLUDES, Collections.emptyList()));
        accepted.removeAll(environment.getPropertyAsList(EnvironmentProperties.EXCLUDES, Collections.emptyList()));
        // setup and run the xml filter to remove not accepted extensions
        final Set<String> removed = new HashSet<>();
        final XMLFileFilter extensionsFilter = (startElement, xmlEventReader, xmlEventWriter, xmlEventFactory) -> {
            if (startElement.getName().getLocalPart().equals("extension")) {
                Attribute moduleAttr = startElement.getAttributeByName(new QName("module"));
                final String moduleName = moduleAttr.getValue();
                if (accepted.contains(moduleName)) {
                    return XMLFileFilter.Result.ADD;
                } else {
                    // TODO if interactive mode, extension not excluded, and not a source server extension, then confirm with user its removal (feature to provide configless custom extension migration)
                    final ServerMigrationTask subtask = new SimpleComponentTask.Builder()
                            .name(new ServerMigrationTaskName.Builder(SUBTASK_NAME)
                                    .addAttribute(SUBTASK_NAME_ATTRIBUTE_MODULE, moduleName)
                                    .build())
                            .runnable(subtaskContext -> {
                                subtaskContext.getLogger().debugf("Extension with module '%s' removed.", moduleName);
                                removed.add(moduleName);
                                return ServerMigrationTaskResult.SUCCESS;
                            })
                            .build();
                    context.execute(subtask);
                    return XMLFileFilter.Result.REMOVE;
                }
            } else {
                if (startElement.getName().getLocalPart().equals("excluded-extensions")) {
                    // this element also has extension child elements, yet those should not be filtered
                    return XMLFileFilter.Result.ADD_ALL;
                } else {
                    return XMLFileFilter.Result.NOT_APPLICABLE;
                }
            }
        };
        XMLFiles.filter(targetConfigurationPath.getPath(), extensionsFilter);
        if (!removed.isEmpty()) {
            context.getLogger().infof("Unsupported extensions removed: %s", removed);
        }
    }
}


text:
import RegisterView from '../views/register.html';

export default ['$stateProvider', ($stateProvider) => {
    $stateProvider
        .state('register', {
            resolve: {
                auth: ['UserService', (userService) => {
                    return userService.checkRules({
                        signOut: true
                    });
                }]
            },
            url: '/register',
            template: RegisterView,
            controller: 'RegisterCtrl',
            controllerAs: 'register',
            params: {
                toState: 'home',
                toParams: {}
            },
            ncyBreadcrumb: {
                label: 'Register'
            }
        });
}];


text:
/////////////////////////////////////////////////////////////////////////////
// Name:        wx/object.h
// Purpose:     wxObject class, plus run-time type information macros
// Author:      Julian Smart
// Modified by: Ron Lee
// Created:     01/02/97
// RCS-ID:      $Id: object.h,v 1.119 2005/07/22 16:56:23 ABX Exp $
// Copyright:   (c) 1997 Julian Smart
//              (c) 2001 Ron Lee <ron@debian.org>
// Licence:     wxWindows licence
/////////////////////////////////////////////////////////////////////////////

#ifndef _WX_OBJECTH__
#define _WX_OBJECTH__

#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
#pragma interface "object.h"
#endif

// ----------------------------------------------------------------------------
// headers
// ----------------------------------------------------------------------------

#include "wx/defs.h"
#include "wx/memory.h"

class WXDLLIMPEXP_BASE wxObject;

#ifndef wxUSE_EXTENDED_RTTI
#define wxUSE_EXTENDED_RTTI 0
#endif

#if wxUSE_EXTENDED_RTTI
#include "wx/xti.h"
#else

// ----------------------------------------------------------------------------
// conditional compilation
// ----------------------------------------------------------------------------

// this shouldn't be needed any longer as <wx/msw/private.h> does it but it
// doesn't hurt neither
#ifdef GetClassName
#undef GetClassName
#endif
#ifdef GetClassInfo
#undef GetClassInfo
#endif

class WXDLLIMPEXP_BASE wxClassInfo;
class WXDLLIMPEXP_BASE wxHashTable;
class WXDLLIMPEXP_BASE wxObjectRefData;

// ----------------------------------------------------------------------------
// wxClassInfo
// ----------------------------------------------------------------------------

typedef wxObject *(*wxObjectConstructorFn)(void);

class WXDLLIMPEXP_BASE wxClassInfo
{
public:
    wxClassInfo( const wxChar *className,
                 const wxClassInfo *baseInfo1,
                 const wxClassInfo *baseInfo2,
                 int size,
                 wxObjectConstructorFn ctor )
        : m_className(className)
        , m_objectSize(size)
        , m_objectConstructor(ctor)
        , m_baseInfo1(baseInfo1)
        , m_baseInfo2(baseInfo2)
        , m_next(sm_first)
        {
            sm_first = this;
            Register();
        }

    ~wxClassInfo();

    wxObject *CreateObject() { return m_objectConstructor ? (*m_objectConstructor)() : 0; }

    const wxChar       *GetClassName() const { return m_className; }
    const wxChar       *GetBaseClassName1() const
        { return m_baseInfo1 ? m_baseInfo1->GetClassName() : NULL; }
    const wxChar       *GetBaseClassName2() const
        { return m_baseInfo2 ? m_baseInfo2->GetClassName() : NULL; }
    const wxClassInfo  *GetBaseClass1() const { return m_baseInfo1; }
    const wxClassInfo  *GetBaseClass2() const { return m_baseInfo2; }
    int                 GetSize() const { return m_objectSize; }

    wxObjectConstructorFn      GetConstructor() const { return m_objectConstructor; }
    static const wxClassInfo  *GetFirst() { return sm_first; }
    const wxClassInfo         *GetNext() const { return m_next; }
    static wxClassInfo        *FindClass(const wxChar *className);

        // Climb upwards through inheritance hierarchy.
        // Dual inheritance is catered for.

    bool IsKindOf(const wxClassInfo *info) const
    {
        return info != 0 &&
               ( info == this ||
                 ( m_baseInfo1 && m_baseInfo1->IsKindOf(info) ) ||
                 ( m_baseInfo2 && m_baseInfo2->IsKindOf(info) ) );
    }

#if WXWIN_COMPATIBILITY_2_4
    // Initializes parent pointers and hash table for fast searching.
    wxDEPRECATED( static void InitializeClasses() );
    // Cleans up hash table used for fast searching.
    wxDEPRECATED( static void CleanUpClasses() );
#endif
    static void     CleanUp();

public:
    const wxChar            *m_className;
    int                      m_objectSize;
    wxObjectConstructorFn    m_objectConstructor;

        // Pointers to base wxClassInfos: set in InitializeClasses

    const wxClassInfo       *m_baseInfo1;
    const wxClassInfo       *m_baseInfo2;

        // class info object live in a linked list:
        // pointers to its head and the next element in it

    static wxClassInfo      *sm_first;
    wxClassInfo             *m_next;

    // FIXME: this should be private (currently used directly by way too
    //        many clients)
    static wxHashTable      *sm_classTable;

private:
    // InitializeClasses() helper
    static wxClassInfo *GetBaseByName(const wxChar *name);

    DECLARE_NO_COPY_CLASS(wxClassInfo)

protected:
    // registers the class
    void Register();
    void Unregister();
};

WXDLLIMPEXP_BASE wxObject *wxCreateDynamicObject(const wxChar *name);

#if WXWIN_COMPATIBILITY_2_4
inline void wxClassInfo::InitializeClasses() {}
inline void wxClassInfo::CleanUpClasses() {}
#endif

// ----------------------------------------------------------------------------
// Dynamic class macros
// ----------------------------------------------------------------------------

#define DECLARE_ABSTRACT_CLASS(name)                                          \
    public:                                                                   \
        static wxClassInfo ms_classInfo;                                      \
        virtual wxClassInfo *GetClassInfo() const;

#define DECLARE_DYNAMIC_CLASS_NO_ASSIGN(name)                                 \
    DECLARE_NO_ASSIGN_CLASS(name)                                             \
    DECLARE_DYNAMIC_CLASS(name)

#define DECLARE_DYNAMIC_CLASS_NO_COPY(name)                                   \
    DECLARE_NO_COPY_CLASS(name)                                               \
    DECLARE_DYNAMIC_CLASS(name)

#define DECLARE_DYNAMIC_CLASS(name)                                           \
    DECLARE_ABSTRACT_CLASS(name)                                              \
    static wxObject* wxCreateObject();

#define DECLARE_CLASS(name) DECLARE_DYNAMIC_CLASS(name)

// common part of the macros below
#define wxIMPLEMENT_CLASS_COMMON(name, basename, baseclsinfo2, func)          \
    wxClassInfo name::ms_classInfo(wxT(#name),                                \
            &basename::ms_classInfo,                                          \
            baseclsinfo2,                                                     \
            (int) sizeof(name),                                               \
            (wxObjectConstructorFn) func);                                    \
                                                                              \
    wxClassInfo *name::GetClassInfo() const                                   \
        { return &name::ms_classInfo; }

#define wxIMPLEMENT_CLASS_COMMON1(name, basename, func)                       \
    wxIMPLEMENT_CLASS_COMMON(name, basename, NULL, func)

#define wxIMPLEMENT_CLASS_COMMON2(name, basename1, basename2, func)           \
    wxIMPLEMENT_CLASS_COMMON(name, basename1, &basename2::ms_classInfo, func)

// -----------------------------------
// for concrete classes
// -----------------------------------

    // Single inheritance with one base class
#define IMPLEMENT_DYNAMIC_CLASS(name, basename)                               \
    wxIMPLEMENT_CLASS_COMMON1(name, basename, name::wxCreateObject)           \
    wxObject* name::wxCreateObject()                                          \
        { return new name; }

    // Multiple inheritance with two base classes
#define IMPLEMENT_DYNAMIC_CLASS2(name, basename1, basename2)                  \
    wxIMPLEMENT_CLASS_COMMON2(name, basename1, basename2,                     \
                              name::wxCreateObject)                           \
    wxObject* name::wxCreateObject()                                          \
        { return new name; }

// -----------------------------------
// for abstract classes
// -----------------------------------

    // Single inheritance with one base class

#define IMPLEMENT_ABSTRACT_CLASS(name, basename)                              \
    wxIMPLEMENT_CLASS_COMMON1(name, basename, NULL)

    // Multiple inheritance with two base classes

#define IMPLEMENT_ABSTRACT_CLASS2(name, basename1, basename2)                 \
    wxIMPLEMENT_CLASS_COMMON2(name, basename1, basename2, NULL)

#define IMPLEMENT_CLASS IMPLEMENT_ABSTRACT_CLASS
#define IMPLEMENT_CLASS2 IMPLEMENT_ABSTRACT_CLASS2

#endif // !wxUSE_EXTENDED_RTTI

// -----------------------------------
// for pluggable classes
// -----------------------------------

    // NOTE: this should probably be the very first statement
    //       in the class declaration so wxPluginSentinel is
    //       the first member initialised and the last destroyed.

// _DECLARE_DL_SENTINEL(name) wxPluginSentinel m_pluginsentinel;

#if wxUSE_NESTED_CLASSES

#define _DECLARE_DL_SENTINEL(name, exportdecl)  \
class exportdecl name##PluginSentinel {         \
private:                                        \
    static const wxString sm_className;         \
public:                                         \
    name##PluginSentinel();                     \
    ~name##PluginSentinel();                    \
};                                              \
name##PluginSentinel  m_pluginsentinel;

#define _IMPLEMENT_DL_SENTINEL(name)                                \
 const wxString name::name##PluginSentinel::sm_className(#name);    \
 name::name##PluginSentinel::name##PluginSentinel() {               \
    wxPluginLibrary *e = (wxPluginLibrary*) wxPluginLibrary::ms_classes.Get(#name);   \
    if( e != 0 ) { e->RefObj(); }                                      \
 }                                                                  \
 name::name##PluginSentinel::~name##PluginSentinel() {            \
    wxPluginLibrary *e = (wxPluginLibrary*) wxPluginLibrary::ms_classes.Get(#name);   \
    if( e != 0 ) { e->UnrefObj(); }                                 \
 }
#else

#define _DECLARE_DL_SENTINEL(name)
#define _IMPLEMENT_DL_SENTINEL(name)

#endif  // wxUSE_NESTED_CLASSES

#define DECLARE_PLUGGABLE_CLASS(name) \
 DECLARE_DYNAMIC_CLASS(name) _DECLARE_DL_SENTINEL(name, WXDLLEXPORT)
#define DECLARE_ABSTRACT_PLUGGABLE_CLASS(name)  \
 DECLARE_ABSTRACT_CLASS(name) _DECLARE_DL_SENTINEL(name, WXDLLEXPORT)

#define DECLARE_USER_EXPORTED_PLUGGABLE_CLASS(name, usergoo) \
 DECLARE_DYNAMIC_CLASS(name) _DECLARE_DL_SENTINEL(name, usergoo)
#define DECLARE_USER_EXPORTED_ABSTRACT_PLUGGABLE_CLASS(name, usergoo)  \
 DECLARE_ABSTRACT_CLASS(name) _DECLARE_DL_SENTINEL(name, usergoo)

#define IMPLEMENT_PLUGGABLE_CLASS(name, basename) \
 IMPLEMENT_DYNAMIC_CLASS(name, basename) _IMPLEMENT_DL_SENTINEL(name)
#define IMPLEMENT_PLUGGABLE_CLASS2(name, basename1, basename2)  \
 IMPLEMENT_DYNAMIC_CLASS2(name, basename1, basename2) _IMPLEMENT_DL_SENTINEL(name)
#define IMPLEMENT_ABSTRACT_PLUGGABLE_CLASS(name, basename) \
 IMPLEMENT_ABSTRACT_CLASS(name, basename) _IMPLEMENT_DL_SENTINEL(name)
#define IMPLEMENT_ABSTRACT_PLUGGABLE_CLASS2(name, basename1, basename2)  \
 IMPLEMENT_ABSTRACT_CLASS2(name, basename1, basename2) _IMPLEMENT_DL_SENTINEL(name)

#define IMPLEMENT_USER_EXPORTED_PLUGGABLE_CLASS(name, basename) \
 IMPLEMENT_PLUGGABLE_CLASS(name, basename)
#define IMPLEMENT_USER_EXPORTED_PLUGGABLE_CLASS2(name, basename1, basename2)  \
 IMPLEMENT_PLUGGABLE_CLASS2(name, basename1, basename2)
#define IMPLEMENT_USER_EXPORTED_ABSTRACT_PLUGGABLE_CLASS(name, basename) \
 IMPLEMENT_ABSTRACT_PLUGGABLE_CLASS(name, basename)
#define IMPLEMENT_USER_EXPORTED_ABSTRACT_PLUGGABLE_CLASS2(name, basename1, basename2)  \
 IMPLEMENT_ABSTRACT_PLUGGABLE_CLASS2(name, basename1, basename2)

#define CLASSINFO(name) (&name::ms_classInfo)

#define wxIS_KIND_OF(obj, className) obj->IsKindOf(&className::ms_classInfo)

// Just seems a bit nicer-looking (pretend it's not a macro)
#define wxIsKindOf(obj, className) obj->IsKindOf(&className::ms_classInfo)

// this cast does some more checks at compile time as it uses static_cast
// internally
//
// note that it still has different semantics from dynamic_cast<> and so can't
// be replaced by it as long as there are any compilers not supporting it
#define wxDynamicCast(obj, className) \
    ((className *) wxCheckDynamicCast( \
        wx_const_cast(wxObject *, wx_static_cast(const wxObject *, \
          wx_const_cast(className *, wx_static_cast(const className *, obj)))), \
        &className::ms_classInfo))

// The 'this' pointer is always true, so use this version
// to cast the this pointer and avoid compiler warnings.
#define wxDynamicCastThis(className) \
     (IsKindOf(&className::ms_classInfo) ? (className *)(this) : (className *)0)

#ifdef __WXDEBUG__
inline void* wxCheckCast(void *ptr)
{
    wxASSERT_MSG( ptr, _T("wxStaticCast() used incorrectly") );
    return ptr;
}
#define wxStaticCast(obj, className) \
 ((className *)wxCheckCast(wxDynamicCast(obj, className)))

#else  // !__WXDEBUG__
#define wxStaticCast(obj, className) \
    wx_const_cast(className *, wx_static_cast(const className *, obj))

#endif  // __WXDEBUG__

// ----------------------------------------------------------------------------
// set up memory debugging macros
// ----------------------------------------------------------------------------

/*
    Which new/delete operator variants do we want?

    _WX_WANT_NEW_SIZET_WXCHAR_INT             = void *operator new (size_t size, wxChar *fileName = 0, int lineNum = 0)
    _WX_WANT_DELETE_VOID                      = void operator delete (void * buf)
    _WX_WANT_DELETE_VOID_CONSTCHAR_SIZET      = void operator delete (void *buf, const char *_fname, size_t _line)
    _WX_WANT_DELETE_VOID_WXCHAR_INT           = void operator delete(void *buf, wxChar*, int)
    _WX_WANT_ARRAY_NEW_SIZET_WXCHAR_INT       = void *operator new[] (size_t size, wxChar *fileName , int lineNum = 0)
    _WX_WANT_ARRAY_DELETE_VOID                = void operator delete[] (void *buf)
    _WX_WANT_ARRAY_DELETE_VOID_WXCHAR_INT     = void operator delete[] (void* buf, wxChar*, int )
*/

#if defined(__WXDEBUG__) && wxUSE_MEMORY_TRACING

// All compilers get this one
#define _WX_WANT_NEW_SIZET_WXCHAR_INT

// Everyone except Visage gets the next one
#ifndef __VISAGECPP__
    #define _WX_WANT_DELETE_VOID
#endif

// Only visage gets this one under the correct circumstances
#if defined(__VISAGECPP__) && __DEBUG_ALLOC__
    #define _WX_WANT_DELETE_VOID_CONSTCHAR_SIZET
#endif

// Only VC++ 6.0 and CodeWarrior compilers get overloaded delete that matches new
#if ( defined(__VISUALC__) && (__VISUALC__ >= 1200) ) || (defined(__MWERKS__) && (__MWERKS__ >= 0x2400))
    #define _WX_WANT_DELETE_VOID_WXCHAR_INT
#endif

// Now see who (if anyone) gets the array memory operators
#if wxUSE_ARRAY_MEMORY_OPERATORS

    // Everyone except Visual C++ (cause problems for VC++ - crashes)
    #if !defined(__VISUALC__)
        #define _WX_WANT_ARRAY_NEW_SIZET_WXCHAR_INT
    #endif

    // Everyone except Visual C++ (cause problems for VC++ - crashes)
    #if !defined(__VISUALC__)
        #define _WX_WANT_ARRAY_DELETE_VOID
    #endif

    // Only CodeWarrior 6 or higher
    #if defined(__MWERKS__) && (__MWERKS__ >= 0x2400)
        #define _WX_WANT_ARRAY_DELETE_VOID_WXCHAR_INT
    #endif

#endif // wxUSE_ARRAY_MEMORY_OPERATORS

#endif // __WXDEBUG__ && wxUSE_MEMORY_TRACING

// ----------------------------------------------------------------------------
// wxObject: the root class of wxWidgets object hierarchy
// ----------------------------------------------------------------------------

class WXDLLIMPEXP_BASE wxObject
{
    DECLARE_ABSTRACT_CLASS(wxObject)

private:
    void InitFrom(const wxObject& other);

public:
    wxObject() { m_refData = NULL; }
    virtual ~wxObject() { UnRef(); }

    wxObject(const wxObject& other)
    {
        InitFrom(other);
    }

    wxObject& operator=(const wxObject& other)
    {
        if ( this != &other )
        {
            UnRef();
            InitFrom(other);
        }
        return *this;
    }

    bool IsKindOf(wxClassInfo *info) const;

    // Turn on the correct set of new and delete operators

#ifdef _WX_WANT_NEW_SIZET_WXCHAR_INT
    void *operator new ( size_t size, const wxChar *fileName = NULL, int lineNum = 0 );
#endif

#ifdef _WX_WANT_DELETE_VOID
    void operator delete ( void * buf );
#endif

#ifdef _WX_WANT_DELETE_VOID_CONSTCHAR_SIZET
    void operator delete ( void *buf, const char *_fname, size_t _line );
#endif

#ifdef _WX_WANT_DELETE_VOID_WXCHAR_INT
    void operator delete ( void *buf, const wxChar*, int );
#endif

#ifdef _WX_WANT_ARRAY_NEW_SIZET_WXCHAR_INT
    void *operator new[] ( size_t size, const wxChar *fileName = NULL, int lineNum = 0 );
#endif

#ifdef _WX_WANT_ARRAY_DELETE_VOID
    void operator delete[] ( void *buf );
#endif

#ifdef _WX_WANT_ARRAY_DELETE_VOID_WXCHAR_INT
    void operator delete[] (void* buf, const wxChar*, int );
#endif

    // ref counted data handling methods

    // get/set
    wxObjectRefData *GetRefData() const { return m_refData; }
    void SetRefData(wxObjectRefData *data) { m_refData = data; }

    // make a 'clone' of the object
    void Ref(const wxObject& clone);

    // destroy a reference
    void UnRef();

    // Reserved for future use
    virtual void ReservedObjectFunc1() {}
    virtual void ReservedObjectFunc2() {}
    virtual void ReservedObjectFunc3() {}
    virtual void ReservedObjectFunc4() {}
    virtual void ReservedObjectFunc5() {}
    virtual void ReservedObjectFunc6() {}
    virtual void ReservedObjectFunc7() {}
    virtual void ReservedObjectFunc8() {}
    virtual void ReservedObjectFunc9() {}

protected:
    // ensure that our data is not shared with anybody else: if we have no
    // data, it is created using CreateRefData() below, if we have shared data
    // it is copied using CloneRefData(), otherwise nothing is done
    void AllocExclusive();

    // both methods must be implemented if Unshare() is used, not pure virtual
    // only because of the backwards compatibility reasons

    // create a new m_refData
    virtual wxObjectRefData *CreateRefData() const;

    // create a new m_refData initialized with the given one
    virtual wxObjectRefData *CloneRefData(const wxObjectRefData *data) const;

    wxObjectRefData *m_refData;
};

// ----------------------------------------------------------------------------
// wxObjectRefData: ref counted data meant to be stored in wxObject
// ----------------------------------------------------------------------------

class WXDLLIMPEXP_BASE wxObjectRefData
{
    friend class WXDLLIMPEXP_BASE wxObject;

public:
    wxObjectRefData() : m_count(1) { }
    virtual ~wxObjectRefData() { }

    int GetRefCount() const { return m_count; }

private:
    int m_count;
};

inline wxObject *wxCheckDynamicCast(wxObject *obj, wxClassInfo *classInfo)
{
    return obj && obj->GetClassInfo()->IsKindOf(classInfo) ? obj : NULL;
}

#if wxUSE_EXTENDED_RTTI
class WXDLLIMPEXP_BASE wxDynamicObject : public wxObject
{
    friend class WXDLLIMPEXP_BASE wxDynamicClassInfo ;
public:
    // instantiates this object with an instance of its superclass
    wxDynamicObject(wxObject* superClassInstance, const wxDynamicClassInfo *info) ;
    ~wxDynamicObject();

    void SetProperty (const wxChar *propertyName, const wxxVariant &value);
    wxxVariant GetProperty (const wxChar *propertyName) const ;

    // get the runtime identity of this object
    wxClassInfo *GetClassInfo() const
    {
#ifdef _MSC_VER
        return (wxClassInfo*) m_classInfo;
#else
        return wx_const_cast(wxClassInfo *, m_classInfo);
#endif
    }

    wxObject* GetSuperClassInstance() const
    {
        return m_superClassInstance ;
    }
private :
    // removes an existing runtime-property
    void RemoveProperty( const wxChar *propertyName ) ;

    // renames an existing runtime-property
    void RenameProperty( const wxChar *oldPropertyName , const wxChar *newPropertyName ) ;

    wxObject *m_superClassInstance ;
    const wxDynamicClassInfo *m_classInfo;
    struct wxDynamicObjectInternal;
    wxDynamicObjectInternal *m_data;
};
#endif

// ----------------------------------------------------------------------------
// more debugging macros
// ----------------------------------------------------------------------------

#ifdef __WXDEBUG__
    #ifndef WXDEBUG_NEW
        #define WXDEBUG_NEW new(__TFILE__,__LINE__)
    #endif
#else // !__WXDEBUG__
    #define WXDEBUG_NEW new
#endif

// Redefine new to be the debugging version. This doesn't work with all
// compilers, in which case you need to use WXDEBUG_NEW explicitly if you wish
// to use the debugging version.

#if defined(__WXDEBUG__) && wxUSE_GLOBAL_MEMORY_OPERATORS && wxUSE_DEBUG_NEW_ALWAYS
    #define new new(__TFILE__,__LINE__)
#elif (defined(__WXDEBUG__) && defined(__VISUALC__) && !wxUSE_GLOBAL_MEMORY_OPERATORS && wxUSE_DEBUG_NEW_ALWAYS)
    // Including this file redefines new and allows leak reports to contain line numbers
    #include "wx/msw/msvcrt.h"
#endif

#endif  // _WX_OBJECTH__


text:
#ifndef _DV_1394_H
#define _DV_1394_H

/* This is the public user-space interface. Try not to break it. */

#define DV1394_API_VERSION 0x20011127

/* ********************
   **                **
   **   DV1394 API   **
   **                **
   ********************

   There are two methods of operating the DV1394 DV output device.

   1)

   The simplest is an interface based on write(): simply write
   full DV frames of data to the device, and they will be transmitted
   as quickly as possible. The FD may be set for non-blocking I/O,
   in which case you can use select() or poll() to wait for output
   buffer space.

   To set the DV output parameters (e.g. whether you want NTSC or PAL
   video), use the DV1394_INIT ioctl, passing in the parameters you
   want in a struct dv1394_init.

   Example 1:
         To play a raw .DV file:   cat foo.DV > /dev/dv1394
	 (cat will use write() internally)

   Example 2:
           static struct dv1394_init init = {
	      0x63,        (broadcast channel)
              4,           (four-frame ringbuffer)
	      DV1394_NTSC, (send NTSC video)
	      0, 0         (default empty packet rate)
           }

	   ioctl(fd, DV1394_INIT, &init);

	   while (1) {
	          read( <a raw DV file>, buf, DV1394_NTSC_FRAME_SIZE );
		  write( <the dv1394 FD>, buf, DV1394_NTSC_FRAME_SIZE );
           }

   2)

   For more control over buffering, and to avoid unnecessary copies
   of the DV data, you can use the more sophisticated the mmap() interface.
   First, call the DV1394_INIT ioctl to specify your parameters,
   including the number of frames in the ringbuffer. Then, calling mmap()
   on the dv1394 device will give you direct access to the ringbuffer
   from which the DV card reads your frame data.

   The ringbuffer is simply one large, contiguous region of memory
   containing two or more frames of packed DV data. Each frame of DV data
   is 120000 bytes (NTSC) or 144000 bytes (PAL).

   Fill one or more frames in the ringbuffer, then use the DV1394_SUBMIT_FRAMES
   ioctl to begin I/O. You can use either the DV1394_WAIT_FRAMES ioctl
   or select()/poll() to wait until the frames are transmitted. Next, you'll
   need to call the DV1394_GET_STATUS ioctl to determine which ringbuffer
   frames are clear (ready to be filled with new DV data). Finally, use
   DV1394_SUBMIT_FRAMES again to send the new data to the DV output.

   Example: here is what a four-frame ringbuffer might look like
            during DV transmission:

         frame 0   frame 1   frame 2   frame 3

	*--------------------------------------*
        | CLEAR   | DV data | DV data | CLEAR  |
        *--------------------------------------*
                   <ACTIVE>

	transmission goes in this direction --->>>

   The DV hardware is currently transmitting the data in frame 1.
   Once frame 1 is finished, it will automatically transmit frame 2.
   (if frame 2 finishes before frame 3 is submitted, the device
   will continue to transmit frame 2, and will increase the dropped_frames
   counter each time it repeats the transmission).

   If you called DV1394_GET_STATUS at this instant, you would
   receive the following values:

                  n_frames          = 4
		  active_frame      = 1
		  first_clear_frame = 3
		  n_clear_frames    = 2

   At this point, you should write new DV data into frame 3 and optionally
   frame 0. Then call DV1394_SUBMIT_FRAMES to inform the device that
   it may transmit the new frames.

   ERROR HANDLING

   An error (buffer underflow/overflow or a break in the DV stream due
   to a 1394 bus reset) can be detected by checking the dropped_frames
   field of struct dv1394_status (obtained through the
   DV1394_GET_STATUS ioctl).

   The best way to recover from such an error is to re-initialize
   dv1394, either by using the DV1394_INIT ioctl call, or closing the
   file descriptor and opening it again. (note that you must unmap all
   ringbuffer mappings when closing the file descriptor, or else
   dv1394 will still be considered 'in use').

   MAIN LOOP

   For maximum efficiency and robustness against bus errors, you are
   advised to model the main loop of your application after the
   following pseudo-code example:

   (checks of system call return values omitted for brevity; always
   check return values in your code!)

   while ( frames left ) {

    struct pollfd *pfd = ...;

    pfd->fd = dv1394_fd;
    pfd->revents = 0;
    pfd->events = POLLOUT | POLLIN; (OUT for transmit, IN for receive)

    (add other sources of I/O here)

    poll(pfd, 1, -1); (or select(); add a timeout if you want)

    if (pfd->revents) {
         struct dv1394_status status;

         ioctl(dv1394_fd, DV1394_GET_STATUS, &status);

	 if (status.dropped_frames > 0) {
	      reset_dv1394();
         } else {
              for (int i = 0; i < status.n_clear_frames; i++) {
	          copy_DV_frame();
              }
         }
    }
   }

   where copy_DV_frame() reads or writes on the dv1394 file descriptor
   (read/write mode) or copies data to/from the mmap ringbuffer and
   then calls ioctl(DV1394_SUBMIT_FRAMES) to notify dv1394 that new
   frames are availble (mmap mode).

   reset_dv1394() is called in the event of a buffer
   underflow/overflow or a halt in the DV stream (e.g. due to a 1394
   bus reset). To guarantee recovery from the error, this function
   should close the dv1394 file descriptor (and munmap() all
   ringbuffer mappings, if you are using them), then re-open the
   dv1394 device (and re-map the ringbuffer).

*/

/* maximum number of frames in the ringbuffer */
#define DV1394_MAX_FRAMES 32

/* number of *full* isochronous packets per DV frame */
#define DV1394_NTSC_PACKETS_PER_FRAME 250
#define DV1394_PAL_PACKETS_PER_FRAME  300

/* size of one frame's worth of DV data, in bytes */
#define DV1394_NTSC_FRAME_SIZE (480 * DV1394_NTSC_PACKETS_PER_FRAME)
#define DV1394_PAL_FRAME_SIZE  (480 * DV1394_PAL_PACKETS_PER_FRAME)

/* ioctl() commands */
#include "ieee1394-ioctl.h"

enum pal_or_ntsc {
	DV1394_NTSC = 0,
	DV1394_PAL
};

/* this is the argument to DV1394_INIT */
struct dv1394_init {
	/* DV1394_API_VERSION */
	unsigned int api_version;

	/* isochronous transmission channel to use */
	unsigned int channel;

	/* number of frames in the ringbuffer. Must be at least 2
	   and at most DV1394_MAX_FRAMES. */
	unsigned int n_frames;

	/* send/receive PAL or NTSC video format */
	enum pal_or_ntsc format;

	/* the following are used only for transmission */

	/* set these to zero unless you want a
	   non-default empty packet rate (see below) */
	unsigned long cip_n;
	unsigned long cip_d;

	/* set this to zero unless you want a
	   non-default SYT cycle offset (default = 3 cycles) */
	unsigned int syt_offset;
};

/* NOTE: you may only allocate the DV frame ringbuffer once each time
   you open the dv1394 device. DV1394_INIT will fail if you call it a
   second time with different 'n_frames' or 'format' arguments (which
   would imply a different size for the ringbuffer). If you need a
   different buffer size, simply close and re-open the device, then
   initialize it with your new settings. */

/* Q: What are cip_n and cip_d? */

/*
  A: DV video streams do not utilize 100% of the potential bandwidth offered
  by IEEE 1394 (FireWire). To achieve the correct rate of data transmission,
  DV devices must periodically insert empty packets into the 1394 data stream.
  Typically there is one empty packet per 14-16 data-carrying packets.

  Some DV devices will accept a wide range of empty packet rates, while others
  require a precise rate. If the dv1394 driver produces empty packets at
  a rate that your device does not accept, you may see ugly patterns on the
  DV output, or even no output at all.

  The default empty packet insertion rate seems to work for many people; if
  your DV output is stable, you can simply ignore this discussion. However,
  we have exposed the empty packet rate as a parameter to support devices that
  do not work with the default rate.

  The decision to insert an empty packet is made with a numerator/denominator
  algorithm. Empty packets are produced at an average rate of CIP_N / CIP_D.
  You can alter the empty packet rate by passing non-zero values for cip_n
  and cip_d to the INIT ioctl.

 */

struct dv1394_status {
	/* this embedded init struct returns the current dv1394
	   parameters in use */
	struct dv1394_init init;

	/* the ringbuffer frame that is currently being
	   displayed. (-1 if the device is not transmitting anything) */
	int active_frame;

	/* index of the first buffer (ahead of active_frame) that
	   is ready to be filled with data */
	unsigned int first_clear_frame;

	/* how many buffers, including first_clear_buffer, are
	   ready to be filled with data */
	unsigned int n_clear_frames;

	/* how many times the DV stream has underflowed, overflowed,
	   or otherwise encountered an error, since the previous call
	   to DV1394_GET_STATUS */
	unsigned int dropped_frames;

	/* N.B. The dropped_frames counter is only a lower bound on the actual
	   number of dropped frames, with the special case that if dropped_frames
	   is zero, then it is guaranteed that NO frames have been dropped
	   since the last call to DV1394_GET_STATUS.
	*/
};

#endif /* _DV_1394_H */


text:
package integrate

import (
	"testing"

	"github.com/google/uuid"
	"github.com/itchio/butler/butlerd"
	"github.com/itchio/butler/butlerd/messages"
	"github.com/stretchr/testify/assert"
)

func Test_Profile(t *testing.T) {
	assert := assert.New(t)

	bi := newInstance(t)
	rc, _, cancel := bi.Unwrap()
	defer cancel()

	_, err := messages.ProfileLoginWithAPIKey.TestCall(rc, butlerd.ProfileLoginWithAPIKeyParams{
		APIKey: "meh",
	})
	assert.Error(err)
	assert.Contains(err.Error(), "itch.io API error (403)")

	prof := bi.Authenticate()

	r, err := messages.ProfileList.TestCall(rc, butlerd.ProfileListParams{})
	must(err)
	assert.NotEmpty(r.Profiles)

	v := uuid.New()

	_, err = messages.ProfileDataPut.TestCall(rc, butlerd.ProfileDataPutParams{
		ProfileID: prof.ID,
		Key:       "@integrate/hello",
		Value:     v.String(),
	})
	must(err)

	dgr, err := messages.ProfileDataGet.TestCall(rc, butlerd.ProfileDataGetParams{
		ProfileID: prof.ID,
		Key:       "@integrate/hello",
	})
	must(err)
	assert.True(dgr.OK)
	assert.EqualValues(v.String(), dgr.Value)

	dgr, err = messages.ProfileDataGet.TestCall(rc, butlerd.ProfileDataGetParams{
		ProfileID: prof.ID,
		Key:       "@integrate/whoops",
	})
	must(err)
	assert.False(dgr.OK)
}


text:
<ion-view title="Calendario">

  <ion-nav-buttons side="left" ng-if="info">
    <button class="button" ui-sref="years({slug: info.slug, year: info.year})">

        Calendari
    </button>
  </ion-nav-buttons>

  <ion-content class="has-header">

{{m.month | integer2date | date: 'MMMM' | uppercase }} {{info.year}}

          <time datetime="{{d.date}}" ng-class="{'text-danger': (d.date|date:'EEEE') == 'domenica'}">{{d.date | date: 'dd'}}</time>
          {{d.date | date: 'EEEE' | capitalize}}

      <ion-item ng-repeat-end ng-repeat="z in d.zones">
        {{wasteType|breakingbad}}
        {{z.name}}
      </ion-item>

  </ion-content>
</ion-view>


text:
// Generated from org/zavodnikov/antlr4/expr/simple/ExprSimple.g4 by ANTLR 4.7

    package org.zavodnikov.antlr4.expr.simple;

import org.antlr.v4.runtime.tree.ParseTreeVisitor;

/**
 * This interface defines a complete generic visitor for a parse tree produced
 * by {@link ExprSimpleParser}.
 *
 * @param <T> The return type of the visit operation. Use {@link Void} for
 * operations with no return type.
 */
public interface ExprSimpleVisitor<T> extends ParseTreeVisitor<T> {
	/**
	 * Visit a parse tree produced by {@link ExprSimpleParser#prog}.
	 * @param ctx the parse tree
	 * @return the visitor result
	 */
	T visitProg(ExprSimpleParser.ProgContext ctx);
	/**
	 * Visit a parse tree produced by {@link ExprSimpleParser#expr}.
	 * @param ctx the parse tree
	 * @return the visitor result
	 */
	T visitExpr(ExprSimpleParser.ExprContext ctx);
}