text:
using System;
using System.Linq.Expressions;
using Nest.Resolvers;

namespace Nest
{
	public class StringMappingDescriptor<T>
	{
		internal StringMapping _Mapping = new StringMapping();

		public StringMappingDescriptor<T> Name(string name)
		{
			this._Mapping.Name = name;
			return this;
		}
		public StringMappingDescriptor<T> Name(Expression<Func<T, object>> objectPath)
		{
			this._Mapping.Name = objectPath;
			return this;
		}

		public StringMappingDescriptor<T> IndexName(string indexName)
		{
			this._Mapping.IndexName = indexName;
			return this;
		}
		public StringMappingDescriptor<T> Index(FieldIndexOption fieldIndexOption)
		{
			this._Mapping.Index = fieldIndexOption;
			return this;
		}
		public StringMappingDescriptor<T> Store(bool store = true)
		{
			this._Mapping.Store = store;
			return this;
		}

		public StringMappingDescriptor<T> TermVector(TermVectorOption termVector)
		{
			this._Mapping.TermVector = termVector;
			return this;
		}
		public StringMappingDescriptor<T> Boost(double boost)
		{
			this._Mapping.Boost = boost;
			return this;
		}
		public StringMappingDescriptor<T> NullValue(string nullValue)
		{
			this._Mapping.NullValue = nullValue;
			return this;
		}
		public StringMappingDescriptor<T> OmitNorms(bool omitNorms = true)
		{
			this._Mapping.OmitNorms = omitNorms;
			return this;
		}

		public StringMappingDescriptor<T> IndexOptions(IndexOptions indexOptions)
		{
			this._Mapping.IndexOptions = indexOptions;
			return this;
		}
		public StringMappingDescriptor<T> Analyzer(string analyzer)
		{
			this._Mapping.Analyzer = analyzer;
			return this;
		}
		public StringMappingDescriptor<T> IndexAnalyzer(string indexAnalyzer)
		{
			this._Mapping.IndexAnalyzer = indexAnalyzer;
			return this;
		}
		public StringMappingDescriptor<T> SearchAnalyzer(string searchAnalyzer)
		{
			this._Mapping.SearchAnalyzer = searchAnalyzer;
			return this;
		}
		public StringMappingDescriptor<T> DocValues(bool docValues = true)
		{
			this._Mapping.DocValues = docValues;
			return this;
		}
		public StringMappingDescriptor<T> IncludeInAll(bool includeInAll = true)
		{
			this._Mapping.IncludeInAll = includeInAll;
			return this;
		}
		public StringMappingDescriptor<T> PositionOffsetGap(int positionOffsetGap)
		{
			this._Mapping.PositionOffsetGap = positionOffsetGap;
			return this;
		}

	}
}


text:
package pinterest4j.entity;

import org.joda.time.DateTime;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import pinterest4j.util.exception.PinterestException;
import pinterest4j.util.http.HttpResponse;
import pinterest4j.util.json.JsonUtil;
import pinterest4j.util.list.PageResponseList;
import pinterest4j.util.list.PageResponseListImpl;

import java.io.Serializable;

/**
 * Entity representing Pinterest Pin
 *
 * Created by Aniket Divekar.
 */
public class Pin extends PinterestBaseEntity implements Serializable {

    private static final long serialVersionUID = -3300936372244598773L;
    private String id;
    private User creator;
    private String url;
    private Media media;
    private DateTime createdAt;
    private String originalLink;
    private String note;
    private String color;
    private String link;
    private Board board;
    private String imageUrl;
    private Counts counts;

    public Pin(HttpResponse res) {
        super(res);
        init(res.getResponseJson().getJSONObject("data"));
    }

    Pin(JSONObject json) {
        init(json);
    }

    private void init(JSONObject json) {
        this.id = JsonUtil.getString("id", json);
        this.url = JsonUtil.getString("url", json);
        if (!json.isNull("creator")) {
            this.creator = new User(json.getJSONObject("creator"));
        }
        this.createdAt = new DateTime(JsonUtil.getString("created_at", json));
        this.originalLink = JsonUtil.getString("original_link", json);
        this.note = JsonUtil.getString("note", json);
        this.color = JsonUtil.getString("color", json);
        this.link = JsonUtil.getString("link", json);

        if (!json.isNull("board")) {
            this.board = new Board(json.getJSONObject("board"));
        }

        this.imageUrl = JsonUtil.getImageUrlOriginal(json);

        if (!json.isNull("counts")) {
            this.counts = new Counts(json.getJSONObject("counts"));
        }

        if(!json.isNull("media")) {
            this.media = new Media(json.getJSONObject("media"));
        }
    }

    public static PageResponseList<Pin> createPagePinList(HttpResponse res) throws PinterestException {
        try {
            JSONArray list = res.getResponseJson().getJSONArray("data");
            int size = list.length();
            PageResponseList<Pin> pins = new PageResponseListImpl<>(size, res);

            for(int index = 0; index < size; index++) {
                JSONObject pinJson = list.getJSONObject(index);
                pins.add(new Pin(pinJson));
            }

            return pins;

        } catch (JSONException e){
            throw new PinterestException(e.getMessage(), e);
        }
    }

    public String getId() {
        return id;
    }

    public User getCreator() {
        return creator;
    }

    public String getUrl() {
        return url;
    }

    public Media getMedia() {
        return media;
    }

    public DateTime getCreatedAt() {
        return createdAt;
    }

    public String getOriginalLink() {
        return originalLink;
    }

    public String getNote() {
        return note;
    }

    public String getColor() {
        return color;
    }

    public String getLink() {
        return link;
    }

    public Board getBoard() {
        return board;
    }

    public String getImageUrl() {
        return imageUrl;
    }

    public Counts getCounts() {
        return counts;
    }

    @Override
    public String toString() {
        return "Pin{" +
                "id='" + id + '\'' +
                ", creator=" + creator +
                ", url='" + url + '\'' +
                ", media=" + media +
                ", createdAt=" + createdAt +
                ", originalLink='" + originalLink + '\'' +
                ", note='" + note + '\'' +
                ", color='" + color + '\'' +
                ", link='" + link + '\'' +
                ", board=" + board +
                ", imageUrl='" + imageUrl + '\'' +
                ", counts=" + counts +
                '}';
    }
}

redpajama_set_name: RedPajamaGithub


text:
'use strict';

var _extends = require('babel-runtime/helpers/extends')['default'];

var _interopRequireDefault = require('babel-runtime/helpers/interop-require-default')['default'];

exports.__esModule = true;

var _react = require('react');

var _react2 = _interopRequireDefault(_react);

var _classnames = require('classnames');

var _classnames2 = _interopRequireDefault(_classnames);

var _BootstrapMixin = require('./BootstrapMixin');

var _BootstrapMixin2 = _interopRequireDefault(_BootstrapMixin);

var _styleMaps = require('./styleMaps');

var _styleMaps2 = _interopRequireDefault(_styleMaps);

var Glyphicon = _react2['default'].createClass({
  displayName: 'Glyphicon',

  mixins: [_BootstrapMixin2['default']],

  propTypes: {
    glyph: _react2['default'].PropTypes.oneOf(_styleMaps2['default'].GLYPHS).isRequired
  },

  getDefaultProps: function getDefaultProps() {
    return {
      bsClass: 'glyphicon'
    };
  },

  render: function render() {
    var classes = this.getBsClassSet();

    classes['glyphicon-' + this.props.glyph] = true;

    return _react2['default'].createElement(
      'span',
      _extends({}, this.props, { className: _classnames2['default'](this.props.className, classes) }),
      this.props.children
    );
  }
});

exports['default'] = Glyphicon;
module.exports = exports['default'];


text:
# Android上结合kotlin使用coroutine

最近入了Android坑,目前还处于疯狂学习的状态,所以很久都没有写博客了。今天记录一个小代码片段,在Android上使用coroutine
的小例子。

由于我自己是做一个记账软件来学习的,我用了gRPC,最开始我是使用线程来做网络请求的:

```kotlin
thread {
    // 网络请求代码

    runOnUiThread {
        // 更新UI的代码
    }
}
```

今天把这一套全部重写成用coroutine。

首先coroutine得有个调度器,英文叫做 "Dispatchers",有这么几个:

- `Dispatchers.Main` 这里面的coroutine跑在主线程上,在Android里也就是UI线程,所以如果在这里面的coroutine也执行大量耗时代码的话,也是会卡UI的
- `Dispatchers.IO` 用来跑大IO的
- `Dispatchers.Default` 用来跑高CPU消耗的
- `Dispatchers.Unconfined` 不绑定在任何特定执行线程上

然后,为了多个coroutine之间可以分组啊,就像进程里可以放很多线程那样,又搞了一个概念,叫做 scope,默认有一个全局scope,叫做 `GlobalScope`,全局的,
就和全局变量一样,在Android上,这个里面跑的coroutine,生命周期和app一样久,不推荐在这里起coroutine。

推荐的方式是每个Activity里起一个scope,然后再launch。

所以我就这样写基类:

```kotlin
abstract class BaseActivity : AppCompatActivity(), CoroutineScope {
    /*
    默认的coroutine scope是Main,也就是UI线程(主线程)。如果要做IO,比如网络请求,记得
    包裹在 launch(Dispatchers.IO) {} 里,如果要大量计算,包裹在 launch(Dispatcher.Default) {} 里
    或者直接写 launch。 UI操作则用 withContext(Dispatchers.Main) {} 切回来
     */
    private val job = SupervisorJob()
    override val coroutineContext: CoroutineContext
        get() = Dispatchers.Main + job

    override fun onDestroy() {
        super.onDestroy()
        coroutineContext.cancelChildren()
    }
```

