text:
package generate

import (
	"bytes"
	"fmt"
	"unicode"
	"unicode/utf8"

	"github.com/0x434D53/dbmap/pgsql/metadata"
)

func rint(nullable bool) string {
	if nullable {
		return "sql.NullInt64"
	}
	return "int64"
}

func rstring(nullable bool) string {
	if nullable {
		return "sql.NullString"
	}

	return "string"
}

func rfloat(nullable bool) string {
	if nullable {
		return "sql.NullFloat64"
	}

	return "float64"
}

func parsebool(s string) bool {
	if s == "YES" {
		return true
	}
	return false
}

func rtime(nullable bool) string {
	if nullable {
		return "*time.Time"
	}
	return "time.Time"
}

func nullable(is_nullable string) bool {
	if is_nullable == "YES" {
		return true
	}
	return false
}

func MapTypes(dataType string, is_nullable string) (gotype string, err error) {
	var nullable bool

	if is_nullable == "YES" {
		nullable = true
	} else if is_nullable == "NO" {
		nullable = false
	} else {
		return "", fmt.Errorf("nullable must be YES or NO, is %s", is_nullable)
	}

	switch dataType {
	case "bigint":
		return rint(nullable), nil
	case "bigserial":
		return rint(nullable), nil
	case "bit":
		return rstring(nullable), nil
	case "bit varying":
		return rstring(nullable), nil
	case "boolean":
		if nullable {
			return "sql.NullBool", nil
		}
		return "bool", nil
	case "box":
		return "", fmt.Errorf("Datatype box not supported")
	case "bytea":
		return "[]byte", nil
	case "character":
		return rstring(nullable), nil
	case "character varying":
		return rstring(nullable), nil
	case "cidr":
		return "", fmt.Errorf("Datatype box not supported")
	case "circle":
		return "", fmt.Errorf("Datatype box not supported")
	case "date":
		return rstring(nullable), nil
	case "double precision":
		return "float64", nil
	case "inet":
		return "", fmt.Errorf("Datatype box not supported")
	case "integer":
		return rint(nullable), nil
	case "interval":
		return "", fmt.Errorf("Datatype box not supported")
	case "json":
		return rstring(nullable), nil
	case "line":
		return "", fmt.Errorf("Datatype box not supported")
	case "lseq":
		return "", fmt.Errorf("Datatype box not supported")
	case "macaddr":
		return "", fmt.Errorf("Datatype box not supported")
	case "money":
		return "", fmt.Errorf("Datatype box not supported")
	case "numeric": // TODO: Better type since float looses precision
		return rfloat(nullable), nil
	case "path":
		return "", fmt.Errorf("Datatype box not supported")
	case "point":
		return "", fmt.Errorf("Datatype box not supported")
	case "polygon":
		return "", fmt.Errorf("Datatype box not supported")
	case "real":
		return rfloat(nullable), nil
	case "smallint":
		return rint(nullable), nil
	case "smallserial":
		return rint(nullable), nil
	case "serial":
		return rint(nullable), nil
	case "text":
		return rstring(nullable), nil
	case "time without time zone":
		return rtime(nullable), nil
	case "time with time zone":
		return rtime(nullable), nil
	case "timestamp without time zone":
		return rtime(nullable), nil
	case "timestamp with time zone":
		return rtime(nullable), nil
	case "tsquery":
		return "", fmt.Errorf("Datatype box not supported")
	case "tsvector":
		return "", fmt.Errorf("Datatype box not supported")
	case "txid_snapshot":
		return "", fmt.Errorf("Datatype box not supported")
	case "uuid":
		return "", fmt.Errorf("Datatype box not supported")
	case "xml":
		return rstring(nullable), nil
	}

	return "", fmt.Errorf("Unknown Data_type")
}

func isTimeType(s string) bool {
	if s == "time without time zone" || s == "time with time zone" || s == "date" {
		return true
	}
	return false
}

func createTimeOrDateAccessors(structname string, c *metadata.Column) string {
	var format string

	if c.Data_type == "time without time zone" {
		format = "04:05.000000Z"
	} else if c.Data_type == "time with time zone" {
		format = "T15:04:05.000000Z"
	} else {
		format = "2006-01-02"
	}

	var b bytes.Buffer

	cname := Sanitize(c.Column_name)
	fmt.Fprintf(&b, "func (s *%s) Get%s() (time.Time, error) {\n", structname, cname)
	if nullable(c.Is_nullable) {
		fmt.Fprintf(&b, "    return time.Parse(\"%s\",s.%s.String)\n}\n\n", format, cname)
	} else {
		fmt.Fprintf(&b, "    return time.Parse(\"%s\",s.%s)\n}\n\n", format, cname)
	}

	//	fmt.Fprintf(&b, "func (s *%s) Set%s(t time.Time) {\n", structname, cname)
	//	if nullable(c.Is_nullable) {
	//		fmt.Fprintf(&b, "    s.%s.Valid = true\n    s.%s.String = t.Format(\"%s\")\n}\n\n", cname, cname, format)
	//	} else {
	//		fmt.Fprintf(&b, "    s.%s = t.Format(\"%s\")\n}\n\n", cname, format)
	//	}

	return b.String()
}

func getEmitFor(structname string, c *metadata.Column) (emit string, emitAfter string, err error) {
	var b bytes.Buffer
	t, err := MapTypes(c.Data_type, c.Is_nullable)
	if err != nil {
		fmt.Fprintf(&b, "// No mapping available for postgres datatype %s\n", c.Data_type)
		fmt.Fprintf(&b, "//    %s %s `db:\"%s\"` \n", Sanitize(c.Column_name), "????", c.Column_name)
	} else {
		fmt.Fprintf(&b, "    %s %s `db:\"%s\"` \n", Sanitize(c.Column_name), t, c.Column_name)
	}
	if isTimeType(c.Data_type) {
		emitAfter = createTimeOrDateAccessors(structname, c)
	}
	return b.String(), emitAfter, nil
}

func Sanitize(s string) string {
	r, size := utf8.DecodeRuneInString(s)
	return string(unicode.ToUpper(r)) + s[size:]
}

func CreateStruct(t *metadata.Table) ([]byte, error) {
	var b bytes.Buffer
	var emitAfter bytes.Buffer

	fmt.Fprintf(&b, "// Struct for database table %v\n", t.Table_name)
	structName := Sanitize(t.Table_name)
	fmt.Fprintf(&b, "type %s struct {\n", structName)

	for _, c := range t.Columns {
		emit, after, err := getEmitFor(structName, c)

		if err != nil {
			return nil, err
		}

		b.WriteString(emit)
		emitAfter.WriteString(after)
	}

	fmt.Fprint(&b, "}\n\n")
	fmt.Fprintf(&b, "%s\n", emitAfter.String())
	return b.Bytes(), nil
}

redpajama_set_name: RedPajamaGithub


text:
(async function() {
  TestRunner.addResult(`Tests stepping into/over/out with framework black-boxing.\n`);
  await TestRunner.loadLegacyModule('sources'); await TestRunner.loadTestModule('sources_test_runner');
  await TestRunner.showPanel('sources');
  await TestRunner.loadHTML(`
      <input type="button" onclick="testFunction()" value="Test">
    `);
  await TestRunner.addScriptTag('../debugger/resources/framework.js');
  await TestRunner.evaluateInPagePromise(`
      function testFunction()
      {
          debugger;
          Framework.safeRun(function callback1() {
              Framework.safeRun(Framework.empty, callback2);
          });
      }

      function callback2()
      {
          Framework.safeRun(Framework.empty, Framework.empty); // Should be skipped: all callbacks are inside frameworks.
          Framework.safeRun(Framework.empty, Framework.throwFrameworkException, callback3); // Should be enough to step into callback3
      }

      function callback3()
      {
          var func = Framework.bind(callback4, null, 1);
          func = Framework.bind(func, null, 2);
          func = Framework.bind(func, null, 3);
          Framework.safeRun(func, Framework.empty);
      }

      function callback4()
      {
          Framework.safeRun(Framework.doSomeWork, function() {
              return 0;
          });
          try {
              Framework.throwFrameworkException("message");
          } catch (e) {
              window.ex = e;
          }
      }
  `);

  var frameworkRegexString = '/framework\\.js$';
  Common.settingForTest('skipStackFramesPattern').set(frameworkRegexString);

  SourcesTestRunner.startDebuggerTest(step1, true);

  function step1() {
    SourcesTestRunner.runTestFunctionAndWaitUntilPaused(step2);
  }

  function step2() {
    var actions = [
      'Print',                                                  // debugger;
      'StepInto', 'StepInto', 'Print',                          // callback1
      'StepInto', 'Print',                                      // callback2
      'StepInto', 'Print',                                      // callback2, skipped
      'StepInto', 'Print',                                      // callback3
      'StepInto', 'StepInto', 'StepInto', 'StepInto', 'Print',  // callback4
      'StepInto', 'Print',                                      // anonymous calback
      'StepInto', 'StepInto', 'Print',                          // callback4, skipped
      'StepInto', 'Print',                                      // callback4, inside catch
      'StepOut',  'Print',                                      // return to callback3
      'StepOver', 'Print',                                      // return to callback2
      'StepInto', 'Print',                                      // return to callback1
    ];
    SourcesTestRunner.waitUntilPausedAndPerformSteppingActions(actions, step3);
  }

  function step3() {
    SourcesTestRunner.completeDebuggerTest();
  }
})();


text:
#include "chr/android/CrossBridge.h"
#include "chr/cross/Context.h"

using namespace std;

namespace chr
{
  namespace jni
  {
    jobject bridge = nullptr;

    CrossDelegate *crossDelegate = nullptr;

    // ---

    /*
     * TODO: THROW "JNI EXCEPTION" WITH THE RELEVANT JAVA ERROR MESSAGE
     *
     * - IF METHOD CAN'T BE FOUND
     * - IF CALL FAILED
     *
     * HINTS: http://stackoverflow.com/questions/6015293/convert-exceptiondescribe-to-string
     */

    void callVoidMethodOnBridge(const char *name, const char *sig, ...)
    {
      JNIEnv *env = getEnv();

      jclass cls = env->GetObjectClass(bridge);
      jmethodID method = env->GetMethodID(cls, name, sig);

      va_list args;
      va_start(args, sig);
      env->CallVoidMethodV(bridge, method, args);
      va_end(args);
    }

