text:
module Bagr
  module DSL
    module OS

      def architecture
        case linux
        when /ubuntu|debian/
          return `dpkg-architecture -qDEB_BUILD_ARCH`
        else
          err "Not sure how to determine arch for: #{linux}"
        end
      end

      def linux
        @lsb_release_tag ||= `lsb_release --id --release | cut -d: -f2 | tr A-Z a-z | xargs | tr ' ' '/'`
      end

      def gem_bin
        `gem env | sed -n '/^ *- EXECUTABLE DIRECTORY: */ { s/// ; p }'`
      end

    end
  end
end


text:
1. Do not be a jerk for no reason.
2. Be nice to new people
3. If you're going to yell at somebody, make sure you know them well enough beforehand. Ideally don't even yell at all.
4. Don't bring up somebody's personal background, it's almost certainly irrelevant.

redpajama_set_name: RedPajamaGithub


text:
<?php

// autoload.php @generated by Composer

require_once __DIR__ . '/composer/autoload_real.php';

return ComposerAutoloaderInitef0c56582cf6db06044f6a885a0f973d::getLoader();


text:
pub fn check(phrase: &str) -> bool {
    let chars = phrase
        .to_lowercase()
        .chars()
        .filter(|c| c.is_alphabetic())
        .collect::<Vec<_>>();

    let mut unique_chars = chars.clone();
    unique_chars.sort();
    unique_chars.dedup();

    chars.len() == unique_chars.len()
}


text:
package org.openehealth.ipf.modules.cda;

import java.util.Map;

import org.openehealth.ipf.commons.core.modules.api.ValidationException;
import org.openehealth.ipf.commons.core.modules.api.Validator;
import org.openhealthtools.mdht.uml.cda.ClinicalDocument;
import org.openhealthtools.mdht.uml.cda.util.CDAUtil;
import org.openhealthtools.mdht.uml.cda.util.CDAUtil.ValidationHandler;

/**
 * Validates a ClinicalDocuments instance for conformity against CDA and/or CCD
 * schema.
 *
 * @author Stefan Ivanov
 *
 */
public class CDAR2Validator implements Validator<ClinicalDocument, Map<Object, Object>> {

    @Override
    public void validate(ClinicalDocument doc, Map<Object, Object> context) {
        boolean isValid = CDAUtil.validate(doc, retrieveValidationHandler(context));
        if (! isValid) {
            throw new ValidationException("Clinical Document not valid!");
        }
    }

    /**
     * Retrieves validation handler from context. If none found returns a
     * default validation handler.
     *
     * @param context
     * @return
     */
    private ValidationHandler retrieveValidationHandler(Map<Object, Object> context) {
        if (context != null) {
            ValidationHandler handler = (ValidationHandler) context.get(ValidationHandler.class);
            if (handler != null) {
                return handler;
            }
        }
        return new DefaultValidationHandler();
    }

}


text:
module.exports = function() {
  global.expect = global.chai.expect;

  beforeEach(function() {
    this.sandbox = global.sinon.sandbox.create();
    global.stub = this.sandbox.stub.bind(this.sandbox);
    global.spy  = this.sandbox.spy.bind(this.sandbox);
  });

  afterEach(function() {
    delete global.stub;
    delete global.spy;
    this.sandbox.restore();
  });
};


text:
require 'grid'
require 'binary_tree'

grid = Grid.new(20, 20)
BinaryTree.on(grid)
# puts grid
img = grid.to_png
img.save 'binary_tree_maze.png'
`open binary_tree_maze.png`


text:
/* @flow */
import { ThemeProvider } from '../../../../../../library/themes';
import IconHelp from 'mineral-ui-icons/IconHelp';

export default {
  id: 'rtl',
  title: 'Bidirectionality',
  description: `Some icons will be
[automatically mirrored](http://google.github.io/material-design-icons/#which-icons-should-be-mirrored-for-rtl-)
for right-to-left (RTL) languages, depending on context.`,
  scope: { IconHelp, ThemeProvider },
  source: `
    <ThemeProvider theme={{ direction: 'rtl' }}>
      <IconHelp />
    </ThemeProvider>`
};


text:
module KG {

    export interface MarkerDefinition extends ViewObjectDefinition {
        name: string;
        refX: number;
        maskPath: string;
        arrowPath: string;
        url: string;
    }

    export class Marker extends ViewObject {

        private maskPath;
        private arrowPath;
        private arrowElement;

        constructor(def: MarkerDefinition) {
            setProperties(def,'constants',['maskPath','arrowPath']);
            setProperties(def,'updatables',['color']);
            super(def);
        }

        draw(layer) {
            let m = this;
            layer.append("svg:path")
                .attr("d", m.maskPath)
                .attr("fill", "white");

            m.arrowElement = layer.append("svg:path")
                .attr("d", m.arrowPath);
            return m;

        }

        redraw() {
            let m = this;
            m.arrowElement.attr("fill", m.color);
            return m;
        }

    }
}


text:
define(['reqwest', 'routes'], function (reqwest, routes) {
  'use strict';

  return {
    getAll: getAll,
    create: create,
    update: update
  };

  function getAll() {
    return reqwest({ url: routes.buildpacksPath(), method: 'get' });
  }

  function create(data) {
    var params = { url: routes.buildpacksPath(), data: data, method: 'post' };
    return reqwest(params);
  }

  function update(id, data) {
    data = data || {};
    var buildpackPath = routes.buildpackPath({ id: id });
    return reqwest({ url: buildpackPath, method: 'put', data: data });
  }
});


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

        <META http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <TITLE>
            Uses of Class org.encog.neural.neat.training.NEATLinkGene (Encog Core 3.2.0-SNAPSHOT API)
        </TITLE>

        <META NAME="date" CONTENT="2013-04-17">

        <LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../../../stylesheet.css" TITLE="Style">

                            Overview
                            Package
                            Class
                          Use
                            Tree
                            Deprecated
                            Index
                            Help

                     PREV
                     NEXT

                    FRAMES
                     NO FRAMES

                        All Classes

            Uses of Class
org.encog.neural.neat.training.NEATLinkGene

                    Packages that use NEATLinkGene

            org.encog.neural.hyperneat

            org.encog.neural.neat

            org.encog.neural.neat.training

            org.encog.neural.neat.training.opp.links

                    Uses of NEATLinkGene in org.encog.neural.hyperneat

            Method parameters in org.encog.neural.hyperneat with type arguments of type NEATLinkGene

                     NEATGenome
            FactorHyperNEATGenome.factor(List<NEATNeuronGene> neurons,
                    List<NEATLinkGene> links,
                    int inputCount,
                    int outputCount)

            Constructor parameters in org.encog.neural.hyperneat with type arguments of type NEATLinkGene

            HyperNEATGenome(List<NEATNeuronGene> neurons,
                    List<NEATLinkGene> links,
                    int inputCount,
                    int outputCount)

                    Uses of NEATLinkGene in org.encog.neural.neat

            Method parameters in org.encog.neural.neat with type arguments of type NEATLinkGene

                     NEATGenome
            FactorNEATGenome.factor(List<NEATNeuronGene> neurons,
                    List<NEATLinkGene> links,
                    int inputCount,
                    int outputCount)

                          Create a NEAT genome from a list of links and neurons.

                     NEATGenome
            NEATGenomeFactory.factor(List<NEATNeuronGene> neurons,
                    List<NEATLinkGene> links,
                    int inputCount,
                    int outputCount)

                          Create a NEAT genome from a list of links and neurons.

                    Uses of NEATLinkGene in org.encog.neural.neat.training

            Methods in org.encog.neural.neat.training that return types with arguments of type NEATLinkGene

                     List<NEATLinkGene>
            NEATGenome.getLinksChromosome()

            Methods in org.encog.neural.neat.training with parameters of type NEATLinkGene

                     void
            NEATLinkGene.copy(NEATLinkGene gene)

                          Copy from another gene.

            Constructors in org.encog.neural.neat.training with parameters of type NEATLinkGene

            NEATLinkGene(NEATLinkGene other)

            Constructor parameters in org.encog.neural.neat.training with type arguments of type NEATLinkGene

            NEATGenome(List<NEATNeuronGene> neurons,
                    List<NEATLinkGene> links,
                    int inputCount,
                    int outputCount)

                          Create a NEAT gnome.

                    Uses of NEATLinkGene in org.encog.neural.neat.training.opp.links

            Methods in org.encog.neural.neat.training.opp.links that return types with arguments of type NEATLinkGene

                     List<NEATLinkGene>
            SelectFixed.selectLinks(Random rnd,
                    NEATGenome genome)

                          Select links from the specified genome.

                     List<NEATLinkGene>
            SelectProportion.selectLinks(Random rnd,
                    NEATGenome genome)

                          Select links from the specified genome.

                     List<NEATLinkGene>
            SelectLinks.selectLinks(Random rnd,
                    NEATGenome genome)

                          Select links from the specified genome.

            Methods in org.encog.neural.neat.training.opp.links with parameters of type NEATLinkGene

                     void
            MutateLinkWeight.mutateWeight(Random rnd,
                    NEATLinkGene linkGene,
                    double weightRange)

                          Perform the weight mutation on the specified link.

                     void
            MutatePerturbLinkWeight.mutateWeight(Random rnd,
                    NEATLinkGene linkGene,
                    double weightRange)

                          Perform the weight mutation on the specified link.

                     void
            MutateResetLinkWeight.mutateWeight(Random rnd,
                    NEATLinkGene linkGene,
                    double weightRange)

                          Perform the weight mutation on the specified link.

                            Overview
                            Package
                            Class
                          Use
                            Tree
                            Deprecated
                            Index
                            Help

                     PREV
                     NEXT

                    FRAMES
                     NO FRAMES

                        All Classes

    Copyright © 2013. All Rights Reserved.


