text:
package org.intellij.xquery.completion.function.parameters;

import com.intellij.codeInsight.lookup.LookupElement;
import com.intellij.lang.parameterInfo.CreateParameterInfoContext;
import com.intellij.lang.parameterInfo.ParameterInfoContext;
import com.intellij.lang.parameterInfo.ParameterInfoHandler;
import com.intellij.lang.parameterInfo.ParameterInfoUIContext;
import com.intellij.lang.parameterInfo.ParameterInfoUtils;
import com.intellij.lang.parameterInfo.UpdateParameterInfoContext;
import com.intellij.psi.PsiElement;
import com.intellij.psi.PsiPolyVariantReference;
import com.intellij.psi.PsiReference;
import com.intellij.psi.ResolveResult;
import com.intellij.psi.util.PsiTreeUtil;
import com.intellij.util.ArrayUtil;
import com.intellij.util.containers.ContainerUtil;
import org.intellij.xquery.completion.function.BuiltInFunctionSignature;
import org.intellij.xquery.psi.XQueryArgumentList;
import org.intellij.xquery.psi.XQueryFile;
import org.intellij.xquery.psi.XQueryFunctionCall;
import org.intellij.xquery.psi.XQueryFunctionDecl;
import org.intellij.xquery.psi.XQueryFunctionName;
import org.intellij.xquery.psi.XQueryParam;
import org.intellij.xquery.psi.XQueryTypes;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.Comparator;
import java.util.List;

import static org.intellij.xquery.util.StringUtils.compressWhitespaces;

public class XQueryParameterInfoHandler implements ParameterInfoHandler<XQueryArgumentList, Object> {
    @Override
    public boolean couldShowInLookup() {
        return true;
    }

    @Nullable
    @Override
    public Object[] getParametersForLookup(LookupElement item, ParameterInfoContext context) {
        return ArrayUtil.EMPTY_OBJECT_ARRAY;
    }

    @Nullable
    @Override
    public Object[] getParametersForDocumentation(Object p, ParameterInfoContext context) {
        return null;
    }

    @Nullable
    @Override
    public XQueryArgumentList findElementForParameterInfo(CreateParameterInfoContext context) {
        return getArgumentList(context);
    }

    @Nullable
    @Override
    public XQueryArgumentList findElementForUpdatingParameterInfo(UpdateParameterInfoContext context) {
        return getArgumentList(context);
    }

    private XQueryArgumentList getArgumentList(ParameterInfoContext context) {
        PsiElement at = context.getFile().findElementAt(context.getOffset());
        return PsiTreeUtil.getParentOfType(at, XQueryArgumentList.class);
    }

    @Override
    public void showParameterInfo(@NotNull XQueryArgumentList args, CreateParameterInfoContext context) {
        XQueryFunctionCall functionCall = PsiTreeUtil.getParentOfType(args, XQueryFunctionCall.class);
        if (functionCall != null) {
            addItemsToShow(context, functionCall);
            context.showHint(args, args.getTextRange().getStartOffset(), this);
        }
    }

    private void addItemsToShow(CreateParameterInfoContext context, XQueryFunctionCall functionCall) {
        ResolveResult[] resolveResults = getFunctionWithAllArities(functionCall);
        List<XQueryFunctionDecl> functionDeclarations = extractFunctionDeclarations(resolveResults);
        if (functionDeclarations.size() > 0) {
            Collections.sort(functionDeclarations, getParameterListSizeComparator());
            context.setItemsToShow(ArrayUtil.toObjectArray(functionDeclarations));
        } else {
            XQueryFile file = (XQueryFile) functionCall.getContainingFile();
            String name = functionCall.getFunctionName().getLocalNameText();
            String prefix = functionCall.getFunctionName().getPrefixText();
            String namespace = file.mapFunctionPrefixToNamespace(prefix);
            context.setItemsToShow(ArrayUtil.toObjectArray(getFunctionsSignatures(file, name, namespace)));
        }
    }

    private Collection<BuiltInFunctionSignature> getFunctionsSignatures(XQueryFile file, String name, String namespace) {
        return file.getFunctionsSignatures(namespace, name);
    }

    private Comparator<XQueryFunctionDecl> getParameterListSizeComparator() {
        return new Comparator<XQueryFunctionDecl>() {
            @Override
            public int compare(XQueryFunctionDecl lhs, XQueryFunctionDecl rhs) {
                final int lhsSize = lhs.getParamList() != null ? lhs.getParamList().getParamList().size() : 0;
                final int rhsSize = rhs.getParamList() != null ? rhs.getParamList().getParamList().size() : 0;
                return Integer.signum(lhsSize - rhsSize);
            }
        };
    }

    private List<XQueryFunctionDecl> extractFunctionDeclarations(ResolveResult[] resolveResults) {
        List<XQueryFunctionDecl> functionDeclarations = new ArrayList<XQueryFunctionDecl>();
        for (ResolveResult result : resolveResults) {
            PsiElement element = result.getElement();
            if (element instanceof XQueryFunctionName) {
                functionDeclarations.add((XQueryFunctionDecl) element.getParent());
            }
        }
        return functionDeclarations;
    }

    private ResolveResult[] getFunctionWithAllArities(XQueryFunctionCall functionCall) {
        PsiReference reference = functionCall.getReference();
        return ((PsiPolyVariantReference) reference).multiResolve(true);
    }

    @Override
    public void updateParameterInfo(@NotNull XQueryArgumentList place, UpdateParameterInfoContext context) {
        context.setCurrentParameter(ParameterInfoUtils.getCurrentParameterIndex(place.getNode(), context.getOffset(),
                XQueryTypes.COMMA));
    }

    @Nullable
    @Override
    public String getParameterCloseChars() {
        return ParameterInfoUtils.DEFAULT_PARAMETER_CLOSE_CHARS;
    }

    @Override
    public boolean tracksParameterIndex() {
        return true;
    }

    @Override
    public void updateUI(Object p, ParameterInfoUIContext context) {
        if (p == null) {
            context.setUIComponentEnabled(false);
            return;
        }
        int index = context.getCurrentParameterIndex();
        ParameterPresentation presentation = null;
        if (p instanceof XQueryFunctionDecl) {
            presentation = buildUserFunctionPresentation((XQueryFunctionDecl) p, index);
        } else if (p instanceof BuiltInFunctionSignature) {
            presentation = buildBuiltInFunctionPresentation((BuiltInFunctionSignature) p, index);
        }
        context.setupUIComponentPresentation(presentation.text, presentation.start, presentation.end,
                presentation.disabled, false, true,
                context.getDefaultParameterColor());
    }

    private ParameterPresentation buildBuiltInFunctionPresentation(BuiltInFunctionSignature functionSignature,
                                                                   int index) {
        StringBuilder builder = new StringBuilder();
        int start = 0;
        int end = 0;
        boolean disabled = false;

        String arguments = functionSignature.getArguments();
        builder.append(arguments);
        for (int i = 0; i < index && start != - 1; ++ i) {
            start = arguments.indexOf(',', start + 1);
        }
        if (start == - 1) {
            disabled = true;
        } else {
            end = arguments.indexOf(',', start + 1);
            end = (end == - 1 ? arguments.length() : end);
        }
        return new ParameterPresentation(builder.toString(), start, end, disabled);
    }

    private ParameterPresentation buildUserFunctionPresentation(XQueryFunctionDecl functionDecl, int index) {
        StringBuilder builder = new StringBuilder();
        int start = 0;
        int end = 0;
        boolean disabled;
        List<XQueryParam> args = functionDecl.getParamList() != null ? functionDecl.getParamList().getParamList() :
                ContainerUtil.<XQueryParam>emptyList();

        for (int i = 0; i < args.size(); i++) {
            if (i != 0) builder.append(", ");
            if (index == i) start = builder.length();
            builder.append(compressWhitespaces(args.get(i).getText()));
            if (index == i) end = builder.length();
        }
        disabled = index >= args.size();
        return new ParameterPresentation(builder.toString(), start, end, disabled);
    }

    private class ParameterPresentation {
        String text;
        int start;
        int end;
        boolean disabled = false;

        public ParameterPresentation(String text, int start, int end, boolean disabled) {
            if (text.length() == 0) {
                this.text = "<no parameters>";
            } else {
                this.text = text;
            }
            this.start = start;
            this.end = end;
            this.disabled = disabled;
        }
    }
}


text:
var FMApp = angular.module('FMApp', ['ur.file']);