    jboolean callBooleanMethodOnBridge(const char *name, const char *sig, ...)
    {
      JNIEnv *env = getEnv();

      jclass cls = env->GetObjectClass(bridge);
      jmethodID method = env->GetMethodID(cls, name, sig);

      va_list args;
      va_start(args, sig);
      jboolean ret = env->CallBooleanMethodV(bridge, method, args);
      va_end(args);

      return ret;
    }

    jchar callCharMethodOnBridge(const char *name, const char *sig, ...)
    {
      JNIEnv *env = getEnv();

      jclass cls = env->GetObjectClass(bridge);
      jmethodID method = env->GetMethodID(cls, name, sig);

      va_list args;
      va_start(args, sig);
      jchar ret = env->CallCharMethodV(bridge, method, args);
      va_end(args);

      return ret;
    }

    jint callIntMethodOnBridge(const char *name, const char *sig, ...)
    {
      JNIEnv *env = getEnv();

      jclass cls = env->GetObjectClass(bridge);
      jmethodID method = env->GetMethodID(cls, name, sig);

      va_list args;
      va_start(args, sig);
      jint ret = env->CallIntMethodV(bridge, method, args);
      va_end(args);

      return ret;
    }

    jlong callLongMethodOnBridge(const char *name, const char *sig, ...)
    {
      JNIEnv *env = getEnv();

      jclass cls = env->GetObjectClass(bridge);
      jmethodID method = env->GetMethodID(cls, name, sig);

      va_list args;
      va_start(args, sig);
      jlong ret = env->CallLongMethodV(bridge, method, args);
      va_end(args);

      return ret;
    }

    jfloat callFloatMethodOnBridge(const char *name, const char *sig, ...)
    {
      JNIEnv *env = getEnv();

      jclass cls = env->GetObjectClass(bridge);
      jmethodID method = env->GetMethodID(cls, name, sig);

      va_list args;
      va_start(args, sig);
      jfloat ret = env->CallFloatMethodV(bridge, method, args);
      va_end(args);

      return ret;
    }

    jdouble callDoubleMethodOnBridge(const char *name, const char *sig, ...)
    {
      JNIEnv *env = getEnv();

      jclass cls = env->GetObjectClass(bridge);
      jmethodID method = env->GetMethodID(cls, name, sig);

      va_list args;
      va_start(args, sig);
      jdouble ret = env->CallDoubleMethod(bridge, method, args);
      va_end(args);

      return ret;
    }

    jobject callObjectMethodOnBridge(const char *name, const char *sig, ...)
    {
      JNIEnv *env = getEnv();

      jclass cls = env->GetObjectClass(bridge);
      jmethodID method = env->GetMethodID(cls, name, sig);

      va_list args;
      va_start(args, sig);
      jobject ret = env->CallObjectMethodV(bridge, method, args);
      va_end(args);

      return ret;
    }
  }

  namespace bridge
  {
    void init(JNIEnv *env, jobject obj, jobject bridge, jobject context, jobject display, jint displayWidth, jint displayHeight, jfloat displayDensity)
    {
      android::initFileSystem(env, context);

      // ---

      jni::bridge = env->NewGlobalRef(bridge);

      jni::crossDelegate = new CrossDelegate();
      jni::crossDelegate->performInit(env, context, display, glm::vec2(displayWidth, displayHeight), displayDensity);
    }

    void uninit(JNIEnv *env, jobject obj)
    {
      jni::crossDelegate->performUninit(env);
      delete jni::crossDelegate;

      env->DeleteGlobalRef(jni::bridge);
      jni::bridge = nullptr;
    }

    void setup(JNIEnv *env, jobject obj, jint width, jint height)
    {
      jni::crossDelegate->performSetup(env, glm::vec2(width, height));
    }

    void shutdown(JNIEnv *env, jobject obj)
    {
      jni::crossDelegate->performShutdown(env);
    }

    // ---

    void resize(JNIEnv *env, jobject obj, jint width, jint height)
    {
      jni::crossDelegate->performResize(glm::vec2(width, height));
    }

    void draw(JNIEnv *env, jobject obj)
    {
      jni::crossDelegate->performUpdate();
      jni::crossDelegate->performDraw();
    }

    // ---

    void addTouch(JNIEnv *env, jobject obj, jint index, jfloat x, jfloat y)
    {
      jni::crossDelegate->addTouch(index, x, y);
    }

    void updateTouch(JNIEnv *env, jobject obj, jint index, jfloat x, jfloat y)
    {
      jni::crossDelegate->updateTouch(index, x, y);
    }

    void removeTouch(JNIEnv *env, jobject obj, jint index, jfloat x, jfloat y)
    {
      jni::crossDelegate->removeTouch(index, x, y);
    }

    // ---

    void dispatchEvent(JNIEnv *env, jobject obj, jint eventId)
    {
      jni::crossDelegate->handleEvent(eventId);
    }

    void sendMessageToSketch(JNIEnv *env, jobject obj, jint what, jstring body)
    {
      if (body)
      {
        const char *chars = env->GetStringUTFChars(body, nullptr);
        jni::crossDelegate->messageFromBridge(what, chars);
        env->ReleaseStringUTFChars(body, chars);
      }
      else
      {
        jni::crossDelegate->messageFromBridge(what);
      }
    }
  }
}


text:
"use strict";

var version = require('../package.json').version;
var path = require('path');

var env = process.env.NODE_ENV;

var config = {
  version: version,
  debug  : env !== 'production',
  port   : process.env.PORT || 8000,
  ethereum : {
    contract: {
      deployerAddress: '0xc3e836ea59dd855469cd2059e531ddcdbceac78f',
      sourcePath: path.resolve(__dirname, '../contract'),
      outputPath: path.resolve(__dirname, '../runtime/contract')
    },
    url: 'http://localhost:8011'
  }
};

// settings by env
if (env === 'production') {

} else if (env === 'stage') {

} else if (env === 'test') {

} else {
  // dev mode

}

module.exports = config;


text:
'use strict';

/**
 * Module dependencies.
 */
var mongoose = require('mongoose'),
    _ = require('lodash');

var AlchemyAPI = require('alchemy-api');
var alchemy = new AlchemyAPI('2e76bbc542a2cc763bb5f2ffc0728850eb6c5c0d');

var freebase= require('freebase');

exports.getKeywords = function(req, res) {
  var keywords = [];
  alchemy.keywords(req.query.content, 'text',function(err, response) {
    if (err) throw err;
    keywords = response.keywords;
    res.jsonp({'keywords': keywords});
  });
};

exports.getTypes = function(req, res) {
  var keywords = req.query.keywords;
  var types = [];
  for (var i in keywords){
    var type = freebase.type(i);
    types.push({'keyword': i, 'type': type});
  }
  res.jsonp({'types': types});
};


text:
<?php

/**
 * Migration: 7
 * Started:   01/07/2020
 *
 * @package     Nails
 * @subpackage  module-cms
 * @category    Database Migration
 * @author      Nails Dev Team
 * @link
 */

namespace Nails\Cms\Database\Migration;

use Nails\Common\Console\Migrate\Base;

/**
 * Class Migration7
 *
 * @package Nails\Database\Migration\Nails\ModuleCms
 */
class Migration7 extends Base
{
    /**
     * Execute the migration
     *
     * @return Void
     */
    public function execute()
    {
        $this->query('ALTER TABLE `{{NAILS_DB_PREFIX}}cms_page` ADD `draft_seo_image_id` INT(11) UNSIGNED NULL DEFAULT NULL AFTER `draft_seo_keywords`;');
        $this->query('ALTER TABLE `{{NAILS_DB_PREFIX}}cms_page` ADD `published_seo_image_id` INT(11) UNSIGNED NULL DEFAULT NULL AFTER `published_seo_keywords`;');
        $this->query('ALTER TABLE `{{NAILS_DB_PREFIX}}cms_page` ADD FOREIGN KEY (`draft_seo_image_id`) REFERENCES `{{NAILS_DB_PREFIX}}cdn_object` (`id`) ON DELETE SET NULL;');
        $this->query('ALTER TABLE `{{NAILS_DB_PREFIX}}cms_page` ADD FOREIGN KEY (`published_seo_image_id`) REFERENCES `{{NAILS_DB_PREFIX}}cdn_object` (`id`) ON DELETE SET NULL;');

        $this->query('ALTER TABLE `{{NAILS_DB_PREFIX}}cms_page_preview` ADD `draft_seo_image_id` INT(11) UNSIGNED NULL DEFAULT NULL AFTER `draft_seo_keywords`;');
        $this->query('ALTER TABLE `{{NAILS_DB_PREFIX}}cms_page_preview` ADD `published_seo_image_id` INT(11) UNSIGNED NULL DEFAULT NULL AFTER `published_seo_keywords`;');
        $this->query('ALTER TABLE `{{NAILS_DB_PREFIX}}cms_page_preview` ADD FOREIGN KEY (`draft_seo_image_id`) REFERENCES `{{NAILS_DB_PREFIX}}cdn_object` (`id`) ON DELETE SET NULL;');
        $this->query('ALTER TABLE `{{NAILS_DB_PREFIX}}cms_page_preview` ADD FOREIGN KEY (`published_seo_image_id`) REFERENCES `{{NAILS_DB_PREFIX}}cdn_object` (`id`) ON DELETE SET NULL;');
    }
}


text:
// Copyright (c) 2017 Till Kolditz
//
// 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.

/*
 * File:   TestConfiguration.hpp
 * Author: Till Kolditz <till.kolditz@gmail.com>
 *
 * Created on 21-08-2017 10:36
 */

#pragma once

#include <variant>

#include <Util/AlignedBlock.hpp>

/**
 * This benchmark suite has a structure where there are individual ``tests'' which
 * contain several ``subtests''.
 * A ``Testcase'' runs each test on a sequence of unroll or block sizes. This is
 * included, because some tests work on an adjustable block size. Other tests do
 * not support block-based operation and there we test how ``loop unrolling''
 * affects the runtimes.
 */

/**
 * Abstract test configuration which keeps those settings which are
 * common / useful / needed across all types of test configurations.
 */
struct BasicTestConfiguration {
    const size_t numIterations;
    const size_t numValues;

    BasicTestConfiguration(
            const size_t numIterations,
            const size_t numValues)
            : numIterations(numIterations),
              numValues(numValues) {
    }
};

/**
 * The TestConfiguration contains the settings
 */