text:
class Baseballbot
  module Sidebars
    SUBREDDITS_WITH_SIDEBARS_QUERY = <<~SQL
      SELECT name
      FROM subreddits
      WHERE options['sidebar']['enabled']::boolean IS TRUE
      ORDER BY id ASC
    SQL

    def update_sidebars!(names: [])
      names = names.map(&:downcase)

      db.exec(SUBREDDITS_WITH_SIDEBARS_QUERY).each do |row|
        next unless names.empty? || names.include?(row['name'].downcase)

        update_sidebar! name_to_subreddit(subreddits[row['name']])
      end
    end

    def update_sidebar!(subreddit)
      Honeybadger.context(subreddit: subreddit.name)

      subreddit.modify_settings description: generate_sidebar(subreddit)
    end

    def show_sidebar(name) = generate_sidebar(name_to_subreddit(name))

    protected

    def generate_sidebar(subreddit)
      raise Baseballbot::Error::NoSidebarText unless sidebar_present?(subreddit)

      Template::Sidebar
        .new(body: subreddit.template_for('sidebar'), subreddit:)
        .replace_in CGI.unescapeHTML(subreddit.settings[:description])
    end

    def sidebar_present?(subreddit) = subreddit.settings[:description] && !subreddit.settings[:description].strip.empty?
  end
end


text:
using System;
using System.Collections.Generic;
using Keen.NET_35.DataEnrichment;
using NUnit.Framework;

namespace Keen.NET_35.Test
{
    [TestFixture]
    public class AddOnsTest : TestBase
    {
        [Test]
        public void IpToGeo_Send_Success()
        {
            var client = new KeenClient(SettingsEnv);
            if (UseMocks)
                client.EventCollection = new EventCollectionMock(SettingsEnv,
                    addEvent: (c, e, p) =>
                    {
                        if (!e["keen"].ToString().Contains("keen:ip_to_geo"))
                            throw new Exception("Unexpected values");
                    });

            var a = AddOn.IpToGeo("an_ip", "geocode");

            Assert.DoesNotThrow(() => client.AddEvent("AddOnTest", new {an_ip = "70.187.8.97"}, new List<AddOn> {a}));
        }

        [Test]
        public void IpToGeo_MissingInput_Throws()
        {
            var client = new KeenClient(SettingsEnv);
            if (UseMocks)
                client.EventCollection = new EventCollectionMock(SettingsEnv,
                    addEvent: (c, e, p) =>
                    {
                        if (!e["keen"].ToString().Contains("\"ip\": \"an_ip\""))
                            throw new KeenException("Unexpected values");
                    });

            var a = AddOn.IpToGeo("wrong_field", "geocode");

            Assert.Throws<KeenException>(
                () => client.AddEvent("AddOnTest", new {an_ip = "70.187.8.97"}, new List<AddOn> {a}));
        }

        [Test]
        public void UserAgentParser_Send_Success()
        {
            var client = new KeenClient(SettingsEnv);
            if (UseMocks)
                client.EventCollection = new EventCollectionMock(SettingsEnv,
                    addEvent: (c, e, p) =>
                    {
                        if (!e["keen"].ToString().Contains("keen:ua_parser"))
                            throw new Exception("Unexpected values");
                    });

            var a = AddOn.UserAgentParser("user_agent_string", "user_agent_parsed");

            Assert.DoesNotThrow(
                () =>
                    client.AddEvent("AddOnTest",
                        new
                        {
                            user_agent_string =
                                "Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2228.0 Safari/537.36"
                        }, new List<AddOn> {a}));
        }

        [Test]
        public void UrlParser_Send_Success()
        {
            var client = new KeenClient(SettingsEnv);
            if (UseMocks)
                client.EventCollection = new EventCollectionMock(SettingsEnv,
                    addEvent: (c, e, p) =>
                    {
                        if (!e["keen"].ToString().Contains("keen:url_parser"))
                            throw new Exception("Unexpected values");
                    });

            var a = AddOn.UrlParser("url", "url_parsed");

            Assert.DoesNotThrow(
                () =>
                    client.AddEvent("AddOnTest",
                        new {url = "https://keen.io/docs/data-collection/data-enrichment/#anchor"}, new List<AddOn> {a}));
        }

        [Test]
        public void ReferrerParser_Send_Success()
        {
            var client = new KeenClient(SettingsEnv);
            if (UseMocks)
                client.EventCollection = new EventCollectionMock(SettingsEnv,
                    addEvent: (c, e, p) =>
                    {
                        if (!e["keen"].ToString().Contains("keen:referrer_parser"))
                            throw new Exception("Unexpected values");
                    });

            var a = AddOn.ReferrerParser("referrer", "page", "referrer_parsed");

            Assert.DoesNotThrow(() => client.AddEvent("AddOnTest", new {page = "", referrer = ""}, new List<AddOn> {a}));
        }

    }
}


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Uses of Class io.ebean.config.EncryptDeploy.Mode (ebean 11.35.3 API)</title>
<meta name="date" content="2019-03-05">
<link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Skip navigation links

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev

Next

Frames

No Frames

All Classes

Uses of Class
io.ebean.config.EncryptDeploy.Mode

Packages that use EncryptDeploy.Mode

Package
Description

io.ebean.config

Configuration settings for EbeanServer construction

Uses of EncryptDeploy.Mode in io.ebean.config

Methods in io.ebean.config that return EncryptDeploy.Mode

Modifier and Type
Method and Description

EncryptDeploy.Mode
EncryptDeploy.getMode()

Return the encryption mode.

static EncryptDeploy.Mode
EncryptDeploy.Mode.valueOf(String name)

Returns the enum constant of this type with the specified name.

static EncryptDeploy.Mode[]
EncryptDeploy.Mode.values()

Returns an array containing the constants of this enum type, in
the order they are declared.

Constructors in io.ebean.config with parameters of type EncryptDeploy.Mode

Constructor and Description

EncryptDeploy(EncryptDeploy.Mode mode,
             boolean dbEncrypt,
             int dbLength)

Construct with all options for Encryption including the dbLength.

Skip navigation links

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev

Next

Frames

No Frames

All Classes

Copyright © 2019. All rights reserved.


text:
package org.xbib.elasticsearch.action.river.jdbc.execute;

import org.elasticsearch.action.support.nodes.NodesOperationResponse;
import org.elasticsearch.common.io.stream.StreamInput;
import org.elasticsearch.common.io.stream.StreamOutput;
import org.elasticsearch.common.xcontent.ToXContent;
import org.elasticsearch.common.xcontent.XContentBuilder;

import java.io.IOException;

public class RiverExecuteResponse extends NodesOperationResponse implements ToXContent {

    private boolean[] executed;

    public RiverExecuteResponse() {
    }

    public RiverExecuteResponse setExecuted(boolean[] b) {
        this.executed = b;
        return this;
    }

    public boolean[] isExecuted() {
        return executed;
    }

    @Override
    public XContentBuilder toXContent(XContentBuilder builder, Params params) throws IOException {
        builder.field("executed", executed);
        return builder;
    }

    @Override
    public void readFrom(StreamInput in) throws IOException {
        super.readFrom(in);
        int len = in.readInt();
        executed = new boolean[len];
        for (int i = 0; i < len; i++) {
            executed[i] = in.readBoolean();
        }
    }

    @Override
    public void writeTo(StreamOutput out) throws IOException {
        super.writeTo(out);
        out.writeInt(executed.length);
        for (boolean b : executed) {
            out.writeBoolean(b);
        }
    }

}


text:
package jp.ac.shibaura_it.se.tslab.aaextractor.predicate.rrvwls;

import jp.ac.shibaura_it.se.tslab.aaextractor.Window;
import jp.ac.shibaura_it.se.tslab.aaextractor.predicate.attributes.AttributeL;
import jp.ac.shibaura_it.se.tslab.aaextractor.predicate.attributes.AttributeR;
import jp.ac.shibaura_it.se.tslab.aaextractor.predicate.attributes.AttributeRvw;
import jp.ac.shibaura_it.se.tslab.aaextractor.predicate.attributes.AttributeS;

public class RRvwLSAttributesFactory {
	private AttributeR attributeR;
	private AttributeL attributeL;
	private AttributeS attributeS;
	private AttributeRvw attributeRvw;

	public RRvwLSAttributesFactory() {
		this.attributeR = new AttributeR();
		this.attributeL = new AttributeL();
		this.attributeS = new AttributeS();
		this.attributeRvw = new AttributeRvw();
	}
	public RRvwLSAttributes create(Window w) {
		RRvwLSAttributes attributes = new RRvwLSAttributes();
		attributes.setR((double)this.attributeR.getAttribute(w));
		attributes.setL((int)this.attributeL.getAttribute(w));
		attributes.setS((int)this.attributeS.getAttribute(w));
		attributes.setRvw((double)this.attributeRvw.getAttribute(w));
		return attributes;
	}

}


text:
#ifndef _SHA512_ALT_H_
#define _SHA512_ALT_H_

#if defined(MBEDTLS_SHA512_ALT)

#include "hal/sha_types.h"
#include "soc/soc_caps.h"

#ifdef __cplusplus
extern "C" {
#endif

#if SOC_SHA_SUPPORT_PARALLEL_ENG

typedef enum {
    ESP_MBEDTLS_SHA512_UNUSED, /* first block hasn't been processed yet */
    ESP_MBEDTLS_SHA512_HARDWARE, /* using hardware SHA engine */
    ESP_MBEDTLS_SHA512_SOFTWARE, /* using software SHA */
} esp_mbedtls_sha512_mode;

/**
 * \brief          SHA-512 context structure
 */
typedef struct {
    uint64_t total[2];          /*!< number of bytes processed  */
    uint64_t state[8];          /*!< intermediate digest state  */
    unsigned char buffer[128];  /*!< data block being processed */
    int is384;                  /*!< 0 => SHA-512, else SHA-384 */
    esp_mbedtls_sha512_mode mode;
} mbedtls_sha512_context;

#elif SOC_SHA_SUPPORT_DMA || SOC_SHA_SUPPORT_RESUME

typedef enum {
    ESP_SHA512_STATE_INIT,
    ESP_SHA512_STATE_IN_PROCESS
} esp_sha512_state;

/**
 * \brief          SHA-512 context structure
 */
typedef struct {
    uint64_t total[2];          /*!< number of bytes processed  */
    uint64_t state[8];          /*!< intermediate digest state  */
    unsigned char buffer[128];  /*!< data block being processed */
    int first_block;
    esp_sha_type mode;
    uint32_t t_val;             /*!< t_val for 512/t mode */
    esp_sha512_state sha_state;
} mbedtls_sha512_context;

/**
 * @brief Sets the specfic algorithm for SHA512
 *
 * @param ctx The mbedtls sha512 context
 *
 * @param type The mode, used for setting SHA2_512224 and SHA2_512256:
 *
 */
void esp_sha512_set_mode(mbedtls_sha512_context *ctx, esp_sha_type type);

/* For SHA512/t mode the intial hash value will depend on t */
void esp_sha512_set_t( mbedtls_sha512_context *ctx, uint16_t t_val);

#endif

#endif

#ifdef __cplusplus
}
#endif