FMApp.controller('FileManagerCtr', ['$scope', '$http', '$location',
  function ($scope, $http, $location) {
    var FM = this;
    FM.curHashPath = '#/';          // hash in browser url
    FM.curFolderPath = '/';         // current relative folder path
    FM.curBreadCrumbPaths = [];     // items in breadcrumb list, for each level folder
    FM.curFiles = [];               // files in current folder

    FM.selecteAll = false;          // if select all files
    FM.selection = [];              // selected files
    FM.renameName = '';             // new name for rename action
    FM.uploadFile = null;           // will upload file
    FM.newFolderName = '';
    FM.successData = '__init__';
    FM.errorData = '__init__';
    FM.updateArchiveName = function() {
      FM.archiveTarget = 'files_' + FM.curFolderPath.substring(1).replace(/\//g, '_') + new Date().toISOString().replace(/:/g, '.') + '.zip';
    };

    var hash2paths = function (relPath) {
      var paths = [];
      var names = relPath.split('/');
      var path = '#/';
      paths.push({name: 'Home', path: path});
      for (var i=0; i<names.length; ++i) {
        var name = names[i];
        if (name) {
          path = path + name + '/';
          paths.push({name: name, path: path});
        }
      }
      return paths;
    };

    var humanSize = function (size) {
      var hz;
      if (size < 1024) hz = size + ' B';
      else if (size < 1024*1024) hz = (size/1024).toFixed(2) + ' KB';
      else if (size < 1024*1024*1024) hz = (size/1024/1024).toFixed(2) + ' MB';
      else hz = (size/1024/1024/1024).toFixed(2) + ' GB';
      return hz;
    };

    var humanTime = function (timestamp) {
      var t = new Date(timestamp);
      return t.toLocaleDateString() + ' ' + t.toLocaleTimeString();
    };

    var setCurFiles = function (relPath) {
      $http.get('api' + relPath)
        .success(function (data) {
          var files = data;
          files.forEach(function (file) {
            file.relPath = relPath + encodeURIComponent(file.name);
            if (file.folder) file.relPath += '/';
            file.selected = false;
            file.humanSize = humanSize(file.size);
            file.humanTime = humanTime(file.mtime);
          });
          FM.curFiles = files;
          console.log('Current Files:');
          console.log(FM.curFiles);
        })
        .error(function (data, status) {
          alert('Error: ' + status + data);
        });
    };

    var handleHashChange = function (hash) {
      if (!hash) {
        return $location.path('/');
      }
      console.log('Hash change: ' + hash);
      var relPath = hash.slice(1);
      FM.curHashPath = hash;
      FM.curFolderPath = relPath;
      FM.curBreadCrumbPaths = hash2paths(relPath);
      setCurFiles(relPath);
    };

    $scope.$watch(function () {
      return location.hash;
    }, function (val) {
      handleHashChange(val);
    });

    // listening on file checkbox
    $scope.$watch('FM.curFiles|filter:{selected:true}', function (nv) {
      FM.selection = nv.map(function (file) {
        return file;
      });
    }, true);

    $scope.$watch('FM.selectAll', function (nv) {
      FM.curFiles.forEach(function (file) {
        file.selected = nv;
      });
    });

    $scope.$watch('FM.successData', function () {
      if (FM.successData === '__init__') return;
      $('#successAlert').show();
      $('#successAlert').fadeIn(3000);
      $('#successAlert').fadeOut(3000);
    });

    $scope.$watch('FM.errorData', function () {
      if (FM.errorData === '__init__') return;
      $('#errorAlert').show();
    });

    var httpRequest = function (method, url, params, data, config) {
      var conf = {
        method: method,
        url: url,
        params: params,
        data: data,
        timeout: 10000
      };
      for (var k in config) {
        if (config.hasOwnProperty(k)) {
          conf[k] = config[k];
        }
      }
      console.log('request url', url);
      $http(conf)
        .success(function (data) {
          FM.successData = data;
          handleHashChange(FM.curHashPath);
        })
        .error(function (data, status) {
          FM.errorData = ' ' + status + ': ' + data;
        });
    };

    var downloadFile = function (file) {
      window.open('api' + file.relPath);
    };

    FM.clickFile = function (file) {
      if (file.folder) {
        // open folder by setting url hash
        $location.path(decodeURIComponent(file.relPath));
      }
      else {
        // download file
        downloadFile(file);
      }
    };

    FM.download = function () {

      // Technique for downloading multiple files adapted from here:
      //  [1] http://stackoverflow.com/questions/2339440/download-multiple-files-with-a-single-action

      var link = document.createElement('a');
      link.style.display = 'none';
      document.body.appendChild(link);

      for (var i in FM.selection) {
        link.setAttribute('href', 'api' + FM.selection[i].relPath);
        link.setAttribute('download', FM.selection[i].name);
        link.click();
      }

      document.body.removeChild(link);
    };

    FM.delete = function () {
      for (var i in FM.selection) {
        var relPath = FM.selection[i].relPath;
        var url = 'api' + relPath;
        httpRequest('DELETE', url, null, null);
      }
    };

    FM.move = function (target) {
      var url = 'api' + encodeURI(target);
      var src = FM.selection.map(function (file) {
        return file.relPath;
      });
      httpRequest('PUT', url, {type: 'MOVE'}, {src: src});
    };

    FM.archive = function (archive) {
      if (!archive.match(/\.zip$/)) {
        archive += '.zip';
      }
      var url = 'api' + FM.curFolderPath + encodeURI(archive);
      var src = FM.selection.map(function (file) {
        return file.relPath;
      });
      httpRequest('POST', url, {type: 'CREATE_ARCHIVE'}, {src: src, embedDirs: FM.archiveEmbedDirs});
    };

    FM.rename = function (newName) {
      var url = 'api' + FM.selection[0].relPath;
      var target = FM.curFolderPath + encodeURI(newName);
      console.log('rename target', target);
      httpRequest('PUT', url, {type: 'RENAME'}, {target: target});
    };

    FM.createFolder = function (folderName) {
      var url = 'api' + FM.curFolderPath + encodeURI(folderName);
      httpRequest('POST', url, {type: 'CREATE_FOLDER'}, null);
    };

    FM.upload = function () {
      console.log('Upload File:', FM.uploadFile);
      var formData = new FormData();
      formData.append('upload', FM.uploadFile);
      var url = 'api' + FM.curFolderPath + encodeURI(FM.uploadFile.name);
      httpRequest('POST', url, {type: 'UPLOAD_FILE'}, formData, {
        transformRequest: angular.identity,
        headers: {'Content-Type': undefined}
      });
    };

    FM.btnDisabled = function (btnName) {
      switch (btnName) {
        case 'download':
          if (FM.selection.length === 0) return true;
          else {
            for (var i in FM.selection) {
              if (FM.selection[i].folder) return true;
            }
            return false;
          }
        case 'delete':
        case 'move':
        case 'archive':
          return FM.selection.length === 0;
        case 'rename':
          return FM.selection.length !== 1;
        case 'upload_file':
        case 'create_folder':
          return false;
        default:
          return true;
      }
    }
  }
]);

redpajama_set_name: RedPajamaGithub


text:
<?php

namespace Phapi\Tests\Exception\Error;

use Phapi\Exception\Forbidden;
use Phapi\Tests\Exception\exceptionTests;

require_once __DIR__ . '/ExceptionTrait.php';

/**
 * @coversDefaultClass \Phapi\Exception\Forbidden
 */
class ForbiddenTest extends \PHPUnit_Framework_TestCase
{

    public $statusCode = 403;
    public $statusMessage = 'Forbidden';
    public $link = null;
    public $code = null;
    public $description = 'The request is understood, but it has been refused or access is not allowed. An accompanying error message will explain why.';
    public $message = null;

    /**
     * @covers ::__construct
     */
    public function testConstructor()
    {
        return new Forbidden();
    }

    use exceptionTests;
}


text:
package oauth2_test

import (
	"context"
	"fmt"
	"net/http"
	"net/http/httptest"
	"strings"
	"testing"
	"time"

	hydra "github.com/ory/hydra-client-go/v2"

	"github.com/ory/x/httprouterx"

	"github.com/ory/hydra/x"
	"github.com/ory/x/contextx"

	"github.com/ory/hydra/driver/config"
	"github.com/ory/hydra/internal"

	"github.com/stretchr/testify/assert"
	"github.com/stretchr/testify/require"

	"github.com/ory/fosite"
)

func TestIntrospectorSDK(t *testing.T) {
	ctx := context.Background()
	conf := internal.NewConfigurationWithDefaults()
	conf.MustSet(ctx, config.KeyScopeStrategy, "wildcard")
	conf.MustSet(ctx, config.KeyIssuerURL, "https://foobariss")
	reg := internal.NewRegistryMemory(t, conf, &contextx.Default{})

	internal.MustEnsureRegistryKeys(reg, x.OpenIDConnectKeyName)
	internal.AddFositeExamples(reg)

	tokens := Tokens(reg.OAuth2ProviderConfig(), 4)

	c, err := reg.ClientManager().GetConcreteClient(context.TODO(), "my-client")
	require.NoError(t, err)
	c.Scope = "fosite,openid,photos,offline,foo.*"
	require.NoError(t, reg.ClientManager().UpdateClient(context.TODO(), c))

	router := x.NewRouterAdmin(conf.AdminURL)
	handler := reg.OAuth2Handler()
	handler.SetRoutes(router, &httprouterx.RouterPublic{Router: router.Router}, func(h http.Handler) http.Handler {
		return h
	})
	server := httptest.NewServer(router)
	defer server.Close()

	now := time.Now().UTC().Round(time.Minute)
	createAccessTokenSession("alice", "my-client", tokens[0][0], now.Add(time.Hour), reg.OAuth2Storage(), fosite.Arguments{"core", "foo.*"})
	createAccessTokenSession("siri", "my-client", tokens[1][0], now.Add(-time.Hour), reg.OAuth2Storage(), fosite.Arguments{"core", "foo.*"})
	createAccessTokenSession("my-client", "my-client", tokens[2][0], now.Add(time.Hour), reg.OAuth2Storage(), fosite.Arguments{"hydra.introspect"})
	createAccessTokenSessionPairwise("alice", "my-client", tokens[3][0], now.Add(time.Hour), reg.OAuth2Storage(), fosite.Arguments{"core", "foo.*"}, "alice-obfuscated")

	t.Run("TestIntrospect", func(t *testing.T) {
		for k, c := range []struct {
			token          string
			description    string
			expectInactive bool
			scopes         []string
			assert         func(*testing.T, *hydra.IntrospectedOAuth2Token)
			prepare        func(*testing.T) *hydra.APIClient
		}{
			{
				description:    "should fail because invalid token was supplied",
				token:          "invalid",
				expectInactive: true,
			},
			{
				description:    "should fail because token is expired",
				token:          tokens[1][1],
				expectInactive: true,
			},
			// {
			//	description:    "should fail because username / password are invalid",
			//	token:          tokens[0][1],
			//	expectInactive: true,
			//	expectCode:     http.StatusUnauthorized,
			//	prepare: func(*testing.T) *hydra.OAuth2Api.{
			//		client := hydra.Ne.OAuth2Api.ithBasePath(server.URL)
			//		client.config.Username = "foo"
			//		client.config.Password = "foo"
			//		return client
			//	},
			// },
			{
				description:    "should fail because scope `bar` was requested but only `foo` is granted",
				token:          tokens[0][1],
				expectInactive: true,
				scopes:         []string{"bar"},
			},
			{
				description:    "should pass",
				token:          tokens[0][1],
				expectInactive: false,
			},
			{
				description:    "should pass using bearer authorization",
				token:          tokens[0][1],
				expectInactive: false,
				scopes:         []string{"foo.bar"},
				assert: func(t *testing.T, c *hydra.IntrospectedOAuth2Token) {
					assert.Equal(t, "alice", *c.Sub)
					assert.Equal(t, now.Add(time.Hour).Unix(), *c.Exp, "expires at")
					assert.Equal(t, now.Unix(), *c.Iat, "issued at")
					assert.Equal(t, "https://foobariss", *c.Iss, "issuer")
					assert.Equal(t, map[string]interface{}{"foo": "bar"}, c.Ext)
				},
			},
			{
				description:    "should pass using regular authorization",
				token:          tokens[0][1],
				expectInactive: false,
				scopes:         []string{"foo.bar"},
				assert: func(t *testing.T, c *hydra.IntrospectedOAuth2Token) {
					assert.Equal(t, "core foo.*", *c.Scope)
					assert.Equal(t, "alice", *c.Sub)
					assert.Equal(t, now.Add(time.Hour).Unix(), *c.Exp, "expires at")
					assert.Equal(t, now.Unix(), *c.Iat, "issued at")
					assert.Equal(t, "https://foobariss", *c.Iss, "issuer")
					assert.Equal(t, map[string]interface{}{"foo": "bar"}, c.Ext)
				},
			},
			{
				description:    "should pass and check for obfuscated subject",
				token:          tokens[3][1],
				expectInactive: false,
				scopes:         []string{"foo.bar"},
				assert: func(t *testing.T, c *hydra.IntrospectedOAuth2Token) {
					assert.Equal(t, "alice", *c.Sub)
					assert.Equal(t, "alice-obfuscated", *c.ObfuscatedSubject)
				},
			},
		} {
			t.Run(fmt.Sprintf("case=%d/description=%s", k, c.description), func(t *testing.T) {
				var client *hydra.APIClient
				if c.prepare != nil {
					client = c.prepare(t)
				} else {
					client = hydra.NewAPIClient(hydra.NewConfiguration())
					client.GetConfig().Servers = hydra.ServerConfigurations{{URL: server.URL}}
				}

				ctx, _, err := client.OAuth2Api.IntrospectOAuth2Token(context.Background()).
					Token(c.token).Scope(strings.Join(c.scopes, " ")).Execute()
				require.NoError(t, err)

				if c.expectInactive {
					assert.False(t, ctx.Active)
				} else {
					assert.True(t, ctx.Active)
				}

				if !c.expectInactive && c.assert != nil {
					c.assert(t, ctx)
				}
			})
		}
	})
}


text:
package com.sequenceiq.cloudbreak.service.messages;

import java.util.Collections;

import javax.inject.Inject;

import org.junit.Assert;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;

@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(classes = { MessagesConfig.class, TestConfig.class })
public class CloudbreakMessagesHostServiceTypeTest {

    @Inject
    private CloudbreakMessagesService messageService;

    @Test
    public void shouldResolveMessageIfCodeProvided() {
        // GIVEN

        // WHEN
        String message = messageService.getMessage("test.message");
        // THEN

        Assert.assertEquals("Invalid message", "Hi my dear friend", message);

    }

    @Test
    public void shouldResolveCodeAndMergeArgs() {
        // GIVEN

        // WHEN
        String message = messageService.getMessage("stack.infrastructure.time", Collections.singletonList(123));
        // THEN
        Assert.assertEquals("Invalid message resolution!", "Infrastructure creation took 123 seconds", message);

    }
}


text:
<component name="ProjectCodeStyleConfiguration">
  <code_scheme name="Project" version="173">
    <JavaCodeStyleSettings>
      <option name="FIELD_NAME_PREFIX" value="my" />
      <option name="USE_SINGLE_CLASS_IMPORTS" value="false" />
      <option name="CLASS_COUNT_TO_USE_IMPORT_ON_DEMAND" value="3" />
    </JavaCodeStyleSettings>
    <codeStyleSettings language="JAVA">
      <option name="LINE_COMMENT_AT_FIRST_COLUMN" value="false" />
      <option name="IF_BRACE_FORCE" value="3" />
      <option name="METHOD_ANNOTATION_WRAP" value="0" />
      <option name="FIELD_ANNOTATION_WRAP" value="0" />
    </codeStyleSettings>
  </code_scheme>
</component>


text:
from dimagi.ext.jsonobject import DictProperty, JsonObject, StringProperty

from corehq.apps.userreports.expressions.factory import ExpressionFactory
from corehq.apps.userreports.specs import TypeProperty

class IndexedCaseExpressionSpec(JsonObject):
    type = TypeProperty('indexed_case')
    case_expression = DictProperty(required=True)
    index = StringProperty(required=False)

    def configure(self, case_expression, factory_context):
        self._case_expression = case_expression

        index = self.index or 'parent'
        spec = {
            'type': 'related_doc',
            'related_doc_type': 'CommCareCase',
            'doc_id_expression': {
                'type': 'nested',
                'argument_expression': self.case_expression,
                'value_expression': {
                    'type': 'nested',
                    'argument_expression': {
                        'type': 'array_index',
                        'array_expression': {
                            'type': 'filter_items',
                            'items_expression': {
                                'datatype': 'array',
                                'type': 'property_name',
                                'property_name': 'indices'
                            },
                            'filter_expression': {
                                'type': 'boolean_expression',
                                'operator': 'eq',
                                'property_value': index,
                                'expression': {
                                    'type': 'property_name',
                                    'property_name': 'identifier'
                                }
                            }
                        },
                        'index_expression': {
                            'type': 'constant',
                            'constant': 0
                        }
                    },
                    'value_expression': {
                        'type': 'property_name',
                        'property_name': 'referenced_id'
                    }
                }
            },
            'value_expression': {
                'type': 'identity'
            }
        }
        self._expression = ExpressionFactory.from_spec(spec, factory_context)

    def __call__(self, item, evaluation_context=None):
        return self._expression(item, evaluation_context)

    def __str__(self):
        return "{case}/{index}".format(
            case=str(self._case_expression),
            index=self.index or "parent"
        )

def indexed_case_expression(spec, factory_context):
    wrapped = IndexedCaseExpressionSpec.wrap(spec)
    wrapped.configure(
        ExpressionFactory.from_spec(wrapped.case_expression, factory_context),
        factory_context
    )
    return wrapped


text:
var badWords = require('./bad-words');

module.exports = function filter(string) {
  string = string || '';
  var regexp = new RegExp(badWords.join('|'), 'gi');

  return string.replace(regexp, function(str) {
    var replace_str = '';
    for(var i=0; i<str.length; i++) {
      replace_str = replace_str+'*';
    }
    return replace_str;
  });
};


text:
Sequel.migration do
  change do
    create_table(:books) do
      String :code, :null=>false, :primary_key=>true
      String :name, :null=>false
      TrueClass :available, :null=>false
    end
  end
end


text:
package ai.h2o.sparkling.backend

import java.util.TimeZone

import ai.h2o.sparkling.H2OConf
import ai.h2o.sparkling.extensions.serde.ExpectedTypes.ExpectedType

case class WriterMetadata(
    conf: H2OConf,
    frameId: String,
    expectedTypes: Array[ExpectedType],
    maxVectorSizes: Array[Int],
    timezone: TimeZone,
    featureColsForConstCheck: Option[Seq[String]])


text:
ops
====

A Golang package that provides OS abstracted operations for sysadmin
automation tasks.


text:
from django.conf.urls import url

from bluebottle.funding_vitepay.views import (
    VitepayPaymentList, VitepayWebhookView,
    VitepayBankAccountAccountList,
    VitepayBankAccountAccountDetail)

urlpatterns = [
    url(r'^/payments/$',
        VitepayPaymentList.as_view(),
        name='vitepay-payment-list'),
    url(r'^/webhook/$',
        VitepayWebhookView.as_view(),
        name='vitepay-payment-webhook'),
    url(r'^/bank-accounts/$',
        VitepayBankAccountAccountList.as_view(),
        name='vitepay-external-account-list'),
    url(r'^/bank-accounts/(?P<pk>[\d]+)$',
        VitepayBankAccountAccountDetail.as_view(),
        name='vitepay-external-account-detail'),
]


text:
<!DOCTYPE html>

  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">

  <title>
    Public source code repositories

  </title>
  <link rel="stylesheet" href="/css/site.css">

  <link href="/favicon.ico" rel="shortcut icon" type="image/x-icon" />

  <link rel="alternate" type="application/atom+xml" title="RSS Feed for Seonho Oh's blog" href="/feed.xml" />
  <link rel="stylesheet" href="/css/bibliography.css">

    Home
    About

    Archive
    Tag

      Seonho Oh's Blog

          Think different. Being positive.

    Public source code repositories

Monday 26 May 2014

This is collections of public source code for human pose estimation and 3D reconstruction from monocular video.

Human Pose Estimation Source Code Repositories

Poselet Conditioned Pictorial Structures, L. Pishchulin et al. 2013

Flowing Puppets, Silvia Zuffi et al. 2013

Compositional Grammar, B. Rothrock et al. 2013

Deformable Structure, Silvia Zuffi et al. 2012

Stretchable Model, Benjamin Sapp et al. 2011

Flexible Mixtures of Parts, FMP by D. Ramanan, Yi Yang and Deva Ramanan, 2011

N-Best Maximal Decoder, D. Park and D. Ramanan, 2011

2D articulated human pose estimation, M. Eichner et al. 2011

Human pose estimation, Hao Jiang, 2011

Poselet and their application, Lubomir Bourdev et al. 2010

Pictorial Structures Revisited, M. Andriluka et al. 2009

Articulated Trajectory Reconstruction

Trajectory Reconstruction using Filters J. Valmadre et al. 2012

Deterministic approach using Rigid Structure J. Valmadre and S. Lucey, 2010

Temporal Alignment

Canonical Time Warping (CTW) and Generalized Time Warping (GTW), Feng Zhou and Fernando De la Torre, 2012

Dense Trajectory

Deep Matching and DeepFlow, P. Weinzaepfel et al., 2013

Improved Trajectories, H. Wang and C. Schmid, 2013

Dense Trajectories, H. Wang et al., 2011

Optical Flow Source Code Repositories

To be inserted.

      Tag>

Research

Repository

Human Pose Estimation

Dense Trajectory

Temporal Alignment

3D

Reconstruction

Code

GitHub

Please enable JavaScript to view the comments powered by Disqus.

comments powered by Disqus

  Made with Jekyll,
  hosted on Github Pages.
  Theme inspired by Sebastien.saunier.me.


text:
/*************************************************************************/
/*  haiku_gl_view.h                                                      */
/*************************************************************************/
/*                       This file is part of:                           */
/*                           GODOT ENGINE                                */
/*                      https://godotengine.org                          */
/*************************************************************************/
/* Copyright (c) 2007-2018 Juan Linietsky, Ariel Manzur.                 */
/* Copyright (c) 2014-2018 Godot Engine contributors (cf. AUTHORS.md)    */
/*                                                                       */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the       */
/* "Software"), to deal in the Software without restriction, including   */
/* without limitation the rights to use, copy, modify, merge, publish,   */
/* distribute, sublicense, and/or sell copies of the Software, and to    */
/* permit persons to whom the Software is furnished to do so, subject to */
/* the following conditions:                                             */
/*                                                                       */
/* The above copyright notice and this permission notice shall be        */
/* included in all copies or substantial portions of the Software.       */
/*                                                                       */
/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,       */
/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF    */
/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/
/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY  */
/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,  */
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE     */
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.                */
/*************************************************************************/

#ifndef HAIKU_GL_VIEW_H
#define HAIKU_GL_VIEW_H

#include <kernel/image.h> // needed for image_id

#include <GLView.h>

class HaikuGLView : public BGLView {
public:
	HaikuGLView(BRect frame, uint32 type);
	virtual void AttachedToWindow(void);
	virtual void Draw(BRect updateRect);
};

#endif


text:
/*
 * 文 件 名 : Assert.java
 * CopyRright (c) since 2012:
 * 文件编号:
 * 创 建 人:Liu Hengyang Email:yangyang8599@163.com QQ:119316891
 * 日    期: 2012-10-18
 * 修 改 人:
 * 日   期:
 * 描   述:
 * 版 本 号: 1.0
 */
package cn.remex.core.util;

import cn.remex.RemexConstants;
import cn.remex.core.exception.NestedException;

import java.util.Collection;
import java.util.Map;

/**
 * 本断言类用于在运行时检查异常和错误。
 * 例如,如果一个公共方法,它的一行代码中的某个变量不能为空,此类可以用来验证。

 * 这个类是类似的断言主张。 如果一个变量值被视为无效, (通常)就会抛出一个
 * IllegalArgumentException 。
 * 比如说,Assert.notNull(obj)
 *
 * @author Hengyang Liu yangyang8599@163.com
 * @since 2012-5-18
 */

public abstract class Assert implements RemexConstants {

    //空检测系列方法
    public static void isNull(final Object object, final String errorCode, final String errorMsg) {
        if (object != null) {
            throw new NestedException(errorCode, errorMsg);
        }
    }

    public static void isNull(final Object object, final String errorCode, final String errorMsg, final Class<? extends RuntimeException> exceptionClassForThrow) {
        if (object != null) {
            throw createRuntimeException(errorCode, errorMsg, exceptionClassForThrow);
        }
    }

    public static void notNull(final Object object, final String errorCode, final String errorMsg) {
        if (object == null) {
            throw new NestedException(errorCode, errorMsg);
        }
    }

    public static void notNull(final Object object, final String errorCode, final String errorMsg, final Class<? extends RuntimeException> exceptionClassForThrow) {
        if (object == null) {
            throw createRuntimeException(errorCode, errorMsg, exceptionClassForThrow);
        }
    }
    public static void notNullAndEmpty(final Object stringOrObject,  final String errorCode, final String errorMsg) {
        if (stringOrObject == null || (stringOrObject instanceof String && "".equals(((String) stringOrObject).trim()))) {
            throw new NestedException(errorCode, errorMsg);
        }
    }
    public static void nullOrEmpty(final Object stringOrObject,  final String errorCode, final String errorMsg) {
        if (stringOrObject != null && (stringOrObject instanceof String && !"".equals(((String) stringOrObject).trim()))) {
            throw new NestedException(errorCode, errorMsg);
        }
    }

    //逻辑判断系列方法
    public static void isTrue(final boolean expression, final String errorCode, final String errorMsg) {
        if (!expression) {
            throw new NestedException(errorCode, errorMsg);
        }
    }
    public static void isTrue(final boolean expression, final String errorCode, final String message, final Class<? extends RuntimeException> exceptionClassForThrow) {
        if (!expression) {
            throw createRuntimeException(errorCode, message, exceptionClassForThrow);
        }
    }

    //特殊场景用途的断言方法
    public static void isSimpleBean(final Object object, final String errorCode, final String errorMsg) {
        if (object instanceof Map || object instanceof Collection) {
            throw new NestedException(errorCode, errorMsg);
        }
    }

    //私有方法
    private static RuntimeException createRuntimeException(String errorCode, final String message, final Class<? extends RuntimeException> exceptionClassForThrow) {
        try {
            if (NestedException.class.isAssignableFrom(exceptionClassForThrow))
                return exceptionClassForThrow.getConstructor(String.class, String.class).newInstance(message);
            else
                return exceptionClassForThrow.getConstructor(String.class).newInstance(message);

        } catch (Exception e) {
            return new IllegalArgumentException("自定义异常类" + exceptionClassForThrow.getName() + "无法构建,调用默认异常IllegalArgumentException,处理断言。此处异常信息为:" + message);
        }
    }
}


text:
/*!
 * \file   record_ostream.hpp
 * \author Andrey Semashev
 * \date   09.03.2009
 *
 * This header contains a wrapper class around a logging record that allows to compose the
 * record message with a streaming expression.
 */

#ifndef BOOST_LOG_SOURCES_RECORD_OSTREAM_HPP_INCLUDED_
#define BOOST_LOG_SOURCES_RECORD_OSTREAM_HPP_INCLUDED_

#include <string>
#include <ostream>
#include <boost/assert.hpp>
#include <boost/move/core.hpp>
#include <boost/move/utility_core.hpp>
#include <boost/core/addressof.hpp>
#include <boost/log/detail/config.hpp>
#include <boost/log/detail/native_typeof.hpp>
#include <boost/log/detail/unhandled_exception_count.hpp>
#include <boost/log/core/record.hpp>
#include <boost/log/utility/unique_identifier_name.hpp>
#include <boost/utility/explicit_operator_bool.hpp>
#include <boost/log/utility/formatting_ostream.hpp>
#include <boost/log/detail/header.hpp>

#ifdef BOOST_HAS_PRAGMA_ONCE
#pragma once
#endif

namespace boost {

BOOST_LOG_OPEN_NAMESPACE

template< typename CharT >
class basic_record_ostream;

namespace aux {

template< typename StreamT, typename R >
struct enable_if_record_ostream {};
template< typename CharT, typename R >
struct enable_if_record_ostream< basic_record_ostream< CharT >, R > { typedef R type; };

} // namespace aux

/*!
 * \brief Logging record adapter with a streaming capability
 *
 * This class allows to compose the logging record message by streaming operations. It
 * aggregates the log record and provides the standard output stream interface.
 */
template< typename CharT >
class basic_record_ostream :
    public basic_formatting_ostream< CharT >
{
    //! Self type
    typedef basic_record_ostream< CharT > this_type;
    //! Base stream class
    typedef basic_formatting_ostream< CharT > base_type;

public:
    //! Character type
    typedef CharT char_type;
    //! String type to be used as a message text holder
    typedef std::basic_string< char_type > string_type;
    //! Stream type
    typedef std::basic_ostream< char_type > stream_type;

private:
    //! Log record
    record* m_record;

public:
    /*!
     * Default constructor. Creates an empty record that is equivalent to the invalid record handle.
     * The stream capability is not available after construction.
     *
     * \post <tt>!*this == true</tt>
     */
    basic_record_ostream() BOOST_NOEXCEPT : m_record(NULL) {}

    /*!
     * Constructor from a record object. Attaches to the provided record.
     *
     * \pre <tt>!!rec == true</tt>
     * \post <tt>&this->get_record() == &rec</tt>
     * \param rec The record handle being attached to
     */
    explicit basic_record_ostream(record& rec)
    {
        BOOST_ASSERT_MSG(!!rec, "Boost.Log: basic_record_ostream should only be attached to a valid record");
        m_record = &rec;
        init_stream();
    }

    /*!
     * Destructor. Destroys the record, releases any sinks and attribute values that were involved in processing this record.
     */
    ~basic_record_ostream() BOOST_NOEXCEPT
    {
        detach_from_record();
    }

    /*!
     * Conversion to an unspecified boolean type
     *
     * \return \c true, if stream is valid and ready for formatting, \c false, if the stream is not valid. The latter also applies to
     *         the case when the stream is not attached to a log record.
     */
    BOOST_EXPLICIT_OPERATOR_BOOL_NOEXCEPT()

    /*!
     * Inverted conversion to an unspecified boolean type
     *
     * \return \c false, if stream is valid and ready for formatting, \c true, if the stream is not valid. The latter also applies to
     *         the case when the stream is not attached to a log record.
     */
    bool operator! () const BOOST_NOEXCEPT
    {
        return (!m_record || base_type::fail());
    }

    /*!
     * Flushes internal buffers to complete all pending formatting operations and returns the aggregated log record
     *
     * \return The aggregated record object
     */
    record& get_record()
    {
        BOOST_ASSERT(m_record != NULL);
        this->flush();
        return *m_record;
    }

    /*!
     * Flushes internal buffers to complete all pending formatting operations and returns the aggregated log record
     *
     * \return The aggregated record object
     */
    record const& get_record() const
    {
        BOOST_ASSERT(m_record != NULL);
        const_cast< this_type* >(this)->flush();
        return *m_record;
    }

    /*!
     * If the stream is attached to a log record, flushes internal buffers to complete all pending formatting operations.
     * Then reattaches the stream to another log record.
     *
     * \param rec New log record to attach to
     */
    void attach_record(record& rec)
    {
        BOOST_ASSERT_MSG(!!rec, "Boost.Log: basic_record_ostream should only be attached to a valid record");
        detach_from_record();
        m_record = &rec;
        init_stream();
    }

    //! The function resets the stream into a detached (default initialized) state
    BOOST_LOG_API void detach_from_record() BOOST_NOEXCEPT;

private:
    //! The function initializes the stream and the stream buffer
    BOOST_LOG_API void init_stream();

    //  Copy and assignment are closed
    BOOST_DELETED_FUNCTION(basic_record_ostream(basic_record_ostream const&))
    BOOST_DELETED_FUNCTION(basic_record_ostream& operator= (basic_record_ostream const&))
};

#ifdef BOOST_LOG_USE_CHAR
typedef basic_record_ostream< char > record_ostream;        //!< Convenience typedef for narrow-character logging
#endif
#ifdef BOOST_LOG_USE_WCHAR_T
typedef basic_record_ostream< wchar_t > wrecord_ostream;    //!< Convenience typedef for wide-character logging
#endif

// Implementation note: these operators below should be the least attractive for the compiler
// so that user's overloads are chosen, when present. We use function template partial ordering for this purpose.
// We also don't use perfect forwarding for the right hand argument because in ths case the generic overload
// would be more preferred than the typical one written by users:
//
// record_ostream& operator<< (record_ostream& strm, my_type const& arg);
//
// This is because my_type rvalues require adding const to the type, which counts as a conversion that is not required
// if there is a perfect forwarding overload.
template< typename StreamT, typename T >
inline typename boost::log::aux::enable_if_record_ostream< StreamT, StreamT& >::type
operator<< (StreamT& strm, T const& value)
{
    typedef basic_formatting_ostream< typename StreamT::char_type > formatting_ostream_type;
    static_cast< formatting_ostream_type& >(strm) << value;
    return strm;
}

template< typename StreamT, typename T >
inline typename boost::log::aux::enable_if_record_ostream< StreamT, StreamT& >::type
operator<< (StreamT& strm, T& value)
{
    typedef basic_formatting_ostream< typename StreamT::char_type > formatting_ostream_type;
    static_cast< formatting_ostream_type& >(strm) << value;
    return strm;
}

#if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES)

template< typename StreamT, typename T >
inline typename boost::log::aux::enable_if_record_ostream< StreamT, StreamT& >::type
operator<< (StreamT&& strm, T const& value)
{
    typedef basic_formatting_ostream< typename StreamT::char_type > formatting_ostream_type;
    static_cast< formatting_ostream_type& >(strm) << value;
    return strm;
}

template< typename StreamT, typename T >
inline typename boost::log::aux::enable_if_record_ostream< StreamT, StreamT& >::type
operator<< (StreamT&& strm, T& value)
{
    typedef basic_formatting_ostream< typename StreamT::char_type > formatting_ostream_type;
    static_cast< formatting_ostream_type& >(strm) << value;
    return strm;
}

#endif // !defined(BOOST_NO_CXX11_RVALUE_REFERENCES)

namespace aux {

//! Internal class that provides formatting streams for record pumps
template< typename CharT >
struct stream_provider
{
    //! Character type
    typedef CharT char_type;

    //! Formatting stream compound
    struct stream_compound
    {
        stream_compound* next;

        //! Log record stream adapter
        basic_record_ostream< char_type > stream;

        //! Initializing constructor
        explicit stream_compound(record& rec) : next(NULL), stream(rec) {}
    };

    //! The method returns an allocated stream compound
    BOOST_LOG_API static stream_compound* allocate_compound(record& rec);
    //! The method releases a compound
    BOOST_LOG_API static void release_compound(stream_compound* compound) BOOST_NOEXCEPT;

    //  Non-constructible, non-copyable, non-assignable
    BOOST_DELETED_FUNCTION(stream_provider())
    BOOST_DELETED_FUNCTION(stream_provider(stream_provider const&))
    BOOST_DELETED_FUNCTION(stream_provider& operator= (stream_provider const&))
};

/*!
 * \brief Logging record pump implementation
 *
 * The pump is used to format the logging record message text and then
 * push it to the logging core. It is constructed on each attempt to write
 * a log record and destroyed afterwards.
 *
 * The pump class template is instantiated on the logger type.
 */
template< typename LoggerT >
class record_pump
{
    BOOST_MOVABLE_BUT_NOT_COPYABLE(record_pump)

private:
    //! Logger type
    typedef LoggerT logger_type;
    //! Character type
    typedef typename logger_type::char_type char_type;
    //! Stream compound provider
    typedef stream_provider< char_type > stream_provider_type;
    //! Stream compound type
    typedef typename stream_provider_type::stream_compound stream_compound;

    //! Stream compound release guard
    class auto_release;
    friend class auto_release;
    class auto_release
    {
        stream_compound* m_pCompound;

    public:
        explicit auto_release(stream_compound* p) BOOST_NOEXCEPT : m_pCompound(p) {}
        ~auto_release() BOOST_NOEXCEPT { stream_provider_type::release_compound(m_pCompound); }
    };

protected:
    //! A reference to the logger
    logger_type* m_pLogger;
    //! Stream compound
    stream_compound* m_pStreamCompound;
    //! Exception state
    const unsigned int m_ExceptionCount;

public:
    //! Constructor
    explicit record_pump(logger_type& lg, record& rec) :
        m_pLogger(boost::addressof(lg)),
        m_pStreamCompound(stream_provider_type::allocate_compound(rec)),
        m_ExceptionCount(unhandled_exception_count())
    {
    }
    //! Move constructor
    record_pump(BOOST_RV_REF(record_pump) that) BOOST_NOEXCEPT :
        m_pLogger(that.m_pLogger),
        m_pStreamCompound(that.m_pStreamCompound),
        m_ExceptionCount(that.m_ExceptionCount)
    {
        that.m_pLogger = 0;
        that.m_pStreamCompound = 0;
    }
    //! Destructor. Pushes the composed message to log.
    ~record_pump() BOOST_NOEXCEPT_IF(false)
    {
        if (m_pLogger)
        {
            auto_release cleanup(m_pStreamCompound); // destructor doesn't throw
            // Only push the record if no exception has been thrown in the streaming expression (if possible)
            if (m_ExceptionCount >= unhandled_exception_count())
                m_pLogger->push_record(boost::move(m_pStreamCompound->stream.get_record()));
        }
    }

    //! Returns the stream to be used for message text formatting
    basic_record_ostream< char_type >& stream() const BOOST_NOEXCEPT
    {
        BOOST_ASSERT(m_pStreamCompound != 0);
        return m_pStreamCompound->stream;
    }
};

template< typename LoggerT >
BOOST_FORCEINLINE record_pump< LoggerT > make_record_pump(LoggerT& lg, record& rec)
{
    return record_pump< LoggerT >(lg, rec);
}

} // namespace aux

#ifndef BOOST_LOG_DOXYGEN_PASS

#define BOOST_LOG_STREAM_INTERNAL(logger, rec_var)\
    for (::boost::log::record rec_var = (logger).open_record(); !!rec_var;)\
        ::boost::log::aux::make_record_pump((logger), rec_var).stream()

#define BOOST_LOG_STREAM_WITH_PARAMS_INTERNAL(logger, rec_var, params_seq)\
    for (::boost::log::record rec_var = (logger).open_record((BOOST_PP_SEQ_ENUM(params_seq))); !!rec_var;)\
        ::boost::log::aux::make_record_pump((logger), rec_var).stream()

#endif // BOOST_LOG_DOXYGEN_PASS

//! The macro writes a record to the log
#define BOOST_LOG_STREAM(logger)\
    BOOST_LOG_STREAM_INTERNAL(logger, BOOST_LOG_UNIQUE_IDENTIFIER_NAME(_boost_log_record_))

//! The macro writes a record to the log and allows to pass additional named arguments to the logger
#define BOOST_LOG_STREAM_WITH_PARAMS(logger, params_seq)\
    BOOST_LOG_STREAM_WITH_PARAMS_INTERNAL(logger, BOOST_LOG_UNIQUE_IDENTIFIER_NAME(_boost_log_record_), params_seq)

#ifndef BOOST_LOG_NO_SHORTHAND_NAMES

//! An equivalent to BOOST_LOG_STREAM(logger)
#define BOOST_LOG(logger) BOOST_LOG_STREAM(logger)

//! An equivalent to BOOST_LOG_STREAM_WITH_PARAMS(logger, params_seq)
#define BOOST_LOG_WITH_PARAMS(logger, params_seq) BOOST_LOG_STREAM_WITH_PARAMS(logger, params_seq)

#endif // BOOST_LOG_NO_SHORTHAND_NAMES

BOOST_LOG_CLOSE_NAMESPACE // namespace log

} // namespace boost

#include <boost/log/detail/footer.hpp>

#endif // BOOST_LOG_SOURCES_RECORD_OSTREAM_HPP_INCLUDED_


text:
Clojure CES Engine

lounge-clj is a project to create a Component Entity System in as few lines of code (LOC) as possible.

```clojure
;; add dependencies
(set-env! :dependencies '[[adzerk/boot-reload "0.1.0"]])

;; require in namespace
(:require [lounge-clj :as lounge])
```

## Component, Entity, System

### Components
Components are small independant reusable bit's of state which can be attached to Entities.
These bit's of state are implemented as hash-maps.

### Entity
Entities consist of a universally unique name associated to a collection of Components.
Entities are implemented as a vector containing:
   a) a UUID
   b) Vector of Components