这样子之后,就可以直接launch,起coroutine了:

```kotlin
launch {
    val req = CreateFeedbackReq.newBuilder().build()
    val respAny = callRPC {
        api.createFeedback(req)
    }
    respAny?:return@launch

    val resp = respAny as CreateFeedbackResp
    if (handleRespAction(resp.action)) {
        withContext(Dispatchers.Main) {
            showSnackBar(R.string.thank_you_for_feedback)
            delay(1000)
            finish()
        }
    }
}
```

如上,默认情况下,root coroutine就是当前所在activity,而他们默认会在 `Dispatchers.Main` 上执行,如果想要coroutine在
别的 dispatcher 上执行,就用 `withContext`,然后里面如果又想更新UI的话,就用 `withContext(Dispatchers.Main)`。

那为啥 `launch` 不传参数的话,就是直接用的 `Dispatchers.Main` 呢?因为其实 `CoroutineScope` 是一个接口,而
`coroutineContext` 是里面的一个变量:

```kotlin
public interface CoroutineScope {
    /**
     * The context of this scope.
     * Context is encapsulated by the scope and used for implementation of coroutine builders that are extensions on the scope.
     * Accessing this property in general code is not recommended for any purposes except accessing the [Job] instance for advanced usages.
     *
     * By convention, should contain an instance of a [job][Job] to enforce structured concurrency.
     */
    public val coroutineContext: CoroutineContext
}
```

我们再来看看 `launch` 的实现:

```kotlin
public fun CoroutineScope.launch(
    context: CoroutineContext = EmptyCoroutineContext,
    start: CoroutineStart = CoroutineStart.DEFAULT,
    block: suspend CoroutineScope.() -> Unit
): Job {
    val newContext = newCoroutineContext(context)
    val coroutine = if (start.isLazy)
        LazyStandaloneCoroutine(newContext, block) else
        StandaloneCoroutine(newContext, active = true)
    coroutine.start(start, coroutine, block)
    return coroutine
}

@ExperimentalCoroutinesApi
public actual fun CoroutineScope.newCoroutineContext(context: CoroutineContext): CoroutineContext {
    val combined = coroutineContext + context
    val debug = if (DEBUG) combined + CoroutineId(COROUTINE_ID.incrementAndGet()) else combined
    return if (combined !== Dispatchers.Default && combined[ContinuationInterceptor] == null)
        debug + Dispatchers.Default else debug
}
```

可以看到,默认情况下,会把当前的 `coroutineContext` 放在前面。

Kotlin的coroutine很好用,不过我感觉还是有点复杂,我也还在学习。

---

ref:

- https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines/-dispatchers/index.html


text:
import _ from 'lodash';

function tryGetModel(...args) {
    const model = _.attempt(getModel, args);

    return _.isError(model) ? {} : model;
}

function getModelArray(scorm, key, children, count) {
     return Object.assign(
        {
            [`${key}._children`]: children,
            [`${key}._count`]: count
        },
        _.reduce(
            _.range(0, Number(count)),
            (memo, n) => Object.assign(
                memo,
                _.reduce(
                    children.split(','),
                    (memo2, childkey) => Object.assign(
                        memo2,
                        tryGetModel(scorm, `${key}.${n}.${childkey}`)
                    ),
                    {}
                )
            ),
            {}
        )
    );
}

function getModelChildren(scorm, key, children) {
     return Object.assign(
        { [`${key}._children`]: children },
        _.reduce(
            children.split(','),
            (memo, childkey) => Object.assign(
                memo,
                tryGetModel(scorm, `${key}.${childkey}`)
            ),
            {}
        )
    );
}

function getModel(scorm, key) {
    const val = scorm.GetValue(key);

    // if this key exists, just return it
    if (scorm.GetLastError() === '0') {
        return { [key]: val };
    }

    // if key doesn't exist, check for children
    const children = scorm.GetValue(`${key}._children`);

    const hasChildren = scorm.GetLastError() === '0';

    // if there are no children, exit
    // TODO: change this to `return {}`?
    if (!hasChildren) {
        throw new SCORMError(scorm);
    }

    // check to see if it's an array
    const count = scorm.GetValue(`${key}._count`);

    const isArray = scorm.GetLastError() === '0';

    if (!isArray) {
        return getModelChildren(scorm, key, children);
    }

    return getModelArray(scorm, key, children, count);
}

export default function getSCORMDataModel(scorm) {
    const children = scorm.GetValue('cmi._children');

    return Object.assign(
        { 'cmi._children': children },
        _.reduce(
            children.split(','),
            (memo, key) => Object.assign(
                memo,
                tryGetModel(scorm, `cmi.${key}`)
            ),
            {}
        )
    );
}


text:
package com.touchvie.sdkfront;

import org.junit.Test;

import static org.junit.Assert.*;

/**
 * To work on unit tests, switch the Test Artifact in the Build Variants view.
 */
public class ExampleUnitTest {
    @Test
    public void addition_isCorrect() throws Exception {
        assertEquals(4, 2 + 2);
    }
}


text:
package com.busqueumlugar.model;

import java.io.Serializable;

/**
 *
 * @author Israel
 */
public class EmailImovel implements Serializable {

    /**
	 *
	 */
	private static final long serialVersionUID = 1L;
	private String textoEmail;
    private String assunto;
    private String to;
    private String acao;

    /**
     * @return the textoEmail
     */
    public String getTextoEmail() {
        return textoEmail;
    }

    /**
     * @param textoEmail the textoEmail to set
     */
    public void setTextoEmail(String textoEmail) {
        this.textoEmail = textoEmail;
    }

    /**
     * @return the assunto
     */
    public String getAssunto() {
        return assunto;
    }

    /**
     * @param assunto the assunto to set
     */
    public void setAssunto(String assunto) {
        this.assunto = assunto;
    }

    /**
     * @return the to
     */
    public String getTo() {
        return to;
    }

    /**
     * @param to the to to set
     */
    public void setTo(String to) {
        this.to = to;
    }

    /**
     * @return the acao
     */
    public String getAcao() {
        return acao;
    }

    /**
     * @param acao the acao to set
     */
    public void setAcao(String acao) {
        this.acao = acao;
    }

}


text:
ACCEPTED

#### According to
International Plant Names Index

#### Published in
null

#### Original name
Colsmannia flava Lehm.

### Remarks
null


text:
package parser.commands;

import core.Player;
import core.Map;
import core.Utilities;
import core.WObject;
import constructs.Conversation;
import constructs.Room;
import parser.Parser;

//
// Command Say to say something. If in a conversation used to communicate,
// otherwise treated like echo
//
// @author Alex Petersen <theoperatore@gmail.com>
//
public class Say extends WObject implements Command {

    //constructor
    public Say(String name, String description) {
        super(name, description);
    }

    //Say something!
    public void invoke(String[] parts, Player p, Map m) {
        //check for Parser.conversationOptions
        if (Parser.getOptions().size() != 0) {

            for (int i = 0; i < Parser.getOptions().size(); i++) {
                for (int j = 0; j < parts.length; j++) {

                    try {
                        int idx = Integer.parseInt(parts[j], 10);
                        idx -= 1;
                        if (idx >= 0 && idx < Parser.getOptions().size()) {
                            Conversation optn = Parser.getOptions().get(idx);
                            if (optn.getNumOptions() != 0) {
                                optn.getOptions().get(0).startConversation();
                                optn.getOptions().get(0).onInvoke(p,m);
                            }
                        }
                        else {
                            Utilities.println(Utilities.BOLD_RED,"You don't know how to say " + idx);
                            break;
                        }
                    }
                    catch (NumberFormatException e) { continue; }

                }
            }
        }

        //if none, echo
        else {
            String out = "";
            for (int i = 0; i < parts.length; i++) {
                out+= parts[i] + " ";
            }
            Utilities.println("You say: " + out);
        }
    }

    //equivalence
    public boolean equals(String name) {
        return super.equals(name);
    }

}


text:
##
# Import Modules
#
from CommonDataClass.FdfClass import ComponentStatementClassObject

## VTF components
#
#
class ComponentStatement (ComponentStatementClassObject) :
    ## The constructor
    #
    #   @param  self        The object pointer
    #
    def __init__(self):
          ComponentStatementClassObject.__init__(self)


text:
import type { ActionType } from "../actionTypes";

export type DropboxState = {
  +authToken: ?string,
  +uploading: boolean,
  +mock: boolean,
  +dirty: boolean,
  +triedStashingDecoder: boolean
};

const defaultDropboxSate = {
  authToken: null,
  uploading: false,
  mock: false,
  dirty: false,
  triedStashingDecoder: false
};

const dropbox = (
  state: DropboxState = defaultDropboxSate,
  action: ActionType
): DropboxState => {
  switch (action.type) {
    case "SET_AUTH_TOKEN":
      return Object.assign({}, state, { authToken: action.token });
    case "LOGOUT":
      return Object.assign({}, state, { authToken: null, mock: false });
    case "STARTING_DROPBOX_UPLOAD":
      return Object.assign({}, state, { uploading: true });
    case "DROPBOX_UPLOAD_COMPLETE":
      return Object.assign({}, state, {
        uploading: false,
        dirty: false
      });
    case "MARK_JOURNAL_DIRTY":
      // TODO: Find a more robust way to know when we are dirty.
      return Object.assign({}, state, { dirty: true });
    case "MOCK_DROPBOX":
      return Object.assign({}, state, { mock: true });
    case "TRYING_TO_STASH_DECRYPTER":
      return Object.assign({}, state, { triedStashingDecoder: true });
    default:
      return state;
  }
};

