text:
var __extends = (this && this.__extends) || (function () {
    var extendStatics = Object.setPrototypeOf ||
        ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
        function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
    return function (d, b) {
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();
import { Injectable } from "@angular/core";
import { isDefined } from "./util";
var TranslateParser = (function () {
    function TranslateParser() {
    }
    return TranslateParser;
}());
export { TranslateParser };
var TranslateDefaultParser = (function (_super) {
    __extends(TranslateDefaultParser, _super);
    function TranslateDefaultParser() {
        var _this = _super !== null && _super.apply(this, arguments) || this;
        _this.templateMatcher = /{{\s?([^{}\s]*)\s?}}/g;
        return _this;
    }
    TranslateDefaultParser.prototype.interpolate = function (expr, params) {
        var result;
        if (typeof expr === 'string') {
            result = this.interpolateString(expr, params);
        }
        else if (typeof expr === 'function') {
            result = this.interpolateFunction(expr, params);
        }
        else {
            // this should not happen, but an unrelated TranslateService test depends on it
            result = expr;
        }
        return result;
    };
    TranslateDefaultParser.prototype.getValue = function (target, key) {
        var keys = key.split('.');
        key = '';
        do {
            key += keys.shift();
            if (isDefined(target) && isDefined(target[key]) && (typeof target[key] === 'object' || !keys.length)) {
                target = target[key];
                key = '';
            }
            else if (!keys.length) {
                target = undefined;
            }
            else {
                key += '.';
            }
        } while (keys.length);
        return target;
    };
    TranslateDefaultParser.prototype.interpolateFunction = function (fn, params) {
        return fn(params);
    };
    TranslateDefaultParser.prototype.interpolateString = function (expr, params) {
        var _this = this;
        if (!params) {
            return expr;
        }
        return expr.replace(this.templateMatcher, function (substring, b) {
            var r = _this.getValue(params, b);
            return isDefined(r) ? r : substring;
        });
    };
    return TranslateDefaultParser;
}(TranslateParser));
export { TranslateDefaultParser };
TranslateDefaultParser.decorators = [
    { type: Injectable },
];
/** @nocollapse */
TranslateDefaultParser.ctorParameters = function () { return []; };


text:
package com.comcast.oscar.configurationfile;

import java.io.File;
import java.io.FileNotFoundException;
import java.util.HashMap;
import java.util.Map;
import java.util.Scanner;

import org.antlr.v4.runtime.ANTLRInputStream;
import org.antlr.v4.runtime.CommonTokenStream;
import org.antlr.v4.runtime.tree.ParseTree;
import org.antlr.v4.runtime.tree.ParseTreeWalker;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;

import com.comcast.oscar.dictionary.Dictionary;
import com.comcast.oscar.parser.TlvConfigurationFileParser;
import com.comcast.oscar.parser.tlvLexer;
import com.comcast.oscar.parser.tlvParser;
import com.comcast.oscar.tlv.TlvBuilder;
import com.comcast.oscar.tlv.TlvException;
import com.comcast.oscar.tlv.TlvVariableBinding;
import com.comcast.oscar.utilities.HexString;

/**
 * ConfigrationFileImport takes a OSCAR ASCII Compliant configuration file and convert to its JSON TLV Dictionary
 *
 */
public class ConfigurationFileImport {
	private StringBuilder sbConfiguration = null;
	private TlvConfigurationFileParser tcfpConfig = null;
	private JSONArray jaTlvDefinition = new JSONArray();
	private int iConfigurationFileType = -1;

	public static final Integer DOCSIS_VER_10 = ConfigurationFileTypeConstants.DOCSIS_10_CONFIGURATION_TYPE;
	public static final Integer DOCSIS_VER_11 = ConfigurationFileTypeConstants.DOCSIS_11_CONFIGURATION_TYPE;
	public static final Integer DOCSIS_VER_20 = ConfigurationFileTypeConstants.DOCSIS_20_CONFIGURATION_TYPE;
	public static final Integer DOCSIS_VER_30 = ConfigurationFileTypeConstants.DOCSIS_30_CONFIGURATION_TYPE;
	public static final Integer DOCSIS_VER_31 = ConfigurationFileTypeConstants.DOCSIS_31_CONFIGURATION_TYPE;

	public static final Integer PKT_CBL_VER_10 = ConfigurationFileTypeConstants.PKT_CABLE_10_CONFIGURATION_TYPE;
	public static final Integer PKT_CBL_VER_15 = ConfigurationFileTypeConstants.PKT_CABLE_15_CONFIGURATION_TYPE;
	public static final Integer PKT_CBL_VER_20 = ConfigurationFileTypeConstants.PKT_CABLE_20_CONFIGURATION_TYPE;

	public static final Integer DPOE_VER_10 = ConfigurationFileTypeConstants.DPOE_10_CONFIGURATION_TYPE;
	public static final Integer DPOE_VER_20 = ConfigurationFileTypeConstants.DPOE_20_CONFIGURATION_TYPE;

	/**
	 *
	 * @param sbConfiguration
	 */
 	public ConfigurationFileImport(StringBuilder sbConfiguration) {

		this.sbConfiguration = sbConfiguration;

		processConfigurationFile(sbConfiguration);
	}

	/**
	 *
	 * @param fConfigfile

	 * @throws FileNotFoundException * @throws ConfigrationFileException
	 */
	public ConfigurationFileImport (File fConfigfile) throws FileNotFoundException , ConfigurationFileException {

		//Check to see if file is a ASCII
		if (!HexString.verifyAsciiPlainText(HexString.fileToByteArray(fConfigfile)))  {
			throw new ConfigurationFileException("ConfigrationFileImport() - File is not a text File: " + fConfigfile.getName());
		}

		@SuppressWarnings("resource")
		String output = new Scanner(fConfigfile).useDelimiter("\\Z").next();

		sbConfiguration = new StringBuilder(output);

	    processConfigurationFile(sbConfiguration);

	}

	/**
	 *
	 * @param bConfigfile

	 * @throws NullPointerException * @throws ConfigrationFileException  */
	public ConfigurationFileImport (byte[] bConfigfile) throws NullPointerException, ConfigurationFileException {

		if (bConfigfile == null)
			throw new NullPointerException("ConfigrationFileImport() - ByteArray is null");

		if (!HexString.verifyAsciiPlainText(bConfigfile))
			throw new ConfigurationFileException("ConfigrationFileImport () - Input ByteArray is not of Text Characters");

		this.sbConfiguration = new StringBuilder(new HexString(bConfigfile).toASCII());

		processConfigurationFile(sbConfiguration);
	}

	/**
	 *

	 * @return byte[]
	 */
 	public byte[] toByteArray() {
		return this.tcfpConfig.toByteArray();
	}

	/**
	 *

	 * @return int
	 */
	public int length () {
		return tcfpConfig.toByteArray().length;
	}

	/**
	 *
	 * @return String
	 */
	@Override
	public String toString () {
		return tcfpConfig.toString();
	}

	/**
	 *
	 * @param sSeperation

	 * @return String
	 */
	public String toString (String sSeperation) {
		return tcfpConfig.toString(sSeperation);
	}

	/**
	 *

	 * @return TlvBuilder
	 */
	public TlvBuilder getTlvBuilder() {

		TlvBuilder tb = new TlvBuilder();

		if (iConfigurationFileType > DOCSIS_VER_31) {

			Map<Integer,Integer> miiTypeToByteLength = new HashMap<Integer,Integer>(64,2);

			TlvVariableBinding tvb = new TlvVariableBinding(toByteArray(),miiTypeToByteLength);

			tb.add(tvb);

		} else {
			try {
				tb.add(new HexString(toByteArray()));
			} catch (TlvException e) {
				e.printStackTrace();
			}
		}

		return tb;
	}

	/**
	 *

	 * @return the configuration file type from ConfigurationFile() field statics */
	public int getConfigurationFileType () {
		return this.iConfigurationFileType;
	}

	/**
	 *
	 * @param iTlvType - Top Level TLV

	 * @return JSONArray
	 */
 	public JSONArray getTopLevelTLVJSON(int iTlvType) {

		JSONArray jaTopLevelTLV = new JSONArray();

		JSONObject joTopLevelTLV = null;

		for (int iIndex = 0 ; iIndex < jaTlvDefinition.length(); iIndex++) {

			try {
				joTopLevelTLV = jaTlvDefinition.getJSONObject(iIndex);
			} catch (JSONException e1) {
				e1.printStackTrace();
			}

			try {

				if (joTopLevelTLV.getInt(Dictionary.TYPE) == iTlvType) {
					jaTopLevelTLV.put(joTopLevelTLV);
				}

			} catch (JSONException e) {
				e.printStackTrace();
			}
		}

		return jaTopLevelTLV;
	}

	/**
	 *
	 * @param sbConfigurationFile
	 */
	private void processConfigurationFile (StringBuilder sbConfigurationFile) {

		// create a CharStream that reads from standard input
		ANTLRInputStream input = new ANTLRInputStream(sbConfigurationFile.toString());

		// create a Lexer that feeds off of input CharStream
		tlvLexer tlConfigLexer = new tlvLexer(input);

		// create a buffer of tokens pulled from the lexer
		CommonTokenStream ctsConfigTokens = new CommonTokenStream(tlConfigLexer);

		tlvParser tpConfigParser = new tlvParser(ctsConfigTokens);

		ParseTree ptConfigParseTree = tpConfigParser.begin();

		ParseTreeWalker walker = new ParseTreeWalker();

		tcfpConfig = new TlvConfigurationFileParser();

		walker.walk(tcfpConfig, ptConfigParseTree);

		//Update local JSONArray
		this.jaTlvDefinition = tcfpConfig.getTLVDefinitions();

		this.iConfigurationFileType = tcfpConfig.getConfigurationFileType();

	}

}

redpajama_set_name: RedPajamaGithub


text:
var angular = require('angular');

describe('GroupDetailController Test', () => {
  var $httpBackend;
  var $controller;
  var groupDetailCtrl;
  var $routeParams;

  beforeEach(angular.mock.module('hueApp'));

  beforeEach(angular.mock.inject((_$routeParams_) => {
    $routeParams = _$routeParams_;
  }));

  beforeEach(angular.mock.inject((_$controller_) => {
    $controller = _$controller_;
  }));

  beforeEach(angular.mock.inject((_$httpBackend_) => {
    $httpBackend = _$httpBackend_;
    groupDetailCtrl = $controller('GroupDetailController');
  }));

  afterEach(() => {
    $httpBackend.verifyNoOutstandingExpectation();
    $httpBackend.verifyNoOutstandingRequest();
    groupDetailCtrl.status = ' ';
  });

  it('should be a controller', () => {
    expect(typeof groupDetailCtrl).toBe('object');
    expect(typeof groupDetailCtrl.getAll).toBe('function');
    expect(typeof groupDetailCtrl.update).toBe('function');
    expect(typeof groupDetailCtrl.reset).toBe('function');
  });

  it('It should get all of the light', () => {
    $httpBackend.expectGET('/api/group')
    .respond(200, [{ lightId: 'test' }]);
    groupDetailCtrl.getAll();
    $httpBackend.flush();
    expect(groupDetailCtrl.group[0].lightId).toBe('test');
  });

   it('It should return a status of success when updated', () => {
     $httpBackend.expectGET('/api/light/magic')
     .respond(200);
     $routeParams.groupDetailCtrl = 'test';
     groupDetailCtrl.update();
     $httpBackend.flush();
     expect(groupDetailCtrl.status).toBe('success');
   });

   it('It should return a status of success when reset', () => {
     $httpBackend.expectGET('/api/group/reset')
     .respond(200);
     $routeParams.groupDetailCtrl = 'test';
     groupDetailCtrl.reset();
     $httpBackend.flush();
     expect(groupDetailCtrl.status).toBe('success');
   });
  });


text:
/**
 * \file StereoRendererPassive.h
 * \brief A renderer for passive stereo (e.g., polarized projection).
 *
 * \author Volker Ahlers\n
 *         volker.ahlers@hs-hannover.de
 */

/*
 * Copyright 2014 Volker Ahlers
 *
 * 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.
 */

#ifndef STEREORENDERERPASSIVE_H_
#define STEREORENDERERPASSIVE_H_

#include <string>
#include "../src/scg_internals.h"
#include "scg_ext_internals.h"
#include "StereoRenderer.h"

namespace scg {

/**
 * \brief A renderer for passive stereo (e.g., polarized projection).
 *
 * Decorator pattern, render() calls concreteRenderer->render().
 */
class StereoRendererPassive: public StereoRenderer {

public:

  /**
   * Constructor.
   *
   * \param concreteRenderer concrete renderer to be called by render() (decorator pattern)
   */
  StereoRendererPassive(RendererSP concreteRenderer);

  /**
   * Destructor.
   */
  virtual ~StereoRendererPassive();

  /**
   * Create shared pointer.
   *
   * \param concreteRenderer concrete renderer to be called by render() (decorator pattern)
   */
  static StereoRendererPassiveSP create(RendererSP concreteRenderer);

  /**
   * Render the scene, called by Viewer::startMainLoop().
   * Calls concreteRenderer->render().
   */
  virtual void render();

};

} /* namespace scg */

#endif /* STEREORENDERERPASSIVE_H_ */


text:
import * as util from 'util';
import { GraphQLStatusCodes } from './GraphQLStatusCodes';

export class AuthenticationError {
  private context: GraphQLStatusCodes;
  private message: string;

  public constructor(context: GraphQLStatusCodes, message: string) {
    this.context = context;
    this.message = message;
  }

  public toString(): string {
    return util.format('%s, %s', this.context || '', this.message);
  }
  public value(): [GraphQLStatusCodes, string] {
    return [this.context, this.message];
  }
}


text:
#include <string.h>

#define CFISH_USE_SHORT_NAMES
#define TESTCFISH_USE_SHORT_NAMES

#include "Clownfish/Test/TestByteBuf.h"

#include "Clownfish/ByteBuf.h"
#include "Clownfish/Test.h"
#include "Clownfish/TestHarness/TestBatchRunner.h"
#include "Clownfish/TestHarness/TestUtils.h"
#include "Clownfish/Blob.h"
#include "Clownfish/Class.h"
#include "Clownfish/String.h"

TestByteBuf*
TestBB_new() {
    return (TestByteBuf*)Class_Make_Obj(TESTBYTEBUF);
}

static void
test_Equals(TestBatchRunner *runner) {
    ByteBuf *bb = BB_new_bytes("foo", 4); // Include terminating NULL.

    {
        ByteBuf *other = BB_new_bytes("foo", 4);
        TEST_TRUE(runner, BB_Equals(bb, (Obj*)other), "Equals");
        DECREF(other);
    }

    TEST_TRUE(runner, BB_Equals_Bytes(bb, "foo", 4), "Equals_Bytes");
    TEST_FALSE(runner, BB_Equals_Bytes(bb, "foo", 3),
               "Equals_Bytes spoiled by different size");
    TEST_FALSE(runner, BB_Equals_Bytes(bb, "bar", 4),
               "Equals_Bytes spoiled by different content");

    {
        ByteBuf *other = BB_new_bytes("foo", 3);
        TEST_FALSE(runner, BB_Equals(bb, (Obj*)other),
                   "Different size spoils Equals");
        DECREF(other);
    }

    {
        ByteBuf *other = BB_new_bytes("bar", 4);
        TEST_INT_EQ(runner, BB_Get_Size(bb), BB_Get_Size(other),
                    "same length");
        TEST_FALSE(runner, BB_Equals(bb, (Obj*)other),
                   "Different content spoils Equals");
        DECREF(other);
    }

    DECREF(bb);
}

static void
test_Grow(TestBatchRunner *runner) {
    ByteBuf *bb = BB_new(1);
    TEST_INT_EQ(runner, BB_Get_Capacity(bb), 8,
                "Allocate in 8-byte increments");
    BB_Grow(bb, 9);
    TEST_INT_EQ(runner, BB_Get_Capacity(bb), 16,
                "Grow in 8-byte increments");
    DECREF(bb);
}

static void
test_Clone(TestBatchRunner *runner) {
    ByteBuf *bb = BB_new_bytes("foo", 3);
    ByteBuf *twin = BB_Clone(bb);
    TEST_TRUE(runner, BB_Equals(bb, (Obj*)twin), "Clone");
    DECREF(bb);
    DECREF(twin);
}

static void
test_Compare_To(TestBatchRunner *runner) {
    ByteBuf *a = BB_new_bytes("foo\0a", 5);
    ByteBuf *b = BB_new_bytes("foo\0b", 5);

    BB_Set_Size(a, 4);
    BB_Set_Size(b, 4);
    TEST_INT_EQ(runner, BB_Compare_To(a, (Obj*)b), 0,
                "Compare_To returns 0 for equal ByteBufs");

    BB_Set_Size(a, 3);
    TEST_TRUE(runner, BB_Compare_To(a, (Obj*)b) < 0,
              "shorter ByteBuf sorts first");

    BB_Set_Size(a, 5);
    BB_Set_Size(b, 5);
    TEST_TRUE(runner, BB_Compare_To(a, (Obj*)b) < 0,
              "NULL doesn't interfere with Compare_To");

    DECREF(a);
    DECREF(b);
}

static void
test_Cat(TestBatchRunner *runner) {
    ByteBuf *bb = BB_new_bytes("foo", 3);

    {
        Blob *blob = Blob_new("bar", 3);
        BB_Cat(bb, blob);
        TEST_TRUE(runner, BB_Equals_Bytes(bb, "foobar", 6), "Cat");
        DECREF(blob);
    }

    BB_Cat_Bytes(bb, "baz", 3);
    TEST_TRUE(runner, BB_Equals_Bytes(bb, "foobarbaz", 9), "Cat_Bytes");

    DECREF(bb);
}

static void
test_Utf8_To_String(TestBatchRunner *runner) {
    ByteBuf *bb = BB_new_bytes("foo", 3);

    {
        String *string = BB_Utf8_To_String(bb);
        TEST_TRUE(runner, Str_Equals_Utf8(string, "foo", 3), "Utf8_To_String");
        DECREF(string);
    }

    {
        String *string = BB_Trusted_Utf8_To_String(bb);
        TEST_TRUE(runner, Str_Equals_Utf8(string, "foo", 3),
                  "Trusted_Utf8_To_String");
        DECREF(string);
    }

    DECREF(bb);
}

void
TestBB_Run_IMP(TestByteBuf *self, TestBatchRunner *runner) {
    TestBatchRunner_Plan(runner, (TestBatch*)self, 17);
    test_Equals(runner);
    test_Grow(runner);
    test_Clone(runner);
    test_Compare_To(runner);
    test_Utf8_To_String(runner);
    test_Cat(runner);
}


text:
describe("@grails.codegen.defaultPackage@.index module", function() {

    beforeEach(angular.mock.module('@grails.codegen.defaultPackage@.index', function($provide) {
        $provide.constant('contextPath', '/GrailsApp');
    }));

    describe('applicationDataFactory', function() {
        var applicationDataFactory, $httpBackend;

        beforeEach(angular.mock.inject(function(_applicationDataFactory_, _$httpBackend_) {
            $httpBackend = _$httpBackend_;
            applicationDataFactory = _applicationDataFactory_;
        }));

        afterEach(function() {
            $httpBackend.verifyNoOutstandingExpectation();
            $httpBackend.verifyNoOutstandingRequest();
        });

        it("should get application data on .get()", function() {
            function headerValidation(headers) {
                return headers["X-Requested-With"] == "XMLHttpRequest";
            }
            $httpBackend.expectGET("/GrailsApp/application/index", headerValidation).respond(200);

            var promise = applicationDataFactory.get();

            var successFunction = jasmine.createSpy('successFunction');
            promise.then(successFunction);

            $httpBackend.flush();

            expect(successFunction).toHaveBeenCalled();
        });
    });
});


text:
enum TBrushStyle { bsSolid, bsClear, bsHorizontal, bsVertical,
			       bsFDiagonal, bsBDiagonal, bsCross, bsDiagCross };

//-------------------------------------------------------------------

class N_PUBLIC TBrush
{
	TColor Color;
	TBrushStyle Style;
	TTexture* Texture;
	float TextureU;
	float TextureV;
	float TextureOffsetU;
	float TextureOffsetV;

public:
	TBrush();
	virtual ~TBrush();

	TColor GetColor(void) const { return Color; }
	void SetColor(TColor Value) { Color = Value; }

	TBrushStyle GetStyle(void) const { return Style; }
	void SetStyle(TBrushStyle Value) { Style = Value; }

	TTexture* GetTexture(void) const { return Texture; }
	void SetTexture(TTexture* ATexture) { Texture = ATexture; }

	float GetTextureU(void) const { return TextureU; }
	float GetTextureV(void) const { return TextureV; }
	void SetTextureUV(float U, float V);
	void GetTextureUV(float &U, float &V);

	void SetTextureOffsetUV(float U, float V);
	void GetTextureOffsetUV(float &U, float &V);
	float GetTextureOffsetU(void) const { return TextureOffsetU; }
	float GetTextureOffsetV(void) const { return TextureOffsetV; }

};

//-------------------------------------------------------------------
#endif


text:
<?php
/**
 * Exemplo de uso do método autoPrintSend()
 * Todas as NFes contidas na pasta "enviadas/aprovadas" terão o DANFE impresso na impressora definida,
 * e será enviado um email contendo a NFe em xml e o Danfe em pdf ao destinatario com email indicado na NFe,
 * em caso de sucesso as NFe serão colocadas em um subdiretório denominado com "YYYYMM",
 * sendo "YYYY" igual o ano de emissao da NFe e "MM" o mes de emissão.
 *
 * ATENÇÃO: Este método somente obterá exito caso o pear Mail esteja instalado e o sistema possa
 * acessar a impressora estabelecida.
 *
 * As funções auto contidas na classe seguem uma determinada lógica
 * e movimentam as NFes pelos diretorios da estrutura.
 *
 * Estas são funções simplificadas que podem ser utilizadas em linha de comando com
 * o CRON para automatizar as tarefas de gestão das NFe.
 *
 * As funções auto não são muito adequadas para o tratamento de erros !!!
 * Portanto é desaconselhado seu uso em ambiente Produção, sem outras
 * ações que permitam o tratamento dos erros.
 *
 * Recomenda-se o teste e leitura atenta das mesmas antes de tentar por em uso.
 *
 */
error_reporting(E_ALL);
require_once('../libs/AutoToolsNFePHP.class.php');
$nfe = new ToolsNFePHP;
if (!$nfe->autoPrintSend()){
    echo $nfe->errMsg;
}
?>


text:
#include <aws/cloudtrail/model/LookupAttributeKey.h>
#include <aws/core/utils/HashingUtils.h>
#include <aws/core/Globals.h>
#include <aws/core/utils/EnumParseOverflowContainer.h>

using namespace Aws::Utils;

namespace Aws
{
  namespace CloudTrail
  {
    namespace Model
    {
      namespace LookupAttributeKeyMapper
      {

        static const int EventId_HASH = HashingUtils::HashString("EventId");
        static const int EventName_HASH = HashingUtils::HashString("EventName");
        static const int ReadOnly_HASH = HashingUtils::HashString("ReadOnly");
        static const int Username_HASH = HashingUtils::HashString("Username");
        static const int ResourceType_HASH = HashingUtils::HashString("ResourceType");
        static const int ResourceName_HASH = HashingUtils::HashString("ResourceName");
        static const int EventSource_HASH = HashingUtils::HashString("EventSource");
        static const int AccessKeyId_HASH = HashingUtils::HashString("AccessKeyId");

        LookupAttributeKey GetLookupAttributeKeyForName(const Aws::String& name)
        {
          int hashCode = HashingUtils::HashString(name.c_str());
          if (hashCode == EventId_HASH)
          {
            return LookupAttributeKey::EventId;
          }
          else if (hashCode == EventName_HASH)
          {
            return LookupAttributeKey::EventName;
          }
          else if (hashCode == ReadOnly_HASH)
          {
            return LookupAttributeKey::ReadOnly;
          }
          else if (hashCode == Username_HASH)
          {
            return LookupAttributeKey::Username;
          }
          else if (hashCode == ResourceType_HASH)
          {
            return LookupAttributeKey::ResourceType;
          }
          else if (hashCode == ResourceName_HASH)
          {
            return LookupAttributeKey::ResourceName;
          }
          else if (hashCode == EventSource_HASH)
          {
            return LookupAttributeKey::EventSource;
          }
          else if (hashCode == AccessKeyId_HASH)
          {
            return LookupAttributeKey::AccessKeyId;
          }
          EnumParseOverflowContainer* overflowContainer = Aws::GetEnumOverflowContainer();
          if(overflowContainer)
          {
            overflowContainer->StoreOverflow(hashCode, name);
            return static_cast<LookupAttributeKey>(hashCode);
          }

          return LookupAttributeKey::NOT_SET;
        }

        Aws::String GetNameForLookupAttributeKey(LookupAttributeKey enumValue)
        {
          switch(enumValue)
          {
          case LookupAttributeKey::EventId:
            return "EventId";
          case LookupAttributeKey::EventName:
            return "EventName";
          case LookupAttributeKey::ReadOnly:
            return "ReadOnly";
          case LookupAttributeKey::Username:
            return "Username";
          case LookupAttributeKey::ResourceType:
            return "ResourceType";
          case LookupAttributeKey::ResourceName:
            return "ResourceName";
          case LookupAttributeKey::EventSource:
            return "EventSource";
          case LookupAttributeKey::AccessKeyId:
            return "AccessKeyId";
          default:
            EnumParseOverflowContainer* overflowContainer = Aws::GetEnumOverflowContainer();
            if(overflowContainer)
            {
              return overflowContainer->RetrieveOverflow(static_cast<int>(enumValue));
            }

            return {};
          }
        }

      } // namespace LookupAttributeKeyMapper
    } // namespace Model
  } // namespace CloudTrail
} // namespace Aws


text:
/**
 * Imports
 */

import { component, element } from 'vdux'
import Badge from 'components/Badge'
import { Block } from 'vdux-ui'
import fire from 'vdux-fire'
import getProp from '@f/get-prop'

/**
 * <Playlist Badges/>
 */

export default fire(({ uid, playlist }) => ({
  myProgress: {
    ref: `/playlistsByUser/${uid}/byPlaylistRef/${playlist.ref}`,
    join: {
      ref: `/playlistInstances`,
      child: 'progressValue',
      childRef: 'instanceRef'
    }
  }
}))(
  component({
    render ({ props }) {
      const { myProgress, sequence } = props
      if (myProgress.loading) return

      const value = myProgress.value.progressValue || {}
      const saved = value.savedChallenges || {}
      const completed = value.completedChallenges || []

      return (
        <Block align='start center' flexWrap='wrap'>
          {sequence.map((ref, i) => (
            <GameBadges
              idx={i}
              ref={ref}
              isComplete={completed.indexOf(ref.gameRef) !== -1}
              saveRef={saved[ref.key]} />
          ))}
        </Block>
      )
    }
  })
)

const GameBadges = fire(({ ref, saveRef }) => ({
  game: `/games/${ref}/meta`,
  savedGame: saveRef && `/saved/${saveRef}/meta`
}))(
  component({
    render ({ props }) {
      const size = 48
      const { savedGame, game, isComplete } = props

      if (savedGame.loading || game.loading) return

      const stretchType = getProp('value.stretch.type', game)
      const completeType = 'completed'
      const count = getProp(`value.badges.${stretchType}`, savedGame) || 0

      return (
        <Block align='center center' my>
          <Badge
            type={completeType}
            size={size}
            hideTitle
            effects={false}
            count={isComplete}
            description={false}
            mx='s' />
          <Badge
            type={stretchType}
            size={size}
            hideTitle
            effects={false}
            count={count}
            description={false}
            mx='s' />
        </Block>
      )
    }
  })
)


text:
{% extends "layout.html" %}
{% block content %}

Welcome to Whose turn is it anyway?

Start tracking whose turn it is to perform those boring, fun or repetitive tasks!

{% if not current_user.is_authenticated() %}

Register here »

{% endif %}

{% endblock %}


text:
#ifdef PROFILER
#include <gperftools/profiler.h>
#endif

#include <limits>
#include <vector>
#include <map>
#include <algorithm>
#include <atomic>

#include "thread.h"
#include "io_interface.h"
#include "container.h"
#include "concurrency.h"

#include "vertex_index.h"
#include "graph_engine.h"
#include "graph_config.h"
#include "FGlib.h"
#include "FG_vector.h"
#include "save_result.h"

using namespace fg;

// NOTE: This routine is only meant for undirected graphs!!!
namespace {
	// INIT lets us accumulate
	enum stage_t
	{
		INIT,
		RUN,
		REBUILD,
	};

	template <typename T>
		class atomicwrapper
		{
			private:
				std::atomic<T> _a;

			public:
				atomicwrapper() :_a() {}

				atomicwrapper(const std::atomic<T> &a) :_a(a.load()) {}

				atomicwrapper(const atomicwrapper &other) :_a(other._a.load()) {}

				atomicwrapper &operator=(const atomicwrapper &other) {
					_a.store(other._a.load());
					return *this;
				}

				T get() {
					return _a;
				}

				void assign(T val) {
					_a = val;
				}

				void minus_eq(T val) {
					_a -= val;
				}

				void plus_eq(T val) {
					_a += val;
				}
		};

	template <typename T>
		static void print_atomicwrapper_v(std::vector<atomicwrapper<T>>& v ) {

			std::cout << "[ ";
			for (typename std::vector<atomicwrapper<T>>::iterator it = v.begin(); it != v.end(); ++it)  {
				std::cout << it->get() << " ";
			}
			std::cout << "]\n";
		}

	// Global map from cluster_id : cluster(volume, weight)
	std::vector<atomicwrapper<uint32_t>> g_weight_vec;
	std::vector<atomicwrapper<uint32_t>> g_volume_vec;

	typedef safs::page_byte_array::seq_const_iterator<edge_count> data_seq_iterator;
	typedef vertex_id_t cluster_id_t;

	uint64_t g_edge_weight = 0;
	bool g_changed = false;
	stage_t louvain_stage = INIT; // Init the stage

	// If anything changes cluster we cannot converge
	static void set_changed(bool changed) {
		if (!changed) // Only once per iter so no prob with this
			g_changed = changed;
		if (changed && (!g_changed))
			g_changed = changed;
	}

	// Easy printer for cluster
	template<typename T>
		static void print_vector(typename std::vector<T>& v) {
			std::cout << "[ ";
			for (typename std::vector<T>::iterator it = v.begin(); it != v.end(); ++it) {
				std::cout << *it << " ";
			}
			std::cout << "]\n";
		}

	class louvain_vertex: public compute_vertex
	{
		cluster_id_t cluster_id; // current cluster
		cluster_id_t next_cluster_id; // current cluster
		float max_modularity; // max modularity to any cluster
		uint32_t weight;
		uint32_t volume;
		bool update_globals;

		public:
		louvain_vertex(vertex_id_t id): compute_vertex(id) {
			cluster_id = id;
			next_cluster_id = id;
			max_modularity = 0;
			weight = 0;
			volume = 0;
			update_globals = false;
		}

		void run(vertex_program &prog) {
			if (update_globals) {
				if (cluster_id != next_cluster_id)
					switch_clusters();
				else
					BOOST_LOG_TRIVIAL(info) << "ignoring ...";
				update_globals = false;
			} else {
				vertex_id_t id = prog.get_vertex_id(*this);
				request_vertices(&id, 1);
			}
		}

		void run(vertex_program &prog, const page_vertex &vertex);
		void run_on_message(vertex_program &prog, const vertex_message &msg1);

		void compute_modularity(cluster_id_t neigh_cluster_id, vertex_id_t my_id, vertex_program& prog);
		void compute_per_vertex_vol_weight(data_seq_iterator& weight_it, edge_seq_iterator& id_it,
				vertex_program &prog);
		void compute_per_cluster_vol_weight(vertex_program &prog);

		// Used for save_query join
		const cluster_id_t get_result() const {
			return cluster_id;
		}

		// Remove vertex from old cluster
		void switch_clusters () {
			BOOST_LOG_TRIVIAL(info) << " Switching! Moving from c" << cluster_id << " to c" << next_cluster_id;
			g_weight_vec[cluster_id].minus_eq(weight);
			g_volume_vec[cluster_id].minus_eq(volume);

			cluster_id = next_cluster_id;
			g_weight_vec[cluster_id].plus_eq(weight);
			g_volume_vec[cluster_id].plus_eq(volume);
		}

		//void notify_iteration_end(vertex_program &vprog);

	};

	/* We need this to get the total edge_weight of the graph */
	class init_vertex_program: public vertex_program_impl<louvain_vertex>
	{
		// Thread local
		edge_count th_local_edge_count; // For the global edge count

		public:
		init_vertex_program() {
			th_local_edge_count = 0;
		}

		typedef std::shared_ptr<init_vertex_program> ptr;

		static ptr cast2(vertex_program::ptr prog) {
			return std::static_pointer_cast<init_vertex_program, vertex_program>(prog);
		}

		void pp_ec(edge_count weight) {
			this->th_local_edge_count += weight;
		}

		const uint32_t get_local_ec() const {
			return th_local_edge_count.get_count();
		}
	};

	/* We need this to do the INIT phase and pass vertex_program_impl to the start method */
	class init_vertex_program_creater: public vertex_program_creater
	{
		public:
			vertex_program::ptr create() const {
				return vertex_program::ptr(new init_vertex_program());
			}
	};

	class cluster_message: public vertex_message
	{
		cluster_id_t sender_cluster_id;

		public:
		cluster_message(cluster_id_t cluster_id):
			vertex_message(sizeof(cluster_message), true)	{
				this->sender_cluster_id = cluster_id;
			}

		const cluster_id_t get_sender_cluster_id() const {
			return sender_cluster_id;
		}
	};

	void louvain_vertex::run(vertex_program &prog, const page_vertex &vertex) {
		switch (louvain_stage) {
			case INIT: /* INIT just accums the global edge_count */
				{
					// Out edges
					data_seq_iterator weight_it =
						((const page_directed_vertex&)vertex).get_data_seq_it<edge_count>(OUT_EDGE);
					edge_seq_iterator id_it = vertex.get_neigh_seq_it(OUT_EDGE);
					compute_per_vertex_vol_weight(weight_it, id_it, prog);

					// In edges
					weight_it = ((const page_directed_vertex&)vertex).
						get_data_seq_it<edge_count>(IN_EDGE);
					id_it = vertex.get_neigh_seq_it(IN_EDGE);
					compute_per_vertex_vol_weight(weight_it, id_it, prog);
				}
				break;
			case RUN:
				{
					// Broadcast cluster_id to all my neighbors then rely on run_on_message
					// Out edges
					edge_seq_iterator id_it = vertex.get_neigh_seq_it(OUT_EDGE);
					cluster_message out_msg(this->cluster_id);
					prog.multicast_msg(id_it, out_msg);

					// In edges
					id_it = vertex.get_neigh_seq_it(IN_EDGE);
					cluster_message in_msg(this->cluster_id);
					prog.multicast_msg(id_it, in_msg);
				}
				break;
			default:
				assert(0);
		}
	}

	void louvain_vertex::run_on_message(vertex_program &prog, const vertex_message &msg1) {

		if (!update_globals)
			update_globals = true;

		const cluster_message& msg = (const cluster_message& ) msg1;
		if (msg.get_sender_cluster_id() == next_cluster_id) {
			return; // Ignore since my cluster will not change
		} else {
			// This may update the next_cluster_id and max_modularity values
			compute_modularity(msg.get_sender_cluster_id(), prog.get_vertex_id(*this), prog);

		}
	}

	// Tradeoff by iterating through neighbors, instead of the min computation which is every cluster.
	void louvain_vertex::compute_modularity(cluster_id_t neigh_cluster_id, vertex_id_t my_id, vertex_program& prog) {

		// TODO: Remove divisions & hope for no overflow
		float delta_mod = ((int)(g_weight_vec[neigh_cluster_id].get() -
					(g_weight_vec[this->next_cluster_id].get() - this->weight)) / (float) g_edge_weight) +
			(((int)((g_volume_vec[this->next_cluster_id].get() - this->volume) - g_volume_vec[neigh_cluster_id].get())
			  * (int)this->volume) / (float)(2*(g_edge_weight*g_edge_weight)));

		if (delta_mod > this->max_modularity) {
#if 1
			/** DEBUG **/
			BOOST_LOG_TRIVIAL(info) << "v" << my_id << " tentative move from c" <<  cluster_id << " to c"
				<< neigh_cluster_id << ", delta_mod="<< delta_mod << " > max_mod=" << max_modularity << "\n";
			/** GUBED **/
#endif
			max_modularity = delta_mod;
			this->next_cluster_id = neigh_cluster_id;
			//BOOST_LOG_TRIVIAL(info) << "Activating v" << my_id << " for the switch iteration";
			set_changed(true); // Global notification of cluster change

			//prog.request_notify_iter_end(*this);
			//prog.activate_vertices(&my_id,1); // Activate myself so I can change my clusters metadata
		}
	}

#if 0
	void louvain_vertex::notify_iteration_end(vertex_program &prog) {
		assert (next_cluster_id != cluster_id);
		vertex_id_t my_id = prog.get_vertex_id(*this);
		prog.activate_vertices(&my_id,1); // Activate myself so I can change my clusters metadata in NEXT iteration
	}

#endif

	// Only need to do this once per vertex ever
	void louvain_vertex::compute_per_vertex_vol_weight(data_seq_iterator& weight_it, edge_seq_iterator& id_it,
			vertex_program &prog) {
		edge_count local_edge_weight = 0;
		uint32_t self_edge_weight = 0;

		while (weight_it.has_next()) {
			edge_count e = weight_it.next();
			vertex_id_t nid = id_it.next();

			local_edge_weight += e.get_count();
			if (nid == prog.get_vertex_id(*this)) {
				self_edge_weight += e.get_count();
			}
		}

		((init_vertex_program&)prog).
			pp_ec(local_edge_weight);
		this->volume += local_edge_weight.get_count() + (2*self_edge_weight);
		this->weight += local_edge_weight.get_count() + self_edge_weight;

		// Aggregate for the cluster INIT
		g_weight_vec[cluster_id].plus_eq(local_edge_weight.get_count() + self_edge_weight);
		g_volume_vec[cluster_id].plus_eq(local_edge_weight.get_count() + (2*self_edge_weight));
	}
}

namespace fg
{
	void compute_louvain(FG_graph::ptr fg, const uint32_t levels)
	{
		graph_index::ptr index = NUMA_graph_index<louvain_vertex>::create(
				fg->get_graph_header());
		graph_engine::ptr graph = fg->create_engine(index);

		BOOST_LOG_TRIVIAL(info) << "Starting Louvain with " << levels << " levels";
		BOOST_LOG_TRIVIAL(info) << "prof_file: " << graph_conf.get_prof_file().c_str();
#ifdef PROFILER
		if (!graph_conf.get_prof_file().empty())
			ProfilerStart(graph_conf.get_prof_file().c_str());
#endif

		struct timeval start, end;
		gettimeofday(&start, NULL);
		// Resize weight and volume vectors
		BOOST_LOG_TRIVIAL(info) << "Resizing vectors to " << graph->get_num_vertices() << "\n";
		g_weight_vec.resize(graph->get_num_vertices(), atomicwrapper<uint32_t>(0));
		g_volume_vec.resize(graph->get_num_vertices(), atomicwrapper<uint32_t>(0));

		/*~~~~~~~~~~~~~~~~~~~~~~~~~~ Compute Vol & Weight ~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
		graph->start_all(vertex_initializer::ptr(),
				vertex_program_creater::ptr(new init_vertex_program_creater()));
		graph->wait4complete();

		// Aggregate the global edge-weight
		std::vector<vertex_program::ptr> ec_progs;
		graph->get_vertex_programs(ec_progs);
		BOOST_FOREACH(vertex_program::ptr vprog, ec_progs) {
			init_vertex_program::ptr lvp = init_vertex_program::cast2(vprog);
			g_edge_weight += lvp->get_local_ec();
		}
		BOOST_LOG_TRIVIAL(info) << "The graph's total edge weight is " << g_edge_weight << "\n";

		int iter = 0;
		do {
			set_changed(false);
			/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Compute modularity ~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
			louvain_stage = RUN;
			BOOST_LOG_TRIVIAL(info) << "\n\n\x1B[31m****************** LEVEL ITERATION: " << iter++
				<< " ********************************\x1B[0m\n\n";

			graph->start_all();
			graph->wait4complete();

#if 1
			/** DEBUG **/
			FG_vector<cluster_id_t>::ptr ret = FG_vector<cluster_id_t>::create(
					graph->get_num_vertices());
			graph->query_on_all(vertex_query::ptr(new save_query<cluster_id_t, louvain_vertex>(ret)));
			BOOST_LOG_TRIVIAL(info) << "Printing vertex clusters:";
			ret->print();
			/** GUBED **/
#endif
#if 1
			/** DEBUG **/
			BOOST_LOG_TRIVIAL(info) << "\x1B[31m===========================================\x1B[0m\n";
			BOOST_LOG_TRIVIAL(info) << "Global volume vector:";
			print_atomicwrapper_v(g_volume_vec);

			BOOST_LOG_TRIVIAL(info) << "Global weight vector:";
			print_atomicwrapper_v(g_weight_vec);
			BOOST_LOG_TRIVIAL(info) << "\x1B[31m===========================================\x1B[0m\n";
			/** GUBED **/
			if (g_changed) BOOST_LOG_TRIVIAL(info) << "Loop continues!";
			else BOOST_LOG_TRIVIAL(info) << "Loop ending!";

			//if (iter > 2) { fprintf(stderr, "Premature kill"); exit(-1); }
			/** GUBED **/
#endif
		} while (g_changed);

#if 1
		/** DEBUG **/
		FG_vector<cluster_id_t>::ptr ret = FG_vector<cluster_id_t>::create(
				graph->get_num_vertices());
		graph->query_on_all(vertex_query::ptr(new save_query<cluster_id_t, louvain_vertex>(ret)));
		BOOST_LOG_TRIVIAL(info) << "\nVertex clusters @ end of Level1:";
		ret->print();
		/** GUBED **/
#endif

		louvain_stage = REBUILD; // TODO: Do something here
		BOOST_LOG_TRIVIAL(info) << "\n Reached rebuild graph stage\n";
		gettimeofday(&end, NULL);

#ifdef PROFILER
		if (!graph_conf.get_prof_file().empty())
			ProfilerStop();
#endif

		BOOST_LOG_TRIVIAL(info) << boost::format("It takes %1% seconds")
			% time_diff(start, end);

		return;
	}
}


text:
package com.xinyuan.app.stage.business.service.impl;

import com.xinyuan.app.stage.business.service.ProjectService;
import com.xinyuan.app.stage.business.service.RegionCompanyService;
import com.xinyuan.app.stage.config.InputConfig;
import com.xinyuan.app.stage.config.WebConfig;
import com.xinyuan.app.stage.security.service.impl.SysLogContext;
import com.xinyuan.app.stage.service.SystemConstant;
import com.xinyuan.pub.business.dao.RegionCompanyDao;
import com.xinyuan.pub.common.constant.Constant;
import com.xinyuan.pub.common.constant.EnumIsSuccess;
import com.xinyuan.pub.common.constant.EnumOperatorType;
import com.xinyuan.pub.common.web.PubModelMap;
import com.xinyuan.pub.model.business.po.CityCompany;
import com.xinyuan.pub.model.business.po.RegionCompany;
import com.xinyuan.pub.model.business.po.query.RegionCompanyQuery;
import com.xinyuan.pub.model.po.CheckErrorDto;
import com.xinyuan.pub.model.po.TotalInfo;
import com.xinyuan.pub.model.security.po.Users;
import org.apache.commons.lang.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;
import org.springframework.ui.ModelMap;
import org.springframework.util.CollectionUtils;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;

/**
 * @author liangyongjian
 * @desc 区域公司 服务实现类
 * @create 2018-04-17 22:02
 **/
@Service("regionCompanyService")
public class RegionCompanyServiceImpl implements RegionCompanyService {

    private static final Logger LOGGER = LoggerFactory.getLogger(RegionCompanyServiceImpl.class);

    @Resource
    private WebConfig webConfig;

    @Resource
    private InputConfig inputConfig;

    @Resource
    private SysLogContext sysLogContext;

    @Resource
    private SystemConstant systemConstant;

    @Resource
    private RegionCompanyDao regionCompanyDao;

    @Override
    public List<RegionCompany> getAllRegionCompany(){
        LOGGER.debug("Service层:获取全部的区域公司常量信息");
        return regionCompanyDao.getAllRegionCompany();
    }

    @Override
    public RegionCompany getRegionCompanyById(Long regionCompanyId) {
        RegionCompany regionCompany = null;
        List<RegionCompany> regionCompanyList = systemConstant.getRegionCompanyList();
        if (!CollectionUtils.isEmpty(regionCompanyList)) {
            for (RegionCompany p : regionCompanyList) {
                if (p.getId().compareTo(regionCompanyId) == 0) {
                    regionCompany = p; break;
                }
            }
        }
        return regionCompany;
    }

    @Override
    public RegionCompany getRegionCompanyByName(String regionCompanyName) {
        if (StringUtils.isBlank(regionCompanyName)) {
            LOGGER.error("Service层:根据区域公司名称获取区域公司信息出现错误,参数区域公司名称为null : {}",
                    regionCompanyName);
            return null;
        }
        LOGGER.debug("Service层:根据区域公司名称获取区域公司信息 : {}", regionCompanyName);
        return regionCompanyDao.getRegionCompanyByName(regionCompanyName);
    }

    @Override
    public void getRegionCompanyInfoForInitPage(ModelMap model, String method, HttpServletRequest request) {
        LOGGER.debug("Service层:根据查询参数获取区域公司信息 用于区域公司管理页面");
        RegionCompanyQuery regionCompanyQuery = new RegionCompanyQuery();
        //以id升序排序
        regionCompanyQuery.setSortBy("id");
        regionCompanyQuery.setSortType("1");
        regionCompanyQuery.setPageSize(webConfig.getPageSize());
        if (method.equals("POST")) {
            String pageNum = request.getParameter("pageNumInput");
            if (! StringUtils.isBlank(pageNum)) {
                regionCompanyQuery.setPage(Integer.parseInt(pageNum));
            }
            String nameSearch = request.getParameter("regionCompanyNameSearch");
            if (! StringUtils.isBlank(nameSearch)) {
                regionCompanyQuery.setRegionCompanyName(nameSearch);
                model.addAttribute("nameSearch", nameSearch);
            }
        }
        Integer totalCount = regionCompanyDao.getRegionCompanyCountByQuery(regionCompanyQuery);
        TotalInfo totalInfo = new TotalInfo(totalCount, regionCompanyQuery.getPageSize(),
                regionCompanyQuery.getPage(), regionCompanyQuery.getStartNum());

        if (totalCount == 0) {
            return;
        }

        model.addAttribute("totalInfo", totalInfo);
        List<RegionCompany> regionCompanyList = regionCompanyDao.getRegionCompanyInfoByQuery(regionCompanyQuery);
        model.addAttribute("regionCompanyList", regionCompanyList);

    }

    @Override
    public RegionCompany getExtendRegionCompanyById(Long regionCompanyId){
        LOGGER.debug("Service层:根据区域公司id获取区域公司的扩展信息");
        RegionCompany regionCompany = this.getRegionCompanyById(regionCompanyId);
        if (regionCompany == null || regionCompany.getId() == null) {
            LOGGER.debug("根据区域公司id获取区域公司的扩展信息,没有查取到区域公司信息:regionCompanyId {}", regionCompanyId);
            return null;
        }

        //获取创建和修改区域公司信息的用户名称
        if (regionCompany.getCreateUserId() != null || regionCompany.getUpdateUserId() != null) {
            List<Long> userIdList = new ArrayList<Long>();
            if (regionCompany.getCreateUserId() != null) {
                userIdList.add(regionCompany.getCreateUserId());
            }
            if (regionCompany.getUpdateUserId() != null) {
                userIdList.add(regionCompany.getUpdateUserId());
            }
            List<Users> usersList = systemConstant.getUserInfoByUserIdList(userIdList);
            if (usersList != null && usersList.size() > 0) {
                for (Users user : usersList) {
                    if (regionCompany.getCreateUserId() != null && user.getId().compareTo(regionCompany.getCreateUserId()) == 0) {
                        regionCompany.setCreateUserName(user.getTrueName());
                    }
                    if (regionCompany.getUpdateUserId() != null && user.getId().compareTo(regionCompany.getUpdateUserId()) == 0) {
                        regionCompany.setUpdateUserName(user.getTrueName());
                    }
                }
            }
        }
        return regionCompany;
    }

    @Override
    public boolean addNewRegionCompany(RegionCompany regionCompany, HttpServletRequest request, PubModelMap modelMap) {
        LOGGER.debug("Service层:新增区域公司信息");
        Users user = (Users)request.getSession().getAttribute("CURRENT_USER_INFO");
        String sysLogCause = "";
        boolean result = false;
        //过滤掉区域公司信息中各个属性值的前后空格
        regionCompany.trim();
        if (this.checkNewRegionCompany(regionCompany, modelMap)) {
            //通过校验,开始进行更新
            regionCompany.setCreateUserId(user.getId());
            Integer resultNum = regionCompanyDao.addNewRegionCompany(regionCompany);
            if (resultNum.compareTo(new Integer(1)) == 0) {
                //将新的区域公司数据加载到内存中
                systemConstant.setRegionCompanySysCons();
                result = true;
            } else {
                modelMap.put("status", "failure");
            }
        } else {
            sysLogCause = Constant.COMMON_ERROR.ERROR_MSG;
        }

        //记录访问日志
        sysLogContext.saveSysLog(request, EnumOperatorType.ADD.getType(),
                "新增区域公司信息:" + regionCompany.getRegionCompanyName(),
                result ? EnumIsSuccess.SUCCESS.getStatus() : EnumIsSuccess.FAILURE.getStatus(), sysLogCause);
        return result;
    }

    @Override
    public boolean updateRegionCompany(RegionCompany regionCompany, HttpServletRequest request, PubModelMap modelMap) {
        LOGGER.debug("Service层:根据区域公司id更新区域公司信息");
        Users user = (Users)request.getSession().getAttribute("CURRENT_USER_INFO");
        String sysLogCause = "";
        boolean result = false;
        //过滤掉用户信息中各个属性值的前后空格
        regionCompany.trim();
        if (this.checkUpdateRegionCompany(regionCompany, modelMap)) {
            //通过校验,开始进行更新
            regionCompany.setUpdateUserId(user.getId());
            Integer resultNum = regionCompanyDao.updateRegionCompanyById(regionCompany);
            if (resultNum.compareTo(new Integer(1)) == 0) {
                //将新的区域公司数据加载到内存中
                systemConstant.setRegionCompanySysCons();
                result = true;
            } else {
                sysLogCause = Constant.PERSISTENCE_ERROR.ERROR_MSG;
                modelMap.put("status", "failure");
            }
        } else {
            sysLogCause = Constant.COMMON_ERROR.ERROR_MSG;
        }
        //记录访问日志
        sysLogContext.saveSysLog(request, EnumOperatorType.MODIFY.getType(),
                "更新区域公司信息:" + regionCompany.getRegionCompanyName(),
                result ? EnumIsSuccess.SUCCESS.getStatus() : EnumIsSuccess.FAILURE.getStatus(), sysLogCause);
        return result;
    }

    @Override
    public boolean removeRegionCompany(Long regionCompanyId, HttpServletRequest request, PubModelMap modelMap) {
        LOGGER.debug("Service层:根据区域公司id删除区域公司信息 物理删除");
        boolean result = false;
        boolean isHave = false;
        String sysLogCause = "";
        RegionCompany regionCompany = null;
        List<RegionCompany> regionCompanyList = systemConstant.getRegionCompanyList();
        for (RegionCompany p : regionCompanyList) {
            if (p.getId().compareTo(regionCompanyId) == 0) {
                regionCompany = p;
                isHave = true;
            }
        }

        if (!isHave) {
            modelMap.put("status", "error");
            modelMap.put("data", "不存在该区域公司记录!");
            sysLogCause = Constant.COMMON_ERROR.ERROR_MSG + "——不存在该区域公司记录";
        } else {
            boolean isHaveCity = false;
            Map<Long, Map<String, CityCompany>> cityCompanyMap =
                    systemConstant.getCityCompanyMapWithKeyRegionCompanyId();
            if (!CollectionUtils.isEmpty(cityCompanyMap)) {
                if (cityCompanyMap.containsKey(regionCompanyId)) {
                    isHaveCity = true;
                }
            }
            if (isHaveCity){
                modelMap.put("status", "error");
                modelMap.put("data", "不允许删除:存在属于本区域公司的城市公司!");
                sysLogCause = Constant.COMMON_ERROR.ERROR_MSG + "——存在属于本区域公司的城市公司";
            } else {
//                ProjectQuery projectQuery = new ProjectQuery();
//                projectQuery.setRegionCompanyId(regionCompanyId);
//                if (projectService.getProjectCountByQuery(projectQuery) > 0) {
//                    modelMap.put("status", "error");
//                    modelMap.put("data", "不允许删除:存在引用了该区域公司的项目!");
//                    sysLogCause = Constant.COMMON_ERROR.ERROR_MSG + "——存在引用了该区域公司的项目";
//                } else {
//                    Integer resultNum = regionCompanyDao.deleteRegionCompanyById(regionCompanyId);
//                    if (resultNum.compareTo(new Integer(1)) == 0) {
//                        //将新的区域公司数据加载到内存中
//                        systemConstant.setRegionCompanySysCons();
//                        result = true;
//                    } else {
//                        sysLogCause = Constant.PERSISTENCE_ERROR.ERROR_MSG;
//                        modelMap.put("status", "failure");
//                    }
//                }
                Integer resultNum = regionCompanyDao.deleteRegionCompanyById(regionCompanyId);
                if (resultNum.compareTo(new Integer(1)) == 0) {
                    //将新的区域公司数据加载到内存中
                    systemConstant.setRegionCompanySysCons();
                    result = true;
                } else {
                    sysLogCause = Constant.PERSISTENCE_ERROR.ERROR_MSG;
                    modelMap.put("status", "failure");
                }
            }
        }
        //记录访问日志
        sysLogContext.saveSysLog(request, EnumOperatorType.DELETE.getType(),
                "删除区域公司信息" + (result ? ":" + regionCompany.getRegionCompanyName() : ""),
                result ? EnumIsSuccess.SUCCESS.getStatus() : EnumIsSuccess.FAILURE.getStatus(), sysLogCause);

        return result;
    }

    /**
     * 校验更新后区域公司的信息
     * @param regionCompany
     * @param modelMap
     * @return
     */
    private boolean checkUpdateRegionCompany(RegionCompany regionCompany, PubModelMap modelMap) {
        List<CheckErrorDto> errorInfoList = new ArrayList<CheckErrorDto>();
        this.checkRegionCompanyBaseInfo(regionCompany, errorInfoList);
        if (errorInfoList.size() > 0) {
            modelMap.put("status", "error");
            modelMap.put("data", errorInfoList);
            return false;
        }

        LOGGER.debug("Service层:校验更新后区域公司的名称是否已存在!");
        Map<String, RegionCompany> regionCompanyMap = systemConstant.getRegionCompanyMapWithKeyName();
        if (!CollectionUtils.isEmpty(regionCompanyMap)) {
            if (regionCompanyMap.containsKey(regionCompany.getRegionCompanyName())
                    && regionCompanyMap.get(
                            regionCompany.getRegionCompanyName()).getId().compareTo(regionCompany.getId()) != 0) {
                LOGGER.info("区域公司名称已经存在");
                errorInfoList.add(new CheckErrorDto("change_regionCompanyName", "区域公司名称已经存在"));
            }
        }

        if (errorInfoList.size() > 0) {
            modelMap.put("status", "error");
            modelMap.put("data", errorInfoList);
            return false;
        }
        return true;
    }

    /**
     * 校验新的区域公司信息
     * @param regionCompany
     * @param modelMap
     * @return
     */
    private boolean checkNewRegionCompany(RegionCompany regionCompany, PubModelMap modelMap) {
        LOGGER.debug("Service层:校验区域公司名称的长度,备注的长度,经度维度数据有效性,校验新区域公司的名称是否已存在!");
        List<CheckErrorDto> errorInfoList = new ArrayList<CheckErrorDto>();

        this.checkRegionCompanyBaseInfo(regionCompany, errorInfoList);

        if (errorInfoList.size() > 0) {
            modelMap.put("status", "error");
            modelMap.put("data", errorInfoList);
            return false;
        }

        LOGGER.debug("Service层:校验新区域公司的名称是否已存在!");
        Map<String, RegionCompany> regionCompanyMap = systemConstant.getRegionCompanyMapWithKeyName();
        if (!CollectionUtils.isEmpty(regionCompanyMap)) {
            if (regionCompanyMap.containsKey(regionCompany.getRegionCompanyName())) {
                LOGGER.info("区域公司名称已经存在");
                errorInfoList.add(new CheckErrorDto("regionCompanyName", "区域公司名称已经存在"));
            }
        }

        if (errorInfoList.size() > 0) {
            modelMap.put("status", "error");
            modelMap.put("data", errorInfoList);
            return false;
        }
        return true;
    }

    /**
     * 校验区域公司的基本信息
     * @param regionCompany
     * @param errorInfoList
     */
    private void checkRegionCompanyBaseInfo(RegionCompany regionCompany, List<CheckErrorDto> errorInfoList) {
        LOGGER.debug("Service层:校验区域公司名称的长度,备注的长度!");
        Integer length = null;
        String prefix = "";
        if (regionCompany.getId() != null)
            prefix = "change_";
        if (StringUtils.isBlank(regionCompany.getRegionCompanyName())) {
            LOGGER.info("请输入区域公司名称");
            errorInfoList.add(new CheckErrorDto(prefix + "regionCompanyName", "请输入区域公司名称"));
        } else {
            length = new Integer(regionCompany.getRegionCompanyName().length());
            if (length.compareTo(inputConfig.getRegionCompanyNameLength()) > 0) {
                errorInfoList.add(new CheckErrorDto(prefix + "regionCompanyName", "区域公司名称长度不能大于"
                        + inputConfig.getRegionCompanyNameLength() + "位"));
            }
        }

        if (!StringUtils.isBlank(regionCompany.getNote())) {
            length = new Integer(regionCompany.getNote().length());
            if (length.compareTo(inputConfig.getNoteLength()) > 0) {
                errorInfoList.add(new CheckErrorDto(prefix + "regionCompany_note", "备注长度不能大于"
                        + inputConfig.getNoteLength() + "位"));
            }
        }
    }

}


text:
// -*- C++ -*-
//===----------------------------------------------------------------------===//
//
//                     The LLVM Compiler Infrastructure
//
// This file is dual licensed under the MIT and the University of Illinois Open
// Source Licenses. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//

int main()
{
}


text:
package org.jboss.weld.tests.proxy.superclass;

import jakarta.enterprise.context.ApplicationScoped;

@ApplicationScoped
public class SimpleBean extends NotSimpleConstructorClass {

    public SimpleBean() {
        super("nothing");
    }

}


text: **Vendors** – All third party stlyes if they needed


text:
void solarAltitude(double * solarAlt, double sunDeclination, double latitude, double localHourAngle)
{
	//Equation for solar altitude as found on page 25 of reading (Planetary Motions and the Distribution of Radiation)
	*solarAlt = asin(sin(sunDeclination)*sin(latitude) + cos(sunDeclination)*cos(latitude)*cos(localHourAngle));

}


text:
CREATE DATABASE  IF NOT EXISTS 'tasksdb';
USE 'tasksdb';

--
-- Table structure for table 't_tasks'
--

DROP TABLE IF EXISTS 't_tasks';

CREATE TABLE 't_tasks' (
  'id' int(11) NOT NULL AUTO_INCREMENT,
  'name' varchar(45) DEFAULT NULL,
  'description' varchar(45) DEFAULT NULL,
  'date_created' datetime DEFAULT NULL,
  'finished' bit(1) DEFAULT b'0',
  PRIMARY KEY ('id')
) ENGINE=InnoDB AUTO_INCREMENT=12 DEFAULT CHARSET=utf8;


text:
category: Cards
title: Collapsible
---

      View more data

Some extra data to view

Even more data


text:
<?php

/**
 * This file is part of symforium-cms-extension
 *
 * (c) Aaron Scherer <aequasi@gmail.com>
 *
 * This source file is subject to the license that is bundled
 * with this source code in the file LICENSE
 */

namespace Symforium\Plugin\CmsPlugin\Controller;

use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Sensio\Bundle\FrameworkExtraBundle\Configuration as Config;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
use Symforium\Plugin\CmsPlugin\Entity\Page;

/**
 * @author Aaron Scherer <aequasi@gmail.com>
 */
class FrontendController extends Controller
{
    /**
     * @return array
     * @Config\Template()
     */
    public function indexAction(Request $request)
    {
        $repo = $this->getDoctrine()->getManager()->getRepository('SymforiumCmsPlugin:Page');
        $page = $repo->findOneBy(['id' => $request->attributes->get('page_id'), 'published' => 1]);

        if ($page === null) {
            throw new NotFoundHttpException('A page was found, but it is not published.');
        }

        return ['page' => $page];
    }

    /**
     * @return array
     *
     * @Config\Template()
     */
    public function failoverAction()
    {
        return [];
    }
}


text:
#ifndef _CNCOCR_STENCIL1D_TYPES_H_
#define _CNCOCR_STENCIL1D_TYPES_H_

typedef struct Stencil1DArguments {
    /* TODO: Add struct members.
     * Use this struct to pass all arguments for
     * graph initialization. This should not contain any
     * pointers (unless you know you'll only be executing
     * in shared memory and thus passing pointers is safe).
     */
} Stencil1DArgs;

#define NUM_TILES 4
#define TILE_SIZE 16
#define LAST_TIMESTEP 4

#endif /*_CNCOCR_STENCIL1D_TYPES_H_*/


text:
package org.coursera.capstone.integration.test;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;

import java.util.Calendar;
import java.util.Collection;
import java.util.Date;
import java.util.List;

import jdk.nashorn.internal.ir.annotations.Ignore;

import org.coursera.capstone.TestData;
import org.coursera.capstone.client.SecuredRestBuilder;
import org.coursera.capstone.client.SymptomManagementApi;
import org.coursera.capstone.dto.AlertDto;
import org.coursera.capstone.dto.CheckInPatientResponseDto;
import org.coursera.capstone.dto.CheckInRequestDto;
import org.coursera.capstone.dto.PatientDto;
import org.junit.Test;

import retrofit.RestAdapter.LogLevel;
import retrofit.RetrofitError;
import retrofit.client.ApacheClient;
import retrofit.client.Response;

public class SymptomManagementClientApiTest {

    private final String USERNAME_DOCTOR = "hibe";
    private final String PASSWORD_DOCTOR = "pass";
    private final String CLIENT_ID = "mobile";
    private final String USERNAME_PATIENT = "jeff";
    private final String PASSWORD_PATIENT = "pass";
    private final Long PATIENT_MEDICAL_RECORD_NO = 202L;

    private final String TEST_URL = "https://localhost:8443";

    private SymptomManagementApi doctorService = new SecuredRestBuilder()
            .setLoginEndpoint(TEST_URL + SymptomManagementApi.TOKEN_PATH).setUsername(USERNAME_DOCTOR)
            .setPassword(PASSWORD_DOCTOR).setClientId(CLIENT_ID)
            .setClient(new ApacheClient(UnsafeHttpsClient.createUnsafeClient())).setEndpoint(TEST_URL)
            .setLogLevel(LogLevel.FULL).build().create(SymptomManagementApi.class);

    private SymptomManagementApi patientService = new SecuredRestBuilder()
            .setLoginEndpoint(TEST_URL + SymptomManagementApi.TOKEN_PATH).setUsername(USERNAME_PATIENT)
            .setPassword(PASSWORD_PATIENT).setClientId(CLIENT_ID)
            .setClient(new ApacheClient(UnsafeHttpsClient.createUnsafeClient())).setEndpoint(TEST_URL)
            .setLogLevel(LogLevel.FULL).build().create(SymptomManagementApi.class);

    @Test
    public void onlyDoctorsShouldHaveAccessToDoctorApi() throws Exception {
        // Should be fine
        doctorService.getPatientList(USERNAME_DOCTOR);
        // Should fail
        try {
            patientService.getPatientList(USERNAME_DOCTOR);
            fail("Server should denied patient from accessing doctor api");
        } catch (RetrofitError e) {
            // Forbidden
            assertTrue(e.getResponse().getStatus() == 403);
        }
    }

    @Test
    public void onlyPatientsShouldBeAbleToCheckIn() throws Exception {
        try {
            doctorService.checkIn(new CheckInRequestDto());
            fail("Server should denied doctor from performing a check-in");
        } catch (RetrofitError e) {
            // Forbidden
            assertTrue(e.getResponse().getStatus() == 403);
        }
    }

    @Test
    @Ignore
    public void testCheckInFlow() throws Exception {
        CheckInRequestDto checkInRequest = TestData.createCheckInRequest(patientService, PATIENT_MEDICAL_RECORD_NO,
                new Date());
        // Patient submits a check-in
        Response response = patientService.checkIn(checkInRequest);
        assertEquals(200, response.getStatus());

        // Get the created request, need the doctor service for this
        List<CheckInPatientResponseDto> checkInResponse = doctorService.getPatientCheckIn(USERNAME_PATIENT);
        assertTrue(checkInResponse.size() > 0);
    }

    @Test
    public void shouldBeAlerted() throws Exception {
        // Submit an "alert check-in" six hours ago
        Calendar c = Calendar.getInstance();
        c.add(Calendar.HOUR_OF_DAY, -16);
        CheckInRequestDto firstCheckInRequest = TestData.createCheckInRequest(patientService,
                PATIENT_MEDICAL_RECORD_NO, c.getTime());
        patientService.checkIn(firstCheckInRequest);

        // Submit another today
        CheckInRequestDto secondCheckInRequest = TestData.createCheckInRequest(patientService,
                PATIENT_MEDICAL_RECORD_NO, new Date());
        patientService.checkIn(secondCheckInRequest);
        AlertDto alerts = doctorService.getPatientAlerts(USERNAME_PATIENT);
        // Should have an alert
        assertTrue(alerts.getAlerts().size() > 0);
    }

    @Test
    public void testSearchByName() throws Exception {
        Collection<PatientDto> patients = doctorService.findByName("name");
        assertNotNull(patients);
    }

}


text:
---
uid: SolidEdgeFramework.SelectSet.Application
summary:
remarks:
example: [*content]
---
[!code-vb[Main](..\snippets\SolidEdgeFramework.SelectSet.Application.bas]


text:
CREATE TEXT SEARCH DICTIONARY ispell (
                        Template=ispell,
                        DictFile=ispell_sample,
                        AffFile=ispell_sample
);

SELECT ts_lexize('ispell', 'skies');
SELECT ts_lexize('ispell', 'bookings');
SELECT ts_lexize('ispell', 'booking');
SELECT ts_lexize('ispell', 'foot');
SELECT ts_lexize('ispell', 'foots');
SELECT ts_lexize('ispell', 'rebookings');
SELECT ts_lexize('ispell', 'rebooking');
SELECT ts_lexize('ispell', 'rebook');
SELECT ts_lexize('ispell', 'unbookings');
SELECT ts_lexize('ispell', 'unbooking');
SELECT ts_lexize('ispell', 'unbook');

SELECT ts_lexize('ispell', 'footklubber');
SELECT ts_lexize('ispell', 'footballklubber');
SELECT ts_lexize('ispell', 'ballyklubber');
SELECT ts_lexize('ispell', 'footballyklubber');

-- Test ISpell dictionary with hunspell affix file
CREATE TEXT SEARCH DICTIONARY hunspell (
                        Template=ispell,
                        DictFile=ispell_sample,
                        AffFile=hunspell_sample
);

SELECT ts_lexize('hunspell', 'skies');
SELECT ts_lexize('hunspell', 'bookings');
SELECT ts_lexize('hunspell', 'booking');
SELECT ts_lexize('hunspell', 'foot');
SELECT ts_lexize('hunspell', 'foots');
SELECT ts_lexize('hunspell', 'rebookings');
SELECT ts_lexize('hunspell', 'rebooking');
SELECT ts_lexize('hunspell', 'rebook');
SELECT ts_lexize('hunspell', 'unbookings');
SELECT ts_lexize('hunspell', 'unbooking');
SELECT ts_lexize('hunspell', 'unbook');

SELECT ts_lexize('hunspell', 'footklubber');
SELECT ts_lexize('hunspell', 'footballklubber');
SELECT ts_lexize('hunspell', 'ballyklubber');
SELECT ts_lexize('hunspell', 'footballyklubber');

-- Test ISpell dictionary with hunspell affix file with FLAG long parameter
CREATE TEXT SEARCH DICTIONARY hunspell_long (
                        Template=ispell,
                        DictFile=hunspell_sample_long,
                        AffFile=hunspell_sample_long
);

SELECT ts_lexize('hunspell_long', 'skies');
SELECT ts_lexize('hunspell_long', 'bookings');
SELECT ts_lexize('hunspell_long', 'booking');
SELECT ts_lexize('hunspell_long', 'foot');
SELECT ts_lexize('hunspell_long', 'foots');
SELECT ts_lexize('hunspell_long', 'rebookings');
SELECT ts_lexize('hunspell_long', 'rebooking');
SELECT ts_lexize('hunspell_long', 'rebook');
SELECT ts_lexize('hunspell_long', 'unbookings');
SELECT ts_lexize('hunspell_long', 'unbooking');
SELECT ts_lexize('hunspell_long', 'unbook');
SELECT ts_lexize('hunspell_long', 'booked');

SELECT ts_lexize('hunspell_long', 'footklubber');
SELECT ts_lexize('hunspell_long', 'footballklubber');
SELECT ts_lexize('hunspell_long', 'ballyklubber');
SELECT ts_lexize('hunspell_long', 'ballsklubber');
SELECT ts_lexize('hunspell_long', 'footballyklubber');
SELECT ts_lexize('hunspell_long', 'ex-machina');

-- Test ISpell dictionary with hunspell affix file with FLAG num parameter
CREATE TEXT SEARCH DICTIONARY hunspell_num (
                        Template=ispell,
                        DictFile=hunspell_sample_num,
                        AffFile=hunspell_sample_num
);

SELECT ts_lexize('hunspell_num', 'skies');
SELECT ts_lexize('hunspell_num', 'sk');
SELECT ts_lexize('hunspell_num', 'bookings');
SELECT ts_lexize('hunspell_num', 'booking');
SELECT ts_lexize('hunspell_num', 'foot');
SELECT ts_lexize('hunspell_num', 'foots');
SELECT ts_lexize('hunspell_num', 'rebookings');
SELECT ts_lexize('hunspell_num', 'rebooking');
SELECT ts_lexize('hunspell_num', 'rebook');
SELECT ts_lexize('hunspell_num', 'unbookings');
SELECT ts_lexize('hunspell_num', 'unbooking');
SELECT ts_lexize('hunspell_num', 'unbook');
SELECT ts_lexize('hunspell_num', 'booked');

SELECT ts_lexize('hunspell_num', 'footklubber');
SELECT ts_lexize('hunspell_num', 'footballklubber');
SELECT ts_lexize('hunspell_num', 'ballyklubber');
SELECT ts_lexize('hunspell_num', 'footballyklubber');

-- Synonym dictionary
CREATE TEXT SEARCH DICTIONARY synonym (
						Template=synonym,
						Synonyms=synonym_sample
);

SELECT ts_lexize('synonym', 'PoStGrEs');
SELECT ts_lexize('synonym', 'Gogle');
SELECT ts_lexize('synonym', 'indices');

-- Create and simple test thesaurus dictionary
-- More tests in configuration checks because ts_lexize()
-- cannot pass more than one word to thesaurus.
CREATE TEXT SEARCH DICTIONARY thesaurus (
                        Template=thesaurus,
						DictFile=thesaurus_sample,
						Dictionary=english_stem
);

SELECT ts_lexize('thesaurus', 'one');

-- Test ispell dictionary in configuration
CREATE TEXT SEARCH CONFIGURATION ispell_tst (
						COPY=english
);

ALTER TEXT SEARCH CONFIGURATION ispell_tst ALTER MAPPING FOR
	word, numword, asciiword, hword, numhword, asciihword, hword_part, hword_numpart, hword_asciipart
	WITH ispell, english_stem;

SELECT to_tsvector('ispell_tst', 'Booking the skies after rebookings for footballklubber from a foot');
SELECT to_tsquery('ispell_tst', 'footballklubber');
SELECT to_tsquery('ispell_tst', 'footballyklubber:b & rebookings:A & sky');

-- Test ispell dictionary with hunspell affix in configuration
CREATE TEXT SEARCH CONFIGURATION hunspell_tst (
						COPY=ispell_tst
);

ALTER TEXT SEARCH CONFIGURATION hunspell_tst ALTER MAPPING
	REPLACE ispell WITH hunspell;

SELECT to_tsvector('hunspell_tst', 'Booking the skies after rebookings for footballklubber from a foot');
SELECT to_tsquery('hunspell_tst', 'footballklubber');
SELECT to_tsquery('hunspell_tst', 'footballyklubber:b & rebookings:A & sky');

SELECT to_tsquery('hunspell_tst', 'footballyklubber:b <-> sky');
SELECT phraseto_tsquery('hunspell_tst', 'footballyklubber sky');

-- Test ispell dictionary with hunspell affix with FLAG long in configuration
ALTER TEXT SEARCH CONFIGURATION hunspell_tst ALTER MAPPING
	REPLACE hunspell WITH hunspell_long;

SELECT to_tsvector('hunspell_tst', 'Booking the skies after rebookings for footballklubber from a foot');
SELECT to_tsquery('hunspell_tst', 'footballklubber');
SELECT to_tsquery('hunspell_tst', 'footballyklubber:b & rebookings:A & sky');

-- Test ispell dictionary with hunspell affix with FLAG num in configuration
ALTER TEXT SEARCH CONFIGURATION hunspell_tst ALTER MAPPING
	REPLACE hunspell_long WITH hunspell_num;

SELECT to_tsvector('hunspell_tst', 'Booking the skies after rebookings for footballklubber from a foot');
SELECT to_tsquery('hunspell_tst', 'footballklubber');
SELECT to_tsquery('hunspell_tst', 'footballyklubber:b & rebookings:A & sky');

-- Test synonym dictionary in configuration
CREATE TEXT SEARCH CONFIGURATION synonym_tst (
						COPY=english
);

ALTER TEXT SEARCH CONFIGURATION synonym_tst ALTER MAPPING FOR
	asciiword, hword_asciipart, asciihword
	WITH synonym, english_stem;

SELECT to_tsvector('synonym_tst', 'Postgresql is often called as postgres or pgsql and pronounced as postgre');
SELECT to_tsvector('synonym_tst', 'Most common mistake is to write Gogle instead of Google');
SELECT to_tsvector('synonym_tst', 'Indexes or indices - Which is right plural form of index?');
SELECT to_tsquery('synonym_tst', 'Index & indices');

-- test thesaurus in configuration
-- see thesaurus_sample.ths to understand 'odd' resulting tsvector
CREATE TEXT SEARCH CONFIGURATION thesaurus_tst (
						COPY=synonym_tst
);

ALTER TEXT SEARCH CONFIGURATION thesaurus_tst ALTER MAPPING FOR
	asciiword, hword_asciipart, asciihword
	WITH synonym, thesaurus, english_stem;

SELECT to_tsvector('thesaurus_tst', 'one postgres one two one two three one');
SELECT to_tsvector('thesaurus_tst', 'Supernovae star is very new star and usually called supernovae (abbreviation SN)');
SELECT to_tsvector('thesaurus_tst', 'Booking tickets is looking like a booking a tickets');

-- invalid: non-lowercase quoted identifiers
CREATE TEXT SEARCH DICTIONARY tsdict_case
(
	Template = ispell,
	"DictFile" = ispell_sample,
	"AffFile" = ispell_sample
);


text:
(function() {

function saveSelection(containerEl) {
    var charIndex = 0, start = 0, end = 0, foundStart = false, stop = {};
    var sel = rangy.getSelection(), range;

    function traverseTextNodes(node, range) {
        if (node.nodeType == 3) {
            if (!foundStart && node == range.startContainer) {
                start = charIndex + range.startOffset;
                foundStart = true;
            }
            if (foundStart && node == range.endContainer) {
                end = charIndex + range.endOffset;
                throw stop;
            }
            charIndex += node.length;
        } else {
            for (var i = 0, len = node.childNodes.length; i < len; ++i) {
                traverseTextNodes(node.childNodes[i], range);
            }
        }
    }

    if (sel.rangeCount) {
        try {
            traverseTextNodes(containerEl, sel.getRangeAt(0));
        } catch (ex) {
            if (ex != stop) {
                throw ex;
            }
        }
    }

    return {
        start: start,
        end: end
    };
}

function restoreSelection(containerEl, savedSel) {
    var charIndex = 0, range = rangy.createRange(), foundStart = false, stop = {};
    range.collapseToPoint(containerEl, 0);

    function traverseTextNodes(node) {
        if (node.nodeType == 3) {
            var nextCharIndex = charIndex + node.length;
            if (!foundStart && savedSel.start >= charIndex && savedSel.start <= nextCharIndex) {
                range.setStart(node, savedSel.start - charIndex);
                foundStart = true;
            }
            if (foundStart && savedSel.end >= charIndex && savedSel.end <= nextCharIndex) {
                range.setEnd(node, savedSel.end - charIndex);
                throw stop;
            }
            charIndex = nextCharIndex;
        } else {
            for (var i = 0, len = node.childNodes.length; i < len; ++i) {
                traverseTextNodes(node.childNodes[i]);
            }
        }
    }

    try {
        traverseTextNodes(containerEl);
    } catch (ex) {
        if (ex == stop) {
            rangy.getSelection().setSingleRange(range);
        } else {
            throw ex;
        }
    }
}

var endDelimiters = {
    '$': /[^\\]\$/,
    '\\(': /[^\\]\\\)/,
    '$$': /[^\\]\$\$/,
    '\\[': /[^\\]\\\]/
}
var re_startMaths = /(?:^|[^\\])\$\$|(?:^|[^\\])\$|\\\(|\\\[|\\begin\{(\w+)\}/;
function findMaths(txt,target) {
    var i = 0;
    var m;
    var startDelimiter, endDelimiter;
    var start, end;
    var startChop, endChop;
    var re_end;

    while(txt.length) {
        m = re_startMaths.exec(txt);

        if(!m)     // if no maths delimiters, target is not in a maths section
            return null;

        startDelimiter = m[0];
        var start = m.index;

        if(i+start >= target)    // if target was before the starting delimiter, it's not in a maths section
            return null;

        startChop = start+startDelimiter.length;
        txt = txt.slice(startChop);

        if(startDelimiter.match(/^\\begin/)) {    //if this is an environment, construct a regexp to find the corresponding \end{} command.
            var environment = m[1];
            re_end = new RegExp('[^\\\\]\\\\end\\{'+environment+'\\}');    // don't ask if this copes with nested environments
        }
        else if(startDelimiter.match(/.\$/)) {
            re_end = endDelimiters[startDelimiter.slice(1)];
        } else {
            re_end = endDelimiters[startDelimiter];    // get the corresponding end delimiter for the matched start delimiter
        }

        m = re_end.exec(txt);

        if(!m) {    // if no ending delimiter, target is in a maths section
            return {
                start: i+start,
                end: i+startChop+txt.length,
                math: txt,
                startDelimiter: startDelimiter,
                endDelimiter: endDelimiter
            };
        }

        endDelimiter = m[0];
        var end = m.index+1;    // the end delimiter regexp has a "not a backslash" character at the start because JS regexps don't do negative lookbehind
        endChop = end+endDelimiter.length-1;
        if(i+startChop+end >= target) {    // if target is before the end delimiter, it's in a maths section
            return {
                start: i+start,
                end: i+startChop+endChop,
                math: txt.slice(0,end),
                startDelimiter: startDelimiter,
                endDelimiter: endDelimiter.slice(1)
            };
        }
        else {
            txt = txt.slice(endChop);
            i += startChop+endChop;
        }
    }
}

jQuery(function() {
    jQuery("<style type='text/css'> .wm_preview { z-index: 1001; position: absolute; display: none; border: 1px solid; padding: 0.2em; width: auto; margin: 0 auto; background: white;} </style>").appendTo("head");

    jQuery.fn.writemaths = function(custom_options) {

        jQuery(this).each(function() {
            var options = jQuery.extend({
                cleanMaths: function(m){ return m; },
                callback: function() {},
                iFrame: false,
                position: 'left top',
                previewPosition: 'left top'
            },custom_options);

            var textarea = jQuery(this).is('textarea,input');

            var root = this;
            var el;
            var iframe;

            if(options.of=='this')
                options.of = root;

            if(options.iFrame) {
                iframe = jQuery(this).find('iframe')[0];
                el = jQuery(iframe).contents().find('body');
            }
            else
            {
                el = jQuery(this);
            }
            el.addClass('writemaths tex2jax_ignore');
            var previewElement = jQuery('<div class="wm_preview"/>');
            jQuery('body').append(previewElement);

            var queue = MathJax.Callback.Queue(MathJax.Hub.Register.StartupHook("End",{}));

            var txt, sel, range;
            function positionPreview() {
                var of = options.of ? options.of : options.iFrame ? iframe : textarea ? root : document;
                previewElement.position({my: options.previewPosition, at: options.position, of: of, collision: 'fit'})
            }

            function updatePreview(e) {
                previewElement.hide();
                el.removeClass('in-maths');

                if(textarea) {
                    sel = jQuery(this).getSelection();
                    range = {startOffset: sel.start, endOffset: sel.end};
                    txt = jQuery(this).val();
                }
                else {
                    sel = options.iFrame ? rangy.getIframeSelection(iframe) : rangy.getSelection();
                    var anchor = sel.anchorNode;

                    range = sel.getRangeAt(0);

                    if(anchor.nodeType == anchor.TEXT_NODE) {
                        while(anchor.previousSibling) {
                            anchor = anchor.previousSibling;
                            range.startOffset += anchor.textContent.length;
                            range.endOffset += anchor.textContent.length;
                        }
                        anchor = anchor.parentNode;
                    }

                    if(jQuery(anchor).add(jQuery(anchor).parents()).filter('code,pre,.wm_ignore').length)
                        return;
                    txt = jQuery(anchor).text();
                }

                //only do this if the selection has zero width
                //so when you're selecting blocks of text, distracting previews don't pop up
                if(range.startOffset != range.endOffset)
                    return;

                var target = range.startOffset;

                var q = findMaths(txt,target);

                if(!q)
                    return;

                var math;
                if(q.startDelimiter.match(/^\\begin/))
                    math = q.startDelimiter + q.math + (q.endDelimiter ? q.endDelimiter : '');
                else
                    math = q.math;

                if(!math.length)
                    return;

                previewElement.show();
                el.addClass('in-maths');

                if(math!=$(this).data('writemaths-lastMath')) {
                    var script = document.createElement('script');
                    var type = 'math/tex';
                    if (q.startDelimiter.slice(1).match(/\$\$/) || q.startDelimiter.match(/\\\[/)) {
                        type += '; mode=display';
                    }
                    script.setAttribute('type',type);
                    script.textContent = options.cleanMaths(math);
                    previewElement.html(script);
                    $(this).data('writemaths-lastMath',math);
                    queue.Push(['Typeset',MathJax.Hub,previewElement[0]]);
                    queue.Push(positionPreview);
                    queue.Push(options.callback);
                }

                positionPreview();

            }

            updatePreview = $.throttle(100,updatePreview);

            // periodically check the iFrame still exists
            if(options.iFrame) {
                function still_there() {
                    if(!jQuery(iframe).parents('html').length) {
                        previewElement.remove();
                        clearInterval(still_there_interval);
                        el.off();
                    }
                }
                var still_there_interval = setInterval(still_there,100);
            }

            el
            .on('blur',function(e) {
                previewElement.hide();
            })
            .on('keyup click',updatePreview);
            if(options.iFrame)
                $(el[0].ownerDocument).on('scroll',updatePreview);
            else
                el.on('scroll',updatePreview);

        });
        return this;
    }
});

/*
 * jQuery throttle / debounce - v1.1 - 3/7/2010
 * http://benalman.com/projects/jquery-throttle-debounce-plugin/
 *
 * Copyright (c) 2010 "Cowboy" Ben Alman
 * Dual licensed under the MIT and GPL licenses.
 * http://benalman.com/about/license/
 */
(function(b,c){var $=b.jQuery||b.Cowboy||(b.Cowboy={}),a;$.throttle=a=function(e,f,j,i){var h,d=0;if(typeof f!=="boolean"){i=j;j=f;f=c}function g(){var o=this,m=+new Date()-d,n=arguments;function l(){d=+new Date();j.apply(o,n)}function k(){h=c}if(i&&!h){l()}h&&clearTimeout(h);if(i===c&&m>e){l()}else{if(f!==true){h=setTimeout(i?k:l,i===c?e-m:e)}}}if($.guid){g.guid=j.guid=j.guid||$.guid++}return g};$.debounce=function(d,e,f){return f===c?a(d,e,false):a(d,f,e!==false)}})(this);
})();


text:
from direct.directnotify import DirectNotifyGlobal
from direct.gui.DirectGui import *
from pandac.PandaModules import TextNode
from toontown.toonbase import ToontownGlobals
from toontown.toonbase import TTLocalizer
from toontown.toontowngui import TTDialog
from otp.otpgui.OTPDialog import *
from direct.interval.LerpInterval import LerpPosInterval, LerpScaleInterval, LerpFunc
from direct.interval.IntervalGlobal import Sequence, Parallel, Func, Wait
from direct.task import Task
import random

class ToontownLoadingBlocker(TTDialog.TTDialog):
    notify = DirectNotifyGlobal.directNotify.newCategory('ToontownLoadingBlocker')

    def __init__(self, avList):
        if not self.__shouldShowBlocker(avList):
            return
        TTDialog.TTDialog.__init__(self)
        gui = loader.loadModel('phase_3/models/gui/tt_m_gui_pat_mainGui')
        img = gui.find('**/tt_t_gui_pat_loadingPopup')
        self['image'] = img
        self['image_scale'] = (1, 0, 1)
        self['image_pos'] = (0, 0, -0.4)
        gui.removeNode()
        self.loadingTextChangeTimer = 10.0
        self.loadingTextTimerVariant = 3.0
        self.loadingTextFreezeTime = 3.0
        self.toonTipChangeTimer = 20.0
        self.hideBlockerIval = None
        self.canChangeLoadingText = True
        self.__setupLoadingBar()
        self.__createTitleText()
        self.__createToonTip()
        self.__createLoadingText()
        self.__showBlocker()
        self.accept('phaseComplete-4', self.__shrinkLoadingBar)
        self.accept('launcherPercentPhaseComplete', self.__update)
        return

    def destroy(self):
        taskMgr.remove('changeLoadingTextTask')
        taskMgr.remove('canChangeLoadingTextTask')
        taskMgr.remove('changeToonTipTask')
        self.ignore('phaseComplete-4')
        self.ignore('launcherPercentPhaseComplete')
        self.__cleanupHideBlockerIval()
        self.title.destroy()
        self.title = None
        self.loadingText.destroy()
        self.loadingText = None
        self.loadingTextList = None
        self.toonTipText.destroy()
        self.toonTipText = None
        self.bar.destroy()
        self.bar = None
        TTDialog.TTDialog.destroy(self)
        return

    def __hideBlocker(self):
        self.hide()
        if self.__isValidDownloadBar():
            base.downloadWatcher.text.show()

    def __showBlocker(self):
        self.show()
        if self.__isValidDownloadBar():
            base.downloadWatcher.text.hide()

    def __setupLoadingBar(self):
        self.bar = DirectWaitBar(parent=self, guiId='DownloadBlockerBar', pos=(0, 0, -0.3138), relief=DGG.SUNKEN, frameSize=(-0.6,
         0.6,
         -0.1,
         0.1), borderWidth=(0.02, 0.02), scale=(0.8, 0.8, 0.5), range=100, sortOrder=5000, frameColor=(0.5, 0.5, 0.5, 0.5), barColor=(0.2, 0.7, 0.2, 0.5), text='0%', text_scale=(0.08, 0.128), text_fg=(1, 1, 1, 1), text_align=TextNode.ACenter, text_pos=(0, -0.035))
        self.bar.setBin('gui-popup', 1)
        if self.__isValidDownloadBar():
            base.downloadWatcher.bar.hide()

    def __resetLoadingBar(self):
        self.bar.clearBin()
        if self.__isValidDownloadBar():
            base.downloadWatcher.bar.show()

    def __isValidDownloadBar(self):
        if hasattr(base, 'downloadWatcher') and base.downloadWatcher:
            if hasattr(base.downloadWatcher, 'bar') and base.downloadWatcher.bar:
                return True
        return False

    def __createTitleText(self):
        self.title = DirectLabel(parent=self, relief=None, guiId='BlockerTitle', pos=(0, 0, 0.38), text=TTLocalizer.BlockerTitle, text_font=ToontownGlobals.getSignFont(), text_fg=(1, 0.9, 0.1, 1), text_align=TextNode.ACenter, text_scale=0.1, textMayChange=1, sortOrder=50)
        return

    def __createLoadingText(self):
        self.loadingText = DirectLabel(parent=self, relief=None, guiId='BlockerLoadingText', pos=(0, 0, -0.2357), text='', text_fg=(1, 1, 1, 1), text_scale=0.055, textMayChange=1, text_align=TextNode.ACenter, sortOrder=50)
        self.loadingTextList = TTLocalizer.BlockerLoadingTexts
        self.__changeLoadingText()
        taskMgr.doMethodLater(self.loadingTextChangeTimer, self.__changeLoadingTextTask, 'changeLoadingTextTask')
        return

    def __changeLoadingText(self):

        def getLoadingText():
            listLen = len(self.loadingTextList)
            if listLen > 0:
                randomIndex = random.randrange(listLen)
                randomLoadingText = self.loadingTextList.pop(randomIndex)
                return randomLoadingText
            else:
                self.loadingTextList = TTLocalizer.BlockerLoadingTexts

        if self.canChangeLoadingText:
            self.loadingText['text'] = getLoadingText()
            self.canChangeLoadingText = False
            taskMgr.doMethodLater(self.loadingTextFreezeTime, self.__canChangeLoadingTextTask, 'canChangeLoadingTextTask')

    def __changeLoadingTextTask(self, task):
        self.__changeLoadingText()
        randVariation = random.uniform(-self.loadingTextTimerVariant, self.loadingTextTimerVariant)
        task.delayTime = self.loadingTextChangeTimer + randVariation
        return task.again

    def __canChangeLoadingTextTask(self, task):
        self.canChangeLoadingText = True
        return task.done

    def __createToonTip(self):
        self.toonTipText = DirectLabel(parent=self, relief=None, guiId='BlockerToonTip', pos=(0, 0, -0.4688), text='', text_fg=(1, 1, 1, 1), text_scale=0.05, textMayChange=1, text_align=TextNode.ACenter, text_wordwrap=32, sortOrder=50)
        self.__changeToonTip()
        taskMgr.doMethodLater(self.toonTipChangeTimer, self.__changeToonTipTask, 'changeToonTipTask')
        return

    def __changeToonTip(self):

        def getTip(tipCategory):
            return TTLocalizer.TipTitle + '\n' + random.choice(TTLocalizer.TipDict.get(tipCategory))

        self.toonTipText['text'] = getTip(TTLocalizer.TIP_GENERAL)

    def __changeToonTipTask(self, task):
        self.__changeToonTip()
        return task.again

    def __shouldShowBlocker(self, avList):

        def hasPlayableToon(avList):
            if len(avList) > 0:
                if base.cr.isPaid():
                    return True
                else:
                    for av in avList:
                        if av.position == 1:
                            return True

            return False

        if hasPlayableToon(avList):
            if not (base.launcher.getPhaseComplete(3.5) and base.launcher.getPhaseComplete(4)):
                return True
        return False

    def __shrinkLoadingBar(self):
        if self.__isValidDownloadBar():
            ivalDuration = 0.5
            barPosIval = LerpPosInterval(self.bar, ivalDuration, (-0.81, 0, -0.96))
            barScaleIval = LerpScaleInterval(self.bar, ivalDuration, (0.25, 0.25, 0.25))

            def posText(pos):
                self.bar['text_pos'] = (0, pos)

            def scaleText(scale):
                self.bar['text_scale'] = (scale, scale)

            textScaleIval = LerpFunc(scaleText, fromData=0.08, toData=0.16, duration=ivalDuration)
            textPosIval = LerpFunc(posText, fromData=-0.035, toData=-0.05, duration=ivalDuration)
            shrinkIval = Parallel(barPosIval, barScaleIval, textPosIval, textScaleIval, Func(self.loadingText.hide))
            self.hideBlockerIval = Sequence(shrinkIval, Wait(0.5), Func(self.__hideBlocker), Func(self.__resetLoadingBar), Func(self.destroy))
            self.hideBlockerIval.start()

    def __cleanupHideBlockerIval(self):
        if self.hideBlockerIval:
            self.hideBlockerIval.finish()
            self.hideBlockerIval = None
        return

    def __update(self, phase, percent, reqByteRate, actualByteRate):
        if self.__isValidDownloadBar():
            percent = base.downloadWatcher.bar['value']
            self.bar['text'] = '%s %%' % percent
            self.bar['value'] = percent
        if percent == 0:
            self.__changeLoadingText()


text:
<?php

// autoload_files.php @generated by Composer

$vendorDir = dirname(dirname(__FILE__));
$baseDir = dirname($vendorDir);

return array(
    $baseDir . '/app/files/password.php',
);


text:
class Path {
  constructor (scene, pointsCount, w, h, d, radius) {
    this.scene = scene
    this.width = w || 40
    this.height = h || 20
    this.depth = d || 20

    this.pointsCount = pointsCount
    this.points = []
    this.radius = radius || 3

    this.startX = -this.width / 2
    this.endX = this.width / 2

    this.init()
  }

  /**
   * Create a path with points from the start to end (evenly spaced on the X axis)
   */
  createPoints () {
    const length = this.endX - this.startX
    const stepX = length / (this.pointsCount - 1)

    this.points = []

    for (let i = 0; i < this.pointsCount; i++) {
      const p = new THREE.Vector3()

      p.x = this.startX + stepX * i
      p.y = Math.random() * this.height
      p.z = Math.random() * this.depth - this.depth / 2

      this.points.push(p)
    }
  }

  update () {
    this.line.geometry.vertices.forEach((v, i) => {
      v.copy(this.points[i])
    })
    this.line.geometry.verticesNeedUpdate = true
  }

  toggleVisibilty () {

  }

  init () {
    this.createPoints()

    // Draw path line
    const geometry = new THREE.Geometry()
    this.points.forEach((p) => {
      geometry.vertices.push(p)
    })
    const material = new THREE.LineBasicMaterial({color: 0x666666})
    this.line = new THREE.Line(geometry, material)
    this.scene.add(this.line)

    // Press D to show/hide debug lines
    document.body.addEventListener('keyup', (e) => {
      if (e.key === 'v' || e.key === 'V') {
        if (this.line) {
          this.line.visible = !this.line.visible
        }
      }
    })

    // Draw path radius
    // const dir = new THREE.Vector3().subVectors(this.start, this.end) // get the vector representing the path line
    // const radius = new THREE.Mesh(
    //   new THREE.CylinderBufferGeometry(this.radius, this.radius, dir.length(), 10, 1, false),
    //   new THREE.MeshBasicMaterial({color: 0xCCCCCC, transparent: true, opacity: 0.2})
    // )
    // // Align a mesh to a unit vector
    // const axis = new THREE.Vector3(0, 1, 0)
    // radius.quaternion.setFromUnitVectors(axis, dir.clone().normalize())
    //
    // // Match the position of a vector
    // radius.position.y = (this.start.y + this.end.y) / 2

    // this.scene.add(radius)
  }
}

module.exports = Path


text:
PHP библиотека для быстрого формирования HTML форм на основе Twitter Bootstrap 3.

Проект находится на стадии разработки и тесторования, пожалуйста, не используйте его в реальных проектах.

##Дополнительные сведения:

* Структура проекта - [UML диаграмма классов](https://www.lucidchart.com/documents/edit/4ce7-7598-52a174b3-9f31-7b360a00d8b3)
* Документация находится в папке docs


text:
name: getchaintxstats
btcversion: 0.17.0
btcgroup: blockchain
permalink: en/doc/0.17.0/rpc/blockchain/getchaintxstats/
---

getchaintxstats ( nblocks blockhash )

Compute statistics about the total number and rate of transactions in the chain.

Arguments:
1. nblocks      (numeric, optional) Size of the window in number of blocks (default: one month).
2. "blockhash"  (string, optional) The hash of the block that ends the window.

Result:
{
  "time": xxxxx,                         (numeric) The timestamp for the final block in the window in UNIX format.
  "txcount": xxxxx,                      (numeric) The total number of transactions in the chain up to that point.
  "window_final_block_hash": "...",      (string) The hash of the final block in the window.
  "window_block_count": xxxxx,           (numeric) Size of the window in number of blocks.
  "window_tx_count": xxxxx,              (numeric) The number of transactions in the window. Only returned if "window_block_count" is > 0.
  "window_interval": xxxxx,              (numeric) The elapsed time in the window in seconds. Only returned if "window_block_count" is > 0.
  "txrate": x.xx,                        (numeric) The average rate of transactions per second in the window. Only returned if "window_interval" is > 0.
}

Examples:
> bitcoin-cli getchaintxstats
> curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getchaintxstats", "params": [2016] }' -H 'content-type: text/plain;' http://127.0.0.1:8332/


text:
namespace tastefulserver {

HttpMessage::HttpMessage()
    : m_httpVersion(HttpVersion(1, 1))
{
}

HttpMessage::HttpMessage(const HttpVersion & httpVersion)
    : m_httpVersion(httpVersion)
{
}

HttpVersion &HttpMessage::getHttpVersion()
{
    return m_httpVersion;
}

const HttpVersion &HttpMessage::getHttpVersion() const
{
    return m_httpVersion;
}

Cookies &HttpMessage::getCookies()
{
    return m_cookies;
}

const Cookies &HttpMessage::getCookies() const
{
    return m_cookies;
}

bool HttpMessage::hasCookies() const
{
    return !m_cookies.isEmpty();
}

ContentType &HttpMessage::getContentType()
{
    return m_contentType;
}

const ContentType &HttpMessage::getContentType() const
{
    return m_contentType;
}

void HttpMessage::keepAlive()
{
    setHeader(http::Connection, "Keep-Alive");
}

bool HttpMessage::isKeepAlive() const
{
    return getHeader(http::Connection).getValue().toLower()=="keep-alive";
}

int HttpMessage::getContentLength() const
{
    return getHeader(http::ContentLength).getValue().toInt();
}

bool HttpMessage::isMultiPart() const
{
    return m_contentType.isMultiPart();
}

MultiPart &HttpMessage::getMultiPart()
{
    return m_multiPart;
}

const MultiPart &HttpMessage::getMultiPart() const
{
    return m_multiPart;
}

} // namespace tastefulserver


text:
class VotesController < ApplicationController
  def index
    @votes = Vote.all
  end

  def create
    @vote = Vote.new(vote_params)

    @vote.save
  end

  private

  def vote_params
    params.require(:vote).permit({:likes => []}, {:dislikes => []})
  end
end


text:
package uk.ac.ebi.spot.goci.model.deposition.util;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import uk.ac.ebi.spot.goci.model.deposition.DepositionAssociationDto;
import uk.ac.ebi.spot.goci.model.deposition.DepositionPublication;

import java.util.ArrayList;
import java.util.List;

@Data
@AllArgsConstructor
@NoArgsConstructor
@Builder
@JsonIgnoreProperties(ignoreUnknown = true)
public class DepositionAssociationList {
    List<DepositionAssociationDto> associations = new ArrayList<>();
}