struct TestConfiguration :
        public BasicTestConfiguration {
    bool enableCheck;
    bool enableArithmetic;
    bool enableArithmeticChk;
    bool enableAggregate;
    bool enableAggregateChk;
    bool enableReencodeChk;
    bool enableDecode;
    bool enableDecodeChk;

    TestConfiguration(
            const size_t numIterations,
            const size_t numValues)
            : BasicTestConfiguration(numIterations, numValues),
              enableCheck(true),
              enableArithmetic(true),
              enableArithmeticChk(true),
              enableAggregate(true),
              enableAggregateChk(true),
              enableReencodeChk(true),
              enableDecode(true),
              enableDecodeChk(true) {
    }

    void disableAll() {
        enableCheck = false;
        enableArithmetic = false;
        enableArithmeticChk = false;
        enableAggregate = false;
        enableAggregateChk = false;
        enableReencodeChk = false;
        enableDecode = false;
        enableDecodeChk = false;
    }
};

struct SubTestConfiguration :
        public BasicTestConfiguration {
    const AlignedBlock & source;
    const AlignedBlock & target;
    SubTestConfiguration(
            const BasicTestConfiguration & config,
            const AlignedBlock & source,
            const AlignedBlock & target)
            : BasicTestConfiguration(config),
              source(source),
              target(target) {
    }
    SubTestConfiguration(
            const size_t numIterations,
            const size_t numValues,
            const AlignedBlock & source,
            const AlignedBlock & target)
            : BasicTestConfiguration(numIterations, numValues),
              source(source),
              target(target) {
    }
    SubTestConfiguration(
            const SubTestConfiguration &) = default;
};

struct EncodeConfiguration :
        public SubTestConfiguration {
    using SubTestConfiguration::SubTestConfiguration;
};

struct CheckConfiguration :
        public SubTestConfiguration {
    using SubTestConfiguration::SubTestConfiguration;
};

struct FilterConfiguration :
        public SubTestConfiguration {
    struct None {
    };
    struct LT {
    };
    struct LE {
    };
    struct EQ {
    };
    struct NE {
    };
    struct GE {
    };
    struct GT {
    };
    typedef std::variant<LT, LE, EQ, NE, GE, GT> Mode1;
    typedef std::variant<None, LT, LE, EQ, NE, GE, GT> Mode2;
    Mode1 mode1;
    size_t predicate1;
    Mode2 mode2;
    size_t predicate2;
    FilterConfiguration(
            const SubTestConfiguration & config,
            Mode1 mode,
            size_t predicate)
            : SubTestConfiguration(config),
              mode1(mode),
              predicate1(predicate),
              mode2(None()),
              predicate2() {
    }
    FilterConfiguration(
            const BasicTestConfiguration & config,
            const AlignedBlock & source,
            const AlignedBlock & target,
            Mode1 mode,
            size_t predicate)
            : SubTestConfiguration(config, source, target),
              mode1(mode),
              predicate1(predicate),
              mode2(None()),
              predicate2() {
    }
    FilterConfiguration(
            const SubTestConfiguration & config,
            Mode1 mode1,
            size_t predicate1,
            Mode2 mode2,
            size_t predicate2)
            : SubTestConfiguration(config),
              mode1(mode1),
              predicate1(predicate1),
              mode2(mode2),
              predicate2(predicate2) {
    }
    FilterConfiguration(
            const BasicTestConfiguration & config,
            const AlignedBlock & source,
            const AlignedBlock & target,
            Mode1 mode1,
            size_t predicate1,
            Mode2 mode2,
            size_t predicate2)
            : SubTestConfiguration(config, source, target),
              mode1(mode1),
              predicate1(predicate1),
              mode2(mode2),
              predicate2(predicate2) {
    }
};

struct ArithmeticConfiguration :
        public SubTestConfiguration {
    struct Add {
    };
    struct Sub {
    };
    struct Mul {
    };
    struct Div {
    };
    typedef std::variant<Add, Sub, Mul, Div> Mode;
    Mode mode;
    size_t operand;
    ArithmeticConfiguration(
            const SubTestConfiguration & config,
            Mode mode,
            const size_t operand)
            : SubTestConfiguration(config),
              mode(mode),
              operand(operand) {
    }
    ArithmeticConfiguration(
            const BasicTestConfiguration & config,
            const AlignedBlock & source,
            const AlignedBlock & target,
            Mode mode,
            const size_t operand)
            : SubTestConfiguration(config, source, target),
              mode(mode),
              operand(operand) {
    }
};

struct ArithmeticConfigurationModeName {
    const char * operator()(
            ArithmeticConfiguration::Add) {
        return "add";
    }
    const char * operator()(
            ArithmeticConfiguration::Sub) {
        return "sub";
    }
    const char * operator()(
            ArithmeticConfiguration::Mul) {
        return "mul";
    }
    const char * operator()(
            ArithmeticConfiguration::Div) {
        return "div";
    }
};

struct AggregateConfiguration :
        public SubTestConfiguration {
    struct Sum {
    };
    struct Min {
    };
    struct Max {
    };
    struct Avg {
    };
    typedef std::variant<Sum, Min, Max, Avg> Mode;
    Mode mode;
    AggregateConfiguration(
            const SubTestConfiguration & config,
            Mode mode)
            : SubTestConfiguration(config),
              mode(mode) {
    }
    AggregateConfiguration(
            const BasicTestConfiguration & config,
            const AlignedBlock & source,
            const AlignedBlock & target,
            Mode mode)
            : SubTestConfiguration(config, source, target),
              mode(mode) {
    }
};

struct AggregateConfigurationModeName {
    const char * operator()(
            AggregateConfiguration::Sum) {
        return "sum";
    }
    const char * operator()(
            AggregateConfiguration::Min) {
        return "min";
    }
    const char * operator()(
            AggregateConfiguration::Max) {
        return "max";
    }
    const char * operator()(
            AggregateConfiguration::Avg) {
        return "avg";
    }
};

struct ReencodeConfiguration :
        public SubTestConfiguration {
    size_t newA;
    ReencodeConfiguration(
            const SubTestConfiguration & config,
            const size_t newA)
            : SubTestConfiguration(config),
              newA(newA) {
    }
    ReencodeConfiguration(
            const BasicTestConfiguration & config,
            const AlignedBlock & source,
            const AlignedBlock & target,
            const size_t newA)
            : SubTestConfiguration(config, source, target),
              newA(newA) {
    }
};

struct DecodeConfiguration :
        public SubTestConfiguration {
    using SubTestConfiguration::SubTestConfiguration;
};


text:
package org.irmacard.credentials.idemix.proofs;

import java.math.BigInteger;
import java.util.Arrays;
import java.util.List;

import de.henku.jpaillier.KeyPair;
import org.irmacard.credentials.idemix.IdemixPublicKey;
import org.irmacard.credentials.idemix.IdemixSystemParameters;
import org.irmacard.credentials.idemix.util.Crypto;

public class ProofP implements Proof {
	private BigInteger P;
	private BigInteger c;
	private BigInteger s_response;

	public ProofP(BigInteger P, BigInteger c, BigInteger s_response) {
		this.P = P;
		this.c = c;
		this.s_response = s_response;
	}

	@Override
	public boolean verify(IdemixPublicKey pk, BigInteger context,
			BigInteger nonce) {
		return verify(pk, context, nonce, null);
	}

	@Override
	public boolean verify(IdemixPublicKey pk, BigInteger context,
			BigInteger nonce, BigInteger challenge) {
		IdemixSystemParameters params = pk.getSystemParameters();

		// Recalculate hash
		BigInteger c_prime = challenge;
		if (c_prime == null) {
			BigInteger P_commit = reconstructP_commit(pk);
			c_prime = Crypto.sha256Hash(Crypto.asn1Encode(context, P, P_commit, nonce));
		}

		boolean matched = c.compareTo(c_prime) == 0;

		if(!matched) {
			System.out.println("Hash doesn't match");
		}

		return matched;
	}

	@Override
	public List<BigInteger> getChallengeContribution(IdemixPublicKey pk) {
		return Arrays.asList(P, reconstructP_commit(pk));
	}

	@Override
	public IdemixPublicKey extractPublicKey() {
		return null;
	}

	@Override
	public BigInteger get_c() {
		return c;
	}

	@Override
	public BigInteger getSecretKeyResponse() {
		return s_response;
	}

	public void decrypt(KeyPair keyPair) {
		s_response = keyPair.decrypt(s_response);
	}

	public BigInteger getP() {
		return P;
	}

	public BigInteger reconstructP_commit(IdemixPublicKey pk) {
		BigInteger n = pk.getModulus();

		// Reconstruct U_commit
		// U_commit = P^{-c} * R_0^{s_response}
		BigInteger Uc = P.modPow(this.c.negate(), n);
		BigInteger R0s = pk.getGeneratorR(0).modPow(this.s_response, n);

		return Uc.multiply(R0s).mod(n);
	}

	public ProofP mergeProofP(ProofP p, IdemixPublicKey pk) {
		throw new RuntimeException("Can't merge proofP's with proofP's");
	}
}


text:
package talecraft.container;

import javax.annotation.Nullable;

import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.inventory.ContainerWorkbench;
import net.minecraft.inventory.IInventory;
import net.minecraft.inventory.InventoryCrafting;
import net.minecraft.inventory.Slot;
import net.minecraft.inventory.SlotCrafting;
import net.minecraft.item.ItemStack;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
import talecraft.TaleCraftBlocks;
import talecraft.blocks.world.WorkbenchBlock;

public class WorkbenchContainer extends ContainerWorkbench {

	private final World worldObj;
	private final BlockPos pos;

	public WorkbenchContainer(InventoryPlayer player, World worldObj, BlockPos pos) {
		super(player, worldObj, pos);
		this.worldObj = worldObj;
		this.pos = pos;
		this.inventorySlots.clear();
		this.inventoryItemStacks.clear();
		this.addSlotToContainer(new SlotWorkbenchCrafting(player.player, this.craftMatrix, this.craftResult, 0, 124, 35));

		for (int i = 0; i < 3; ++i)
		{
			for (int j = 0; j < 3; ++j)
			{
				this.addSlotToContainer(new Slot(this.craftMatrix, j + i * 3, 30 + j * 18, 17 + i * 18));
			}
		}

		for (int k = 0; k < 3; ++k)
		{
			for (int i1 = 0; i1 < 9; ++i1)
			{
				this.addSlotToContainer(new Slot(player, i1 + k * 9 + 9, 8 + i1 * 18, 84 + k * 18));
			}
		}

		for (int l = 0; l < 9; ++l)
		{
			this.addSlotToContainer(new Slot(player, l, 8 + l * 18, 142));
		}

		this.onCraftMatrixChanged(this.craftMatrix);
	}