export default dropbox;


text:
class ErrorsController < ApplicationController
  def error_404
    @not_found_path = params[:not_found]
  end

  def error_500
  end
end


text:
package demo.java.v2c11.CompilerTest;
import java.io.*;
import java.net.*;
import javax.tools.*;

/**
 * A Java class that holds the bytecodes in a byte array.
 * @version 1.00 2007-11-02
 * @author Cay Horstmann
 */
public class ByteArrayJavaClass extends SimpleJavaFileObject
{
   /**
    * Constructs a new ByteArrayJavaClass
    * @param name the name of the class file represented by this file object
    */
   public ByteArrayJavaClass(String name)
   {
      super(URI.create("bytes:///" + name), Kind.CLASS);
      stream = new ByteArrayOutputStream();
   }

   public OutputStream openOutputStream() throws IOException
   {
      return stream;
   }

   public byte[] getBytes()
   {
      return stream.toByteArray();
   }

   private ByteArrayOutputStream stream;
}


text:
package org.kaazing.net.ws.impl.url;

import java.io.IOException;
import java.net.URI;
import java.net.URL;
import java.net.URLStreamHandler;
import java.util.Map;

import org.kaazing.net.ws.WsURLConnection;
import org.kaazing.net.ws.impl.WsURLConnectionImpl;
import org.kaazing.net.ws.impl.spi.WebSocketExtensionFactorySpi;

class WsURLStreamHandlerImpl extends URLStreamHandler {

    private final Map<String, WebSocketExtensionFactorySpi> _extensionFactories;

    private String    _scheme;

    public WsURLStreamHandlerImpl(Map<String, WebSocketExtensionFactorySpi> extensionFactories) {
        _extensionFactories = extensionFactories;
    }

    @Override
    protected int getDefaultPort() {
        return 80;
    }

    @Override
    protected WsURLConnection openConnection(URL location) throws IOException {
        return new WsURLConnectionImpl(location, _extensionFactories);
    }

    @Override
    protected void parseURL(URL location, String spec, int start, int limit) {
        _scheme = spec.substring(0, spec.indexOf("://"));

        // start needs to be adjusted for schemes that include a ':' such as
        // java:wse, etc.
        // int index = spec.indexOf(":/");
        // start = index + 1;

        URI    specURI = _getSpecURI(spec);
        String host = specURI.getHost();
        int    port = specURI.getPort();
        String authority = specURI.getAuthority();
        String userInfo = specURI.getUserInfo();
        String path = specURI.getPath();
        String query = specURI.getQuery();

        setURL(location, _scheme, host, port, authority, userInfo, path, query, null);
        // super.parseURL(location, spec, start, limit);
    }

    // ### TODO:
    // This method is no longer needed as we are not supporting 'java:'
    // prefixes. Keeping it for time being.
    @Override
    protected String toExternalForm(URL location) {
        return super.toExternalForm(location);
    }

    // ----------------- Private Methods -----------------------------------
    // Creates a URI that can be used to retrieve various parts such as host,
    // port, etc. Based on whether the scheme includes ':', the method returns
    // the appropriate URI that can be used to retrieve the needed parts.
    private URI _getSpecURI(String spec) {
        URI specURI = URI.create(spec);

        if (_scheme.indexOf(':') == -1) {
            return specURI;
        }

        String schemeSpecificPart = specURI.getSchemeSpecificPart();
        return URI.create(schemeSpecificPart);
    }
}


text:
package net.glowstone.generator.populators.overworld;

import net.glowstone.generator.objects.OreType;
import net.glowstone.generator.objects.OreVein;
import org.bukkit.Chunk;
import org.bukkit.Material;
import org.bukkit.StoneType;
import org.bukkit.World;
import org.bukkit.generator.BlockPopulator;
import org.bukkit.material.Stone;

import java.util.LinkedHashMap;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Random;

/**
 * Populates the world with ores.
 */
public class OrePopulator extends BlockPopulator {

    private final Map<OreType, Integer> ores = new LinkedHashMap<>();

    public OrePopulator() {
        ores.put(new OreType(Material.DIRT, 0, 256, 32), 10);
        ores.put(new OreType(Material.GRAVEL, 0, 256, 32), 8);
        ores.put(new OreType(Material.STONE, new Stone(StoneType.GRANITE), 0, 80, 32), 10);
        ores.put(new OreType(Material.STONE, new Stone(StoneType.DIORITE), 0, 80, 32), 10);
        ores.put(new OreType(Material.STONE, new Stone(StoneType.ANDESITE), 0, 80, 32), 10);
        ores.put(new OreType(Material.COAL_ORE, 0, 128, 16), 20);
        ores.put(new OreType(Material.IRON_ORE, 0, 64, 8), 20);
        ores.put(new OreType(Material.GOLD_ORE, 0, 32, 8), 2);
        ores.put(new OreType(Material.REDSTONE_ORE, 0, 16, 7), 8);
        ores.put(new OreType(Material.DIAMOND_ORE, 0, 16, 7), 1);
        ores.put(new OreType(Material.LAPIS_ORE, 16, 16, 6), 1);
    }

    @Override
    public void populate(World world, Random random, Chunk chunk) {
        int cx = chunk.getX() << 4;
        int cz = chunk.getZ() << 4;

        for (Entry<OreType, Integer> entry : ores.entrySet()) {

            OreType oreType = entry.getKey();
            for (int n = 0; n < entry.getValue(); n++) {

                int sourceX = cx + random.nextInt(16);
                int sourceZ = cz + random.nextInt(16);
                int sourceY = oreType.getMinY() == oreType.getMaxY() ?
                        random.nextInt(oreType.getMinY()) + random.nextInt(oreType.getMinY()) :
                        random.nextInt(oreType.getMaxY() - oreType.getMinY()) + oreType.getMinY();

                new OreVein(oreType).generate(world, random, sourceX, sourceY, sourceZ);
            }
        }
    }
}


text:
@implementation HHAYAppDelegate

- (void)dealloc
{
}

- (void)applicationDidFinishLaunching:(NSNotification *)aNotification
{
    HHAYController *hhay = [HHAYController alloc];
    [[hhay init] autorelease];
}

@end


text:
#include "Module.h"

CIMPLE_NAMESPACE_BEGIN

void Module::dump() const
{
    printf("=== Module:\n");

    for (Registration* p = _registration; p; p = p->next)
        printf("    provider(%s, %s)\n", p->provider_name, p->meta_class->name);
}

CIMPLE_NAMESPACE_END


text:
import java.util.Scanner;

public class Solution {

	public static void main(String[] args) {
		Scanner read = new Scanner(System.in);

		String s = read.nextLine();

		int minNumberOfCardsToFlip = 0;
		for (int i = 0; i < s.length(); ++i) {
			char c = s.charAt(i);
			if ( "aeiou13579".contains(String.valueOf(c)) ) {
				minNumberOfCardsToFlip++;
			}
		}

		System.out.println(minNumberOfCardsToFlip);

		// Close scanner
		read.close();
	}
}


text:
======
Tensor
======

.. doxygenclass:: primitiv::Tensor
  :members:


text:
package lapd.test.neo4j;

import static org.junit.Assert.*;
import lapd.databases.neo4j.GraphDbMappingException;

import org.eclipse.imp.pdb.facts.IValue;
import org.junit.Test;

public class TestTuple extends BaseGraphDbTest {

	@Test
	public void testEmptyTuple() throws GraphDbMappingException {
		IValue tupleValue = valueFactory.tuple();
		graphDbValueIO.write(id, tupleValue);
		assertEquals(tupleValue, graphDbValueIO.read(id, tupleValue.getType()));
	}

	@Test
	public void testTuple() throws GraphDbMappingException {
		IValue tupleValue = valueFactory.tuple(createTupleElements());
		graphDbValueIO.write(id, tupleValue);
		assertEquals(tupleValue, graphDbValueIO.read(id, tupleValue.getType()));
	}

	private IValue[] createTupleElements() {
		IValue[] elements = new IValue[] { valueFactory.integer(3), valueFactory.integer(4), valueFactory.integer(5) };
		return elements;
	}

}


text:
 .. Licensed to the Apache Software Foundation (ASF) under one
    or more contributor license agreements.  See the NOTICE file
    distributed with this work for additional information
    regarding copyright ownership.  The ASF licenses this file
    to you under the Apache License, Version 2.0 (the
    "License"); you may not use this file except in compliance
    with the License.  You may obtain a copy of the License at

 ..   http://www.apache.org/licenses/LICENSE-2.0

 .. Unless required by applicable law or agreed to in writing,
    software distributed under the License is distributed on an
    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
    KIND, either express or implied.  See the License for the
    specific language governing permissions and limitations
    under the License.

.. _executor:DaskExecutor:

Dask Executor
=============

:class:`airflow.executors.dask_executor.DaskExecutor` allows you to run Airflow tasks in a Dask Distributed cluster.

Dask clusters can be run on a single machine or on remote networks. For complete
details, consult the `Distributed documentation <https://distributed.readthedocs.io/>`_.

To create a cluster, first start a Scheduler:

.. code-block:: bash

    # default settings for a local cluster
    DASK_HOST=127.0.0.1
    DASK_PORT=8786

    dask-scheduler --host $DASK_HOST --port $DASK_PORT

Next start at least one Worker on any machine that can connect to the host:

.. code-block:: bash

    dask-worker $DASK_HOST:$DASK_PORT

Edit your ``airflow.cfg`` to set your executor to :class:`airflow.executors.dask_executor.DaskExecutor` and provide
the Dask Scheduler address in the ``[dask]`` section. For more information on setting the configuration,
see :doc:`../howto/set-config`.

Please note:

- Each Dask worker must be able to import Airflow and any dependencies you
  require.
- Dask does not support queues. If an Airflow task was created with a queue, a
  warning will be raised but the task will be submitted to the cluster.


text:
<?php
// include 'session.php';
session_start();
if(!session_is_registered(myusername)){
	// header("location:login.php");
} else{
	 $fullname = $_SESSION["fullname"];
	 $address = $_SESSION["address"];
	 $phone = $_SESSION["phone"];
	 $manager = $_SESSION["manager"];
	 $title = "Online Movie Database Management System";
}
include 'connect.php';
?>
<!DOCTYPE html>

	<title><?php echo $title?> | Manage Movies</title>

	<?php
	if($manager){
		echo("Add a movie");
	}
	?>

<?php
$id = $_GET["id"];
$sql="SELECT * FROM movies WHERE id=$id";
$result=mysql_query($sql);
$count=mysql_num_rows($result);
if ($count == 1) {
    while($row = mysql_fetch_assoc($result)) {
    	echo '<form method="post" action="updatemovie.php">';
		echo '
		<input name="id" value="'.$row["id"].'" type="hidden">
		<input class="readonly" name="title" placeholder="Title" value="' . $row["title"] . '" type="text" readonly>
		<input class="readonly" name="year" placeholder="Year of Release" value="' . $row["year"] . '" type="text" readonly>
		<input name="director" placeholder="Director" value="' . $row["director"] . '" type="text" required>
		<input name="producers" placeholder="Producers" value="' . $row["producers"] . '" type="text" required>
		<input name="actors" placeholder="Actors" value="' . $row["actors"] . '" type="text" required>
		<input name="studio" placeholder="Studio" value="' . $row["studio"] . '" type="text" required>
		<input name="rating" placeholder="Rating" value="' . $row["rating"] . '" type="Number" step="0.1" min="0.0" max="5.0" required>
		<input name="length" placeholder="Length in minutes" value="' . $row["length"] . '" type="Number" required>
		<select name="genre">
		  <option id="humor" value="humor">humor</option>
		  <option id="horror" value="horror">horror</option>
		  <option id="action" value="action">action</option>
		  <option id="adventure" value="adventure">adventure</option>
		  <option id="romance" value="romance">romance</option>
		  <option id="drama" value="drama">drama</option>
		</select>
		';
		echo '

		';
		echo '
		<input type="submit">
		</form>
		';
    }
} else {
    echo "No such movie!!";
}
?>


text:
def application(environ, start_response):
    return ("a","b","c")


text:
<?php

namespace Sonata\PriceBundle\DependencyInjection;

use Symfony\Component\Config\Definition\Builder\TreeBuilder;
use Symfony\Component\Config\Definition\ConfigurationInterface;
use Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition;
use Symfony\Component\Intl\Intl;

/**
 * This is the class that validates and merges configuration from your app/config files
 *
 * To learn more see {@link http://symfony.com/doc/current/cookbook/bundles/extension.html#cookbook-bundles-extension-config-class}
 */
class Configuration implements ConfigurationInterface
{
    /**
     * {@inheritdoc}
     */
    public function getConfigTreeBuilder()
    {
        $treeBuilder = new TreeBuilder();
        $node = $treeBuilder->root('sonata_price');

        $this->addPriceSection($node);

        return $treeBuilder;
    }

    /**
     * @param  \Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition $node
     * @return void
     */
    private function addPriceSection(ArrayNodeDefinition $node)
    {
        $node
            ->children()
                ->scalarNode('currency')
                    ->isRequired()
                    ->validate()
                    ->ifNotInArray(array_keys(Intl::getCurrencyBundle()->getCurrencyNames()))
                        ->thenInvalid("Invalid currency '%s'")
                    ->end()
                ->end()
            ->end()
        ;
    }
}