#endif


text:
package org.apache.activemq;

import org.apache.activemq.test.JmsResourceProvider;

/**
 *
 */
public class JmsTopicTransactionTest extends JmsTransactionTestSupport {

   /**
    * @see org.apache.activemq.JmsTransactionTestSupport#getJmsResourceProvider()
    */
   protected JmsResourceProvider getJmsResourceProvider() {
      JmsResourceProvider p = new JmsResourceProvider();
      p.setTopic(true);
      p.setDurableName("testsub");
      p.setClientID("testclient");
      return p;
   }

}


text:
# This is your project's main settings file that can be committed to your
# repo. If you need to override a setting locally, use settings_local.py

from funfactory.settings_base import *

# Name of the top-level module where you put all your apps.
# If you did not install Playdoh with the funfactory installer script
# you may need to edit this value. See the docs about installing from a
# clone.
PROJECT_MODULE = 'rockit'

# Bundles is a dictionary of two dictionaries, css and js, which list css files
# and js files that can be bundled together by the minify app.
MINIFY_BUNDLES = {
    'css': {
        'example_css': (
            'css/examples/main.css',
        ),
        'example_mobile_css': (
            'css/examples/mobile.css',
        ),
    },
    'js': {
        'example_js': (
            'js/examples/libs/jquery-1.4.4.min.js',
            'js/examples/libs/jquery.cookie.js',
            'js/examples/init.js',
        ),
    }
}

# Defines the views served for root URLs.
ROOT_URLCONF = '%s.urls' % PROJECT_MODULE

INSTALLED_APPS = list(INSTALLED_APPS) + [
    # Application base, containing global templates.
    '%s.base' % PROJECT_MODULE,
    'rockit.sync',
    'rockit.music',
    'django.contrib.admin',
]

MIDDLEWARE_CLASSES = list(MIDDLEWARE_CLASSES) + [
    'rockit.base.middleware.LogExceptionsMiddleware'
]

# Because Jinja2 is the default template loader, add any non-Jinja templated
# apps here:
JINGO_EXCLUDE_APPS = [
    'admin',
    'registration',
]

# Tells the extract script what files to look for L10n in and what function
# handles the extraction. The Tower library expects this.
DOMAIN_METHODS['messages'] = [
    ('%s/**.py' % PROJECT_MODULE,
        'tower.management.commands.extract.extract_tower_python'),
    ('%s/**/templates/**.html' % PROJECT_MODULE,
        'tower.management.commands.extract.extract_tower_template'),
    ('templates/**.html',
        'tower.management.commands.extract.extract_tower_template'),
],

# # Use this if you have localizable HTML files:
# DOMAIN_METHODS['lhtml'] = [
#    ('**/templates/**.lhtml',
#        'tower.management.commands.extract.extract_tower_template'),
# ]

# # Use this if you have localizable JS files:
# DOMAIN_METHODS['javascript'] = [
#    # Make sure that this won't pull in strings from external libraries you
#    # may use.
#    ('media/js/**.js', 'javascript'),
# ]

# Paths that don't require a locale code in the URL.
SUPPORTED_NONLOCALES = [
    'media',
    'admin',
    'music',
    'sync',
]

# Time limit in seconds for background tasks.
CELERYD_TASK_SOFT_TIME_LIMIT = 60 * 5

# Used for JWT signature verification.
SITE_URL = 'http://localhost:8000'

# Client / access_key for signed JWT API requests.
# Each client in this list will be authorized to interact with the service.
API_CLIENTS = {'client1': '<secret key>'}

LOGGING = {'loggers': {'playdoh': {'level': logging.INFO,
                                   'handlers': ['console']},
                       'rockit': {'level': logging.DEBUG,
                                  'handlers': ['console']}}}

UPLOAD_TEMP_DIR = os.path.join(ROOT, 'tmp')

S3_ACCESS_ID = '<set in local>'
S3_SECRET_KEY = '<set in local>'
S3_BUCKET = 'rockitscratch'

LAST_FM_KEY = '<set in local>'


text:
import React from 'react';
import PropTypes from 'prop-types';
import Icon from "../icon";
import Button from "../buttons/button";
import history from '../../globals/history';
import './not-found-styles.css';

const NotFound = ({page, redirect, below_topbar}) => {
  document.title = "Something's not quite right";

  const pluralize = () =>{
    if(redirect) {
      let last_letter = redirect.substr(-1);

      if ("hhxz".indexOf(last_letter) !== -1) return `${redirect}es`;
      else if("s".indexOf(last_letter !== -1)) return redirect;
      else return `${redirect}s`;
    }
    return "home";
  };

  const handleRedirectClick = () => redirect ? history.push(`/${redirect}`) : history.push('/');

  return (
      <div className={`not-found ${below_topbar === true ? "below-topbar" : ""}`}>

            <Icon type="mana" name="4" />
            <Icon name="hs-logo" />
            <Icon type="mana" name="4" />

Sorry, the {page} page you are looking for doesn't exist.

Take a run around the block or tap the button below.

            <Button text={`Go to the ${pluralize()} page`} type="default--active" handleClick={handleRedirectClick}/>

  );
};

export default NotFound;

NotFound.propTypes = {
  page: PropTypes.string.isRequired,
  redirect: PropTypes.string,
  below_topbar: PropTypes.bool
};