	@Override
		public boolean canInteractWith(EntityPlayer playerIn){
		return this.worldObj.getBlockState(this.pos).getBlock() != TaleCraftBlocks.workbench ? false : playerIn.getDistanceSq((double)this.pos.getX() + 0.5D, (double)this.pos.getY() + 0.5D, (double)this.pos.getZ() + 0.5D) <= 64.0D;
	}

	@Override
		public void onCraftMatrixChanged(IInventory inventoryIn){
		ItemStack stack = WorkbenchBlock.findMatchingRecipe(this.craftMatrix, this.worldObj);
		if(stack == null)stack = ItemStack.EMPTY;
		this.craftResult.setInventorySlotContents(0, stack);
	}

	public static class SlotWorkbenchCrafting extends SlotCrafting{

		private InventoryCrafting craftMatrix;
		private EntityPlayer player;

		public SlotWorkbenchCrafting(EntityPlayer player, InventoryCrafting craftingInventory, IInventory inventoryIn, int slotIndex, int xPosition, int yPosition) {
			super(player, craftingInventory, inventoryIn, slotIndex, xPosition, yPosition);
			craftMatrix = craftingInventory;
			this.player = player;
		}

		@Override
			public boolean isItemValid(@Nullable ItemStack stack){
			return player.isCreative();
		}

		@Override
		public ItemStack onTake(EntityPlayer playerIn, ItemStack stack){
				net.minecraftforge.fml.common.FMLCommonHandler.instance().firePlayerCraftingEvent(playerIn, stack, craftMatrix);
				this.onCrafting(stack);
				net.minecraftforge.common.ForgeHooks.setCraftingPlayer(playerIn);
				ItemStack[] aitemstack = WorkbenchBlock.getRemainingItems(this.craftMatrix, playerIn.getEntityWorld());
				net.minecraftforge.common.ForgeHooks.setCraftingPlayer(null);

				for (int i = 0; i < aitemstack.length; ++i)
				{
					ItemStack itemstack = this.craftMatrix.getStackInSlot(i);
					ItemStack itemstack1 = aitemstack[i];

					if (itemstack != null)
					{
						this.craftMatrix.decrStackSize(i, 1);
						itemstack = this.craftMatrix.getStackInSlot(i);
					}

					if (itemstack1 != null)
					{
						if (itemstack == null)
						{
							this.craftMatrix.setInventorySlotContents(i, itemstack1);
						}
						else if (ItemStack.areItemsEqual(itemstack, itemstack1) && ItemStack.areItemStackTagsEqual(itemstack, itemstack1))
						{
							itemstack1.grow(itemstack.getCount());
							this.craftMatrix.setInventorySlotContents(i, itemstack1);
						}
						else if (!this.player.inventory.addItemStackToInventory(itemstack1))
						{
							this.player.dropItem(itemstack1, false);
						}
					}
				}
				return stack;
			}

	}
}


text:
class BaseNet:
    def __init__(self, input_dim, output_dim):
        self.input_dim = input_dim
        self.output_dim = output_dim

    def learn(self, input_vecs, result_vecs, error_threshold,
              max_iterations=1000):
        raise NotImplementedError()

    def clear(self):
        raise NotImplementedError()

    def get_results(self, input_vec):
        raise NotImplementedError()


text:
<!DOCTYPE html>