text:
class String

  # remove leading whitespace from multi-line text uniformly to the left most
  # character, used for HEREDOCs
  def unindent
    gsub(/^#{scan(/^\s*/).min_by{|l|l.length}}/, "")
  end
end


text:
<?php

/**
 * This file is part of CoverallsKit.
 *
 * (c) Noritaka Horio <holy.shared.design@gmail.com>
 *
 * This source file is subject to the MIT license that is bundled
 * with this source code in the file LICENSE.
 */
namespace coverallskit\entity;

use coverallskit\CompositeEntity;

/**
 * Interface ServiceEntity
 */
interface ServiceEntity extends CompositeEntity
{
    /**
     * @return string
     */
    public function getServiceName();

    /**
     * @return string
     */
    public function getServiceJobId();

    /**
     * @return string|null
     */
    public function getCoverallsToken();
}


text:
<?php

use ProcessControl\Process;
/**
 * Class ProcessTest
 */
class ProcessTest extends PHPUnit_Framework_TestCase
{
    public function testGetId()
    {
        $id = 1234;

        $process = new Process($id);

        $this->assertSame($id, $process->getId());
    }

    public function testIsMasterTrue()
    {
        $process = new Process(1234);

        $this->assertTrue($process->isMaster());
    }

    public function testIsMasterFalse()
    {
        $process = new Process(1234, new Process(5678));

        $this->assertFalse($process->isMaster());
    }

    public function testGetParentOfMasterReturnsNull()
    {
        $process = new Process(1234);

        $this->assertNull($process->getParent());
    }

    public function testGetParentOfMasterReturnsMaster()
    {
        $master = new Process(5678);
        $process = new Process(1234, $master);

        $this->assertSame($master, $process->getParent());
    }

    /**
     * @expectedException \ProcessControl\Exception\MissingChildException
     */
    public function testGetChildByIdWithMissingChildThrowsException()
    {
        $process = new Process(1234);
        $process->getChildById(5678);
    }

    public function testGetChildWithIdReturnsChild()
    {
        $process = new Process(1234);
        $childProcess = new Process(5678, $process);
        $process->addChild($childProcess);

        $this->assertSame($childProcess, $process->getChildById($childProcess->getId()));
    }

    /**
     * @expectedException \ProcessControl\Exception\MissingChildException
     */
    public function testRemoveMissingChildThrowsException()
    {
        $process = new Process(1234);
        $childProcess = new Process(5678, $process);

        $process->removeChild($childProcess);
    }

    public function testRemoveChildSuccess()
    {
        $process = new Process(1234);
        $childProcess = new Process(5678, $process);

        $process->addChild($childProcess);
        $this->assertTrue($process->hasChildById($childProcess->getId()));

        $process->removeChild($childProcess);
        $this->assertFalse($process->hasChildById($childProcess->getId()));
    }

    public function testGetInitialChildCountIsZero()
    {
        $process = new Process(1234);

        $this->assertSame(0, $process->getChildCount());
    }
}


text:
const getInternalData = require('./get-internal-data');
const isBanned = require('../is-banned');

async function getUserId(username, verifyBanned = false) {
  const internalData = await getInternalData
    .call(this, username, verifyBanned);

  if (verifyBanned === true) {
    isBanned(internalData);
  }

  return internalData.id;
}

module.exports = getUserId;


text:
import numpy as np
import astropy
from itertools import izip
from pearce.mocks import compute_prim_haloprop_bins, cat_dict
from pearce.mocks.customHODModels import *
from halotools.utils.table_utils import compute_conditional_percentiles
from halotools.utils import *

PMASS = 591421440.0000001 #chinchilla 400/ 2048
Lbox = 400.0
catalog = astropy.table.Table.read('/u/ki/swmclau2/des/AB_tests/abmatched_halos.hdf5', format = 'hdf5')
catalog = catalog[catalog['halo_mvir'] > 200*PMASS]

add_halo_hostid(catalog, delete_possibly_existing_column=True)

for prop in ['halo_x', 'halo_y', 'halo_z', 'halo_nfw_conc', 'halo_mvir', 'halo_rvir']:
    broadcast_host_halo_property(catalog, prop, delete_possibly_existing_column=True)

from halotools.utils.table_utils import compute_prim_haloprop_bins
from math import ceil
min_log_mass = np.log10(np.min(catalog['halo_mvir']))-0.001
max_log_mass = np.log10(np.max(catalog['halo_mvir']))+0.001
dlog10_prim_haloprop = 0.1
num_prim_haloprop_bins = (max_log_mass - min_log_mass) / dlog10_prim_haloprop
prim_haloprop_bin_boundaries = np.logspace(min_log_mass, max_log_mass,
    num=int(ceil(num_prim_haloprop_bins)))

prim_haloprop_bins = compute_prim_haloprop_bins(prim_haloprop = catalog['halo_mvir_host_halo'],                                                dlog10_prim_haloprop=dlog10_prim_haloprop,
                                                prim_haloprop_bin_boundaries = prim_haloprop_bin_boundaries)

shuffled_pos = np.zeros((len(catalog), 3))
shuffled_upids = np.zeros((len(catalog)))
shuffled_host_mvir = np.zeros((len(catalog)))
shuffled_mags = np.zeros((len(catalog), 3))

from pearce.mocks import cat_dict
cosmo_params = {'simname':'chinchilla', 'Lbox':400.0, 'scale_factors':[0.658, 1.0]}
cat = cat_dict[cosmo_params['simname']](**cosmo_params)#construct the specified catalog!
cat.load_model(1.0, HOD = 'redMagic')

np.random.seed(64)
bins_in_halocat = set(prim_haloprop_bins)

for ibin in bins_in_halocat:
    print ibin
    if ibin==0:
        continue
    indices_of_prim_haloprop_bin = np.where(prim_haloprop_bins == ibin)[0]

    centrals_idx = np.where(catalog[indices_of_prim_haloprop_bin]['halo_upid'] == -1)[0]
    n_centrals = len(centrals_idx)
    satellites_idx = np.where(catalog[indices_of_prim_haloprop_bin]['halo_upid']!=-1)[0]
    n_satellites = len(satellites_idx)

    if centrals_idx.shape[0]!=0:
        rand_central_idxs = np.random.choice(indices_of_prim_haloprop_bin[centrals_idx], size = n_centrals, replace = False)
    else:
        rand_central_idxs = np.array([])

    for idx, coord in enumerate(['vpeak', 'vvir', 'alpha_05']):
        shuffled_mags[indices_of_prim_haloprop_bin[centrals_idx], idx]=                 catalog[rand_central_idxs]['halo_'+coord+'_mag']

        shuffled_mags[indices_of_prim_haloprop_bin[satellites_idx],idx ] =                 catalog[indices_of_prim_haloprop_bin[satellites_idx]]['halo_'+coord+'_mag']
    #Create second rand_central_idxs, Iterate through satellite hosts and assign them when they match.

    for idx, coord in enumerate(['x','y','z']):
        # don't need to shuffle positions cu we've shuffled mags for centrals
        shuffled_pos[indices_of_prim_haloprop_bin[centrals_idx], idx] =                 catalog[indices_of_prim_haloprop_bin[centrals_idx]]['halo_'+coord]

    shuffled_upids[indices_of_prim_haloprop_bin[centrals_idx]] = -1

    shuffled_host_mvir[indices_of_prim_haloprop_bin[centrals_idx]] =             catalog[indices_of_prim_haloprop_bin[centrals_idx]]['halo_mvir']

    hosts_id, first_sat_idxs = np.unique(catalog[indices_of_prim_haloprop_bin[satellites_idx]]['halo_upid'], return_index=True)
    shuffled_idxs = np.random.permutation(hosts_id.shape[0])
    shuffled_hosts_id = hosts_id[shuffled_idxs]
    shuffled_sat_idxs = first_sat_idxs[shuffled_idxs]
    shuffled_arrays_idx = 0
    host_map = dict() #maps the current host id to the index of a new host id.
    #the host_id -> idx map is easier than the host_id -> host_id map

    for sat_idx in satellites_idx:
        host_id = catalog[indices_of_prim_haloprop_bin][sat_idx]['halo_upid']

        if host_id in host_map:
            new_host_id, hosts_old_satellite_idx = host_map[host_id]
        else:
            new_host_id = shuffled_hosts_id[shuffled_arrays_idx]
            hosts_old_satellite_idx = shuffled_sat_idxs[shuffled_arrays_idx]
            host_map[host_id] = (new_host_id, hosts_old_satellite_idx)
            shuffled_arrays_idx+=1

        shuffled_upids[indices_of_prim_haloprop_bin[sat_idx]] = new_host_id

        shuffled_host_mvir[indices_of_prim_haloprop_bin[sat_idx]] =                 catalog[indices_of_prim_haloprop_bin[satellites_idx]][hosts_old_satellite_idx]['halo_mvir_host_halo']

        hc_x, hc_y, hc_z = cat.model.model_dictionary['satellites_profile'].mc_halo_centric_pos(                                                        catalog[indices_of_prim_haloprop_bin[sat_idx]]['halo_nfw_conc_host_halo'],
                                                        halo_radius = catalog[indices_of_prim_haloprop_bin[sat_idx]]['halo_rvir_host_halo'])

        for idx, (coord, hc) in enumerate(izip(['x','y','z'], [hc_x, hc_y, hc_z])):
            #shuffled_pos[indices_of_prim_haloprop_bin[satellites_idx], idx] = \
            #        (catalog[indices_of_prim_haloprop_bin[satellites_idx]]['halo_'+coord] -\
            #        host_halo_pos[indices_of_prim_haloprop_bin[satellites_idx], idx]+\
            #        host_halo_pos[rand_host_idxs, idx])%Lbox

            shuffled_pos[indices_of_prim_haloprop_bin[sat_idx],idx] =                        (catalog[indices_of_prim_haloprop_bin[satellites_idx][hosts_old_satellite_idx]]['halo_'+coord+'_host_halo'] + hc)%Lbox

catalog['halo_sh_shuffled_vpeak_mag'] = shuffled_mags[:,0]
catalog['halo_sh_shuffled_vvir_mag'] = shuffled_mags[:,1]
catalog['halo_sh_shuffled_alpha_05_mag'] = shuffled_mags[:,2]
catalog['halo_sh_shuffled_x'] = shuffled_pos[:,0]
catalog['halo_sh_shuffled_y'] = shuffled_pos[:,1]
catalog['halo_sh_shuffled_z'] = shuffled_pos[:,2]
catalog['halo_sh_shuffled_upid']=shuffled_upids[:]
catalog['halo_sh_shuffled_host_mvir'] = shuffled_host_mvir[:]

catalog.write('/u/ki/swmclau2/des/AB_tests/abmatched_halos.hdf5', format = 'hdf5', path = './abmatched_halos.hdf5', overwrite=True)


text:
"""add language to posts

Revision ID: 2b017edaa91f
Revises: ae346256b650
Create Date: 2017-10-04 22:48:34.494465

"""
from alembic import op
import sqlalchemy as sa

# revision identifiers, used by Alembic.
revision = '2b017edaa91f'
down_revision = 'ae346256b650'
branch_labels = None
depends_on = None

def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.add_column('post', sa.Column('language', sa.String(length=5), nullable=True))
    # ### end Alembic commands ###

def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_column('post', 'language')
    # ### end Alembic commands ###


text:
<?php

class Recurly_ClientResponse
{
  var $statusCode;
  var $headers;
  var $body;

  function __construct($statusCode, $headers, $body) {
    $this->statusCode = $statusCode;
    $this->headers = $headers;
    $this->body = $body;
  }

  public function assertSuccessResponse($object)
  {
    if ($this->statusCode == 422)
    {
      if ($object instanceof Recurly_FieldError)
        throw new Recurly_ValidationError('Validation error', null, array($object));
      else if ($object instanceof Recurly_ErrorList)
        throw new Recurly_ValidationError('Validation error', null, $object);
      else if (is_array($object) && count($object) == 3) {
        $trans_error = $object[0];
        $transaction = $object[2];
        if ($trans_error instanceof Recurly_TransactionError && $transaction instanceof Recurly_Transaction)
          throw new Recurly_ValidationError($trans_error->customer_message, $transaction, array($trans_error));
      }
      else
        throw new Recurly_ValidationError('Validation error', $object, $object->getErrors());
    }
  }

  public function assertValidResponse()
  {
    // Successful response code
    if ($this->statusCode >= 200 && $this->statusCode < 400)
      return;

    // Do not fail here if the response is not valid XML
    $error = @$this->parseErrorXml($this->body);

    switch ($this->statusCode) {
      case 0:
        throw new Recurly_ConnectionError('An error occurred while connecting to Recurly.');
      case 400:
        $message = (is_null($error) ? 'Bad API Request' : $error->description);
        throw new Recurly_Error($message);
      case 401:
        throw new Recurly_UnauthorizedError('Your API Key is not authorized to connect to Recurly.');
      case 403:
        throw new Recurly_UnauthorizedError('Please use an API key to connect to Recurly.');
      case 404:
        $message = (is_null($error) ? 'Object not found' : $error->description);
        throw new Recurly_NotFoundError($message);
      case 422:
        // Handled in assertSuccessResponse()
        return;
      case 429:
        throw new Recurly_ApiRateLimitError('You have made too many API requests in the last hour. Future GET API requests will be ignored until the beginning of the next hour.');
      case 500:
        $message = (is_null($error) ? 'An error occurred while connecting to Recurly' :
                   'An error occurred while connecting to Recurly: ' . $error->description);
        throw new Recurly_ServerError($message);
      case 502:
      case 503:
      case 504:
        throw new Recurly_ConnectionError('An error occurred while connecting to Recurly.');
    }

    // Catch future 400-499 errors as request errors
    if ($this->statusCode >= 400 && $this->statusCode < 500)
      throw new Recurly_RequestError("Invalid request, status code: {$this->statusCode}");

    // Catch future 500-599 errors as server errors
    if ($this->statusCode >= 500 && $this->statusCode < 600) {
      $message = (is_null($error) ? 'An error occurred while connecting to Recurly' :
                 'An error occurred while connecting to Recurly: ' . $error->description);
      throw new Recurly_ServerError($message);
    }
  }

  private function parseErrorXml($xml) {
    $dom = new DOMDocument();
    if (empty($xml) || !$dom->loadXML($xml)) return null;

    $rootNode = $dom->documentElement;
    if ($rootNode->nodeName == 'error')
      return Recurly_ClientResponse::parseErrorNode($rootNode);
    else
      return null;
  }

  private static function parseErrorNode($node)
  {
    $node = $node->firstChild;
    $error = new Recurly_FieldError();

    while ($node) {
      switch ($node->nodeName) {
        case 'symbol':
          $error->symbol = $node->nodeValue;
          break;
        case 'description':
          $error->description = $node->nodeValue;
          break;
      }
      $node = $node->nextSibling;
    }
    return $error;
  }
}


text:
import { IQueueConfiguration } from './IQueueConfiguration';
/**
 * Each node corresponds to an entry within the queue. This helps with
 * storage and removal from local storage.
 */
export declare class Node<ILogEntry> {
    value: ILogEntry;
    private _key;
    private _serializedNode;
    /**
     * Constructs a node representing an entry in the queue.
     * @param config The queue configuration. This is used to provide the prefix for the key.
     * @param index The index within the queue
     * @param value The value of the entry
     */
    constructor(config: IQueueConfiguration, index: number, value: ILogEntry);
    /**
     * Returns an estimate of the size this will take up in local storage.
     */
    estimatedSize(): number;
    /**
     * Stores the serialized entry in local storage.
     * @return {boolean} Success?
     */
    store(): boolean;
    /**
     * Removes the entry from local storage if it exists.
     */
    remove(): void;
    /**
     * Creates a key for an entry.
     * @param config The configuration containing the key prefix
     * @param index The index of the entry in the queue
     */
    static createKey(config: IQueueConfiguration, index: number): string;
    /**
     * Loads an entry from local storage and deserializes it. Returns the associated node.
     * @param config The configuration containing the key prefix
     * @param index The index of the entry in the queue
     */
    static fromLocalStorage<ILogEntry>(config: IQueueConfiguration, index: number): Node<ILogEntry>;
}


text:
package com.netflix.spinnaker.clouddriver.alicloud.deploy.converters;

import com.netflix.spinnaker.clouddriver.alicloud.AliCloudOperation;
import com.netflix.spinnaker.clouddriver.alicloud.common.ClientFactory;
import com.netflix.spinnaker.clouddriver.alicloud.deploy.description.DeleteAliCloudSecurityGroupDescription;
import com.netflix.spinnaker.clouddriver.alicloud.deploy.ops.DeleteAliCloudSecurityGroupAtomicOperation;
import com.netflix.spinnaker.clouddriver.orchestration.AtomicOperation;
import com.netflix.spinnaker.clouddriver.orchestration.AtomicOperations;
import com.netflix.spinnaker.clouddriver.security.AbstractAtomicOperationsCredentialsSupport;
import java.util.Map;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@AliCloudOperation(AtomicOperations.DELETE_SECURITY_GROUP)
@Component("deleteAliCloudSecurityGroupDescription")
public class DeleteAliCloudSecurityGroupAtomicOperationConverter
    extends AbstractAtomicOperationsCredentialsSupport {

  private final ClientFactory clientFactory;

  @Autowired
  public DeleteAliCloudSecurityGroupAtomicOperationConverter(ClientFactory clientFactory) {
    this.clientFactory = clientFactory;
  }

  @Override
  public AtomicOperation convertOperation(Map input) {
    return new DeleteAliCloudSecurityGroupAtomicOperation(convertDescription(input), clientFactory);
  }

  @Override
  public DeleteAliCloudSecurityGroupDescription convertDescription(Map input) {
    DeleteAliCloudSecurityGroupDescription description =
        getObjectMapper().convertValue(input, DeleteAliCloudSecurityGroupDescription.class);
    description.setCredentials(getCredentialsObject((String) input.get("credentials")));
    return description;
  }
}


text:
/**
 * Aplicação RequireJS principal no servidor.
 */
var requirejs = require('requirejs');

requirejs.config({
    //Pass the top-level main.js/index.js require
    //function to requirejs so that node modules
    //are loaded relative to the top-level JS file.
    nodeRequire: require
    , paths: {
		i18n : 'public/libs/i18n'
		, nls : 'public/nls'
		, json2: 'public/libs/json2'
		, config : 'config'
	}
//    , locale: "pt-br"
});

requirejs(['app', 'i18n!nls/server'],function(app, server_text) {
  var port = 8080;
  app.server.listen(port);
  console.log(server_text.server_start + port);
});


text:
from ctypes import *

import numpy as np

from zounds.timeseries import SR44100, AudioSamples, Seconds
from zounds.core import ArrayWithUnits

try:
    libsamplerate = CDLL('libsamplerate.so')
except OSError as e:
    # KLUDGE: This is here to support building documentation on readthedocs
    pass

from featureflow import Node

class SRC_DATA(Structure):
    """
    A wrapper for the libsamplerate.SRC_DATA struct
    """
    _fields_ = [('data_in', POINTER(c_float)),
                ('data_out', POINTER(c_float)),
                ('input_frames', c_long),
                ('output_frames', c_long),
                ('input_frames_used', c_long),
                ('output_frames_gen', c_long),
                ('end_of_input', c_int),
                ('src_ratio', c_double), ]

class SRC_STATE(Structure):
    """
    A dummy structure to represent the state returned from libsamplerate
    src_new.
    """
    _fields_ = []

class Resample(object):
    """
    A wrapper around the libsamplerate src_process() method.  This class is
    intended for one-time use. New instances should be created for each sound\
    file processed.
    """

    def __init__(
            self,
            orig_sample_rate,
            new_sample_rate,
            nchannels=1,
            converter_type=1):

        """
        orig_sample_rate - The sample rate of the incoming samples, in hz
        new_sample_rate - The sample_rate of the outgoiing samples, in hz
        n_channels - Number of channels in the incoming and outgoing samples
        converter_type - See http://www.mega-nerd.com/SRC/api_misc.html#Converters
                         for a list of conversion types. "0" is the best-quality,
                         and slowest converter

        """
        super(Resample, self).__init__()
        self._ratio = new_sample_rate / orig_sample_rate
        # check if the conversion ratio is considered valid by libsamplerate
        if not libsamplerate.src_is_valid_ratio(c_double(self._ratio)):
            raise ValueError('%1.2f / %1.2f = %1.4f is not a valid ratio' % \
                             (new_sample_rate, orig_sample_rate, self._ratio))
        # create a pointer to the SRC_STATE struct, which maintains state
        # between calls to src_process()
        self.error = pointer(c_int(0))
        self.nchannels = nchannels
        self.converter_type = converter_type
        self.c_int_converter_type = c_int(converter_type)
        self.c_int_channels = c_int(self.nchannels)
        libsamplerate.src_new.restype = POINTER(SRC_STATE)
        self._state = libsamplerate.src_new(
            self.c_int_converter_type, self.c_int_channels, self.error)

    def _prepare_input(self, insamples):
        # ensure that the input is float data
        if np.float32 != insamples.dtype:
            return insamples.astype(np.float32)
        return insamples

    def _output_buffer(self, insamples):
        outsize = (int(np.round(len(insamples) * self._ratio)), self.nchannels)
        return np.zeros(outsize, dtype=np.float32).squeeze()

    def _check_for_error(self, return_code):
        if return_code:
            raise Exception(
                'libsamplerate sent non-zero return code {return_code}'
                    .format(**locals()))

    def __call__(self, insamples, end_of_input=False):

        normalized_insamples = self._prepare_input(insamples)
        outsamples = self._output_buffer(normalized_insamples)

        insamples_ptr = normalized_insamples.ctypes.data_as(POINTER(c_float))
        outsamples_ptr = outsamples.ctypes.data_as(POINTER(c_float))

        sd = SRC_DATA(
            # a pointer to the input samples
            data_in=insamples_ptr,
            # a pointer to the output buffer
            data_out=outsamples_ptr,
            # number of input samples
            input_frames=len(normalized_insamples),
            # number of output samples
            output_frames=len(outsamples),
            # NOT the end of input, i.e., there is more data to process
            end_of_input=int(end_of_input),
            # the conversion ratio
            src_ratio=self._ratio)
        sd_ptr = pointer(sd)
        rv = libsamplerate.src_process(self._state, sd_ptr)
        self._check_for_error(rv)
        return outsamples

class Resampler(Node):
    """
    `Resampler` expects to process :class:`~zounds.timeseries.AudioSamples`
    instances (e.g., those produced by a :class:`AudioStream` node), and will
    produce a new stream of :class:`AudioSamples` at a new sampling rate.

    Args:
        samplerate (AudioSampleRate): the desired sampling rate.  If none is
            provided, the default is :class:`~zounds.timeseries.SR44100`
        needs (Feature): a processing node that produces
            :class:`~zounds.timeseries.AudioSamples`

    Here's how you'd typically see :class:`Resampler` used in a processing
    graph.

    .. code:: python

        import featureflow as ff
        import zounds

        chunksize = zounds.ChunkSizeBytes(
            samplerate=zounds.SR44100(),
            duration=zounds.Seconds(30),
            bit_depth=16,
            channels=2)

        @zounds.simple_in_memory_settings
        class Document(ff.BaseModel):
            meta = ff.JSONFeature(
                zounds.MetaData,
                store=True,
                encoder=zounds.AudioMetaDataEncoder)

            raw = ff.ByteStreamFeature(
                ff.ByteStream,
                chunksize=chunksize,
                needs=meta,
                store=False)

            pcm = zounds.AudioSamplesFeature(
                zounds.AudioStream,
                needs=raw,
                store=True)

            resampled = zounds.AudioSamplesFeature(
                zounds.Resampler,
                samplerate=zounds.SR22050(),
                needs=pcm,
                store=True)

        synth = zounds.NoiseSynthesizer(zounds.SR11025())
        samples = synth.synthesize(zounds.Seconds(10))
        raw_bytes = samples.encode()
        _id = Document.process(meta=raw_bytes)
        doc = Document(_id)
        print doc.pcm.samplerate.__class__.__name__  # SR11025
        print doc.resampled.samplerate.__class__.__name__  # SR22050
    """

    def __init__(self, samplerate=None, needs=None):
        super(Resampler, self).__init__(needs=needs)
        self._samplerate = samplerate or SR44100()
        self._resample = None

    def _noop(self, data, finalized):
        return data

    def _process(self, data):
        sr = data.samples_per_second

        if self._resample is None:
            target_sr = self._samplerate.samples_per_second
            self._resample = Resample(
                sr,
                target_sr,
                1 if len(data.shape) == 1 else data.shape[1])

            if target_sr != sr:
                self._rs = self._resample
                # KLUDGE: The following line seems to solve a bug whereby
                # libsamplerate doesn't generate enough samples the first time
                # src_process is called. We're calling it once here, so the "real"
                # output will come out click-free
                silence = AudioSamples.silence(
                    self._samplerate, Seconds(1), channels=data.channels)
                self._resample(silence)
            else:
                self._rs = self._noop

        resampled = self._rs(data, self._finalized)
        if not isinstance(resampled, ArrayWithUnits):
            resampled = AudioSamples(resampled, self._samplerate)
        yield resampled


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace RevStack.OrientDb.Query
{
    public abstract class ProjectionRow
    {
        public abstract object GetValue(int index);
    }
}


text:
package com.gigigo.orchextra.core.utils;

import com.squareup.moshi.JsonDataException;
import java.util.Calendar;
import java.util.Date;
import java.util.GregorianCalendar;
import java.util.Locale;
import java.util.TimeZone;

/**
 * Jackson's date formatter. Forked from this file:
 * https://github.com/FasterXML/jackson-databind/blob/master/src/main/java/com/fasterxml/jackson/databind/util/ISO8601Utils.java
 *
 * Utilities methods for manipulating dates in iso8601 format. This is much much faster and GC
 * friendly than using SimpleDateFormat so highly suitable if you (un)serialize lots of date
 * objects.
 *
 * Supported parse format: [yyyy-MM-dd|yyyyMMdd][T(hh:mm[:ss[.sss]]|hhmm[ss[.sss]])]?[Z|[+-]hh[:]mm]]
 *
 * @see this specification
 */
public final class Iso8601Utils {
  /** ID to represent the 'GMT' string */
  static final String GMT_ID = "GMT";

  /** The GMT timezone, prefetched to avoid more lookups. */
  static final TimeZone TIMEZONE_Z = TimeZone.getTimeZone(GMT_ID);

  /** Returns {@code date} formatted as yyyy-MM-ddThh:mm:ss.sssZ */
  public static String format(Date date) {
    Calendar calendar = new GregorianCalendar(TIMEZONE_Z, Locale.US);
    calendar.setTime(date);

    // estimate capacity of buffer as close as we can (yeah, that's pedantic ;)
    int capacity = "yyyy-MM-ddThh:mm:ss.sssZ".length();
    StringBuilder formatted = new StringBuilder(capacity);
    padInt(formatted, calendar.get(Calendar.YEAR), "yyyy".length());
    formatted.append('-');
    padInt(formatted, calendar.get(Calendar.MONTH) + 1, "MM".length());
    formatted.append('-');
    padInt(formatted, calendar.get(Calendar.DAY_OF_MONTH), "dd".length());
    formatted.append('T');
    padInt(formatted, calendar.get(Calendar.HOUR_OF_DAY), "hh".length());
    formatted.append(':');
    padInt(formatted, calendar.get(Calendar.MINUTE), "mm".length());
    formatted.append(':');
    padInt(formatted, calendar.get(Calendar.SECOND), "ss".length());
    formatted.append('.');
    padInt(formatted, calendar.get(Calendar.MILLISECOND), "sss".length());
    formatted.append('Z');
    return formatted.toString();
  }

  /**
   * Parse a date from ISO-8601 formatted string. It expects a format
   * [yyyy-MM-dd|yyyyMMdd][T(hh:mm[:ss[.sss]]|hhmm[ss[.sss]])]?[Z|[+-]hh:mm]]
   *
   * @param date ISO string to parse in the appropriate format.
   * @return the parsed date
   */
  public static Date parse(String date) {
    try {
      int offset = 0;

      // extract year
      int year = parseInt(date, offset, offset += 4);
      if (checkOffset(date, offset, '-')) {
        offset += 1;
      }

      // extract month
      int month = parseInt(date, offset, offset += 2);
      if (checkOffset(date, offset, '-')) {
        offset += 1;
      }

      // extract day
      int day = parseInt(date, offset, offset += 2);
      // default time value
      int hour = 0;
      int minutes = 0;
      int seconds = 0;
      int milliseconds =
          0; // always use 0 otherwise returned date will include millis of current time

      // if the value has no time component (and no time zone), we are done
      boolean hasT = checkOffset(date, offset, 'T');

      if (!hasT && (date.length() <= offset)) {
        Calendar calendar = new GregorianCalendar(year, month - 1, day);

        return calendar.getTime();
      }

      if (hasT) {

        // extract hours, minutes, seconds and milliseconds
        hour = parseInt(date, offset += 1, offset += 2);
        if (checkOffset(date, offset, ':')) {
          offset += 1;
        }

        minutes = parseInt(date, offset, offset += 2);
        if (checkOffset(date, offset, ':')) {
          offset += 1;
        }
        // second and milliseconds can be optional
        if (date.length() > offset) {
          char c = date.charAt(offset);
          if (c != 'Z' && c != '+' && c != '-') {
            seconds = parseInt(date, offset, offset += 2);
            if (seconds > 59 && seconds < 63) seconds = 59; // truncate up to 3 leap seconds
            // milliseconds can be optional in the format
            if (checkOffset(date, offset, '.')) {
              offset += 1;
              int endOffset = indexOfNonDigit(date, offset + 1); // assume at least one digit
              int parseEndOffset = Math.min(endOffset, offset + 3); // parse up to 3 digits
              int fraction = parseInt(date, offset, parseEndOffset);
              milliseconds = (int) (Math.pow(10, 3 - (parseEndOffset - offset)) * fraction);
              offset = endOffset;
            }
          }
        }
      }

      // extract timezone
      if (date.length() <= offset) {
        throw new IllegalArgumentException("No time zone indicator");
      }

      TimeZone timezone;
      char timezoneIndicator = date.charAt(offset);

      if (timezoneIndicator == 'Z') {
        timezone = TIMEZONE_Z;
      } else if (timezoneIndicator == '+' || timezoneIndicator == '-') {
        String timezoneOffset = date.substring(offset);
        // 18-Jun-2015, tatu: Minor simplification, skip offset of "+0000"/"+00:00"
        if ("+0000".equals(timezoneOffset) || "+00:00".equals(timezoneOffset)) {
          timezone = TIMEZONE_Z;
        } else {
          // 18-Jun-2015, tatu: Looks like offsets only work from GMT, not UTC...
          //    not sure why, but it is what it is.
          String timezoneId = GMT_ID + timezoneOffset;
          timezone = TimeZone.getTimeZone(timezoneId);
          String act = timezone.getID();
          if (!act.equals(timezoneId)) {
            /* 22-Jan-2015, tatu: Looks like canonical version has colons, but we may be given
             *    one without. If so, don't sweat.
             *   Yes, very inefficient. Hopefully not hit often.
             *   If it becomes a perf problem, add 'loose' comparison instead.
             */
            String cleaned = act.replace(":", "");
            if (!cleaned.equals(timezoneId)) {
              throw new IndexOutOfBoundsException("Mismatching time zone indicator: "
                  + timezoneId
                  + " given, resolves to "
                  + timezone.getID());
            }
          }
        }
      } else {
        throw new IndexOutOfBoundsException(
            "Invalid time zone indicator '" + timezoneIndicator + "'");
      }

      Calendar calendar = new GregorianCalendar(timezone);
      calendar.setLenient(false);
      calendar.set(Calendar.YEAR, year);
      calendar.set(Calendar.MONTH, month - 1);
      calendar.set(Calendar.DAY_OF_MONTH, day);
      calendar.set(Calendar.HOUR_OF_DAY, hour);
      calendar.set(Calendar.MINUTE, minutes);
      calendar.set(Calendar.SECOND, seconds);
      calendar.set(Calendar.MILLISECOND, milliseconds);

      return calendar.getTime();
      // If we get a ParseException it'll already have the right message/offset.
      // Other exception types can convert here.
    } catch (IndexOutOfBoundsException | IllegalArgumentException e) {
      throw new JsonDataException("Not an RFC 3339 date: " + date, e);
    }
  }

  /**
   * Check if the expected character exist at the given offset in the value.
   *
   * @param value the string to check at the specified offset
   * @param offset the offset to look for the expected character
   * @param expected the expected character
   * @return true if the expected character exist at the given offset
   */
  private static boolean checkOffset(String value, int offset, char expected) {
    return (offset < value.length()) && (value.charAt(offset) == expected);
  }

  /**
   * Parse an integer located between 2 given offsets in a string
   *
   * @param value the string to parse
   * @param beginIndex the start index for the integer in the string
   * @param endIndex the end index for the integer in the string
   * @return the int
   * @throws NumberFormatException if the value is not a number
   */
  private static int parseInt(String value, int beginIndex, int endIndex)
      throws NumberFormatException {
    if (beginIndex < 0 || endIndex > value.length() || beginIndex > endIndex) {
      throw new NumberFormatException(value);
    }
    // use same logic as in Integer.parseInt() but less generic we're not supporting negative values
    int i = beginIndex;
    int result = 0;
    int digit;
    if (i < endIndex) {
      digit = Character.digit(value.charAt(i++), 10);
      if (digit < 0) {
        throw new NumberFormatException("Invalid number: " + value.substring(beginIndex, endIndex));
      }
      result = -digit;
    }
    while (i < endIndex) {
      digit = Character.digit(value.charAt(i++), 10);
      if (digit < 0) {
        throw new NumberFormatException("Invalid number: " + value.substring(beginIndex, endIndex));
      }
      result *= 10;
      result -= digit;
    }
    return -result;
  }

  /**
   * Zero pad a number to a specified length
   *
   * @param buffer buffer to use for padding
   * @param value the integer value to pad if necessary.
   * @param length the length of the string we should zero pad
   */
  private static void padInt(StringBuilder buffer, int value, int length) {
    String strValue = Integer.toString(value);
    for (int i = length - strValue.length(); i > 0; i--) {
      buffer.append('0');
    }
    buffer.append(strValue);
  }

  /**
   * Returns the index of the first character in the string that is not a digit, starting at
   * offset.
   */
  private static int indexOfNonDigit(String string, int offset) {
    for (int i = offset; i < string.length(); i++) {
      char c = string.charAt(i);
      if (c < '0' || c > '9') return i;
    }
    return string.length();
  }
}


text:
using System;
using Commencement.Core.Domain;
using Commencement.Tests.Core.Extensions;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using UCDArch.Testing.Extensions;

namespace Commencement.Tests.Repositories.CeremonyRepositoryTests
{
    partial class CeremonyRepositoryTests
    {
        #region Location Tests
        #region Invalid Tests

        /// <summary>
        /// Tests the Location with null value does not save.
        /// </summary>
        [TestMethod]
        [ExpectedException(typeof(ApplicationException))]
        public void TestLocationWithNullValueDoesNotSave()
        {
            Ceremony ceremony = null;
            try
            {
                #region Arrange
                ceremony = GetValid(9);
                ceremony.Location = null;
                #endregion Arrange

                #region Act
                CeremonyRepository.DbContext.BeginTransaction();
                CeremonyRepository.EnsurePersistent(ceremony);
                CeremonyRepository.DbContext.CommitTransaction();
                #endregion Act
            }
            catch (Exception)
            {
                Assert.IsNotNull(ceremony);
                var results = ceremony.ValidationResults().AsMessageList();
                results.AssertErrorsAre("Location: may not be null or empty");
                Assert.IsTrue(ceremony.IsTransient());
                Assert.IsFalse(ceremony.IsValid());
                throw;
            }
        }

        /// <summary>
        /// Tests the Location with empty string does not save.
        /// </summary>
        [TestMethod]
        [ExpectedException(typeof(ApplicationException))]
        public void TestLocationWithEmptyStringDoesNotSave()
        {
            Ceremony ceremony = null;
            try
            {
                #region Arrange
                ceremony = GetValid(9);
                ceremony.Location = string.Empty;
                #endregion Arrange

                #region Act
                CeremonyRepository.DbContext.BeginTransaction();
                CeremonyRepository.EnsurePersistent(ceremony);
                CeremonyRepository.DbContext.CommitTransaction();
                #endregion Act
            }
            catch (Exception)
            {
                Assert.IsNotNull(ceremony);
                var results = ceremony.ValidationResults().AsMessageList();
                results.AssertErrorsAre("Location: may not be null or empty");
                Assert.IsTrue(ceremony.IsTransient());
                Assert.IsFalse(ceremony.IsValid());
                throw;
            }
        }

        /// <summary>
        /// Tests the Location with spaces only does not save.
        /// </summary>
        [TestMethod]
        [ExpectedException(typeof(ApplicationException))]
        public void TestLocationWithSpacesOnlyDoesNotSave()
        {
            Ceremony ceremony = null;
            try
            {
                #region Arrange
                ceremony = GetValid(9);
                ceremony.Location = " ";
                #endregion Arrange

                #region Act
                CeremonyRepository.DbContext.BeginTransaction();
                CeremonyRepository.EnsurePersistent(ceremony);
                CeremonyRepository.DbContext.CommitTransaction();
                #endregion Act
            }
            catch (Exception)
            {
                Assert.IsNotNull(ceremony);
                var results = ceremony.ValidationResults().AsMessageList();
                results.AssertErrorsAre("Location: may not be null or empty");
                Assert.IsTrue(ceremony.IsTransient());
                Assert.IsFalse(ceremony.IsValid());
                throw;
            }
        }

        /// <summary>
        /// Tests the Location with too long value does not save.
        /// </summary>
        [TestMethod]
        [ExpectedException(typeof(ApplicationException))]
        public void TestLocationWithTooLongValueDoesNotSave()
        {
            Ceremony ceremony = null;
            try
            {
                #region Arrange
                ceremony = GetValid(9);
                ceremony.Location = "x".RepeatTimes((200 + 1));
                #endregion Arrange

                #region Act
                CeremonyRepository.DbContext.BeginTransaction();
                CeremonyRepository.EnsurePersistent(ceremony);
                CeremonyRepository.DbContext.CommitTransaction();
                #endregion Act
            }
            catch (Exception)
            {
                Assert.IsNotNull(ceremony);
                Assert.AreEqual(200 + 1, ceremony.Location.Length);
                var results = ceremony.ValidationResults().AsMessageList();
                results.AssertErrorsAre("Location: length must be between 0 and 200");
                Assert.IsTrue(ceremony.IsTransient());
                Assert.IsFalse(ceremony.IsValid());
                throw;
            }
        }
        #endregion Invalid Tests

        #region Valid Tests

        /// <summary>
        /// Tests the Location with one character saves.
        /// </summary>
        [TestMethod]
        public void TestLocationWithOneCharacterSaves()
        {
            #region Arrange
            var ceremony = GetValid(9);
            ceremony.Location = "x";
            #endregion Arrange

            #region Act
            CeremonyRepository.DbContext.BeginTransaction();
            CeremonyRepository.EnsurePersistent(ceremony);
            CeremonyRepository.DbContext.CommitTransaction();
            #endregion Act

            #region Assert
            Assert.IsFalse(ceremony.IsTransient());
            Assert.IsTrue(ceremony.IsValid());
            #endregion Assert
        }

        /// <summary>
        /// Tests the Location with long value saves.
        /// </summary>
        [TestMethod]
        public void TestLocationWithLongValueSaves()
        {
            #region Arrange
            var ceremony = GetValid(9);
            ceremony.Location = "x".RepeatTimes(200);
            #endregion Arrange

            #region Act
            CeremonyRepository.DbContext.BeginTransaction();
            CeremonyRepository.EnsurePersistent(ceremony);
            CeremonyRepository.DbContext.CommitTransaction();
            #endregion Act

            #region Assert
            Assert.AreEqual(200, ceremony.Location.Length);
            Assert.IsFalse(ceremony.IsTransient());
            Assert.IsTrue(ceremony.IsValid());
            #endregion Assert
        }

        #endregion Valid Tests
        #endregion Location Tests
    }
}


text:
(function(root, factory) {
  'use strict';
  /* jshint unused: false */

  if (typeof define === 'function' && define.amd) {
    define([], function() {
      return factory(root);
    });
  } else if (typeof module !== 'undefined' && module.exports) {
    module.exports = factory.call(root, root, process || undefined);
  } else if (root !== undefined) {
    root.corbel = factory(root);
  }

})(this, function(root, process) {
  'use strict';
  /* jshint unused: false */

  /**
   * corbel namespace
   * @exports corbel
   * @namespace
   */
  var corbel = {};

  //-----------Utils and libraries (exports into corbel namespace)---------------------------

  //  @include ../corbel.js

  //  @include ../utils.js

  //  @include ../validate.js

  //  @include ../object.js

  //  @include ../cryptography.js

  //  @include ../jwt.js

  //  @include ../request.js

  //  @include ../services.js

  //----------corbel modules----------------

  //  @include ../config.js
  //  @include ../iam/iam.js
  //  @include ../iam/clientBuilder.js
  //  @include ../iam/domainBuilder.js
  //  @include ../iam/scopeBuilder.js
  //  @include ../iam/tokenBuilder.js
  //  @include ../iam/usernameBuilder.js
  //  @include ../iam/usersBuilder.js
  //  @include ../iam/groupsBuilder.js
  //  @include ../request-params/aggregation-builder.js
  //  @include ../request-params/query-builder.js
  //  @include ../request-params/page-builder.js
  //  @include ../request-params/sort-builder.js
  //  @include ../request-params/request-params-builder.js
  //  @include ../assets/assets.js
  //  @include ../assets/assets-builder.js
  //  @include ../resources/resources.js
  //  @include ../resources/base-resource.js
  //  @include ../resources/relation.js
  //  @include ../resources/collection.js
  //  @include ../resources/resource.js
  //  @include ../oauth/oauth.js
  //  @include ../oauth/authorizationBuilder.js
  //  @include ../oauth/tokenBuilder.js
  //  @include ../oauth/userBuilder.js
  //  @include ../notifications/notifications.js
  //  @include ../notifications/notificationsBuilder.js
  //  @include ../ec/ec.js
  //  @include ../ec/productBuilder.js
  //  @include ../evci/evci.js
  //  @include ../evci/eventBuilder.js
  //  @include ../borrow/borrow.js
  //  @include ../borrow/borrowBuilder.js
  //  @include ../borrow/userBuilder.js
  //  @include ../borrow/lenderBuilder.js
  //  @include ../composr/composr.js
  //  @include ../composr/phraseBuilder.js
  //  @include ../composr/requestBuilder.js

  return corbel;
});