text:
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Short Sectioned Assignment
% LaTeX Template
% Version 1.0 (5/5/12)
%
% This template has been downloaded from:
% http://www.LaTeXTemplates.com
%
% Original author:
% Frits Wenneker (http://www.howtotex.com)
%
% License:
% CC BY-NC-SA 3.0 (http://creativecommons.org/licenses/by-nc-sa/3.0/)
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%----------------------------------------------------------------------------------------
%	PACKAGES AND OTHER DOCUMENT CONFIGURATIONS
%----------------------------------------------------------------------------------------

\documentclass[paper=a4, fontsize=11pt]{scrartcl} % A4 paper and 11pt font size

\usepackage[T1]{fontenc} % Use 8-bit encoding that has 256 glyphs
\usepackage{fourier} % Use the Adobe Utopia font for the document - comment this line to return to the LaTeX default
\usepackage[english]{babel} % English language/hyphenation
\usepackage{amsmath,amsfonts,amsthm} % Math packages

\usepackage{lipsum} % Used for inserting dummy 'Lorem ipsum' text into the template

\usepackage{sectsty} % Allows customizing section commands
\allsectionsfont{\centering \normalfont\scshape} % Make all sections centered, the default font and small caps

\usepackage{fancyhdr} % Custom headers and footers
\pagestyle{fancyplain} % Makes all pages in the document conform to the custom headers and footers
\fancyhead{} % No page header - if you want one, create it in the same way as the footers below
\fancyfoot[L]{} % Empty left footer
\fancyfoot[C]{} % Empty center footer
\fancyfoot[R]{\thepage} % Page numbering for right footer
\renewcommand{\headrulewidth}{0pt} % Remove header underlines
\renewcommand{\footrulewidth}{0pt} % Remove footer underlines
\setlength{\headheight}{13.6pt} % Customize the height of the header

\numberwithin{equation}{section} % Number equations within sections (i.e. 1.1, 1.2, 2.1, 2.2 instead of 1, 2, 3, 4)
\numberwithin{figure}{section} % Number figures within sections (i.e. 1.1, 1.2, 2.1, 2.2 instead of 1, 2, 3, 4)
\numberwithin{table}{section} % Number tables within sections (i.e. 1.1, 1.2, 2.1, 2.2 instead of 1, 2, 3, 4)

\setlength\parindent{0pt} % Removes all indentation from paragraphs - comment this line for an assignment with lots of text

%----------------------------------------------------------------------------------------
%	TITLE SECTION
%----------------------------------------------------------------------------------------

\newcommand{\horrule}[1]{\rule{\linewidth}{#1}} % Create horizontal rule command with 1 argument of height

\title{
\normalfont \normalsize
\textsc{International Institute of Information Technology, Bangalore} \\ [25pt] % Your university, school and/or department name(s)
\horrule{0.5pt} \\[0.4cm] % Thin top horizontal rule
\huge Self Healing Water Networks \\ % The assignment title
\horrule{2pt} \\[0.5cm] % Thick bottom horizontal rule
}

\author{Kumudini Kakwani
\and Arjun S Bharadwaj
\and Abhijith Madhav}

\date{\normalsize\today} % Today's date or a custom date

\begin{document}

\maketitle % Print the title

%----------------------------------------------------------------------------------------
%	PROBLEM 1
%----------------------------------------------------------------------------------------

\section{Problem Statement}

In the communications world, Self-healing networks are those that are architected in a manner that they can withstand a failure in their transmission paths.

Can we apply those concepts to the ``water networks''?

You are to design an app that helps in this ``self-healing'' process by collating real-time data from sensors monitoring water flow and water quality to provide analysis of water resources and usage in an area, along with support for decisions on managing water sources.

%------------------------------------------------

\section{Proposal}
\begin{itemize}
\item Collect data on purity of water.
\item Do time vs purity, water pressure vs time analysis.
\item Analyse water consumption trends with time of the day.
\item Collect data when water is got through tankers. Analyse it.
\item Analyse usage trends across buildings (Academic, hostels, cafeteria) at various granularity levels. Activities include watering plants, cleaning utensils, washrooms and toilets, refilling lake, cleaning, cooking, drinking.
\item Analyse whether using recycled water for gardening etc. will solve the water issue.
\item Controlling of actuators through authorized mobile devices.
\item Notifications to the concerned operational personnel regarding events like
\begin{itemize}
\item Abnormal chemical levels in water.
\item Change in water table level.
\item Regarding running taps and leakages.
\end{itemize}
\end{itemize}
%----------------------------------------------------------------------------------------

\subsection{Analytics}
Followint reports will be generated.
\begin{itemize}
\item Get the data of number of students in campus and plot the water consumption vs no of students in campus.
\item Analyse the peaks and troughs in the usage of water.
\item Get weather data from data.gov.in or Google and compare it with water usage in the campus.
\item Get data of how long the motor is kept on. Get the electricity usage of the motors. Analyse usage of electricity with hardness of water.
\item Analyse monthly water bill.
\end{itemize}

%------------------------------------------------

\section{Identified Problems}
\begin{itemize}
\item Lack of clarity on number and location of sensors.
\item Integration points are not clear.
\item Scope and requirements are unclear.
\end{itemize}

\end{document}


text:
author: takeonrules
comments: true
date: 2011-03-28 08:30:07
layout: post
slug: diaspora-military-campaign
title: Diaspora military campaign
wordpress_id: 117
categories:
- Role-Playing Game
tags:
- burning empires
- burning wheel
- diaspora
---
Diaspora accounts for four primary conflicts:

Personal physical combat

Spaceship-level combat

Platoon-level combat

Social combat

Having yet to run a game, I would wager that each conflict works best with between a couple and a dozen or so participants.  Star Wars, Star Trek, and Star Frontiers: Knighthawks were each influences in my formative years. As such, I have a soft-spot, as I'm sure many of the people my age, for a good space battle.

Having played quite a bit of Axis and Allies and other large scale military games, I also find myself interested in the potential for larger military campaigns, ones with large space battles, fleet deployment, strategic maneuvering, and propaganda.

In some ways, I'm musing about how to incorporate and/or use the amazing work Luke Crane did in Burning Empires; He implemented a very important concept of "scene economy" and adapted his Burning Wheel's Duel of Wits conflict mechanism to address different stages of an insidious invasion.

In looking towards a macro-level conflict sub-system, I believe it needs to address, at a minimum, the following:

Information

Influence

Expiration

**Information:** The players need to know the current state of the conflict; In an abstract way they need to know how many hit points each side has left and should probably have a sense at which side has the momentum.

**Influence:** The characters need to have influence over the conflict; The actions they take at the micro-level should bubble up to the macro-conflict.

**Expiration:** The characters should not have enough time to methodically address everything. No single person, or even small set of people, can possibly always be the "critical path" of a macro-level conflict. Decisions and actions will be made outside the scope of the characters influence.

In the case of Diaspora, modeling the larger conflict would clearly be done with the existing sub-systems, and likely with another sub-system for measuring the macro-conflict. Or, would it make sense to create a handful of social conflicts  that are happening concurrently?  Then again, I want to see spaceships shooting it out. Blockades being run. Ground troops working at securing a critical resource.

So, what is the next step?  I think it is time to re-read my copy of Burning Empires and figure out some next steps.


text:
PSR Wrapper
===========

BabelCache does not follow the PSR proposal. It skips the ``Item`` objects and
has all methods on the services rather than on the items. We believe the way to
encapsulate cache data in objects is a needless overhead.

However, to use BabelCache in a PSR world, you can optionally wrap BabelCache
to make it PSR compliant. For this, the implementations in ``wv\BabelCache\Psr``
are used.

.. sourcecode:: php

   <?php

   $factory = new wv\BabelCache\SimpleFactory();
   $pool    = $factory->getPsrPool('apc');  // returns a Psr\Generic\Pool instance wrapping the APC adapter

   $pool->getItem('mykey')->set('value');

   $item = $pool->getItem('mykey'); // returns an Item
   print $item->get();

.. note::

  The PSR proposal is still just a proposal, so there are no official
  interfaces yet. Until those are available, you have to provide them yourself,
  as BabelCache only contains their implementations.


text:
<?php defined('PHPFOX') or exit('NO DICE!'); ?>
<?php $aContent = array (
  'menu_core_friends' => 'Friends',
  'menu_top_friends' => 'Top Friends',
  'menu_online_friends' => 'Online Friends',
  'create_new_list' => 'Create New List...',
  'edit_lists' => 'Edit Lists',
  'view_list' => 'View List',
  'user_setting_can_add_friends' => 'Can add friends?',
  'user_setting_can_add_folders' => 'Can add custom folders?',
  'setting_total_requests_display' => '<title>Friend Requests Display Total</title><info>How many friend requests should be displayed when a user accepts requests?</info>',
  'menu_all_friends' => 'All Friends',
  'menu_pending_requests' => 'Pending Requests',
  'menu_friend_friends' => 'Friends',
  'setting_friend_display_limit' => '<title>Friends Display Limit</title><info>Define how many friends should be displayed on a users profile and dashboard.</info>',
  'setting_friend_user_feed_display_limit' => '<title>Total Friends Display (User Selection)</title><info>Define how many friends a user can select to be displayed on their dashboard or profile.</info>',
  'user_setting_can_remove_friends_from_profile' => 'Can remove friends block from their profile?',
  'user_setting_can_remove_friends_from_dashboard' => 'Can remove their friends block from their dashboard?',
  'setting_enable_birthday_notices' => '<title>Enable Birthday Notices</title><info>When enabled users will see a list of their friends upcoming birthdays.</info>',
  'setting_days_to_check_for_birthday' => '<title>How many days in advance to check for birthdays</title><info>This setting tells how many days in advance should the script check for.

Setting it to a number too high may beat the purpose of the feature.

The results from this feature cannot be cached, so it is prone to becoming a slow down for your site.

Keep in mind that you can disable this feature altogether in the setting friend.enable_birthday_notices</info>',
  'setting_birthdays_cache_time_out' => '<title>Birthdays Cache Time Out</title><info>Showing your friend\'s birthdays in the dashboard has a cost in database calls, therefore we cache it to save time and avoid extra calls.

This setting tells how often should the cache be refreshed, its set in hours so if you set it to 5 it means that every 5 hours the list of friends whose birthday is coming soon will be refreshed. This is helpful for new sign ups whose birthday is within 1 day.

This setting complements days_to_check_for_birthday and is useless if enable_birthday_notices is disabled.</info>',
  'setting_show_empty_birthdays' => '<title>Show Empty Birthdays</title><info>When enabled the site will show the block in the dashboard regardless if the user has friends whose birthday is coming or not.

Disabling it does not mean a performance optimization since the contents are already cached.</info>',
  'menu_birthday_e_cards' => 'Birthday E-Cards',
  'setting_friend_meta_keywords' => '<title>Friends Meta Keywords</title><info>Meta keywords used when in relation to the Friend module.</info>',
  'your_message_has_been_sent' => 'Your message has been sent.',
  'friend_request_successfully_sent' => 'Friend request successfully sent.',
  'you_have_reached_your_limit' => 'You have reached your limit.',
  'done' => 'Done!',
  'top_friends' => 'Top Friends',
  'remove_from_your_top_friends_list' => 'Remove from your Top Friends List',
  'add_to_your_top_friends_list' => 'Add to your Top Friends List',
  'friends_successfully_moved' => 'Friends successfully moved.',
  'friend_successfully_removed' => 'Friend successfully removed.',
  'friend_lists' => 'Friend Lists',
  'view_all' => 'View All',
  'friends' => 'Friends',
  'birthdays' => 'Birthdays',
  'my_friends' => 'My Friends',
  'change_my_top_friends' => 'Change my "Top Friends"',
  'search_friends' => 'Search Friends',
  'invalid_friend_list' => 'Invalid friend list.',
  'successfully_deleted' => 'Successfully deleted.',
  'birthday_e_cards' => 'Birthday E-Cards',
  'friends_request_successfully_deleted' => 'Friends request successfully deleted.',
  'pending_friend_requests' => 'Pending Friend Requests',
  'user_link_has_closed_their_friends_section' => '{user_link} has closed their friends section.',
  'full_name_s_friends' => '{full_name}\'s friends',
  'full_name_is_on_site_title_and_has_total_friends' => '{full_name} is on {site_title} and has {total} friends.',
  'full_name_is_connected_with_friends' => '{full_name} is connected with {friends}.',
  'sign_up_on_site_title_and_connect_with_full_name_message_full_name_or_add_full_name_as_you' => 'Sign up on {site_title} and connect with {full_name}, message {full_name}, or add {full_name} as your friend.',
  'not_a_valid_user_to_be_friends_with' => 'Not a valid user to be friends with.',
  'you_are_already_friends_with_this_user' => 'You are already friends with this user.',
  'friends_request' => 'Friends Request',
  'full_name_added_you_as_a_friend_on_site_title' => '{full_name} added you as a friend on {site_title}.',
  'full_name_added_you_as_a_friend_on_site_title_to_confirm_this_friend_request' => '{full_name} added you as a friend on {site_title}.

To confirm this friend request, follow the link below:
{link}',
  'no_friends_requests' => 'No friends requests.',
  'friend_requests_total' => 'Friend Requests ({total})',
  'viewer_image_you_and_owner_image_a_href_user_link_full_name_a_are_now_friends' => '{viewer_image}You and {owner_image}{full_name} are now friends.',
  'owner_image_you_and_viewer_image_a_href_friend_link_friend_a_are_now_friends' => '{owner_image}You and {viewer_image}{friend} are now friends.',
  'owner_image_a_href_user_link_full_name_a_and_viewer_image' => '{owner_image}{full_name} and {viewer_image}{friend} are now friends.',
  'owner_image_a_href_user_link_full_name_a_and_viewer_image_friends' => '{owner_image}{full_name} and {viewer_image}{friend} are now friends.',
  'new_friend' => 'New Friend',
  'friend_request' => 'Friend Request',
  'user_link_wished_you_a_happy_birthday' => '{user_link} wished you a happy birthday.',
  'view_friends' => 'View Friends',
  'user_link_asked_to_be_your_friend' => '{user_link} asked to be your friend.',
  'full_name_confirmed_you_as_a_friend_on_site_title' => '{full_name} confirmed you as a friend on {site_title}.',
  'full_name_confirmed_you_as_a_friend_on_site_title_to_view_their_profile' => '{full_name} confirmed you as a friend on {site_title}.

To view their profile, follow the link below:
{link}',
  'full_name_wishes_you_a_happy_birthday_on_site_title' => '{full_name} wishes you a happy birthday on {site_title}.',
  'full_name_wrote_to_congratulate_you_on_your_birthday_on_site_title' => '{full_name} wrote to congratulate you on your birthday on {site_title}.

To view this message, follow the link below:
{link}',
  'adding_new_list' => 'Adding New List',
  'updating' => 'Updating',
  'delete' => 'Delete',
  'update' => 'Update',
  'cancel' => 'Cancel',
  'add' => 'Add',
  'total_friend' => '{total} friend',
  'total_friends' => '{total} friends',
  'friend_requests' => 'Friend Requests',
  'you_are_now_friends_with_user_link' => 'You are now friends with {user_link}.',
  'add_to_a_friend_list' => 'Add to a friend list...',
  'lists' => 'Lists...',
  'create_a_new_list' => 'Create a New List...',
  'create' => 'Create',
  'show_all_lists' => 'Show all lists...',
  'user_link_wrote' => '{user_link} wrote',
  'accept' => 'Accept',
  'deny' => 'Deny',
  'no_birthdays_coming_up' => 'No birthdays coming up.',
  'birthday_e_card' => 'Birthday E-Card',
  'send_a_birthday_e_card_to_full_name' => 'Send a Birthday E-Card to {full_name}.',
  'send_full_name_a_message' => 'Send {full_name} a message.',
  '1_day' => '1 Day',
  'today' => 'Today!',
  'days_left_days' => '{days_left} days',
  'message_optional' => 'Message (Optional)',
  'send_e_card' => 'Send E-Card',
  'view_friends_online' => 'View Friends Online',
  'edit_top_friends' => 'Edit Top Friends',
  'find_friends_by_name_or_email' => 'Find friends by name or email.',
  'you_have_not_added_any_friends_yet' => 'You have not added any friends yet.',
  'search_for_friends' => 'Search For Friends',
  'browse_members' => 'Browse Members',
  'you_have_already_asked_full_name_to_be_your_friend' => 'You have already asked {full_name} to be your friend.',
  'full_name_has_already_asked_to_be_your_friend' => '{full_name} has already asked to be your friend.',
  'would_you_like_to_accept_their_request_to_be_friends' => 'Would you like to accept their request to be friends?',
  'yes' => 'Yes',
  'no' => 'No',
  'cannot_add_yourself_as_a_friend' => 'Cannot add yourself as a friend.',
  'you_are_already_friends_with_full_name' => 'You are already friends with {full_name}.',
  'user_link_will_have_to_confirm_that_you_are_friends' => '{user_link} will have to confirm that you are friends.',
  'add_a_personal_message' => 'Add a personal message...',
  'add_a_personal_message_form' => 'Add a personal message',
  'write_your_message_within_250_characters' => 'Write your message within 250 characters.',
  'add_friend' => 'Add Friend',
  'search_by_email_full_name_or_user_name' => 'Search by email, full name or user name.',
  'view' => 'View',
  'all_friends' => 'All Friends',
  'online_friends' => 'Online Friends',
  'friends_list' => 'Friends List',
  'find' => 'Find',
  'sorry_no_friends_were_found' => 'Sorry, no friends were found.',
  'use_selected' => 'Use Selected',
  'save' => 'Save',
  'use_this_image_to_add_friends_to_your_top_friends_list' => 'Use this image to add friends to your "Top Friends" list',
  'select' => 'Select',
  'none' => 'None',
  'all' => 'All',
  'move_to_list' => 'Move to List...',
  'message' => 'Message',
  'age' => 'Age',
  'gender' => 'Gender',
  'location' => 'Location',
  'remove_from_top' => 'Remove from Top',
  'add_to_top' => 'Add to Top',
  'toggle' => 'Toggle',
  'no_friends' => 'No friends.',
  'no_birthday_messages_found' => 'No birthday messages found.',
  'remove_this_friends_request' => 'Remove this friends request.',
  'user_link_has_not_added_any_friends' => '{user_link} has not added any friends.',
  'browse_other_members' => 'Browse Other Members',
  'in_order_to_view_this_item_posted_by_user_link_you_need_to_be_on_their_friends_list' => 'In order to view this item posted by {user_link} you need to be on their friends list.',
  'send_a_friends_request_to_full_name' => 'Send a Friends Request to {full_name}',
  'thank_you_for_your_request_to_join_our_group_your_membership_will_first_have_to_be_approved' => 'Thank you for your request to join our group. Your membership will first have to be approved.',
  'successfully_deleted_the_group' => 'Successfully deleted the group.',
  'group_invitation_successfully_sent' => 'Group invitation successfully sent!',
  'top' => 'Top',
  'online' => 'Online',
  'there_are_no_pending_friends_requests' => 'There are no pending friends requests.',
  'mutual_friends' => 'Mutual Friends',
  '1_friend_in_common' => '1 friend in common',
  'total_friends_in_common' => '{total} friends in common',
  'friends_online' => 'Friends Online',
  'suggestions' => 'Suggestions',
  'add_to_friends' => 'Add to Friends',
  'friend_suggestions' => 'Friend Suggestions',
  'mutual_friends_will_be_listed_here' => 'Mutual friends will be listed here.',
  'videos' => 'Videos',
  'that_s_you' => 'That\'s You!',
  'the_following_users_are_already_a_member_of_our_community' => 'The following users are already a member of our community',
  'requests' => 'Requests',
  'you_do_not_have_any_friends_requests_at_the_moment' => 'You do not have any friends requests at the moment.',
  'menu_friends_requests' => 'Friends Requests',
  'view_friend_request_id' => 'View Friend Request: #{id}',
  'viewing_friends_request_id' => 'Viewing Friends Request: #{id}',
  'you_have_denied_user_link_s_friends_request' => 'You have denied {user_link}\'s friends request.',
  'search_for_members' => 'Search for Members',
  'search_for_your_friends' => 'Search for Your Friends',
  'total_friends_block' => 'Total friends',
  'we_can_t_create_an_empty_list' => 'We can\'t create an empty list.',
  'provide_a_name_for_your_list' => 'Provide a name for your list.',
  'accepting_friends_request' => 'Accepting friends request',
  'no_friends_online' => 'No friends online.',
  'select_all' => 'Select All',
  'unselect_all' => 'Unselect All',
  'setting_friend_suggestion_search_total' => '<title>Friends Suggestion Friends Check Count</title><info>When performing the search to find friend suggestions for your members it will pull out X amount of users, where X is the numerical value of how many friends to search.</info>',
  'setting_enable_friend_suggestion' => '<title>Friend Suggestions</title><info>Enable this if you want to suggest friends to your members when they visit their dashboard.

You can control the search criteria on what defines a friend to suggest.

This feature requires a lot of extra server resources in order to perform such a search.

Each search result is cached for X minutes (where you can control X).

Notice: This feature is experimental and is not stable.
</info>',
  'setting_friend_suggestion_timeout' => '<title>Refresh Friend Suggestions</title><info>Define how long to wait till we run the search to find friends to suggest to a member in minutes.</info>',
  'setting_friend_suggestion_user_based' => '<title>Check Location for Friend Suggestions</title><info>Enable this option in order for us to pick up friend suggestions for your members based on the Country, State/Province and City they live in.</info>',
  'we_are_unable_to_find_any_friends_to_suggest_at_this_time_once_we_do_you_will_be_notified_within_our_dashboard' => 'We are unable to find any friends to suggest at this time. Once we do you will be notified within our Dashboard.',
  'finding_another_suggestion' => 'Finding another suggestion...',
  'hide_this_suggestion' => 'Hide this suggestion',
  'friend' => 'Friend',
  'hide' => 'Hide',
  'unselect' => 'Unselect',
  'optional' => '(optional)',
  'user_setting_total_folders' => 'Allowed Total Friend Folders (Enter without quotes "0" for no limit.)',
  'no_search_results_found' => 'No search results found.',
  'no_friends_found' => 'No friends found.',
  'search' => 'Search',
  'loading' => 'Loading...',
  'setting_hide_denied_requests_from_pending_list' => '<title>Hide denied requests from pending list</title><info>If enabled, friend requests that were denied will be hidden from the Pending Friend Requests list.</info>',
  'cannot_select_this_user' => '(Based on privacy settings this user cannot be selected)',
  'setting_friend_cache_limit' => '<title>Friends Cache Limit</title><info>Certain features on the site pick up on the users friends list especially when running a search for a friend. In order to provide a "live" feel to search results we cache in advance X (where X is this settings value) number of friends in memory. Making it easier for users to find their friends instantly.</info>',
  'menu_friend_sent_ecards_a441eadc1389cdf0ffe6c4f8babdd66e' => 'Sent ECards',
  'invoices' => 'Invoices',
  'id' => 'Id',
  'status' => 'Status',
  'price' => 'Price',
  'date' => 'Date',
  'sent_to' => 'Sent To',
  'you_do_not_have_any_invoices' => 'You do not have any invoices',
  'sent_from' => 'From',
  'created' => 'Created',
  'paid' => 'Paid',
  'setting_allow_blocked_user_to_friend_request' => '<title>Allow Friend Requests from Blocked users</title><info>If userA blocks userB, should userB be able to send a friend request to userA?</info>',
  'no_new_requests' => 'No new requests.',
  'moderate' => 'Moderate',
  'relationship_request' => 'Relationship request',
  '1_mutual_friend' => '1 mutual friend',
  'total_mutual_friends' => '{total} mutual friends',
  'view_more' => 'View More',
  'send_a_message' => 'Send a Message',
  'view_profile' => 'View Profile',
  'see_all_friend_requests' => 'See All Friend Requests',
  'search_friends_dot_dot_dot' => 'Search Friends...',
  'newest_friends' => 'Newest Friends',
  'by_first_name' => 'By First Name',
  'custom_order' => 'Custom Order',
  'list_successfully_deleted' => 'List successfully deleted.',
  'incoming_requests' => 'Incoming Requests',
  'pending_requests' => 'Pending Requests',
  'you_have_1_new_friend_request' => 'You have 1 new friend request',
  'you_have_total_new_friend_requests' => 'You have {total} new friend requests',
  'delete_list' => 'Delete List',
  'edit_name' => 'Edit Name',
  'display_on_profile' => 'Display on Profile',
  'remove_from_profile' => 'Remove from Profile',
  'change_order' => 'Change Order',
  'remove_this_friend' => 'Remove This Friend',
  'enter_the_name_of_your_custom_friends_list' => 'Enter the name of your custom friends\' list.',
  'submit' => 'Submit',
  'remove_friend' => 'Remove Friend',
  'list_successfully_created' => 'List successfully created.',
  'successfully_added_this_list_to_your_profile' => 'Successfully added this list to your profile.',
  'profile_friend_lists' => 'Profile Friend Lists',
  'order_successfully_saved' => 'Order successfully saved',
  'list_order' => 'List Order',
  'you_must_enable_dnd_mode' => 'You must enable DND mode.',
  'block_was_deleted' => 'Block was deleted',
  'cant_delete_it' => 'Cant delete it',
  'tomorrow' => 'Tomorrow',
  'after_tomorrow' => 'After Tomorrow',
  'today_normal' => 'Today',
  'and' => 'and',
  'full_name_added_you_as_a_friend' => '{full_name} added you as a friend',
  'gets_a_full_list_of_friends_for_a_specific_user' => 'Gets a full list of friends for a specific user. If you do not pass the #{USER_ID} we will return information about the user that is currently logged in.',
  'checks_if_2_users_are_friends_or_not' => 'Checks if 2 users are friends or not. If you do not pass the #{USER_ID} we will return information about the user that is currently logged in.',
  'full_name_posted_a_href_link_a_link_a_on_a_href_parent_user_name' => '{full_name} posted a link on {parent_full_name}\'s wall.',
  'birthday_notification' => 'Birthday Notification',
  'happy_birthday' => 'Happy Birthday!',
  'confirm' => 'Confirm',
  'remove_this_request' => 'Remove This Request',
  'show_more_results_for_search_term' => 'Show more results for "{search_term}"',
  'save_changes' => 'Save Changes',
  'setting_friends_only_profile' => '<title>Friends Only Profile</title><info>With this setting enabled only friends can view each others profiles.
Note this will override your users privacy settings and force anything related to viewing their profile and have it set to "Friends Only".</info>',
  'menu_friend_friends_532c28d5412dd75bf975fb951c740a30' => 'Friends',
  'see_all' => 'See All',
  'confirmed' => 'Confirmed',
  'denied' => 'Denied',
); ?>


text:
package io.truthencode.ddo.support.tree

import enumeratum.{Enum, EnumEntry}
import io.truthencode.ddo.support.StringUtils.Extensions
import io.truthencode.ddo.support.naming.{DisplayName, FriendlyDisplay}

import scala.collection.immutable
sealed trait UniversalTrees
  extends EnumEntry with UniversalTree with DisplayName with FriendlyDisplay {
  /**
   * Used when qualifying a search with a prefix. Examples include finding "HalfElf" from qualified
   * "Race:HalfElf"
   *
   * @return
   *   A default or applied prefix
   */
  override def searchPrefixSource: String = "UniversalEnhancement"

  override protected def nameSource: String =
    entryName.splitByCase.toPascalCase
}

trait Falconry extends UniversalTrees
trait HarperAgent extends UniversalTrees
trait VistaniKnifeFighter extends UniversalTrees with TreePrefix

object UniversalTrees extends Enum[UniversalTrees] {
  override def values: immutable.IndexedSeq[UniversalTrees] = findValues

  case object Falconry extends Falconry

  case object HarperAgent extends HarperAgent

  case object VistaniKnifeFighter extends VistaniKnifeFighter
}


text:
namespace Santase.AI.ProPlayer
{
    using System.Collections.Generic;
    using System.Linq;

    using Logic;
    using Logic.Cards;
    using Logic.PlayerActionValidate;
    using Logic.Players;
	using Logic.WinnerLogic;

	using States;
	using Tools.Extensions;

	public class ProPlayer : IPlayer
	{
		public ProPlayer()
		{
			this.AnnounceValidator = new AnnounceValidator();
			this.PlayerActionValidator = new PlayerActionValidator();
			this.CardWinnerLogic = new CardWinnerLogic();
		}

		private IState State { get; set; }

		public bool IsFirstPlayer { get; set; }

		public int MyPoints { get; private set; }

		public int OpponentPoints { get; private set; }

		public CardMemorizer CardMemorizer { get; private set; }

		public IReadOnlyCollection<Card> MyHand
		{
			get
			{
				return this.CardMemorizer.MyHand;
			}
		}

		public IAnnounceValidator AnnounceValidator { get; }

		public IPlayerActionValidator PlayerActionValidator { get; }

		public ICardWinnerLogic CardWinnerLogic { get; }

		public string Name => "Potato!";

		public virtual void StartGame(string otherPlayerIdentifier)
		{
		}

		public virtual void StartRound(ICollection<Card> cards, Card trumpCard, int myTotalPoints, int opponentTotalPoints)
		{
			this.CardMemorizer = new CardMemorizer(trumpCard, cards);
		}

		public virtual void AddCard(Card card)
		{
			this.CardMemorizer.LogDrawnCard(card);
		}

		public virtual PlayerAction GetTurn(PlayerTurnContext context)
		{
			this.IsFirstPlayer = context.IsFirstPlayerTurn;

			if (context.CardsLeftInDeck == 0)
			{
				this.CardMemorizer.LogTrumpCardDrawn();
			}

			this.SetCorrectState(context);

			var myHand = this.CardMemorizer.GetMyHand();
			if (this.PlayerActionValidator.IsValid(PlayerAction.ChangeTrump(), context, myHand))
			{
				return this.ChangeTrump();
			}

			if (this.ShouldCloseGame(context))
			{
				return this.CloseGame();
			}

			return this.ChooseCard(context);
		}

		public virtual void EndTurn(PlayerTurnContext context)
		{
			if (!this.CardMemorizer.TrumpCardDrawn && !this.CardMemorizer.TrumpCard.Equals(context.TrumpCard))
			{
				this.CardMemorizer.LogTrumpChange();
			}

			if (this.IsFirstPlayer)
			{
				this.MyPoints = context.FirstPlayerRoundPoints;
				this.OpponentPoints = context.SecondPlayerRoundPoints;
			}
			else
			{
				this.MyPoints = context.SecondPlayerRoundPoints;
				this.OpponentPoints = context.FirstPlayerRoundPoints;
			}

			Card opponentCard = this.GetOpponentCard(context);

			if (opponentCard != null)
			{
				this.CardMemorizer.LogOpponentPlayedCard(opponentCard);
			}
		}

		public virtual void EndRound()
		{
			;
		}

		public virtual void EndGame(bool amIWinner)
		{
			;
		}

		public PlayerAction PlayCard(Card card)
		{
			this.CardMemorizer.LogPlayedCard(card);
			return PlayerAction.PlayCard(card);
		}

		public int CalcHandValue()
		{
			return this.MyHand.Sum(card => card.GetValue());
		}

		public Card GetOpponentCard(PlayerTurnContext context)
		{
			return this.IsFirstPlayer ? context.SecondPlayedCard : context.FirstPlayedCard;
		}

		public Card GetPossibleBestAnounce(ICollection<Card> possibleCardsToPlay)

		{
			foreach (var card in possibleCardsToPlay)
			{
				if (!this.IsTrumpCard(card))
				{
					continue;
				}

				if (card.Type == CardType.King && possibleCardsToPlay.Any(c => c.Suit == card.Suit && c.Type == CardType.Queen))
				{
					return card;
				}
			}

			foreach (var card in possibleCardsToPlay)
			{
				if (card.Type == CardType.King && possibleCardsToPlay.Any(c => c.Suit == card.Suit && c.Type == CardType.Queen))
				{
					return card;
				}
			}

			return null;
		}

		public IEnumerable<Card> GetWinningCardsWhenFirst(IEnumerable<Card> cards)
		{
			var opponentCards = this.GetPossibleOpponentCards();
			var winningCards = cards.ToList();
			foreach (var card in cards)
			{
				foreach (var oponentCard in opponentCards)
				{
					if (oponentCard.Suit == card.Suit)
					{
						if (oponentCard.GetValue() > card.GetValue())
						{
							winningCards.Remove(card);
						}
					}
				}
			}

			return winningCards;
		}

		public IEnumerable<Card> GetWinningCardsWhenSecond(IEnumerable<Card> cards, Card cardToBeat)
		{
			return cards
				.Where(card => this.CardWinnerLogic.Winner(cardToBeat, card, this.CardMemorizer.TrumpCard.Suit) == PlayerPosition.SecondPlayer)
				.OrderBy(card => card.GetValue());
		}

		public int CalcPossibleRemainingTurns(bool deckIsClosed)
		{
			int cardsToBePlayedCount = this.CardMemorizer.MyHand.Count;

			if (deckIsClosed)
			{
				return cardsToBePlayedCount;
			}

			cardsToBePlayedCount += this.CardMemorizer.UndiscoveredCards.Count;

			if (!this.CardMemorizer.TrumpCardDrawn)
			{
				cardsToBePlayedCount++;
			}

			return cardsToBePlayedCount / 2;
		}

		public Card GetWeakestCard(IEnumerable<Card> cards)
		{
			Card weakestCard = cards.First();

			foreach (var card in cards)
			{
				if ((this.IsTrumpCard(weakestCard) || !this.IsTrumpCard(card)) && (card.GetValue() < weakestCard.GetValue()))
				{
					weakestCard = card;
				}
			}

			return weakestCard;
		}

		public bool IsTrumpCard(Card card)
		{
			return card.Suit == this.CardMemorizer.TrumpCard.Suit;
		}

		public int CountPotentialWins(Card card)
		{
			int count = 0;

			var opponentCards = this.GetPossibleOpponentCards();

			foreach (var opponentCard in opponentCards)
			{
				if (this.CardWinnerLogic.Winner(card, opponentCard, this.CardMemorizer.TrumpCard.Suit) == PlayerPosition.FirstPlayer)
				{
					count++;
				}
			}

			return count;
		}

		public IReadOnlyCollection<Card> GetPossibleOpponentCards()
		{
			if (this.CardMemorizer.OldTrumpCard == null)
			{
				return this.CardMemorizer.UndiscoveredCards;
			}

			var result = new Tools.CardCollection();

			this.CardMemorizer.UndiscoveredCards.ForEach(result.Add);

			result.Add(this.CardMemorizer.OldTrumpCard);

			return result;
		}

		protected PlayerAction ChooseCard(PlayerTurnContext context)
		{
			return this.State.ChooseCard(context);
		}

		protected PlayerAction ChangeTrump()
		{
			this.CardMemorizer.LogTrumpChange();
			return PlayerAction.ChangeTrump();
		}

		protected PlayerAction CloseGame()
		{
			return PlayerAction.CloseGame();
		}

		protected virtual bool ShouldCloseGame(PlayerTurnContext context)
		{
			bool canCloseGame = this.PlayerActionValidator.IsValid(PlayerAction.CloseGame(), context, this.CardMemorizer.GetMyHand());

			if (canCloseGame)
			{
				int potentialPoints = this.MyPoints + this.CalcHandValue();
				var myThrumpCardCount = this.CardMemorizer.GetMyHand().Count(x => x.Suit == context.TrumpCard.Suit);
				return potentialPoints >= 60 && myThrumpCardCount >= 3;
			}

			return false;
		}

		protected virtual void SetCorrectState(PlayerTurnContext context)
		{
			if (!this.IsFirstPlayer)
			{
				this.State = new PlayingSecond(this);
			}
			else if (context.State.ShouldObserveRules)
			{
				this.State = new PlayingFirstWithRules(this);
			}
			else
			{
				this.State = new PlayingFirst(this);
			}
		}
	}
}


text:
function yn = isReversible(a, i)
% ISREVERSIBLE  Get an array of flags indicating reversibility of a reaction.
% yn = isReversible(a, i)
% A reversible reaction is one that runs in both the forward
% direction (reactants -> products) and in the reverse direction
% (products -> reactants). The reverse rate for reversible
% reactions can computed from thermochemistry, so that the
% reaction satisfies detailed balance, and the net rate of
% progress is zero in states of chemical equilibrium. The reverse
% rate can also be specified directly by a rate expression. An
% irreversible reaction is one whose reverse reaction rate is
% zero.
%
% :param a:
%     Instance of class :mat:func:`Kinetics` (or another
%     object deriving from Kinetics)
%     for which the reversible flags are desired.
% :param i:
%     Integer reaction number
% :return:
%     1 if reaction number ``i`` is
%     reversible, and 0 if it is irreversible.
%

yn = kinetics_get(a.id, 4, i);


text:
package grok

import (
	"path"
	"regexp"
	"strings"

	"github.com/serulian/compiler/compilercommon"
)

// fromImportRegex matches a `from ... import` snippet.
var fromImportRegex, _ = regexp.Compile("^from ((\"[^\"]+\")|(([a-zA-Z0-9]+)(`[^`]+`))|([a-zA-Z0-9]+(\\.[a-zA-Z0-9]+)*)) import $")

// importRegex matches either `import `, `import foo.`, `from ` or `from foo.`
var importRegex, _ = regexp.Compile("^(from|import) ([0-9a-zA-Z]+(\\.[0-9a-zA-Z]+)*\\.?)?$")

type importKind int

const (
	importKindPackage importKind = iota
	importKindFromPackage
)

// importSnippet represents a snippet of an import statement in one form or another. Allows for
// easier handling of completions of imports.
type importSnippet struct {
	// prefix is the prefix for the import (either 'from' or 'import')
	prefix string

	// sourceKind is the kind of source for the package or module. Will be empty string for SRG.
	sourceKind string

	// importSource is the source module/package referenced by the import.
	importSource string

	// importKind defines the kind of import.
	importKind importKind
}

// buildImportSnippet returns an import snippet for the given snippet string. If a snippet could
// not be parsed, returns false.
func buildImportSnippet(snippetString string) (importSnippet, bool) {
	fromPackageSubmatch := fromImportRegex.FindStringSubmatch(snippetString)
	if len(fromPackageSubmatch) > 0 {
		importSource := fromPackageSubmatch[1]
		if fromPackageSubmatch[4] != "" {
			importSource = fromPackageSubmatch[5]
		}

		return importSnippet{
			importKind:   importKindFromPackage,
			sourceKind:   fromPackageSubmatch[4],
			importSource: importSource,
			prefix:       "from",
		}, true
	}

	importSubmatch := importRegex.FindStringSubmatch(snippetString)
	if len(importSubmatch) > 0 {
		return importSnippet{
			importKind:   importKindPackage,
			sourceKind:   "",
			importSource: importSubmatch[2],
			prefix:       importSubmatch[1],
		}, true
	}

	return importSnippet{}, false
}

// populateCompletions populates the completions for this import snippet into the given
// builder, if applicable.
func (is importSnippet) populateCompletions(builder *completionBuilder, parentModule compilercommon.InputSource) bool {
	if is.importKind == importKindPackage {
		return is.populatePackages(builder, parentModule)
	}

	return is.populateTypesAndMembers(builder, parentModule)
}

// populatePackages populates all packages found under or matching the source package.
func (is importSnippet) populatePackages(builder *completionBuilder, parentModule compilercommon.InputSource) bool {
	// Check if this is a sub-package/module by looking for the presence of a dot at the end.
	packageDir := path.Dir(string(parentModule))
	isSubPackage := false
	prefix := is.importSource

	if strings.HasSuffix(is.importSource, ".") {
		// Sub-package/module.
		packageDir = path.Join(packageDir, is.importSource[0:len(is.importSource)-2])
		isSubPackage = true
		prefix = ""
	}

	modulesOrPackages, err := builder.handle.scopeResult.Graph.PackageLoader().ListSubModulesAndPackages(packageDir)
	if err != nil {
		return false
	}

	for _, moduleOrPackage := range modulesOrPackages {
		// If this is a subpackage that we obviously cannot import a non-Serulian file, so
		// we skip.
		if (isSubPackage || prefix != "") && moduleOrPackage.SourceKind != "" {
			continue
		}

		// Skip the parent module.
		if moduleOrPackage.Path == string(parentModule) {
			continue
		}

		// Make sure the import matches the current prefix.
		if strings.HasPrefix(moduleOrPackage.Name, prefix) {
			builder.addImport(moduleOrPackage.Name, moduleOrPackage.SourceKind)
		}
	}

	return true
}

// populateTypesAndMembers populates the types and members of the source package.
func (is importSnippet) populateTypesAndMembers(builder *completionBuilder, parentModule compilercommon.InputSource) bool {
	packagePath := is.importSource
	isVCSPath := false

	// Construct the path and VCS info for lookup in the package loader.
	if strings.HasPrefix(packagePath, "\"") || strings.HasPrefix(packagePath, "`") {
		packagePath = packagePath[1 : len(packagePath)-2]
	}

	if strings.Contains(packagePath, "/") {
		isVCSPath = true
	} else {
		pieces := strings.Split(packagePath, ".")
		packagePath = path.Join(pieces...)
		packagePath = path.Join(path.Dir(string(parentModule)), packagePath)
	}

	// Retrieve the package information for the path (if any).
	packageInfo, err := builder.handle.scopeResult.Graph.PackageLoader().LocalPackageInfoForPath(packagePath, is.sourceKind, isVCSPath)
	if err != nil {
		return false
	}

	// Lookup all types and members under the package from the typegraph.
	for _, completion := range builder.handle.scopeResult.Graph.TypeGraph().TypeOrMembersUnderPackage(packageInfo) {
		if completion.IsAccessibleTo(parentModule) {
			builder.addTypeOrMember(completion)
		}
	}
	return true
}


text:
<?php
	session_start();

	if (count($_FILES)) {
        // Handle degraded form uploads here.  Degraded form uploads are POSTed to index.php.  SWFUpload uploads
		// are POSTed to upload.php
	}

?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<title>SWFUpload Demos - Multi-Instance Demo</title>
<link href="../css/default.css" rel="stylesheet" type="text/css" />

SWFUpload

v2.2.0

Multi-Instance Demo

	<form id="form1" action="index.php" method="post" enctype="multipart/form-data">

This page demonstrates how multiple instances of SWFUpload can be loaded on the same page.
			It also demonstrates the use of the graceful degradation plugin and the queue plugin.

							Large File Upload Site

							<input id="btnCancel1" type="button" value="Cancel Uploads" onclick="cancelQueue(upload1);" disabled="disabled" style="margin-left: 2px; height: 22px; font-size: 8pt;" />

							Small File Upload Site

							<input id="btnCancel2" type="button" value="Cancel Uploads" onclick="cancelQueue(upload2);" disabled="disabled" style="margin-left: 2px; height: 22px; font-size: 8pt;" />

	</form>


text:
ATTENTION
=========

CSV2IATI is Deprecated and this repository is Archived
------------------------------------------------------

Please see https://iatistandard.org/en/guidance/publishing-data/ for guidance and other tools available to publish IATI data

Announcements
-------------

* https://iatistandard.org/en/news/iati-publishing-tool-csv2iati-to-be-decommissioned/
* https://iatistandard.org/en/news/update-csv2iati-decommissioning/

International Aid Transparency Initiative CSV Conversion tool
=============================================================

The scripts in this repository transform data from a CSV spreadsheet
into IATI-XML data. This requires two components:

* Data -- A flat CSV file
* Mapping -- A JSON mapping file, which describes how the CSV file should be related to the IATI Standard

Installation
------------

Clone the repository:

::

    $ git clone https://github.com/IATI/CSV2IATI-backend.git

::

    $ cd CSV2IATI-backend
    $ virtualenv --no-site-packages ./pyenv

Now activate the environment:

::

    $ source ./pyenv/bin/activate

Install dependencies:

::

    $ pip install -r requirements.txt

Running
-------

::

    python csv2iati/__init__.py

Then open http://127.0.0.1:5001/ in a webbrowser.

Standandalone script
^^^^^^^^^^^^^^^^^^^^

The repository also contains a standandlone script, without a web interface but this is curerntly **very out of date**.

The script takes two arguments: the source CSV file and the mapping.
These must be provided as full URLs, even if they are only on your computer. For example:

::

    $ python run.py file:///home/YOUR_USER_NAME/PATH_TO_CSV_CONVERSION_TOOL/testdata/csv.csv file:///home/YOUR_USER_NAME/PATH_TO_CSV_CONVERSION_TOOL/testdata/json.json

The data will be output to PATH_TO_CONVERSION_TOOL/temp/TODAY'S_DATE/IATI.xml

JSON mapping file
-----------------

There are two sections in the JSON mapping file:

* `organisation`
* `mapping`

**Organisation section**

The mapping section should contain:

* The reporting organisation data (``reporting-org``)
* The default currency (``default-currency``)
* The default language (``lang``)
* The data structure (``data-structure``)

*Example:*
::

    "organisation": {

        "reporting-org": {
            "text": "United States Agency for International Development",
            "ref": "US-1",
            "type": "10"
        },
        "default-currency": "USD",
        "lang": "en",
        "contact-info": {
            "person-name": "",
            "telephone": "",
            "email": "",
            "address": ""
        },
        "data-encoding": "utf-8",
        "data-structure": {
            "multiple": ""
        }

    }

**Mapping section**

In the JSON mapping file, you create one element per object that you
want to represent.

* Each object must have a unique name.
* Each object must define the IATI field it relates to (``iati-field``)
* Each object must define whether the source data for the output is a ``column`` in the CSV file or a ``constant`` if it is the same value for all entries (``datatype``)
* Objects can also have *prefixes* (e.g., if the source data contains the project ID you want to use in the ``iati-identifier`` IATI field, you would prefix it with the reporting organisation's reference. (``prefix``)
* Objects can also be more complicated if they have attributes. In this case you set the ``datatype`` to ``compound`` and create a series of ``fields`` within that object.

*Example:*
::

    "mapping": {

        "iati-identifier": {
            "datatype": "compound",
            "iati-field": "iati-identifier",
            "label": "IATI Identifier",
            "fields": {
                "text": {
                    "datatype": "column",
                    "column": "donor_project_number"
                }
            }
        },
        "title": {
            "datatype": "compound",
            "iati-field": "title",
            "label": "Title",
            "fields": {
                "text": {
                    "datatype": "column",
                    "column": "project_title"
                }
            }
        },
        "description": {
            "datatype": "compound",
            "iati-field": "description",
            "label": "Description",
            "fields": {
                "text": {
                    "datatype": "column",
                    "column": "description"
                }
            }
        },
        "activity-date-start": {
            "datatype": "compound",
            "iati-field": "activity-date",
            "label": "Activity Start Date",
            "fields": {
                "type": {
                    "datatype": "constant",
                    "constant": "start-planned"
                },
                "iso-date": {
                    "datatype": "constant",
                    "constant": "2010-01-01"
                },
                "text": {
                    "datatype": "constant",
                    "constant": "2010-01-01"
                }
            }
        },
        "activity-date-end": {
            "datatype": "compound",
            "iati-field": "activity-date",
            "label": "Activity End Date",
            "fields": {
                "type": {
                    "datatype": "constant",
                    "constant": "planned-end"
                },
                "iso-date": {
                    "datatype": "constant",
                    "constant": "2010-12-31"
                },
                "text": {
                    "datatype": "constant",
                    "constant": "2010-12-31"
                }
            }
        },
        "recipient-country": {
            "datatype": "compound",
            "iati-field": "recipient-country",
            "label": "Recipient Country",
            "fields": {
                "text": {
                    "datatype": "column",
                    "column": "recipient_country"
                },
                "code": {
                    "datatype": "constant",
                    "constant": "TZ"
                }
            }
        },
        "funding-organisation": {
            "datatype": "compound",
            "iati-field": "participating-org",
            "label": "Funding Organisation",
            "fields": {
                "role": {
                    "datatype": "constant",
                    "constant": "funding"
                },
                "text": {
                    "datatype": "constant",
                    "constant": "United States"
                },
                "ref": {
                    "datatype": "constant",
                    "constant": "US"
                },
                "type": {
                    "datatype": "constant",
                    "constant": "10"
                }
            }
        },
        "extending-organisation": {
            "datatype": "compound",
            "iati-field": "participating-org",
            "label": "Extending Organisation",
            "fields": {
                "role": {
                    "datatype": "constant",
                    "constant": "extending"
                },
                "text": {
                    "datatype": "constant",
                    "constant": "USAID"
                },
                "ref": {
                    "datatype": "constant",
                    "constant": "US-1"
                },
                "type": {
                    "datatype": "constant",
                    "constant": "10"
                }
            }
        },
        "implementing-organisation": {
            "datatype": "compound",
            "iati-field": "participating-org",
            "label": "Implementing Organisation",
            "fields": {
                "role": {
                    "datatype": "constant",
                    "constant": "implementing"
                },
                "text": {
                    "datatype": "column",
                    "column": "channel_name"
                },
                "ref": {
                    "datatype": "column",
                    "column": "channel_code"
                },
                "type": {
                    "datatype": "column",
                    "column": "channel_code"
                }
            }
        },
        "sectors": {
            "datatype": "compound",
            "iati-field": "sector",
            "label": "Sectors",
            "fields": {
                "text": {
                    "datatype": "column",
                    "column": "purpose_code"
                },
                "code": {
                    "datatype": "column",
                    "column": "purpose_code"
                },
                "vocab": {
                    "datatype": "constant",
                    "constant": "DAC"
                }
            }
        }
        "flow-type": {
            "datatype": "compound",
            "iati-field": "default-flow-type",
            "label": "User field: flow-type",
            "fields": {
                "code": {
                    "datatype": "column",
                    "column": "flow_type"
                },
                "text": {
                    "datatype": "column",
                    "column": "flow_type"
                }
            }
        },
        "finance-type": {
            "datatype": "compound",
            "iati-field": "default-finance-type",
            "label": "User field: finance-type",
            "fields": {
                "code": {
                    "datatype": "column",
                    "column": "finance_type"
                },
                "text": {
                    "datatype": "column",
                    "column": "finance_type"
                }
            }
        },
        "aid-type": {
            "datatype": "compound",
            "iati-field": "default-aid-type",
            "label": "User field: aid-type",
            "fields": {
                "code": {
                    "datatype": "column",
                    "column": "dac_typology"
                },
                "text": {
                    "datatype": "column",
                    "column": "dac_typology"
                }
            }
        },
        "activity-status": {
            "datatype": "compound",
            "iati-field": "activity-status",
            "label": "User field: activity-status",
            "fields": {
                "code": {
                    "datatype": "constant",
                    "constant": "2"
                },
                "text": {
                    "datatype": "constant",
                    "constant": "Implementation"
                }
            }
        },
    }


text:
/* global define, _ */

define(['form/templates/editors/textEditor.html', './BaseEditorView'],
    function (template, EditorBaseView) {
        'use strict';

        var changeMode = {
            blur: 'blur',
            keydown: 'keydown'
        };

        var defaultOptions = {
            changeMode: 'blur'
        };

        return EditorBaseView.extend({
            initialize: function (options) {
                _.extend(this.options, defaultOptions, _.pick(options || {}, _.keys(defaultOptions)));
            },

            focusElement: '.js-input',

            ui: {
                input: '.js-input'
            },

            className: '',

            template: Handlebars.compile(template, {noEscape: true}),

            mixinTemplateHelpers: function (data) {
                data = this.setPlaceholder(data);
                return data;
            },

            events: {
                'keyup @ui.input': '__keyup',
                'change @ui.input': '__change'
            },

            __keyup: function () {
                if (this.options.changeMode === changeMode.keydown) {
                    this.__value(this.ui.input.val(), false);
                }
            },

            __change: function () {
                var val = this.ui.input.val();
                this.__value(val === '' ? null : val, false);
            },

            setValue: function (value, silent) {
                var data;
                if(value){
                    if(value.data && value.data.length) {
                        data = value.data[0].dataValue;
                    } else {
                        data = null;
                    }
                    this.__value(data, true, silent);
                }

            },

            onRender: function () {
                var value = this.getValue();
                this.ui.input.val(value.dataValue || '');
            },

            __value: function (value, updateUi, silent) {
                if (this.value === value) {
                    return;
                }
                this.value.data = [{dataValue: value}];

                updateUi && this.updateUIValue(value);
                !silent && this.__triggerChange();
            }
        });
    });


text:
package db;

import com.sleepycat.db.*;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.OutputStream;

/*
 * An example of a program configuring a database environment.
 *
 * For comparison purposes, this example uses a similar structure
 * as examples/ex_env.c and examples_cxx/EnvExample.cpp.
 */
public class EnvExample {
    private static final String progname = "EnvExample";
    private static final File DATABASE_HOME = new File("/tmp/database");

    private static void runApplication(Environment dbenv)
        throws DatabaseException {

        // Do something interesting...
        // Your application goes here.
    }

    private static void setupEnvironment(File home,
                                         String dataDir,
                                         OutputStream errs)
        throws DatabaseException, FileNotFoundException {

        // Create an environment object and initialize it for error reporting.
        EnvironmentConfig config = new EnvironmentConfig();
        config.setErrorStream(errs);
        config.setErrorPrefix(progname);

        //
        // We want to specify the shared memory buffer pool cachesize,
        // but everything else is the default.
        //
        config.setCacheSize(64 * 1024);

        // Databases are in a separate directory.
        config.addDataDir(dataDir);

        // Open the environment with full transactional support.
        config.setAllowCreate(true);
        config.setInitializeCache(true);
        config.setTransactional(true);
        config.setInitializeLocking(true);

        //
        // open is declared to throw a FileNotFoundException, which normally
        // shouldn't occur when allowCreate is set.
        //
        Environment dbenv = new Environment(home, config);

        try {
            // Start your application.
            runApplication(dbenv);
        } finally {
            // Close the environment.  Doing this in the finally block ensures
            // it is done, even if an error is thrown.
            dbenv.close();
        }
    }

    private static void teardownEnvironment(File home,
                                            String dataDir,
                                            OutputStream errs)
        throws DatabaseException, FileNotFoundException {

        // Remove the shared database regions.
        EnvironmentConfig config = new EnvironmentConfig();

        config.setErrorStream(errs);
        config.setErrorPrefix(progname);
        config.addDataDir(dataDir);
        Environment.remove(home, true, config);
    }

    public static void main(String[] args) {
        //
        // All of the shared database files live in /tmp/database,
        // but data files live in /database/files.
        //
        // Using Berkeley DB in C/C++, we need to allocate two elements
        // in the array and set config[1] to NULL.  This is not
        // necessary in Java.
        //
        File home = DATABASE_HOME;
        String dataDir = "/database/files";

        try {
            System.out.println("Setup env");
            setupEnvironment(home, dataDir, System.err);

            System.out.println("Teardown env");
            teardownEnvironment(home, dataDir, System.err);
        } catch (DatabaseException dbe) {
            System.err.println(progname + ": environment open: " + dbe.toString());
            System.exit (1);
        } catch (FileNotFoundException fnfe) {
            System.err.println(progname + ": unexpected open environment error  " + fnfe);
            System.exit (1);
        }
    }

}