{# Load the tag library #}
{% load bootstrap3 %}

{% load staticfiles %}

		<meta charset="utf-8">
		<meta http-equiv="X-UA-Compatible" content="IE=edge">
		<meta name="viewport" content="width=device-width, initial-scale=1">
		<title>Load Balancing Manager</title>
		{% bootstrap_css %}
		<link rel="stylesheet" type="text/css" href="{% static 'style.css' %}" />
		{% bootstrap_javascript jquery=1 %}

		{% include 'navbar.html' %}

		{% for message in alerts %}
		{% bootstrap_alert message.content alert_type=message.alert_type dismissable=True %}
		{% endfor %}

		{% block content %}{% endblock content %}

		{#
{% filter force_escape %}{% debug %}{% endfilter %}
#}


text:
package jsettlers.main.android.mainmenu.mappicker;

import static java8.util.stream.StreamSupport.stream;

import java.util.List;

import android.app.Activity;
import android.arch.lifecycle.LiveData;
import android.arch.lifecycle.MutableLiveData;
import android.arch.lifecycle.Transformations;
import android.arch.lifecycle.ViewModel;
import android.arch.lifecycle.ViewModelProvider;

import jsettlers.common.menu.EProgressState;
import jsettlers.common.menu.IJoinPhaseMultiplayerGameConnector;
import jsettlers.common.menu.IJoinableGame;
import jsettlers.common.menu.IJoiningGame;
import jsettlers.common.menu.IJoiningGameListener;
import jsettlers.common.menu.IMapDefinition;
import jsettlers.common.utils.collections.ChangingList;
import jsettlers.common.utils.collections.IChangingListListener;
import jsettlers.graphics.localization.Labels;
import jsettlers.main.android.core.GameStarter;
import jsettlers.main.android.core.events.SingleLiveEvent;

/**
 * Created by Tom Pratt on 06/10/2017.
 */

public class JoinMultiPlayerPickerViewModel extends ViewModel implements IJoiningGameListener {

	private final GameStarter gameStarter;
	private final ChangingList<IJoinableGame> changingJoinableGames;

	private final JoinableGamesData joinableGames = new JoinableGamesData();
	private final SingleLiveEvent<String> mapSelectedEvent = new SingleLiveEvent<>();
	private final MutableLiveData<JoiningViewState> joiningState = new MutableLiveData<>();
	private final LiveData<Boolean> showNoGamesMessage;

	private IJoiningGame joiningGame;
	private IMapDefinition mapDefinition;

	public JoinMultiPlayerPickerViewModel(GameStarter gameStarter, ChangingList<IJoinableGame> changingJoinableGames) {
		this.gameStarter = gameStarter;
		this.changingJoinableGames = changingJoinableGames;

		showNoGamesMessage = Transformations.map(joinableGames, joinableGames -> joinableGames.length == 0);
	}

	@Override
	protected void onCleared() {
		super.onCleared();
		if (joiningGame != null) {
			joiningGame.setListener(null);
		}

		if (gameStarter.getStartingGame() == null) {
			abort();
		}
	}

	/**
	 * IJoiningGameListener imeplementation
	 */
	@Override
	public void joinProgressChanged(EProgressState state, float progress) {
		String stateString = Labels.getProgress(state);
		int progressPercentage = (int) (progress * 100);

		joiningState.postValue(new JoiningViewState(stateString, progressPercentage));
	}

	@Override
	public void gameJoined(IJoinPhaseMultiplayerGameConnector connector) {
		joiningGame.setListener(null);
		gameStarter.setJoiningGame(null);
		joiningState.postValue(null);

		gameStarter.setJoinPhaseMultiPlayerConnector(connector);
		mapSelectedEvent.postValue(mapDefinition.getMapId());
	}

	public void joinableGameSelected(IJoinableGame joinableGame) {
		abort();
		mapDefinition = joinableGame.getMap();

		joiningGame = gameStarter.getMultiPlayerConnector().joinMultiplayerGame(joinableGame);
		joiningGame.setListener(this);

		gameStarter.setJoiningGame(joiningGame);
	}

	public LiveData<IJoinableGame[]> getJoinableGames() {
		return joinableGames;
	}

	public LiveData<String> getMapSelectedEvent() {
		return mapSelectedEvent;
	}

	public LiveData<Boolean> getShowNoGamesMessage() {
		return showNoGamesMessage;
	}

	public LiveData<JoiningViewState> getJoiningState() {
		return joiningState;
	}

	private void abort() {
		if (joiningGame != null) {
			joiningGame.abort();
		}
		gameStarter.setJoiningGame(null);
		gameStarter.closeMultiPlayerConnector();
		joiningGame = null;
		mapDefinition = null;
	}

	/**
	 * Maps list live data
	 */
	class JoinableGamesData extends LiveData<IJoinableGame[]> implements IChangingListListener<IJoinableGame> {

		@Override
		protected void onActive() {
			super.onActive();
			changingJoinableGames.setListener(this);
			setValue(sortedMaps(changingJoinableGames.getItems()));
		}

		@Override
		protected void onInactive() {
			super.onInactive();
			changingJoinableGames.removeListener(this);
		}

		@Override
		public void listChanged(ChangingList<? extends IJoinableGame> list) {
			postValue(sortedMaps(list.getItems()));
		}

		private IJoinableGame[] sortedMaps(List<? extends IJoinableGame> items) {
			return stream(items)
					.toArray(IJoinableGame[]::new);
		}
	}

	/**
	 * ViewModel factory
	 */
	public static class Factory implements ViewModelProvider.Factory {

		private final Activity activity;
		private final GameStarter gameStarter;

		public Factory(Activity activity) {
			this.activity = activity;
			gameStarter = (GameStarter) activity.getApplication();
		}

		@Override
		public <T extends ViewModel> T create(Class<T> modelClass) {
			if (modelClass == JoinMultiPlayerPickerViewModel.class) {
				return (T) new JoinMultiPlayerPickerViewModel(gameStarter, gameStarter.getMultiPlayerConnector().getJoinableMultiplayerGames());
			}
			throw new RuntimeException("NewSinglePlayerPickerViewModel.Factory doesn't know how to create a: " + modelClass.toString());
		}
	}
}


text:
class Gamepad
{
	public:
		Gamepad();
		~Gamepad();

		bool Poll();

		unsigned int Buttons();
		bool ButtonDown(unsigned int buttons);
		bool ButtonUp(unsigned int buttons);

		float AnalogX();
		float AnalogY();

	private:
		SceCtrlData pad;
		SceCtrlData lastpad;
};


text:
package collector

import (
	"github.com/cloustone/sentel/iotmanager/mgrdb"
	"github.com/cloustone/sentel/pkg/config"
	"github.com/cloustone/sentel/pkg/message"
)

// Subscription
type SubscriptionTopic struct {
	TopicName string
	mgrdb.Subscription
}

func (p *SubscriptionTopic) Topic() string        { return TopicNameSubscription }
func (p *SubscriptionTopic) SetTopic(name string) {}
func (p *SubscriptionTopic) Serialize(opt message.SerializeOption) ([]byte, error) {
	return message.Serialize(p, opt)
}
func (p *SubscriptionTopic) Deserialize(buf []byte, opt message.SerializeOption) error {
	return message.Deserialize(buf, opt, p)
}

func (p *SubscriptionTopic) handleTopic(c config.Config, ctx context) error {
	switch p.Action {
	case ObjectActionUpdate:
		return ctx.db.UpdateSubscription(p.Subscription)
	case ObjectActionDelete:
		return ctx.db.RemoveSubscription(p.Subscription)
	case ObjectActionRegister:
		return ctx.db.AddSubscription(p.Subscription)
	default:
	}
	return nil
}


text:
namespace ChameleonForms.Component
{
    /// <summary>
    /// The parent of the field being generated.
    /// </summary>
    public enum FieldParent
    {
        /// <summary>
        /// The parent is the root Form.
        /// </summary>
        Form,
        /// <summary>
        /// The parent is a section (or a field within a section).
        /// </summary>
        Section
    }
}


text:
bool doBoundingBoxesIntersect(SolidObject& obA, SolidObject& obB)
{
    sf::FloatRect tempRectA=obA.getSprite().getGlobalBounds();
    sf::FloatRect tempRectB=obB.getSprite().getGlobalBounds();
    float biggestVcomponent = std::max( std::max(fabs(obA.getVelocity().x), fabs(obA.getVelocity().y)), std::max(fabs(obB.getVelocity().x), fabs(obB.getVelocity().y)));
    double steps=biggestVcomponent * SolidObject::dt;           //Distance Traveled by fastest v component in one frame
    double steptime= SolidObject::dt/steps;                              //timestep such that the fastest component moves 1 pixel per step
    double t=steptime;
    while(t<=SolidObject::dt){
        if(tempRectA.intersects(tempRectB)){
            return true;
        }
        t+=steptime;
        tempRectA.left+=steptime*obA.getVelocity().x;
        tempRectA.top+=steptime*obA.getVelocity().y;
        tempRectB.left+=steptime*obB.getVelocity().x;
        tempRectB.top+=steptime*obB.getVelocity().y;
    }
    return false;
}


text:
package com.github.florent37.camerafragment.widgets;

import android.content.Context;
import android.graphics.Color;
import android.graphics.drawable.Drawable;
import android.os.Build;
import android.support.annotation.NonNull;
import android.support.v4.content.ContextCompat;
import android.util.AttributeSet;
import android.widget.ImageButton;

import static com.github.florent37.camerafragment.R.drawable;

/*
 * Created by memfis on 7/6/16.
 */
public class FlashSwitchView extends ImageButton {

    private Drawable flashOnDrawable;
    private Drawable flashOffDrawable;
   // private Drawable flashAutoDrawable;

    public FlashSwitchView(@NonNull Context context) {
        this(context, null);
    }

    public FlashSwitchView(@NonNull Context context, AttributeSet attrs) {
        super(context, attrs);
        flashOnDrawable = ContextCompat.getDrawable(context, drawable.camera_flash);
        flashOffDrawable = ContextCompat.getDrawable(context, drawable.camera_flash);
     //  flashOffDrawable.setColorFilter(context.getColor(color.colorPrimaryDark));
      //  flashAutoDrawable = ContextCompat.getDrawable(context, R.drawable.ic_flash_auto_white_24dp);
        init();
    }

    private void init() {
        setBackgroundColor(Color.TRANSPARENT);
        displayFlashOn();
    }

    public void displayFlashOff() {
        setImageDrawable(flashOffDrawable);
    }

    public void displayFlashOn() {
        setImageDrawable(flashOnDrawable);
    }

    public void displayFlashAuto() {
       // setImageDrawable(flashAutoDrawable);
    }

    @Override
    public void setEnabled(boolean enabled) {
        super.setEnabled(enabled);
        if (Build.VERSION.SDK_INT > 10) {
            if (enabled) {
                setAlpha(1f);
            } else {
                setAlpha(0.5f);
            }
        }
    }

}


text:
package com.sun.tools.txw2.model;

import com.sun.codemodel.JDefinedClass;
import com.sun.codemodel.JMethod;
import com.sun.codemodel.JMod;
import com.sun.codemodel.JType;
import com.sun.tools.txw2.model.prop.Prop;
import com.sun.tools.txw2.model.prop.ValueProp;
import com.sun.xml.txw2.annotation.XmlValue;
import com.sun.tools.rngom.ast.om.ParsedPattern;
import org.xml.sax.Locator;

import java.util.Iterator;
import java.util.Set;

/**
 * {@link Leaf}s form a set (by a cyclic doubly-linked list.)
 *
 * @author Kohsuke Kawaguchi
 */
public abstract class Leaf implements ParsedPattern {
    private Leaf next;
    private Leaf prev;

    /**
     * Source location where this leaf was defined.
     */
    public Locator location;

    protected Leaf(Locator location) {
        this.location = location;
        prev = next = this;
    }

    public final Leaf getNext() {
        assert next!=null;
        assert next.prev == this;
        return next;
    }

    public final Leaf getPrev() {
        assert prev!=null;
        assert prev.next == this;
        return prev;
    }

    /**
     * Combines two sets into one set.
     *
     * @return this
     */
    public final Leaf merge(Leaf that) {
        Leaf n1 = this.next;
        Leaf n2 = that.next;

        that.next = n1;
        that.next.prev = that;
        this.next = n2;
        this.next.prev = this;

        return this;
    }

    /**
     * Returns the collection of all the siblings
     * (including itself)
     */
    public final Iterable<Leaf> siblings() {
        return new Iterable<>() {
            @Override
            public Iterator<Leaf> iterator() {
                return new CycleIterator(Leaf.this);
            }
        };
    }

    /**
     * Populate the body of the writer class.
     *
     * @param props
     *      captures the generatesd {@link Prop}s to
     */
    abstract void generate(JDefinedClass clazz, NodeSet nset, Set<Prop> props);

    /**
     * Creates a prop of the data value method.
     */
    protected final void createDataMethod(JDefinedClass clazz, JType valueType, NodeSet nset, Set<Prop> props) {
        if(!props.add(new ValueProp(valueType)))
            return;

        JMethod m = clazz.method(JMod.PUBLIC,
            nset.opts.chainMethod? clazz : nset.codeModel.VOID,
            "_text");
        m.annotate(XmlValue.class);
        m.param(valueType,"value");
    }
}


text:
A simple Digital Ocean CLI in Python for creating, listing, and destroying droplets.

Uses the beta v2 of their API.

## Usage

    $ droplet.py list

    $ droplet.py create /path/to/cloud_config

    $ droplet.py destroy


text:
    <meta http-equiv="Content-Type" content="text/html; charset=Windows-1252" />
    <meta name="vs_targetSchema" content="http://schemas.microsoft.com/intellisense/ie5" />
    <title>OnlyOnceErrorHandler Methods</title>
    <xml>
    </xml>
    <link rel="stylesheet" type="text/css" href="MSDN.css" />

            Apache log4net™ SDK Documentation - Microsoft .NET Framework 4.0

OnlyOnceErrorHandler Methods

The methods of the OnlyOnceErrorHandler class are listed below. For a complete list of OnlyOnceErrorHandler class members, see the OnlyOnceErrorHandler Members topic.

Public Instance Methods

Equals (inherited from Object)

Error	Overloaded.  Log an Error

FirstError	 Log the very first error

GetHashCode (inherited from Object)

GetType (inherited from Object)

Reset	 Reset the error handler back to its initial disabled state.

ToString (inherited from Object)

Protected Instance Methods

Finalize (inherited from Object)

MemberwiseClone (inherited from Object)

See Also

        OnlyOnceErrorHandler Class | log4net.Util Namespace

      <object type="application/x-oleobject" classid="clsid:1e2a7bd0-dab9-11d0-b93a-00c04fc99f9e" viewastext="true" style="display: none;">
        <param name="Keyword" value="OnlyOnceErrorHandler class, methods">
        </param>
      </object>

Copyright 2004-2013 The Apache Software Foundation.

Apache log4net, Apache and log4net are trademarks of The Apache Software Foundation.


text:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
	xmlns:android="http://schemas.android.com/apk/res/android"
	android:orientation="vertical"
	android:layout_width="match_parent"
	android:layout_height="match_parent">
	<ViewFlipper
		android:id="@+id/details"
		android:layout_width="match_parent"
		android:layout_height="match_parent"
		android:persistentDrawingCache="animation"
		android:flipInterval="1000">
		<ImageView
			android:src="@drawable/java"
			android:layout_width="fill_parent"
			android:layout_height="wrap_content">
		</ImageView>
		<ImageView
			android:src="@drawable/android"
			android:layout_width="fill_parent"
			android:layout_height="wrap_content">
		</ImageView>
		<ImageView
			android:src="@drawable/ee"
			android:layout_width="fill_parent"
			android:layout_height="wrap_content">
		</ImageView>
	</ViewFlipper>
	<Button
		android:text="<"
		android:onClick="prev"
		android:layout_width="wrap_content"
		android:layout_height="wrap_content"
		android:layout_alignParentBottom="true"
		android:layout_alignParentLeft="true" />
	<Button
		android:layout_width="wrap_content"
		android:layout_height="wrap_content"
		android:layout_alignParentBottom="true"
		android:layout_centerInParent="true"
		android:onClick="auto"
		android:text="自动播放" />
	<Button
		android:text=">"
		android:onClick="next"
		android:layout_width="wrap_content"
		android:layout_height="wrap_content"
		android:layout_alignParentBottom="true"
		android:layout_alignParentRight="true" />
</RelativeLayout>


text:
#pragma once
#include <aws/states/SFN_EXPORTS.h>
#include <aws/states/SFNRequest.h>
#include <aws/core/utils/memory/stl/AWSString.h>
#include <utility>

namespace Aws
{
namespace SFN
{
namespace Model
{

  /**
   */
  class AWS_SFN_API ListStateMachinesRequest : public SFNRequest
  {
  public:
    ListStateMachinesRequest();
    Aws::String SerializePayload() const override;

    Aws::Http::HeaderValueCollection GetRequestSpecificHeaders() const override;

    /**
     *
The maximum number of results that will be returned per call.
     * nextToken can be used to obtain further pages of results. The
     * default is 100 and the maximum allowed page size is 1000.

This is an
     * upper limit only; the actual number of results returned per call may be fewer
     * than the specified maximum.

     */
    inline int GetMaxResults() const{ return m_maxResults; }

    /**
     *
The maximum number of results that will be returned per call.
     * nextToken can be used to obtain further pages of results. The
     * default is 100 and the maximum allowed page size is 1000.

This is an
     * upper limit only; the actual number of results returned per call may be fewer
     * than the specified maximum.

     */
    inline void SetMaxResults(int value) { m_maxResultsHasBeenSet = true; m_maxResults = value; }

    /**
     *
The maximum number of results that will be returned per call.
     * nextToken can be used to obtain further pages of results. The
     * default is 100 and the maximum allowed page size is 1000.

This is an
     * upper limit only; the actual number of results returned per call may be fewer
     * than the specified maximum.

     */
    inline ListStateMachinesRequest& WithMaxResults(int value) { SetMaxResults(value); return *this;}

    /**
     *
If a nextToken was returned by a previous call, there are more
     * results available. To retrieve the next page of results, make the call again
     * using the returned token in nextToken. Keep all other arguments
     * unchanged.

The configured maxResults determines how many
     * results can be returned in a single call.

     */
    inline const Aws::String& GetNextToken() const{ return m_nextToken; }

    /**
     *
If a nextToken was returned by a previous call, there are more
     * results available. To retrieve the next page of results, make the call again
     * using the returned token in nextToken. Keep all other arguments
     * unchanged.

The configured maxResults determines how many
     * results can be returned in a single call.

     */
    inline void SetNextToken(const Aws::String& value) { m_nextTokenHasBeenSet = true; m_nextToken = value; }

    /**
     *
If a nextToken was returned by a previous call, there are more
     * results available. To retrieve the next page of results, make the call again
     * using the returned token in nextToken. Keep all other arguments
     * unchanged.

The configured maxResults determines how many
     * results can be returned in a single call.

     */
    inline void SetNextToken(Aws::String&& value) { m_nextTokenHasBeenSet = true; m_nextToken = std::move(value); }

    /**
     *
If a nextToken was returned by a previous call, there are more
     * results available. To retrieve the next page of results, make the call again
     * using the returned token in nextToken. Keep all other arguments
     * unchanged.

The configured maxResults determines how many
     * results can be returned in a single call.

     */
    inline void SetNextToken(const char* value) { m_nextTokenHasBeenSet = true; m_nextToken.assign(value); }

    /**
     *
If a nextToken was returned by a previous call, there are more
     * results available. To retrieve the next page of results, make the call again
     * using the returned token in nextToken. Keep all other arguments
     * unchanged.

The configured maxResults determines how many
     * results can be returned in a single call.

     */
    inline ListStateMachinesRequest& WithNextToken(const Aws::String& value) { SetNextToken(value); return *this;}

    /**
     *
If a nextToken was returned by a previous call, there are more
     * results available. To retrieve the next page of results, make the call again
     * using the returned token in nextToken. Keep all other arguments
     * unchanged.

The configured maxResults determines how many
     * results can be returned in a single call.

     */
    inline ListStateMachinesRequest& WithNextToken(Aws::String&& value) { SetNextToken(std::move(value)); return *this;}

    /**
     *
If a nextToken was returned by a previous call, there are more
     * results available. To retrieve the next page of results, make the call again
     * using the returned token in nextToken. Keep all other arguments
     * unchanged.

The configured maxResults determines how many
     * results can be returned in a single call.

     */
    inline ListStateMachinesRequest& WithNextToken(const char* value) { SetNextToken(value); return *this;}

  private:
    int m_maxResults;
    bool m_maxResultsHasBeenSet;
    Aws::String m_nextToken;
    bool m_nextTokenHasBeenSet;
  };

} // namespace Model
} // namespace SFN
} // namespace Aws


text:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
     android:background="#f0eff5"
    android:orientation="vertical" >

    <RelativeLayout
        android:id="@+id/rl_block_trade_title"
        android:layout_width="match_parent"
        android:layout_height="40dp"
         android:background="#f0eff5"
         >

        <LinearLayout
            android:id="@+id/ll_qiugou_back"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_alignParentLeft="true"
            android:layout_marginLeft="10dp"
            android:layout_centerVertical="true"
            android:orientation="horizontal" >

            <ImageView
                android:id="@+id/imageView1"
                android:layout_width="wrap_content"
                android:layout_gravity="center"
                android:padding="5dp"
                android:layout_height="wrap_content"
                android:src="@drawable/gray_left" />

        </LinearLayout>

        <TextView
            android:id="@+id/tv_block_trade_detail_title"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_centerHorizontal="true"
            android:layout_centerVertical="true"
            android:textColor="#333"
            android:textSize="14sp"
            android:text="求购管理" />

    </RelativeLayout>
   	 <Button
               android:layout_width="match_parent"
               android:background="#c9c9cb"
               android:layout_height="@dimen/fengexian"
               />

   	 <com.dumu.housego.util.MyReboundScrollView
   	     android:layout_width="match_parent"
   	     android:layout_height="match_parent"

   	     >
   	     <LinearLayout
   	         android:layout_width="match_parent"
   	         android:layout_height="match_parent"
   	         android:orientation="vertical"
   	         >
   	         <com.dumu.housego.util.ListViewForScrollView
   	             android:layout_width="match_parent"
   	             android:layout_height="match_parent"
   	             android:id="@+id/lv_qiugou_at"

   	             ></com.dumu.housego.util.ListViewForScrollView>

   	     </LinearLayout>

   	 </com.dumu.housego.util.MyReboundScrollView>

</LinearLayout>


text:
<!--
To change this template, choose Tools | Templates
and open the template in the editor.
-->
<!DOCTYPE html>
<html>
  <head>
    <title></title>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

  </head>
  <body>

      <input type="file" name="toupload[]"  id="toupload" multiple/>
      <input id="go" type="submit" value="go" />

    <script>
      document.getElementById('go').onclick = function(){
        var files = document.getElementById('toupload');
        console.log(files.files);

        var xhr = new XMLHttpRequest();
        xhr.upload.addEventListener('progress',function(ev){
          console.log((ev.loaded/ev.total)*100+'%');
        }, false);

        xhr.onreadystatechange = function(ev){
          // Blah blah blah, you know how to make AJAX requests
          console.log(ev);
        };
        xhr.open('POST', '', true);
        var data = new FormData();
        for(var i = 0; i < files.length; i++) data.append('file'+i, files[i]);
        xhr.send(data);
      };

    </script>

  </body>
</html>


text:
import django.core.validators
import django.db.models.deletion
import django_countries.fields
import django_inet.models
from django.db import migrations, models

import django_peeringdb.fields
import django_peeringdb.models.abstract

class Migration(migrations.Migration):

    dependencies = [
        ("django_peeringdb", "0016_add_ix_service_and_terms"),
    ]

    operations = [
        migrations.AddField(
            model_name="facility",
            name="available_voltage_services",
            field=django_peeringdb.fields.MultipleChoiceField(
                blank=True,
                choices=[
                    ("48 VDC", "48 VDC"),
                    ("120 VAC", "120 VAC"),
                    ("208 VAC", "208 VAC"),
                    ("240 VAC", "240 VAC"),
                    ("480 VAC", "480 VAC"),
                ],
                help_text="The alternating current voltage available to users of the facility either directly from the landlord or delivered by the utility separately.",
                max_length=255,
                null=True,
                verbose_name="Available Voltage Services",
            ),
        ),
        migrations.AddField(
            model_name="facility",
            name="diverse_serving_substations",
            field=models.BooleanField(
                blank=True,
                help_text="Two separate and distinct paths to individual substations which should maintain a separated path back to one or more utility generator stations.",
                null=True,
                verbose_name="Diverse Serving Substations",
            ),
        ),
        migrations.AddField(
            model_name="facility",
            name="property",
            field=models.CharField(
                blank=True,
                choices=[
                    ("", "Not Disclosed"),
                    ("Owner", "Owner"),
                    ("Lessee", "Lessee"),
                ],
                help_text="A property owner is the individual or entity that has title to the property. A lessee is a user of a property who has a lease, an agreement, with the owner of the property.",
                max_length=27,
                null=True,
                verbose_name="Property",
            ),
        ),
    ]


text:
import java.util.HashMap;

import com.twilio.Twilio;
import com.twilio.rest.sync.v1.service.syncmap.SyncMapItem;

public class Example {
  // Get your Account SID and Auth Token from https://twilio.com/console
  // To set up environment variables, see http://twil.io/secure
  public static final String ACCOUNT_SID = System.getenv("TWILIO_ACCOUNT_SID");
  public static final String AUTH_TOKEN = System.getenv("TWILIO_AUTH_TOKEN");

  public static final String SERVICE_SID = System.getenv("TWILIO_SERVICE_SID");
  // You can use a map SID or unique name
  public static final String MAP_SID = "Players";

  public static void main(String[] args) {
    Twilio.init(ACCOUNT_SID, AUTH_TOKEN);

    Map<String, Object> data = new HashMap<>();
    data.put("name", "Stephen Curry");
    data.put("level", 31);
    data.put("username", "spicy_curry");

    SyncMapItem item = SyncMapItem.updater(SERVICE_SID, MAP_SID, "steph_curry")
                          .setData(data)
                          .update();

    System.out.println(item.getData());
  }
}


text:
package org.pickles.crawler

import org.pickles.features.model.Feature
import org.apache.commons.vfs.FileObject

class FeatureFile(fileObject: FileObject, parent: Folder, feature: Feature) extends File(fileObject, parent) {
}

object FeatureFile {
  def apply(fileObject: FileObject, parent: Folder, feature: Feature) = {
    if (parent == null) {
      throw new Exception
    }
    new FeatureFile(fileObject, parent, feature)
  }
}


text:
package com.zuoxiaolong.blog.model.persistent;

import lombok.Data;

@Data
public class UserArticle extends BaseModel {

    public static final int STATUS_DRAFT = 0;

    public static final int STATUS_PUBLISH = 1;

    public static final int STATUS_DELETE = 2;

    private Integer webUserId;

    private Integer categoryId;

    private String title;

    private String content;

    private Integer readTimes;

    private Integer thumbupTimes;

    private Integer isMainPage;

    private Integer status;

    private Integer commentTimes;// 评论次数

}


text:
<?php

use Models\AdminModel;

class GalleryAdmin extends AdminModel
{
    protected $table = 'galleries';
    protected $imageTable = 'gallery_images';

    public function find($id)
    {
        return $this->db
            ->from($this->table)
            ->where('id', $id)
            ->get()
            ->row();
    }

    public function all($paginate = [])
    {
        $this->setFilter();
        $this->setPaginate($paginate);

        return $this->db
            ->select("{$this->table}.*, (SELECT COUNT(id) FROM {$this->imageTable} WHERE {$this->imageTable}.galleryId = {$this->table}.id) images")
            ->from($this->table)
            ->where('language', $this->language)
            ->order_by('order', 'asc')
            ->order_by("id", 'desc')
            ->get()
            ->result();
    }

    public function count()
    {
        $this->setFilter();

        return $this->db
            ->from($this->table)
            ->where('language', $this->language)
            ->count_all_results();
    }

    public function insert($data = array())
    {
        $order = $this->makeLastOrder($this->table);

        $this->db->insert($this->table, array(
            'title' => $this->input->post('title'),
            'slug' => $this->makeSlug(),
            'summary' => $this->input->post('summary'),
            'showHome' => $this->input->post('showHome'),
            'image' => $data['image']->name,
            'content' => $this->input->post('content'),
            'design' => $this->input->post('design'),
            'order' => $order,
            'metaTitle' => $this->input->post('metaTitle'),
            'metaDescription' => $this->input->post('metaDescription'),
            'metaKeywords' => $this->input->post('metaKeywords'),
            'status' => $this->input->post('status'),
            'language' => $this->language,
            'createdAt' => $this->date->set()->mysqlDatetime(),
            'updatedAt' => $this->date->set()->mysqlDatetime()
        ));

        $insertId = $this->db->insert_id();

        if ($insertId > 0) {
            $record = $this->find($insertId);
            $this->checkSlug($this->table, $record);

            return $record;
        }

        return false;
    }

    public function update($record, $data = array())
    {
        $this->db
            ->where('id', $record->id)
            ->update($this->table, array(
                'title' => $this->input->post('title'),
                'slug' => $this->makeSlug(),
                'summary' => $this->input->post('summary'),
                'showHome' => $this->input->post('showHome'),
                'image' => $data['image']->name,
                'content' => $this->input->post('content'),
                'design' => $this->input->post('design'),
                'metaTitle' => $this->input->post('metaTitle'),
                'metaDescription' => $this->input->post('metaDescription'),
                'metaKeywords' => $this->input->post('metaKeywords'),
                'status' => $this->input->post('status'),
                'updatedAt' => $this->date->set()->mysqlDatetime()
            ));

        if ($this->db->affected_rows() > 0) {
            $record = $this->find($record->id);
            $this->checkSlug($this->table, $record);

            return $record;
        }

        return false;
    }

    public function delete($data)
    {
        $records = parent::callDelete($this->table, $data, true);

        if (empty($records)){
            return false;
        }

        foreach ($records as $record){
            $this->utils->deleteFile([
                'public/upload/gallery/'. $record->image
            ]);
        }

        return true;
    }

    public function order($ids)
    {
        return parent::callOrder($this->table, $ids);
    }

    public function image($id)
    {
        return $this->db
            ->from($this->imageTable)
            ->where('id', $id)
            ->get()
            ->row();
    }

    public function imageAll($parent, $paginate = [])
    {
        $this->setFilter();
        $this->setPaginate($paginate);

        return $this->db
            ->from($this->imageTable)
            ->where('galleryId', $parent->id)
            ->where('language', $this->language)
            ->order_by('order', 'asc')
            ->order_by('id', 'asc')
            ->get()
            ->result();
    }

    public function imageCount($parent)
    {
        $this->setFilter();

        return $this->db
            ->from($this->imageTable)
            ->where('galleryId', $parent->id)
            ->where('language', $this->language)
            ->count_all_results();
    }

    public function imageInsert($parent, $data = array())
    {
        $order = $this->makeLastOrder($this->imageTable, array('galleryId' => $parent->id));

        $this->db->insert($this->imageTable, array(
            'galleryId' => $parent->id,
            'image' => $data['image']->name,
            'order' => $order,
            'status' => 'published',
            'language' => $this->language,
            'createdAt' => $this->date->set()->mysqlDatetime(),
            'updatedAt' => $this->date->set()->mysqlDatetime()
        ));

        $insertId = $this->db->insert_id();

        if ($insertId > 0) {
            return $this->image($insertId);
        }

        return false;
    }

    public function imageUpdate($record, $data = array())
    {
        $this->db
            ->where('id', $record->id)
            ->update($this->imageTable, array(
                'title' => $this->input->post('title'),
                'image' => $data['image']->name,
                'content' => $this->input->post('content'),
                'status' => $this->input->post('status'),
                'updatedAt' => $this->date->set()->mysqlDatetime()
            ));

        if ($this->db->affected_rows() > 0) {
            return $this->image($record->id);
        }

        return false;
    }

    public function imageDelete($data)
    {
        $records = parent::callDelete($this->imageTable, $data, true);

        if (empty($records)){
            return false;
        }

        foreach ($records as $record){
            $this->utils->deleteFile([
                'public/upload/gallery/images/thumb/'. $record->image,
                'public/upload/gallery/images/medium/'. $record->image,
                'public/upload/gallery/images/wide/'. $record->image,
                'public/upload/gallery/images/normal/'. $record->image
            ]);
        }

        return true;
    }

    public function imageOrder($ids)
    {
        return parent::callOrder($this->imageTable, $ids);
    }

}


text:
const express = require('express');
const router = express.Router();
const passport = require('passport');

const indexCtrl = require('../controllers/index.ctrl');
const userCtrl = require('../controllers/user.ctrl');
const muddleCtrl = require('../controllers/muddle.ctrl');

router.get('/', indexCtrl.getIndex);

router.get('/auth/github', passport.authenticate('github'));

router.get('/auth/github/callback',
  passport.authenticate('github', { failureRedirect: '/' }),
  function(req, res) {
    // Successful authentication, redirect home.
    res.redirect('/');
  });

router.get('/logout', userCtrl.logout);

router.post('/muddle', muddleCtrl.create);

router.get('/readAll', muddleCtrl.list);
router.get('/readOne/:muddleId', muddleCtrl.read);

module.exports = router;


text:
from pythonforandroid.recipe import CompiledComponentsPythonRecipe
from os.path import dirname, join

class CryptographyRecipe(CompiledComponentsPythonRecipe):
    name = 'cryptography'
    version = '1.4'
    url = 'https://github.com/pyca/cryptography/archive/{version}.tar.gz'
    depends = [('python2', 'python3crystax'), 'openssl', 'idna', 'pyasn1', 'six', 'setuptools', 'enum34', 'ipaddress', 'cffi']
    call_hostpython_via_targetpython = False

    def get_recipe_env(self, arch):
        env = super(CryptographyRecipe, self).get_recipe_env(arch)
        r = self.get_recipe('openssl', self.ctx)
        openssl_dir = r.get_build_dir(arch.arch)
        env['PYTHON_ROOT'] = self.ctx.get_python_install_dir()
        env['CFLAGS'] += ' -I' + env['PYTHON_ROOT'] + '/include/python2.7' + \
                         ' -I' + join(openssl_dir, 'include')
        # Set linker to use the correct gcc
        env['LDSHARED'] = env['CC'] + ' -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions'
        env['LDFLAGS'] += ' -L' + env['PYTHON_ROOT'] + '/lib' + \
                          ' -L' + openssl_dir + \
                          ' -lpython2.7' + \
                          ' -lssl' + r.version + \
                          ' -lcrypto' + r.version
        return env

recipe = CryptographyRecipe()


text:
cd `dirname $0`

#Was this script started in the bin folder? if yes move out
if [ -d "../bin" ]; then
  cd "../"
fi

#Is gnu-grep (ggrep) installed on SunOS (Solaris)
if [ $(uname) = "SunOS" ]; then
  hash ggrep > /dev/null 2>&1 || {
    echo "Please install ggrep (pkg install gnu-grep)" >&2
    exit 1
  }
fi

#Is curl installed?
hash curl > /dev/null 2>&1 || {
  echo "Please install curl" >&2
  exit 1
}

#Is node installed?
#not checking io.js, default installation creates a symbolic link to node
hash node > /dev/null 2>&1 || {
  echo "Please install node.js ( http://nodejs.org )" >&2
  exit 1
}

#Is npm installed?
hash npm > /dev/null 2>&1 || {
  echo "Please install npm ( http://npmjs.org )" >&2
  exit 1
}

#check npm version
NPM_VERSION=$(npm --version)
NPM_MAIN_VERSION=$(echo $NPM_VERSION | cut -d "." -f 1)
if [ $(echo $NPM_MAIN_VERSION) = "0" ]; then
  echo "You're running a wrong version of npm, you're using $NPM_VERSION, we need 1.x or higher" >&2
  exit 1
fi

#check node version
NODE_VERSION=$(node --version)
NODE_V_MINOR=$(echo $NODE_VERSION | cut -d "." -f 1-2)
NODE_V_MAIN=$(echo $NODE_VERSION | cut -d "." -f 1)
NODE_V_MAIN=${NODE_V_MAIN#"v"}
if [ ! $NODE_V_MINOR = "v0.10" ] && [ ! $NODE_V_MINOR = "v0.11" ] && [ ! $NODE_V_MINOR = "v0.12" ] && [ ! $NODE_V_MAIN -ge 4 ]; then
  echo "You're running a wrong version of node. You're using $NODE_VERSION, we need node v0.10.x or higher" >&2
  exit 1
fi

#Get the name of the settings file
settings="settings.json"
a='';
for arg in $*; do
  if [ "$a" = "--settings" ] || [ "$a" = "-s" ]; then settings=$arg; fi
  a=$arg
done

#Does a $settings exist? if no copy the template
if [ ! -f $settings ]; then
  echo "Copy the settings template to $settings..."
  cp settings.json.template $settings || exit 1
fi

echo "Ensure that all dependencies are up to date...  If this is the first time you have run Etherpad please be patient."
(
  mkdir -p node_modules
  cd node_modules
  [ -e ep_etherpad-lite ] || ln -s ../src ep_etherpad-lite
  cd ep_etherpad-lite
  npm install --loglevel warn
  npm install sqlite3   # SANDSTORM EDIT
) || {
  rm -rf node_modules
  exit 1
}

echo "Ensure jQuery is downloaded and up to date..."
DOWNLOAD_JQUERY="true"
NEEDED_VERSION="1.9.1"
if [ -f "src/static/js/jquery.js" ]; then
  if [ $(uname) = "SunOS" ]; then
    VERSION=$(head -n 3 src/static/js/jquery.js | ggrep -o "v[0-9]\.[0-9]\(\.[0-9]\)\?")
  else
    VERSION=$(head -n 3 src/static/js/jquery.js | grep -o "v[0-9]\.[0-9]\(\.[0-9]\)\?")
  fi

  if [ ${VERSION#v} = $NEEDED_VERSION ]; then
    DOWNLOAD_JQUERY="false"
  fi
fi

if [ $DOWNLOAD_JQUERY = "true" ]; then
  curl -lo src/static/js/jquery.js https://code.jquery.com/jquery-$NEEDED_VERSION.js || exit 1
fi

#Remove all minified data to force node creating it new
echo "Clearing minified cache..."
rm -f var/minified*

echo "Ensure custom css/js files are created..."

for f in "index" "pad" "timeslider"
do
  if [ ! -f "src/static/custom/$f.js" ]; then
    cp "src/static/custom/js.template" "src/static/custom/$f.js" || exit 1
  fi

  if [ ! -f "src/static/custom/$f.css" ]; then
    cp "src/static/custom/css.template" "src/static/custom/$f.css" || exit 1
  fi
done

#Install plugins
PLUGINS="ep_align ep_font_color ep_font_family ep_font_size ep_headings2 ep_markdown ep_print ep_spellcheck ep_sticky_attributes ep_subscript_and_superscript"

npm install $PLUGINS
for PLUGIN in $PLUGINS; do
  echo -n done > node_modules/$PLUGIN/.ep_initialized
done

(cd node_modules && git clone https://github.com/kentonv/ep_comments.git ep_comments_page)
(cd node_modules/ep_comments_page && npm install)
echo -n done > node_modules/ep_comments_page/.ep_initialized

(cd node_modules && git clone https://github.com/kentonv/ep_author_neat.git)
(cd node_modules/ep_author_neat && npm install)
echo -n done > node_modules/ep_author_neat/.ep_initialized

#Install capnp
#TODO: This is a hack. It should probably be declared as an npm dependency.
(cd node_modules && git clone https://github.com/kentonv/node-capnp.git capnp -b node4)
(cd node_modules/capnp && npm install)

exit 0


text:
/* Development of this service is support of
   Information-technology Promotion Agency, Japan. */

#ifndef SVTTCMAP_H_
#define SVTTCMAP_H_

#include FT_INTERNAL_SERVICE_H
#include FT_TRUETYPE_TABLES_H

FT_BEGIN_HEADER

#define FT_SERVICE_ID_TT_CMAP  "tt-cmaps"

  /**************************************************************************
   *
   * @struct:
   *   TT_CMapInfo
   *
   * @description:
   *   A structure used to store TrueType/sfnt specific cmap information
   *   which is not covered by the generic @FT_CharMap structure.  This
   *   structure can be accessed with the @FT_Get_TT_CMap_Info function.
   *
   * @fields:
   *   language ::
   *     The language ID used in Mac fonts.  Definitions of values are in
   *     `ttnameid.h`.
   *
   *   format ::
   *     The cmap format.  OpenType 1.6 defines the formats 0 (byte encoding
   *     table), 2~(high-byte mapping through table), 4~(segment mapping to
   *     delta values), 6~(trimmed table mapping), 8~(mixed 16-bit and 32-bit
   *     coverage), 10~(trimmed array), 12~(segmented coverage), 13~(last
   *     resort font), and 14 (Unicode Variation Sequences).
   */
  typedef struct  TT_CMapInfo_
  {
    FT_ULong  language;
    FT_Long   format;

  } TT_CMapInfo;

  typedef FT_Error
  (*TT_CMap_Info_GetFunc)( FT_CharMap    charmap,
                           TT_CMapInfo  *cmap_info );

  FT_DEFINE_SERVICE( TTCMaps )
  {
    TT_CMap_Info_GetFunc  get_cmap_info;
  };

#define FT_DEFINE_SERVICE_TTCMAPSREC( class_, get_cmap_info_ )  \
  static const FT_Service_TTCMapsRec  class_ =                  \
  {                                                             \
    get_cmap_info_                                              \
  };

  /* */

FT_END_HEADER

#endif /* SVTTCMAP_H_ */

/* END */


text:
using UnityEngine;
using System.Collections;

public class SusukeProjectile : MonoBehaviour {

	public float speed;

	public GameObject impactEffect;

	public int damageToGive;

	public SusukayPatrol susuke;

	private bool right;

	// Use this for initialization
	void Start () {

		susuke = FindObjectOfType<SusukayPatrol> ();
		right = !susuke.getDirection ();

	}

	// Update is called once per frame
	void Update () {
		if (right) {
			transform.localScale = new Vector3 (-200f,200f,200f);
			GetComponent<Rigidbody2D> ().velocity = new Vector2 (speed, GetComponent<Rigidbody2D> ().velocity.y);
			//GetComponent<Rigidbody2D> ().angularVelocity = rotationSpeed;
		} else if (!right){
			transform.localScale = new Vector3 (200f,200f,200f);
			GetComponent<Rigidbody2D> ().velocity = new Vector2 (-speed, GetComponent<Rigidbody2D> ().velocity.y);
			//GetComponent<Rigidbody2D> ().angularVelocity = -rotationSpeed;
		}

	}

	void OnTriggerEnter2D(Collider2D other) {

		if (other.tag == "Nerd") {

			HealthManager.HurtPlayer(damageToGive);
		}

		Instantiate (impactEffect, transform.position, transform.rotation);
		Destroy (gameObject);

	}
}


text:
FormHelper = {
  componentOptions: function (hideIcebox) {
    var components = Components.find({projectId: FormHelper.currentProject()._id});

    var options = [];

    components.forEach(function (component) {
      options.push({
        label: component.name,
        value: component._id
      });
    });

    return options;
  },
  currentStoryId: function () {
    var story = Session.get("selectedStory");

    if (story) {
      return story._id;
    }
  },
  currentProject: function () {
    var project = Session.get('currentProject');

    return project || {};
  },
  component: function (componentId) {
    return Components.findOne({_id: componentId, projectId: FormHelper.currentProject()._id}) || {};
  },
  byStoryOrder: function (stories, storyOrder) {
    if (storyOrder) {
      // Convert to object for easier access
      var mappedStories = {};
      stories.forEach(function (story) {
        mappedStories[story._id] = story;
      });

      // Take the and fill the ordered with these stories first
      // and delete selected story from mappedStories
      var orderedStories = storyOrder.map(function (order) {
        var story = mappedStories[order];
        if(story) {
          delete mappedStories[order];
          return story;
        }
      });

      // Append rest of mappedStories in orderedStories and remove null and undefined
      return orderedStories.concat(_.toArray(mappedStories)).filter(function (e) {
        return e;
      });
    }

    return stories;
  }
};


text:
/* global it expect describe afterEach */

import store from '../store';

import {
  setShowExplanations,
  shouldShowExplanation,
  withExplanations
} from '../explanations';

afterEach(store.clear);

describe('withExplanations', () => {
  it('restores the original value when an exception is raised', () => {
    const orig = shouldShowExplanation();

    try {
      withExplanations(!orig, () => {
        throw new Error('oops!');
      });
    } catch (e) {
      // no-op
    } finally {
      expect(shouldShowExplanation()).toEqual(orig);
      setShowExplanations(orig);
    }
  });
});


text:
package org.dspace.app.xmlui.aspect.submission.submit;

import java.io.IOException;
import java.sql.SQLException;

import org.dspace.app.xmlui.utils.UIException;
import org.dspace.app.xmlui.aspect.submission.AbstractStep;
import org.dspace.app.xmlui.wing.Message;
import org.dspace.app.xmlui.wing.WingException;
import org.dspace.app.xmlui.wing.element.Body;
import org.dspace.app.xmlui.wing.element.Division;
import org.dspace.app.xmlui.wing.element.List;
import org.dspace.authorize.AuthorizeException;
import org.dspace.content.Collection;
import org.xml.sax.SAXException;

/**
 * This is sort-of a step of the submission processes (not
 * an official "step", since it does not extend AbstractSubmissionStep).
 *

 * At any time during submission the user may leave the processe and either
 * leave it for later or remove the submission.
 *

 * This form presents three options, 1) Go back, 2) save the work,
 * or 3) remove it.
 *
 * @author Scott Phillips
 * @author Tim Donohue (small updates for Configurable Submission)
 */
public class SaveOrRemoveStep extends AbstractStep
{

	/** Language Strings **/
    protected static final Message T_head =
        message("xmlui.Submission.submit.SaveOrRemoveStep.head");
    protected static final Message T_info1 =
        message("xmlui.Submission.submit.SaveOrRemoveStep.info1");
    protected static final Message T_submit_back =
        message("xmlui.Submission.submit.SaveOrRemoveStep.submit_back");
    protected static final Message T_submit_save =
        message("xmlui.Submission.submit.SaveOrRemoveStep.submit_save");
    protected static final Message T_submit_remove =
        message("xmlui.Submission.submit.SaveOrRemoveStep.submit_remove");

    /**
	 * Establish our required parameters, abstractStep will enforce these.
	 */
	public SaveOrRemoveStep()
	{
		this.requireSubmission = true;
		this.requireStep = true;
	}

	public void addBody(Body body) throws SAXException, WingException,
	UIException, SQLException, IOException, AuthorizeException
	{
		Collection collection = submission.getCollection();
		String actionURL = contextPath + "/handle/"+collection.getHandle() + "/submit/" + knot.getId() + ".continue";

		Division div = body.addInteractiveDivision("submit-save-or-cancel",actionURL, Division.METHOD_POST,"primary submission");
		div.setHead(T_submission_head);
		addSubmissionProgressList(div);

		List saveOrCancel = div.addList("submit-review", List.TYPE_FORM);

		saveOrCancel.setHead(T_head);
		saveOrCancel.addItem(T_info1);

        org.dspace.app.xmlui.wing.element.Item actions = saveOrCancel.addItem();
        actions.addButton("submit_back").setValue(T_submit_back);
        actions.addButton("submit_save").setValue(T_submit_save);
		actions.addButton("submit_remove").setValue(T_submit_remove);
	}
}