### System
Systems are small independant functions which act upon the global environment of Entities,
and optionally mutate state.

## Example
There are three (3) main macro's in lounge-clj each returns a new function.

```clojure
(def env (atom [])) #'lounge-clj/env

(component comp1 [a b c] :a a :b b :c c) #'lounge-clj/comp1

(comp1 "argA" "argB" "argC") #{:a "argA", :name "comp1", :c "argC", :b "argB"}

(entity ent1 (comp1 "argA" "argB" "argC")) #'lounge-clj/ent1

(system sys1 identity) #'lounge-clj/sys1

(reset! env (conj @env (ent1)))

(-> env
  sys1)

```


text:
Run 4 Your Bits!
================

In Run 4 Your Bits! you will control several old school videogame characters throughout four different levels. In order to get points you need to run forward while jumping and dodging obstacles.

![Level](http://img4.wikia.nocookie.net/__cb20120412200535/run4yourbits/images/6/69/Level_1.png)

A while ago (2012) this was my very first programming project, I know it can be optimized and that it is buggy as hell but it actually was my first time doing something relatively big sized (I assure you, I no longer code this way or I would not be saying this)

Some of the media elements here have copyright, all rights belong to their respective owners without exception and will be taken down upon request if needed.


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 org.jutils.jhardware.model;

import java.util.Map;

/**
 *
 * @author Javier Garcia Alonso
 */
public class MemoryInfo implements ComponentInfo {
    private String totalMemory;
    private String freeMemory;
    private String availableMemory;

    private Map<String, String> fullInfo;

    public String getTotalMemory() {
        return totalMemory;
    }

    public void setTotalMemory(String totalMemory) {
        this.totalMemory = totalMemory;
    }

    public String getFreeMemory() {
        return freeMemory;
    }

    public void setFreeMemory(String freeMemory) {
        this.freeMemory = freeMemory;
    }

    public String getAvailableMemory() {
        return availableMemory;
    }

    public void setAvailableMemory(String availableMemory) {
        this.availableMemory = availableMemory;
    }

    public Map<String, String> getFullInfo() {
        return fullInfo;
    }

    public void setFullInfo(Map<String, String> fullInfo) {
        this.fullInfo = fullInfo;
    }

}


text:
using System;

namespace Mozu.Api.Contracts.Core.Extensible
{
		///
		///	Validates the attribute configured for the customer in the storefront against the attribute configured in .
		///
		public class AttributeValidation
		{
			public DateTime? MaxDateTime { get; set; }

			public decimal? MaxNumericValue { get; set; }

			public int? MaxStringLength { get; set; }

			public DateTime? MinDateTime { get; set; }

			public decimal? MinNumericValue { get; set; }

			public int? MinStringLength { get; set; }

			public string RegularExpression { get; set; }

		}

}


text:
function change(startX, startY, endX, endY, screen, color, name)
    local tempScreen = screen
    for y=startY, endY do
        for x=startX, endX do
            screen[name][x][y] = screen[x][y]
            screen[x][y]
        end
    end
end


text:
/* tslint:disable */
/* eslint-disable */
// @generated
// This file was automatically generated and should not be edited.

// ====================================================
// GraphQL mutation operation: DeleteReaction
// ====================================================

export interface DeleteReaction_deleteReaction_reaction_study {
  __typename: "Study";
  dislikesCount: number;
}

export interface DeleteReaction_deleteReaction_reaction {
  __typename: "Reaction";
  study: DeleteReaction_deleteReaction_reaction_study;
}

export interface DeleteReaction_deleteReaction {
  __typename: "DeleteReactionPayload";
  reaction: DeleteReaction_deleteReaction_reaction | null;
  errors: string[] | null;
}

export interface DeleteReaction {
  deleteReaction: DeleteReaction_deleteReaction | null;
}

export interface DeleteReactionVariables {
  id: number;
}


text:
<?php

namespace App\Http\Requests\API\ObjectStorage;

use App\Http\Requests\API\Request as BaseRequest;

class Request extends BaseRequest
{
    /**
     * Determine if the user is authorized to make this request.
     *
     * @return bool
     */
    public function authorize()
    {
        return true;
    }

    public function rules()
    {
        return [
            'bucket' => 'required',
            'key' => 'required',
        ];
    }
}


text:
package org.beepcore.beep.profile.sasl;

import java.io.IOException;

import javax.xml.parsers.*;

import org.w3c.dom.*;

import sun.misc.BASE64Decoder;
import sun.misc.BASE64Encoder;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

/**
 * The Blob class tries to abstract some of the complexity inherent in
 * dealing with the XML <blob> elements that are used in the SASL
 * profiles.  This class may eventually belong in CORE, but until then.
 * One other developmental issue - it might be simpler to just use
 * strings all the time.  I just try to avoid string comparison, but
 * I'm not sure this effort is buying anything.  I need to examine
 * how the status is used...and may well go back to String representation
 * of status alone.
 * @todo move Blob to core
 *
 * @author Eric Dixon
 * @author Huston Franklin
 * @author Jay Kint
 * @author Scott Pead
 * @version $Revision: 1.10 $, $Date: 2003/11/18 14:03:08 $
 *
 */
public class Blob
{
    // Constants
    // Status Constants
    public final static String ABORT    = SASLProfile.SASL_STATUS_ABORT;
    public final static String COMPLETE = SASLProfile.SASL_STATUS_COMPLETE;
    public final static String CONTINUE = SASLProfile.SASL_STATUS_CONTINUE;
    public final static String NONE     = SASLProfile.SASL_STATUS_NONE;
    public final static int STATUS_NONE     = 0;
    public final static int STATUS_ABORT    = 1;
    public final static int STATUS_CONTINUE = 2;
    public final static int STATUS_COMPLETE = 3;
    public final static int STATUS_LIMIT    = 4;
    // Data Constants
    public final static int DEFAULT_BLOB_SIZE = 1024;
    // Error Constants
    private final static String ERR_INVALID_STATUS_VALUE =
        "Invalid SASL Status for Blob";
    private final static String ERR_XML_PARSE_FAILURE = "Failed to parse xml";
    // XML Fragment Constants

    // Class data
    private static String statusMappings[];
    private static BASE64Decoder decoder;
    private static BASE64Encoder encoder;
    private static boolean initialized = false;

    // Data
    private Log log = LogFactory.getLog(this.getClass());

    private int status;
    private String blobData;
    private String stringified;
    private byte[] decodedData;
    private DocumentBuilder builder;    // generic XML parser

    /**
     * This is the Constructor for those that want to create and send a blob.
     *
     * @param status the status to construct the blob with (see the constants
     * in this class).
     *
     * @throws SASLException
     */
    public Blob(int status)
        throws SASLException
    {
        if (log.isDebugEnabled()) {
            log.debug("Created blob=>"+status);
        }
        if (!initialized) {
            init();
        }

        try {
            builder =
                DocumentBuilderFactory.newInstance().newDocumentBuilder();
        } catch (ParserConfigurationException e) {
            throw new SASLException(ERR_XML_PARSE_FAILURE);
        }

        // Validate status
        if (!validateStatus(status)) {
            throw new SASLException(ERR_INVALID_STATUS_VALUE);
        }

        this.status = status;

        StringBuffer buff = new StringBuffer(DEFAULT_BLOB_SIZE);
        buff.append("<blob ");

        if (status != STATUS_NONE) {
            buff.append("status='");
            buff.append(statusMappings[status]);
            buff.append('\'');
        }

        if (blobData == null) {
            buff.append("/>");
        } else {
            buff.append(">");
            buff.append(blobData);
            buff.append("</blob>");
        }

        stringified = buff.toString();
        if (log.isDebugEnabled()) {
            log.debug("Created blob=>" + stringified);
        }
    }

    /**
     * This is the Constructor for those that want to create and send a blob.
     *
     * @param status the status to construct the blob with (see the constants
     * in this class).
     * @param data the data to be embedded in the blob element
     *
     * @throws SASLException
     */
    public Blob(int status, String data)
        throws SASLException
    {
        if (log.isDebugEnabled()) {
            log.debug("Created blob=>" + status + "," + data);
        }
        if (!initialized) {
            init();
        }

        try {
            builder =
                DocumentBuilderFactory.newInstance().newDocumentBuilder();
        } catch (ParserConfigurationException e) {
            throw new SASLException(ERR_XML_PARSE_FAILURE);
        }

        // Validate status
        if (!validateStatus(status)) {
            throw new SASLException(ERR_INVALID_STATUS_VALUE);
        }

        this.status = status;
        if (data != null) {
          try {
            this.decodedData = data.getBytes("UTF-8");
          } catch (java.io.UnsupportedEncodingException e) {
            throw new
                java.lang.RuntimeException("UTF-8 encoding not supported");
          }

          this.blobData = encoder.encodeBuffer(this.decodedData);
        }

        StringBuffer buff = new StringBuffer(DEFAULT_BLOB_SIZE);
        buff.append("<blob ");

        if (status != STATUS_NONE) {
            buff.append("status='");
            buff.append(statusMappings[status]);
            buff.append('\'');
        }

        if (blobData == null) {
            buff.append("/>");
        } else {
            buff.append(">");
            buff.append(blobData);
            buff.append("</blob>");
        }

        stringified = buff.toString();
        if (log.isDebugEnabled()) {
            log.debug("Created blob=>" + stringified);
        }
    }

    /**
     * This is the Constructor for those that want to create and send a blob.
     *
     * @param status the status to construct the blob with (see the constants
     * in this class).
     * @param data the data to be embedded in the blob element
     *
     * @throws SASLException
     */
    public Blob(int status, byte[] data )
        throws SASLException
    {
        if (!initialized) {
            init();
        }

        try {
            builder =
                DocumentBuilderFactory.newInstance().newDocumentBuilder();
        } catch (ParserConfigurationException e) {
            throw new SASLException(ERR_XML_PARSE_FAILURE);
        }

        // Validate status
        if (!validateStatus(status)) {
            throw new SASLException(ERR_INVALID_STATUS_VALUE);
        }

        this.status = status;
        if (data != null) {
            this.decodedData = data;
            this.blobData = encoder.encodeBuffer(data);
        }

        StringBuffer buff = new StringBuffer(DEFAULT_BLOB_SIZE);
        buff.append("<blob ");

        if (status != STATUS_NONE) {
            buff.append("status='");
            buff.append(statusMappings[status]);
            buff.append('\'');
        }

        if (blobData == null) {
            buff.append("/>");
        } else {
            buff.append(">");
            buff.append(blobData);
            buff.append("</blob>");
        }

        stringified = buff.toString();
        if (log.isDebugEnabled()) {
            log.debug("Created blob=>" + stringified);
        }
    }

    /**
     * Constructor for those that want to 'receive' or 'digest' a blob.
     *
     * @param blob The data to digest.
     *
     * @throws SASLException in the event that errors occur during the
     * parsing of the blob passed in.
     */
    public Blob(String blob) throws SASLException
    {
        if (log.isDebugEnabled()) {
            log.debug("Receiving blob of=>"+blob);
        }
        if (!initialized) {
            init();
        }

        try {
            builder =
                DocumentBuilderFactory.newInstance().newDocumentBuilder();
        } catch (ParserConfigurationException e) {
            throw new SASLException(ERR_XML_PARSE_FAILURE);
        }

        stringified = blob;
        // Parse out the status if there is any
        String statusString = extractStatusFromBlob(blob);
        this.status = STATUS_NONE;
        if (statusString != null) { /// @TODO && statusString.equals("") == false
            for (int i=0; i<STATUS_LIMIT; i++) {
                if (statusMappings[i].equals(statusString)) {
                    status = i;
                    break;
                }
            }
            statusString = statusMappings[status];
        }

        // Parse out the data if there is any
        blobData = extractDataFromBlob(blob);
        if (blobData != null) {
            try {
                decodedData = decoder.decodeBuffer(blobData);
            } catch (IOException x) {
                throw new SASLException(x.getMessage());
            }
        } else {
            decodedData = null;
        }

        if (status == STATUS_NONE && blobData == null) {
            throw new SASLException("No valid data in blob");
        }

        if (log.isDebugEnabled()) {
            log.debug("Received Blob of =>" + stringified);
        }
    }

    /**
     * Method init is a static method that prepares some of the
     * XML parsing and Base64Encoding/Decoding machinery needed
     * to understand blobs.  This functionality pops up elsewhere
     * in the library and should probably be moved ot some XML
     * utility class.  It isn't there yet though.
     *
     */
    private static void init() throws SASLException
    {
        if (decoder == null) {
            decoder = new BASE64Decoder();
        }

        if (encoder == null) {
            encoder = new BASE64Encoder();
        }

        if(statusMappings == null) {
            statusMappings = new String[STATUS_LIMIT];
            statusMappings[STATUS_NONE]     = NONE;
            statusMappings[STATUS_ABORT]    = ABORT;
            statusMappings[STATUS_CONTINUE] = CONTINUE;
            statusMappings[STATUS_COMPLETE] = COMPLETE;
        }
        initialized = true;
    }

    /**
     * Returns the status used in the blob - can be 'none'.
     */
    public String getStatus()
    {
        return statusMappings[status];
    }

    /**
     * Returns the blob data as a String.
     */
    public String getData()
    {
        if (decodedData == null) {
            return "";
        }
        return new String(decodedData);
    }

    /**
     * Returns the blob data as bytes.
     */
    public byte[] getDataBytes()
    {
        return decodedData;
    }

    /**
     * Returns a representation of the Blob as it would be sent
     * out on the wire (with the data encoded).
     *
     */
    public String toString()
    {
        return stringified;
    }

    /**
     * Routines to parse XML blobs and extract either status
     * attributes or data (which is sometimes clear, sometimes Base64,
     * and potentially sometimes in other formats).  This routine
     * doesn't decode anything
     *
     * @todo move this to some util class
     *
     * @param blob the data to be processed
     *
     * @return the top Element
     *
     * @throws SASLException
     */
    private Element processMessage(String blob)
        throws SASLException
    {

        // parse the stream
        Document doc = null;

        try {
            log.debug("Tuning Profile Parse Routine");

            doc = builder.parse(new java.io.ByteArrayInputStream(blob.getBytes()));

            log.debug("parsed message");
        } catch (Exception e) {
            log.debug("Error parsing", e);
            throw new SASLException(ERR_XML_PARSE_FAILURE);
        }

        if (doc == null) {
            throw new SASLException(ERR_XML_PARSE_FAILURE);
        }

        Element topElement = doc.getDocumentElement();

        if (topElement == null) {
            throw new SASLException(ERR_XML_PARSE_FAILURE);
        }

        return topElement;
    }

    /**
     * Method extractStatusFromBlob
     *
     * @param blob is the data to extract from
     * @return String the value of the status attribute
     *
     * @throws SASLException if a parsing error occurs
     * or the input is invalid in some other way.
     *
     */
    private String extractStatusFromBlob(String blob)
            throws SASLException
    {
        if ((blob == null) || (blob.indexOf("<blob ") == -1)) {
            return null;
        }

        Element top = processMessage(blob);

        if (!top.getTagName().equals("blob")) {
            throw new SASLException(ERR_XML_PARSE_FAILURE);
        }

        return top.getAttribute("status");
    }

    /**
     * Method extractStatusFromBlob
     *
     * @param blob is the data to extract from
     * @return String the value of the blob element
     *
     * @throws SASLException if a parsing error occurs
     * or the input is invalid in some other way.
     *
     */
    private String extractDataFromBlob(String blob) throws SASLException
    {
        if (blob == null) {
            return null;
        }

        String result;
        Element top = processMessage(blob);

        if (!top.getTagName().equals("blob")) {
            throw new SASLException(ERR_XML_PARSE_FAILURE);
        }

        Node dataNode = top.getFirstChild();

        if (dataNode == null) {
            return null;
        }

        return top.getFirstChild().getNodeValue();
    }

    /**
     * Base64 Help routines so we don't have to expose them
     * to subclasses and others.
     *
     * @todo move this to some util class
     *
     * @param data the data to encode
     * @return String the encoded data.
     *
     * @throws SASLException
     */
    private static String encodeData(String data)
        throws SASLException
    {
        try {
            return new String(encoder.encodeBuffer(data.getBytes()));
        } catch (Exception x) {
            throw new SASLException("Base64 encode or decode failure");
        }
    }

    /**
     * Method decodeData simply checks values of the blob's
     * status attribute against 'valid' values.
     *
     * @param status the string to be checked
     * @return boolean whether or not it's valid or not
     *
     * @throws SASLException
     *
     */
    private static boolean validateStatus(String status)
    {
        if (!status.equals(ABORT)
            &&!status.equals(NONE)
            &&!status.equals(CONTINUE)
            &&!status.equals(COMPLETE)) {
            return false;
        }

        return true;
    }

    /**
     * Method validateStatus validates a status value for an instance
     * of the blob class.
     *
     * @param data
     *
     * @throws SASLException
     *
     */
    private static boolean validateStatus(int status)
    {
        if (status < STATUS_NONE || status > STATUS_COMPLETE) {
            return false;
        }

        return true;
    }
}


text:
        <md-tabs md-selected="ctrl.selectedIndex">
            <md-tab md-on-select="ctrl.onTabSelected()" ng-repeat = "tab in ctrl.tabs">
                <md-tab-label>
                    {{tab.title}}
                </md-tab-label>
                <md-tab-template>

                        <md-grid-list
                                md-cols="4" md-row-height="4:5" md-gutter="20px">
                            <md-grid-tile ng-repeat="card in ctrl.currentCards"
                                          md-colspan="1">

 x {{card.available}}

                            </md-grid-tile>
                        </md-grid-list>

                </md-tab-template>
            </md-tab>

        </md-tabs>

            <md-button class="md-fab md-hue-2" ng-click="ctrl.previousPage()" style="position: relative; left: 40%">Prev</md-button>
            <md-button class="md-fab md-primary" ng-click="ctrl.nextPage()" style="position: relative; left: 50%">Next</md-button>

        Selection List
        <md-list layout="column" layout-padding layout-wrap>
            <md-item class="selectedCard" ng-repeat="card in ctrl.selectedCards" ng-click="ctrl.unselectCard(card)">

{{card.name}} x {{card.selectedCount}}

            </md-item>
        </md-list>


text:
//////////////////////////////////////////////////////////////////////////
//
//  Copyright (c) 2007-2013, Image Engine Design Inc. All rights reserved.
//
//  Redistribution and use in source and binary forms, with or without
//  modification, are permitted provided that the following conditions are
//  met:
//
//     * Redistributions of source code must retain the above copyright
//       notice, this list of conditions and the following disclaimer.
//
//     * Redistributions in binary form must reproduce the above copyright
//       notice, this list of conditions and the following disclaimer in the
//       documentation and/or other materials provided with the distribution.
//
//     * Neither the name of Image Engine Design nor the names of any
//       other contributors to this software may be used to endorse or
//       promote products derived from this software without specific prior
//       written permission.
//
//  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
//  IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
//  THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
//  PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
//  CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
//  EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
//  PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
//  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
//  LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
//  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
//  SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
//////////////////////////////////////////////////////////////////////////

#include "IECore/Export.h"
#include "IECore/TransformationMatrixData.h"
#include "IECore/TypedData.inl"

namespace IECore {

static IndexedIO::EntryID g_valueEntry("value");

#define TRANSFORMATIONMATRIX_SIZE	(8 * 3) + 4 + 1		// 8 3D vectors, 1 quaternion and one rotation order.

// define save/load methods backward compatible with the old structure that represented rotate as Quat<T> instead of Euler<T>
#define IE_CORE_DEFINETRANSFORMATIONMATRIXIOSPECIALIZATION( TNAME )									\
	template<>																						\
	void TNAME::save( SaveContext *context ) const													\
	{																								\
		const TNAME::ValueType &base = TNAME::readable();											\
		TNAME::BaseType values[ TRANSFORMATIONMATRIX_SIZE ] = {										\
			base.scalePivot.x, base.scalePivot.y, base.scalePivot.z,								\
			base.scale.x, base.scale.y, base.scale.z,												\
			base.shear.x, base.shear.y, base.shear.z,																				\
			base.scalePivotTranslation.x, base.scalePivotTranslation.y, base.scalePivotTranslation.z,								\
			base.rotatePivot.x, base.rotatePivot.y, base.rotatePivot.z,																\
			base.rotationOrientation.r, base.rotationOrientation.v.x, base.rotationOrientation.v.y, base.rotationOrientation.v.z, 	\
			(TNAME::BaseType)(base.rotate.order())+0.2f, base.rotate.x, base.rotate.y, base.rotate.z, 								\
			base.rotatePivotTranslation.x, base.rotatePivotTranslation.y, base.rotatePivotTranslation.z, 							\
			base.translate.x, base.translate.y, base.translate.z 																	\
		};																							\
		Data::save( context );																		\
		IndexedIO *container = context->rawContainer();												\
		container->write( g_valueEntry, values, TRANSFORMATIONMATRIX_SIZE );						\
	}																								\
																									\
	template<>																						\
	void TNAME::load( LoadContextPtr context )														\
	{																								\
		Data::load( context );																		\
		TNAME::BaseType values[ TRANSFORMATIONMATRIX_SIZE ];										\
		TNAME::BaseType *p = &values[0];															\
		try																							\
		{																							\
			const IndexedIO *container = context->rawContainer();									\
			container->read( g_valueEntry, p, TRANSFORMATIONMATRIX_SIZE );							\
		}																							\
		catch( ... )																				\
		{																							\
			unsigned int v = 0;																		\
			ConstIndexedIOPtr container = context->container( staticTypeName(), v );				\
			container->read( g_valueEntry, p, TRANSFORMATIONMATRIX_SIZE );							\
		}																							\
		TNAME::ValueType &base = TNAME::writable();													\
		base.scalePivot.x = *p++;																	\
		base.scalePivot.y = *p++;																	\
		base.scalePivot.z = *p++;																	\
		base.scale.x = *p++;																		\
		base.scale.y = *p++;																		\
		base.scale.z = *p++;																		\
		base.shear.x = *p++;																		\
		base.shear.y = *p++;																		\
		base.shear.z = *p++;																		\
		base.scalePivotTranslation.x = *p++;														\
		base.scalePivotTranslation.y = *p++;														\
		base.scalePivotTranslation.z = *p++;														\
		base.rotatePivot.x = *p++;																	\
		base.rotatePivot.y = *p++;																	\
		base.rotatePivot.z = *p++;																	\
		base.rotationOrientation.r = *p++;															\
		base.rotationOrientation.v.x = *p++;														\
		base.rotationOrientation.v.y = *p++;														\
		base.rotationOrientation.v.z = *p++;														\
		TNAME::BaseType order = *p++;																\
		base.rotate.x = *p++;																		\
		base.rotate.y = *p++;																		\
		base.rotate.z = *p++;																		\
		if ( order <= 1.0 )																			\
		{																							\
			/* backward compatibility: rotate used to be a quaternion... */							\
			base.rotate.setOrder( Imath::Euler<TNAME::BaseType>::XYZ );								\
			base.rotate.extract( Imath::Quat<TNAME::BaseType>( order, base.rotate.x, base.rotate.y, base.rotate.z ));	\
		} else																						\
		{																							\
			base.rotate.setOrder( (Imath::Euler<TNAME::BaseType>::Order)(order) );		\
		}																							\
		base.rotatePivotTranslation.x = *p++;														\
		base.rotatePivotTranslation.y = *p++;														\
		base.rotatePivotTranslation.z = *p++;														\
		base.translate.x = *p++;																	\
		base.translate.y = *p++;																	\
		base.translate.z = *p++;																	\
	}\
\
	template<>\
	void SimpleDataHolder<TNAME::ValueType>::hash( MurmurHash &h ) const\
	{\
		const TNAME::ValueType &v = readable();\
		h.append( v.scalePivot );\
		h.append( v.scale );\
		h.append( v.shear );\
		h.append( v.scalePivotTranslation );\
		h.append( v.rotatePivot );\
		h.append( v.rotationOrientation );\
		h.append( v.rotate );\
		h.append( v.rotate.order() );\
		h.append( v.rotatePivotTranslation );\
		h.append( v.translate );\
	}\

#define IE_CORE_DEFINEDATASPECIALISATION( TNAME, TID )							\
	IECORE_RUNTIMETYPED_DEFINETEMPLATESPECIALISATION( TNAME, TID )					\
	IE_CORE_DEFINETRANSFORMATIONMATRIXIOSPECIALIZATION( TNAME )

IE_CORE_DEFINEDATASPECIALISATION( TransformationMatrixfData, TransformationMatrixfDataTypeId )
IE_CORE_DEFINEDATASPECIALISATION( TransformationMatrixdData, TransformationMatrixdDataTypeId )

template class IECORE_API TypedData< TransformationMatrix<float> >;
template class IECORE_API TypedData< TransformationMatrix<double> >;

} // namespace IECore