text:
namespace System.Security.Cryptography.Xml
{
    using System;
    using System.Collections;
    using System.Xml;

    [System.Security.Permissions.HostProtection(MayLeakOnAbort = true)]
    public sealed class EncryptedData : EncryptedType {
        public override void LoadXml(XmlElement value) {
            if (value == null)
                throw new ArgumentNullException("value");

            XmlNamespaceManager nsm = new XmlNamespaceManager(value.OwnerDocument.NameTable);
            nsm.AddNamespace("enc", EncryptedXml.XmlEncNamespaceUrl);
            nsm.AddNamespace("ds", SignedXml.XmlDsigNamespaceUrl);

            this.Id = Utils.GetAttribute(value, "Id", EncryptedXml.XmlEncNamespaceUrl);
            this.Type = Utils.GetAttribute(value, "Type", EncryptedXml.XmlEncNamespaceUrl);
            this.MimeType = Utils.GetAttribute(value, "MimeType", EncryptedXml.XmlEncNamespaceUrl);
            this.Encoding = Utils.GetAttribute(value, "Encoding", EncryptedXml.XmlEncNamespaceUrl);

            XmlNode encryptionMethodNode = value.SelectSingleNode("enc:EncryptionMethod", nsm);

            // EncryptionMethod
            this.EncryptionMethod = new EncryptionMethod();
            if (encryptionMethodNode != null)
                this.EncryptionMethod.LoadXml(encryptionMethodNode as XmlElement);

            // Key Info
            this.KeyInfo = new KeyInfo();
            XmlNode keyInfoNode = value.SelectSingleNode("ds:KeyInfo", nsm);
            if (keyInfoNode != null)
                this.KeyInfo.LoadXml(keyInfoNode as XmlElement);

            // CipherData
            XmlNode cipherDataNode = value.SelectSingleNode("enc:CipherData", nsm);
            if (cipherDataNode == null)
                throw new CryptographicException(SecurityResources.GetResourceString("Cryptography_Xml_MissingCipherData"));

            this.CipherData = new CipherData();
            this.CipherData.LoadXml(cipherDataNode as XmlElement);

            // EncryptionProperties
            XmlNode encryptionPropertiesNode = value.SelectSingleNode("enc:EncryptionProperties", nsm);
            if (encryptionPropertiesNode != null) {
                // Select the EncryptionProperty elements inside the EncryptionProperties element
                XmlNodeList encryptionPropertyNodes = encryptionPropertiesNode.SelectNodes("enc:EncryptionProperty", nsm);
                if (encryptionPropertyNodes != null) {
                    foreach (XmlNode node in encryptionPropertyNodes) {
                        EncryptionProperty ep = new EncryptionProperty();
                        ep.LoadXml(node as XmlElement);
                        this.EncryptionProperties.Add(ep);
                    }
                }
            }

            // Save away the cached value
            m_cachedXml = value;
        }

        public override XmlElement GetXml() {
            if (CacheValid) return(m_cachedXml);

            XmlDocument document = new XmlDocument();
            document.PreserveWhitespace = true;
            return GetXml(document);
        }

        internal XmlElement GetXml (XmlDocument document) {
            // Create the EncryptedData element
            XmlElement encryptedDataElement = (XmlElement) document.CreateElement("EncryptedData", EncryptedXml.XmlEncNamespaceUrl);

            // Deal with attributes
            if (!String.IsNullOrEmpty(this.Id))
                encryptedDataElement.SetAttribute("Id", this.Id);
            if (!String.IsNullOrEmpty(this.Type))
                encryptedDataElement.SetAttribute("Type", this.Type);
            if (!String.IsNullOrEmpty(this.MimeType))
                encryptedDataElement.SetAttribute("MimeType", this.MimeType);
            if (!String.IsNullOrEmpty(this.Encoding))
                encryptedDataElement.SetAttribute("Encoding", this.Encoding);

            // EncryptionMethod
            if (this.EncryptionMethod != null)
                encryptedDataElement.AppendChild(this.EncryptionMethod.GetXml(document));

            // KeyInfo
            if (this.KeyInfo.Count > 0)
                encryptedDataElement.AppendChild(this.KeyInfo.GetXml(document));

            // CipherData is required.
            if (this.CipherData == null)
                throw new CryptographicException(SecurityResources.GetResourceString("Cryptography_Xml_MissingCipherData"));
            encryptedDataElement.AppendChild(this.CipherData.GetXml(document));

            // EncryptionProperties
            if (this.EncryptionProperties.Count > 0) {
                XmlElement encryptionPropertiesElement = document.CreateElement("EncryptionProperties", EncryptedXml.XmlEncNamespaceUrl);
                for (int index = 0; index < this.EncryptionProperties.Count; index++) {
                    EncryptionProperty ep = this.EncryptionProperties.Item(index);
                    encryptionPropertiesElement.AppendChild(ep.GetXml(document));
                }
                encryptedDataElement.AppendChild(encryptionPropertiesElement);
            }
            return encryptedDataElement;
        }
    }
}


text:
Plugin.Google = {

	cache: {},

	parse: function(cmd, data, user, chan){
		var self = this;
		var search = data.match(/^\$google\s([\D\d]*)/);
		if (search) {
			if (this.cache[search]) {
				var result = this.cache[search].responseData.results[0];
				var echo = user + ": " + result.url + " ("+result.titleNoFormatting+")"
				Zarishi.send(echo, chan);
			} else {
				var query = search[1];
				var request = new Request({
					'url': 'http://ajax.googleapis.com/ajax/services/search/web',
					'data': 'v=1.0&q=' + escape(query),
					'method': 'get',
					'onSuccess': function(text, xml){
						var results = self.cache[search] = JSON.decode(text);
						var top = results.responseData.results[0];
						var echo = user + ": " + top.url + " ("+top.titleNoFormatting+")"
						Zarishi.send(echo, chan);
					}
				}).send();
			}
		}
	}

}

Zarishi.Plugins.register(Plugin.Google);

redpajama_set_name: RedPajamaGithub


text:
Patents

(Submitted - May 2020) Methodology for Data Driven Identification of Optimized Asset Strategy Opportunities Across Functional Location Hierarch

(Submitted - May 2020) Methodology for the Development and Deployment of Digital Asset Strategies

(Filed - App # : 20200210859) Predicting Fatigue of an Asset that Heals

A Framework for Unsupervised Anomaly Detection on Industrial Time Series Data (US 15/474,563)

Creating Predictive Damage Models by Transductive Transfer Learning  (US20170300605A1)


text:
@extends('emails.template')

@section('content')

            {{ trans('email.status_changed.subject1') }} {{$order_id}} {{ trans('email.status_changed.subject2') }} {{ trans($new_status) }}

                {{ $email_message }}.

                {{ trans('email.status_changed.click_here') }}

{{ trans('email.tag_team') }}

@endsection


text:
package org.camunda.bpm.engine.test.bpmn.servicetask.util;

import org.camunda.bpm.engine.delegate.DelegateExecution;
import org.camunda.bpm.engine.delegate.Expression;
import org.camunda.bpm.engine.delegate.JavaDelegate;

/**
 * @author Frederik Heremans
 */
public class ToUpperCaseSetterInjected implements JavaDelegate {

  private Expression text;
  private boolean setterInvoked = false;

  public void execute(DelegateExecution execution) {

    if(!setterInvoked) {
      throw new RuntimeException("Setter was not invoked");
    }
    execution.setVariable("setterVar", ((String)text.getValue(execution)).toUpperCase());
  }

  public void setText(Expression text) {
    setterInvoked = true;
    this.text = text;
  }

}


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

router.get('/', function (req, res, next) {

	var stat_data = {};

	var count = 0;
	for (var key in dhcp_lease_data) {

		/**
		 * If we don't have a vendor - set as N/A
		 */
		if (dhcp_lease_data[key].mac_oui_vendor === "") {
			dhcp_lease_data[key].mac_oui_vendor = "N/A";
		}

		/**
		 * Init array
		 */
		if (typeof stat_data[(typeof dhcp_lease_data[key].mac_oui_vendor !== "undefined" ? dhcp_lease_data[key].mac_oui_vendor : 'Misc')] === "undefined")
			stat_data[(typeof dhcp_lease_data[key].mac_oui_vendor !== "undefined" ? dhcp_lease_data[key].mac_oui_vendor : 'Misc')] = 0;

		let vendor_string = (typeof dhcp_lease_data[key].mac_oui_vendor !== "undefined" && dhcp_lease_data[key].mac_oui_vendor != "" ? dhcp_lease_data[key].mac_oui_vendor : 'Misc');

		/**
		 * Increment vendor count
		 */
		stat_data[vendor_string]++;
	}

	/**
	 * Return JSON response
	 */
	res.setHeader('Content-Type', 'application/json');
	res.send(JSON.stringify(stat_data));
});

module.exports = router;


text:
Genome Utilities
===========================

A KBase module that exposes core KBase genome and feature utility methods, such as
running Blast against a genome.

The name of this module should be changed.
'Core Genome' may refers to something oppsite to 'Pan Genome'.
Maybe change the name of this module to 'Genome Core Utilities' or 'Genome basic utilities' will be better for people to understand.


text:
package datastore

import (
	"github.com/CiscoDevNet/ydk-go/ydk/errors"
)

// DataStore is a complete set of configuration data that is required to get a
// device from its initial default state into a desired operational state
type DataStore int

// DataStore constants.
const (
	NotSet DataStore = iota
	Candidate
	Running
	Startup
	URL
)

// String returns the name of the given YFilter (string)
func (ds DataStore) String() string {
	switch ds {
	case Candidate:
		return "candidate"
	case Running:
		return "running"
	case Startup:
		return "startup"
	case URL:
		return "url"
	case NotSet:
		return ""
	}

	err := errors.YError{Msg: "Invalid DataStore value"}
	panic(err.Error())
}


text:
require 'test_helper'

class ActiveReporting::ConfigurationTest < Minitest::Test
  def setup
    @default_dimension_label = ActiveReporting::Configuration.default_dimension_label
    @new_value = :new_value
  end

  def teardown
    ActiveReporting::Configuration.default_dimension_label = @default_dimension_label
  end

  def test_configurations_can_be_set_in_a_block
    ActiveReporting::Configuration.config do |c|
      c.default_dimension_label = @new_value
    end
    assert_equal @new_value, ActiveReporting::Configuration.default_dimension_label
  end

  def test_default_dimension_label_is_defaulted_and_is_settable
    refute ActiveReporting::Configuration.default_dimension_label.nil?
    ActiveReporting::Configuration.default_dimension_label = @new_value
    assert_equal @new_value, ActiveReporting::Configuration.default_dimension_label
  end

  def test_default_measure_is_defaulted_and_is_settable
    refute ActiveReporting::Configuration.default_measure.nil?
    ActiveReporting::Configuration.default_measure = @new_value
    assert_equal @new_value, ActiveReporting::Configuration.default_measure
  end
end


text:
class Step < ApplicationRecord
  belongs_to :step_by_step_page
  validates :step_by_step_page, presence: true
  validates :title, :logic, presence: true
  has_many :link_reports, dependent: :destroy
  after_create :set_step_position
  after_commit :set_parent_step_positions, on: :destroy

  def broken_links?
    broken_links.present? && broken_links.any?
  end

  def link_report?
    most_recent_batch.present?
  end

  def links_last_checked_date
    most_recent_batch.created_at if link_report?
  end

  def broken_links
    collect_broken_links unless most_recent_batch.nil?
  end

  def request_broken_links
    LinkReport.new(step_id: id).create_record
  end

private

  def collect_broken_links
    return [] if batch_link_report.blank?

    batch_link_report.links.keep_if do |link|
      link.fetch("status") == "broken"
    end
  end

  def batch_link_report
    @batch_link_report ||= Services.link_checker_api.get_batch(batch_link_report_id)
  rescue GdsApi::HTTPServerError, GdsApi::HTTPNotFound
    nil
  end

  def batch_link_report_id
    most_recent_batch.batch_id
  end

  def most_recent_batch
    LinkReport.where(step_id: id).last
  end

  def set_step_position
    update!(position: step_by_step_page.steps.count)
  end

  def set_parent_step_positions
    step_by_step_page.make_step_positions_sequential
  end
end


text:
//
// (c) 2014 Raphael Bialon <Raphael.Bialon@hhu.de>
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with this program.  If not, see http://www.gnu.org/licenses/.
//

#ifndef TBUSCRSQ_H_
#define TBUSCRSQ_H_

#include "TbusDatarateQueue.h"

/**
 * Client dataRate Send Queue.
 * Behaves like a #TbusDatarateQueue, but informs the CDSQ of when to start/stop saving values or resetting saved values.
 */
class TbusCRSQ : public TbusDatarateQueue {
	public:
		TbusCRSQ();
		virtual void initialize();

	protected:
		virtual bool addPacketToQueue(cPacket* packet);
		virtual void sendFrontOfQueue();
};

#endif /* TBUSCRSQ_H_ */


text:
package org.compass.core.converter.mapping.osem;

import java.lang.reflect.Array;
import java.util.Collection;
import java.util.Iterator;
import java.util.Map;

import org.compass.core.Property;
import org.compass.core.Resource;
import org.compass.core.converter.ConversionException;
import org.compass.core.converter.Converter;
import org.compass.core.converter.mapping.ResourcePropertyConverter;
import org.compass.core.mapping.Mapping;
import org.compass.core.mapping.ResourcePropertyMapping;
import org.compass.core.mapping.osem.ClassDynamicPropertyMapping;
import org.compass.core.marshall.MarshallingContext;

/**
 * @author kimchy
 */
public class ClassDynamicPropertyMappingConverter implements Converter {

    public boolean marshall(Resource resource, Object root, Mapping mapping, MarshallingContext context) throws ConversionException {
        ClassDynamicPropertyMapping dynamicPropertyMapping = (ClassDynamicPropertyMapping) mapping;
        if (root == null) {
            return false;
        }
        if (dynamicPropertyMapping.getObjectType() == ClassDynamicPropertyMapping.ObjectType.MAP) {
            return marshallMap(resource, root, context, dynamicPropertyMapping);
        } else {
            return marshallSimple(resource, root, context, dynamicPropertyMapping);
        }
    }

    public Object unmarshall(Resource resource, Mapping mapping, MarshallingContext context) throws ConversionException {
        // does not support unmarshalling, simply return null
        return null;
    }

    private boolean marshallMap(Resource resource, Object root, MarshallingContext context, ClassDynamicPropertyMapping dynamicPropertyMapping) {
        Map map = (Map) root;
        if (map.isEmpty()) {
            return false;
        }
        for (Iterator it = map.entrySet().iterator(); it.hasNext();) {
            Map.Entry entry = (Map.Entry) it.next();
            Object nameObj = entry.getKey();
            if (dynamicPropertyMapping.getNameGetter() != null) {
                nameObj = dynamicPropertyMapping.getNameGetter().get(nameObj);
            }
            if (nameObj == null) {
                continue;
            }
            ResourcePropertyConverter nameConverter = dynamicPropertyMapping.getNameConverter();
            if (nameConverter == null) {
                nameConverter = (ResourcePropertyConverter) context.getConverterLookup().lookupConverter(nameObj.getClass());
            }
            String name = nameConverter.toString(nameObj, null);
            if (dynamicPropertyMapping.getNamePrefix() != null) {
                name = dynamicPropertyMapping.getNamePrefix() + name;
            }

            Object valueObj = entry.getValue();
            if (dynamicPropertyMapping.getMapValueType() == ClassDynamicPropertyMapping.ValueType.PLAIN) {
                if (dynamicPropertyMapping.getValueGetter() != null) {
                    valueObj = dynamicPropertyMapping.getValueGetter().get(valueObj);
                }
                // don't save a null value if the context does not states so
                if (valueObj == null && !handleNulls(dynamicPropertyMapping.getResourcePropertyMapping(), context)) {
                    continue;
                }
                processNameAndValue(resource, context, dynamicPropertyMapping, name, valueObj);
            } else if (dynamicPropertyMapping.getMapValueType() == ClassDynamicPropertyMapping.ValueType.ARRAY) {
                int size = Array.getLength(valueObj);
                for (int i = 0; i < size; i++) {
                    Object valueItem = Array.get(valueObj, i);
                    if (dynamicPropertyMapping.getValueGetter() != null) {
                        valueItem = dynamicPropertyMapping.getValueGetter().get(valueItem);
                    }
                    if (valueItem == null && !handleNulls(dynamicPropertyMapping.getResourcePropertyMapping(), context)) {
                        continue;
                    }
                    processNameAndValue(resource, context, dynamicPropertyMapping, name, valueItem);
                }
            } else if (dynamicPropertyMapping.getMapValueType() == ClassDynamicPropertyMapping.ValueType.COLLECTION) {
                Collection valueCol = (Collection) valueObj;
                for (Iterator it2 = valueCol.iterator(); it2.hasNext();) {
                    Object valueItem = it2.next();
                    if (dynamicPropertyMapping.getValueGetter() != null) {
                        valueItem = dynamicPropertyMapping.getValueGetter().get(valueItem);
                    }
                    if (valueItem == null && !handleNulls(dynamicPropertyMapping.getResourcePropertyMapping(), context)) {
                        continue;
                    }
                    processNameAndValue(resource, context, dynamicPropertyMapping, name, valueItem);
                }
            }
        }

        return dynamicPropertyMapping.getResourcePropertyMapping().getStore() != Property.Store.NO;
    }

    private boolean marshallSimple(Resource resource, Object root, MarshallingContext context, ClassDynamicPropertyMapping dynamicPropertyMapping) {
        Object nameObj = dynamicPropertyMapping.getNameGetter().get(root);
        if (nameObj == null) {
            return false;
        }
        String name = dynamicPropertyMapping.getNameConverter().toString(nameObj, null);
        if (dynamicPropertyMapping.getNamePrefix() != null) {
            name = dynamicPropertyMapping.getNamePrefix() + name;
        }
        Object valueObj = dynamicPropertyMapping.getValueGetter().get(root);
        // don't save a null value if the context does not states so
        if (valueObj == null && !handleNulls(dynamicPropertyMapping.getResourcePropertyMapping(), context)) {
            return false;
        }
        processNameAndValue(resource, context, dynamicPropertyMapping, name, valueObj);

        return dynamicPropertyMapping.getResourcePropertyMapping().getStore() != Property.Store.NO;
    }

    private void processNameAndValue(Resource resource, MarshallingContext context, ClassDynamicPropertyMapping dynamicPropertyMapping, String name, Object valueObj) {
        if (dynamicPropertyMapping.getValueType() == ClassDynamicPropertyMapping.ValueType.ARRAY) {
            int size = Array.getLength(valueObj);
            for (int i = 0; i < size; i++) {
                Object valueItem = Array.get(valueObj, i);
                if (valueItem == null && !handleNulls(dynamicPropertyMapping.getResourcePropertyMapping(), context)) {
                    continue;
                }
                addProperty(resource, dynamicPropertyMapping, context, name, valueItem);
            }
        } else if (dynamicPropertyMapping.getValueType() == ClassDynamicPropertyMapping.ValueType.COLLECTION) {
            Collection valueCol = (Collection) valueObj;
            for (Iterator it = valueCol.iterator(); it.hasNext();) {
                Object valueItem = it.next();
                if (valueItem == null && !handleNulls(dynamicPropertyMapping.getResourcePropertyMapping(), context)) {
                    continue;
                }
                addProperty(resource, dynamicPropertyMapping, context, name, valueItem);
            }
        } else {
            ResourcePropertyConverter valueConverter = dynamicPropertyMapping.getValueConverter();
            if (valueConverter == null) {
                valueConverter = (ResourcePropertyConverter) context.getConverterLookup().lookupConverter(valueObj.getClass());
            }
            String value = valueConverter.toString(valueObj, dynamicPropertyMapping.getResourcePropertyMapping());
            Property property = context.getResourceFactory().createProperty(name, value, dynamicPropertyMapping.getResourcePropertyMapping());
            resource.addProperty(property);
        }
    }

    protected void addProperty(Resource resource, ClassDynamicPropertyMapping mapping, MarshallingContext context, String name, Object valueObj) {
        String value = mapping.getValueConverter().toString(valueObj, mapping.getResourcePropertyMapping());
        Property property = context.getResourceFactory().createProperty(name, value, mapping.getResourcePropertyMapping());
        resource.addProperty(property);
    }

    /**
     *
Should the converter handle nulls? Handling nulls means should the
     * converter process nulls or not. Usually the converter will not
     * persist null values, but sometimes it might be needed
     * ({@link org.compass.core.marshall.MarshallingContext#handleNulls()}).
     *
     *
If a specific null value is configured with the {@link org.compass.core.mapping.ResourcePropertyMapping}
     * then the converter will always handle nulls and write it.
     *
     * @param context The marshalling context
     * @return true if the converter should handle null values
     */
    protected boolean handleNulls(ResourcePropertyMapping resourcePropertyMapping, MarshallingContext context) {
        return resourcePropertyMapping.hasNullValue() || context.handleNulls();
    }

    /**
     * If the converter handle nulls, the value that will be stored in the
     * search engine for null values (during the marshall process). Uses
     * {@link org.compass.core.mapping.ResourcePropertyMapping#getNullValue()}.
     *
     * @param resourcePropertyMapping The resource proeprty mapping to get the null value from
     * @param context                 The marshalling context
     * @return Null value that will be inserted for nulls.
     */
    protected String getNullValue(ResourcePropertyMapping resourcePropertyMapping, MarshallingContext context) {
        return resourcePropertyMapping.getNullValue();
    }
}


text:
module.exports = function (grunt, options) {
  var baseTasks = {
    'install': ['shell:bower-install', 'shell:protractor-install'],

    // register before and after test tasks so we don't have to change cli
    // options on the CI server
    'before-test': ['clean', 'newer:jshint', 'newer:jscs', 'ngtemplates', 'less'], // Have to run less so CSS files are present
    'after-test': ['build'],
    'default': ['before-test', 'test:single', 'after-test'],

    // Build with no testing
    'build': ['ngtemplates', 'concat', 'uglify', 'fontello', 'less', 'ngdocs', 'copy'],

    // Auto-test tasks for development
    'autotest:unit': ['karmangular:start'],
    'autotest:e2e': ['shell:protractor-start'],

    // Testing tasks
    'test': ['before-test', 'test:single'],
    'test:ci': ['before-test', 'serialsauce'],
    'test:docs': ['connect:testserver', 'protractor:docs'],
    'test:e2e': ['connect:testserver', 'protractor:singlerun'],
    'test:ci-e2e': ['clean', 'build', 'connect:testserver', 'protractor:ci']
  };

  if (grunt.option('e2e') === false || grunt.option('fast') ){
    grunt.log.writeln("Skipping e2e testing...");
    baseTasks['dev'] = ['before-test', 'after-test', 'connect', 'autotest:unit', 'watch'];
  } else {
    baseTasks['dev'] = ['before-test', 'after-test', 'connect', 'autotest:unit', 'autotest:e2e', 'watch'];
  }

  if (process.env.TRAVIS){
    baseTasks['test:single'] = ['karma:travis'];
  } else {
    baseTasks['test:single'] = ['karmangular'];
  }

  var util = require('../lib/grunt/utils.js');
  var semver = require('semver');
  var currentTag = semver.clean( util.getCurrentTag() );

  if (currentTag){
    baseTasks['release'] = ['clean', 'ngtemplates', 'build', 'cut-release', 'gh-pages:ui-grid-site', 'update-bower-json', 'gh-pages:bower'];
  } else {
    baseTasks['release'] = ['clean', 'ngtemplates', 'build', 'cut-release', 'gh-pages:ui-grid-site'];
  }

  return baseTasks;
};


text:
import { Component } from '@angular/core';

@Component({
  selector: 'demo-dropdown-alignment',
  templateUrl: './menu-alignment.html'
})
export class DemoDropdownAlignmentComponent {
}


text:
<?php
namespace Lonquan\TaobaoSDK\Top\Request;

use Lonquan\TaobaoSDK\Top\RequestCheckUtil;
use Lonquan\TaobaoSDK\Top\RequestInterface;

/**
 * TOP API: taobao.sellercenter.role.info.get request
 *
 * @author auto create
 * @since  1.0, 2016.03.05
 */
class SellercenterRoleInfoGetRequest implements RequestInterface
{
    /**
     * 角色id
     **/
    private $roleId;

    private $apiParas = [ ];

    public function setRoleId($roleId)
    {
        $this->roleId = $roleId;
        $this->apiParas["role_id"] = $roleId;
    }

    public function getRoleId()
    {
        return $this->roleId;
    }

    public function getApiMethodName()
    {
        return "taobao.sellercenter.role.info.get";
    }

    public function getApiParas()
    {
        return $this->apiParas;
    }

    public function check()
    {

        RequestCheckUtil::checkNotNull($this->roleId, "roleId");
    }

    public function putOtherTextParam($key, $value)
    {
        $this->apiParas[ $key ] = $value;
        $this->$key = $value;
    }
}


text:
package org.h2.store.fs;

import java.io.IOException;
import java.nio.ByteBuffer;
import java.nio.channels.ClosedByInterruptException;
import java.nio.channels.ClosedChannelException;
import java.nio.channels.FileChannel;
import java.nio.channels.FileLock;

/**
 * A file system that re-opens and re-tries the operation if the file was
 * closed, because a thread was interrupted. This will clear the interrupt flag.
 * It is mainly useful for applications that call Thread.interrupt by mistake.
 */
public class FilePathRetryOnInterrupt extends FilePathWrapper {

    /**
     * The prefix.
     */
    static final String SCHEME = "retry";

    @Override
    public FileChannel open(String mode) throws IOException {
        return new FileRetryOnInterrupt(name.substring(getScheme().length() + 1), mode);
    }

    @Override
    public String getScheme() {
        return SCHEME;
    }

}

/**
 * A file object that re-opens and re-tries the operation if the file was
 * closed.
 */
class FileRetryOnInterrupt extends FileBase {

    private final String fileName;
    private final String mode;
    private FileChannel channel;
    private FileLockRetry lock;

    FileRetryOnInterrupt(String fileName, String mode) throws IOException {
        this.fileName = fileName;
        this.mode = mode;
        open();
    }

    private void open() throws IOException {
        channel = FileUtils.open(fileName, mode);
    }

    private void reopen(int i, IOException e) throws IOException {
        if (i > 20) {
            throw e;
        }
        if (!(e instanceof ClosedByInterruptException) &&
                !(e instanceof ClosedChannelException)) {
            throw e;
        }
        // clear the interrupt flag, to avoid re-opening many times
        Thread.interrupted();
        FileChannel before = channel;
        // ensure we don't re-open concurrently;
        // sometimes we don't re-open, which is fine,
        // as this method is called in a loop
        synchronized (this) {
            if (before == channel) {
                open();
                reLock();
            }
        }
    }

    private void reLock() throws IOException {
        if (lock == null) {
            return;
        }
        try {
            lock.base.release();
        } catch (IOException e) {
            // ignore
        }
        FileLock l2 = channel.tryLock(lock.position(), lock.size(), lock.isShared());
        if (l2 == null) {
            throw new IOException("Re-locking failed");
        }
        lock.base = l2;
    }

    @Override
    public void implCloseChannel() throws IOException {
        try {
            channel.close();
        } catch (IOException e) {
            // ignore
        }
    }

    @Override
    public long position() throws IOException {
        for (int i = 0;; i++) {
            try {
                return channel.position();
            } catch (IOException e) {
                reopen(i, e);
            }
        }
    }

    @Override
    public long size() throws IOException {
        for (int i = 0;; i++) {
            try {
                return channel.size();
            } catch (IOException e) {
                reopen(i, e);
            }
        }
    }

    @Override
    public int read(ByteBuffer dst) throws IOException {
        long pos = position();
        for (int i = 0;; i++) {
            try {
                return channel.read(dst);
            } catch (IOException e) {
                reopen(i, e);
                position(pos);
            }
        }
    }

    @Override
    public int read(ByteBuffer dst, long position) throws IOException {
        for (int i = 0;; i++) {
            try {
                return channel.read(dst, position);
            } catch (IOException e) {
                reopen(i, e);
            }
        }
    }

    @Override
    public FileChannel position(long pos) throws IOException {
        for (int i = 0;; i++) {
            try {
                channel.position(pos);
                return this;
            } catch (IOException e) {
                reopen(i, e);
            }
        }
    }

    @Override
    public FileChannel truncate(long newLength) throws IOException {
        for (int i = 0;; i++) {
            try {
                channel.truncate(newLength);
                return this;
            } catch (IOException e) {
                reopen(i, e);
            }
        }
    }

    @Override
    public void force(boolean metaData) throws IOException {
        for (int i = 0;; i++) {
            try {
                channel.force(metaData);
                return;
            } catch (IOException e) {
                reopen(i, e);
            }
        }
    }

    @Override
    public int write(ByteBuffer src) throws IOException {
        long pos = position();
        for (int i = 0;; i++) {
            try {
                return channel.write(src);
            } catch (IOException e) {
                reopen(i, e);
                position(pos);
            }
        }
    }

    @Override
    public int write(ByteBuffer src, long position) throws IOException {
        for (int i = 0;; i++) {
            try {
                return channel.write(src, position);
            } catch (IOException e) {
                reopen(i, e);
            }
        }
    }

    @Override
    public synchronized FileLock tryLock(long position, long size,
            boolean shared) throws IOException {
        FileLock l = channel.tryLock(position, size, shared);
        if (l == null) {
            return null;
        }
        lock = new FileLockRetry(l, this);
        return lock;
    }

    /**
     * A wrapped file lock.
     */
    static class FileLockRetry extends FileLock {

        /**
         * The base lock.
         */
        FileLock base;

        protected FileLockRetry(FileLock base, FileChannel channel) {
            super(channel, base.position(), base.size(), base.isShared());
            this.base = base;
        }

        @Override
        public boolean isValid() {
            return base.isValid();
        }

        @Override
        public void release() throws IOException {
            base.release();
        }

    }

    @Override
    public String toString() {
        return FilePathRetryOnInterrupt.SCHEME + ":" + fileName;
    }

}


text:
#include "dprint.h"
#include <radio.h>

//
// Hack: printInit() is both in this file and in dprint-serial.c
// to avoid discarding these files at link stage.
// This is just 6 byte overhead (code memory) by default,
// and significant savings if radio is not used.
//
void printInit(void)
{
    extern void printInitReal(void);
    printInitReal();
}

void radioPrint(const char* str)
{
#if 0
   if (!localMac) getSimpleMac()->init(NULL, false, NULL, 0);
   macSend(NULL, (uint8_t *) str, strlen(str) + 1);
#else
   // don't forget to call radioInit() somewhere!
   radioSend((uint8_t *) str, strlen(str) + 1);
   // mdelay(100); // wait a bit, to allow the radio to complete the sending
#endif
}

#if USE_NETWORK
void networkPrint(const char* str)
{
    static Socket_t socket;
    if (socket.port == 0) {
        socketOpen(&socket, NULL);
        socketBind(&socket, DPRINT_PORT);
        socketSetDstAddress(&socket, MOS_ADDR_ROOT);
    }
    socketSend(&socket, str, strlen(str) + 1);
}
#endif // USE_NETWORK


text:
require 'core/spec_helper'

describe ZendeskAPI::Collection do
  subject do
    ZendeskAPI::Collection.new(client, ZendeskAPI::TestResource)
  end

  context "initialization" do
    it "should set the resource class" do
      subject.instance_variable_get(:@resource_class).should == ZendeskAPI::TestResource
    end

    it "should initially be empty" do
      subject.instance_variable_defined?(:@resources).should be_false
    end
  end

  context "with array option passed in" do
    subject { ZendeskAPI::Collection.new(client, ZendeskAPI::TestResource, :ids => [1, 2, 3, 4]) }

    it "should join array with commas" do
      subject.instance_variable_get(:@options)[:ids].should == "1,2,3,4"
    end
  end

  context "deferral" do
    before(:each) do
      stub_json_request(:any, %r{test_resources}, json(:test_resource => {}))
    end

    it "should defer #create to the resource class" do
      subject.create
    end

    it "should defer #find to the resource class" do
      subject.find(:id => 1)
    end

    it "should defer #destroy to the resource class" do
      subject.destroy(:id => 1)
    end

    it "should defer #update to the resource class" do
      subject.update(:id => 1)
    end

    context "with a class with a parent" do
      let(:association) do
        ZendeskAPI::Association.new(:class => ZendeskAPI::TestResource::TestChild,
          :parent => ZendeskAPI::TestResource.new(client, :id => 1))
      end

      subject do
        ZendeskAPI::Collection.new(client, ZendeskAPI::TestResource::TestChild,
          :association => association)
      end

      before(:each) do
        stub_json_request(:any, %r{/test_resources/\d+/child}, json("test_child" => {}))
      end

      it "should defer #create to the resource class with the parent id" do
        subject.create
      end

      it "should defer #destroy the resource class with the parent id" do
        subject.destroy(:id => 1)
      end

      it "should defer #find to the resource class with the parent id" do
        subject.find(:id => 1)
      end

      it "should defer #update to the resource class with the parent id" do
        subject.update(:id => 1)
      end

      context "on object push" do
        before(:each) do
          stub_json_request(:get, %r{test_resources/\d+/children}, json(:test_children => []))
          subject << { :id => 1 }
        end

        it "should pass association" do
          subject.last.association.should == association
        end
      end
    end
  end

  context "pagination with data" do
    before(:each) do
      stub_json_request(:get, %r{test_resources}, json(
        :test_resources => [{ :id => 1 }]
      ))
      subject.fetch(true)
    end

    context "on #page" do
      context "with nil" do
        before(:each) { subject.page(nil) }

        it "should not empty the cache" do
          subject.instance_variable_get(:@resources).should_not be_empty
        end
      end

      context "with a number" do
        before(:each) { subject.page(3) }

        it "should empty the cache" do
          subject.instance_variable_get(:@resources).should be_nil
        end
      end
    end

    context "on #per_page" do
      context "with nil" do
        before(:each) { subject.per_page(nil) }

        it "should not empty the cache" do
          subject.instance_variable_get(:@resources).should_not be_empty
        end
      end

      context "with a number" do
        before(:each) { subject.per_page(20) }

        it "should empty the cache" do
          subject.instance_variable_get(:@resources).should be_nil
        end
      end
    end
  end

  context "pagination with no options and no data" do
    it "should return an empty array on #next" do
      subject.next.should be_empty
    end

    it "should return an empty array on #prev" do
      subject.prev.should be_empty
    end
  end

  context "pagination with options and no data" do
    before(:each) { subject.per_page(5).page(2) }

    it "should set per_page option" do
      subject.per_page(10).should == subject
      subject.instance_variable_get(:@options)["per_page"].should == 10
    end

    it "should set page option" do
      subject.page(10).should == subject
      subject.instance_variable_get(:@options)["page"].should == 10
    end

    it "should increate page option" do
      subject.next.should == 3
    end

    it "should decreate page option" do
      subject.prev.should == 1
    end
  end

  context "each_page" do
    context "Faraday errors" do
      before(:each) do
        stub_json_request(:get, %r{test_resources$}, json(
          :test_resources => [{:id => 1}], :next_page => "/test_resources?page=2"
        ))

        stub_request(:get, %r{test_resources\?page=2}).to_return(:status => 500).then.to_return(
          :headers => { :content_type => "application/json" }, :status => 200,
          :body => json(:test_resources => [{:id => 2}], :next_page => "/test_resources?page=3"))

        stub_request(:get, %r{test_resources\?page=3}).to_return(:status => 404)
      end

      it "should retry from the same page" do
        class SearchError < Exception; end

        expect do |b|
          client.insert_callback do |env|
            if env[:status] == 500 && env[:url].request_uri =~ /test_resources/
              raise SearchError
            end
          end

          begin
            silence_logger { subject.each_page(&b) }
          rescue SearchError
            retry
          end
        end.to yield_successive_args(
          [ZendeskAPI::TestResource.new(client, :id => 1), 1],
          [ZendeskAPI::TestResource.new(client, :id => 2), 2]
        )
      end
    end

    context "successful requests" do
      before(:each) do
        stub_json_request(:get, %r{test_resources$}, json(
          :test_resources => [{:id => 1}],
          :next_page => "/test_resources?page=2"
        ))

        stub_json_request(:get, %r{test_resources\?page=2}, json(
          :test_resources => [{:id => 2}],
          :next_page => "/test_resources?page=3"
        ))

        stub_request(:get, %r{test_resources\?page=3}).to_return(:status => 404)
      end

      it "should yield resource if arity == 1" do
        expect do |block|
          # Needed to make sure the arity == 1
          block.instance_eval do
            def to_proc
              @used = true

              probe = self
              Proc.new do |arg|
                probe.num_yields += 1
                probe.yielded_args << [arg]
              end
            end
          end

          silence_logger { subject.each_page(&block) }
        end.to yield_successive_args(
          ZendeskAPI::TestResource.new(client, :id => 1),
          ZendeskAPI::TestResource.new(client, :id => 2)
        )
      end

      it "should yield resource and page" do
        expect do |b|
          silence_logger { subject.each_page(&b) }
        end.to yield_successive_args(
          [ZendeskAPI::TestResource.new(client, :id => 1), 1],
          [ZendeskAPI::TestResource.new(client, :id => 2), 2]
        )
      end
    end
  end

  context "fetch" do
    context "grabbing the current page" do
      context "from next_page" do
        before(:each) do
          stub_json_request(:get, %r{test_resources}, json(
            :test_resources => [{:id => 2}],
            :next_page => "/test_resources?page=2"
          ))

          subject.fetch(true)
          @page = subject.instance_variable_get(:@options)["page"]
        end

        it "should set the page to 1" do
          @page.should == 1
        end
      end

      context "from prev_page" do
        before(:each) do
          stub_json_request(:get, %r{test_resources}, json(
            :test_resources => [{:id => 2}],
            :previous_page => "/test_resources?page=1"
          ))

          subject.fetch(true)
          @page = subject.instance_variable_get(:@options)["page"]
        end

        it "should set the page to 2" do
          @page.should == 2
        end
      end

      context "with nothing" do
        before(:each) do
          stub_json_request(:get, %r{test_resources}, json(:test_resources => [{:id => 2}]))
          subject.fetch(true)
          @page = subject.instance_variable_get(:@options)["page"]
        end

        it "should not set the page" do
          @page.should be_nil
        end
      end
    end

    it "does not fetch if associated is a new record" do
      ZendeskAPI::Category.new(client).forums.fetch.should == []
      ZendeskAPI::Category.new(client).forums.to_a.should == []
    end

    context "with client error" do
      before(:each) do
        stub_request(:get, %r{test_resources}).to_return(:status => 500)
      end

      it "should properly be handled" do
        silence_logger { subject.fetch(true).should be_empty }
      end
    end

    context "with unfetchable resource" do
      subject { ZendeskAPI::Collection.new(client, ZendeskAPI::NilResource) }

      it "should not call connection" do
        client.connection.should_not_receive(:get)
        subject.fetch(true).should be_empty
      end
    end
  end

  context "save" do
    let(:options) { { :abc => 1 } }
    before(:each) do
      stub_json_request(:get, %r{test_resources}, json(:test_resources => []))
      subject.clear_cache
    end

    context "with a hash" do
      let(:object) { mock('ZendeskAPI::TestResource', :changes => [:xxx]) }

      it "should call create with those options" do
        ZendeskAPI::TestResource.should_receive(:new).
          with(client, options.merge(:association => subject.association)).
          and_return(object)

        subject << options

        object.should_receive(:save)
        subject.save

        subject.should include(object)
      end
    end

    context "with a new object" do
      let(:object) { ZendeskAPI::TestResource.new(client, options) }
      before(:each) do
        subject << object
      end

      it "should save object" do
        object.should_receive(:save)
        subject.save
      end

      it "should have object in collection" do
        subject.should include(object)
      end
    end

    context "with everything else" do
      it "should pass to new, since this is how attachment handles it" do
        attachment = mock(:changes => [:xxx])
        ZendeskAPI::TestResource.should_receive(:new).with(client, "img.jpg").and_return attachment
        subject << "img.jpg"

        attachment.should_receive :save
        subject.save
      end
    end
  end

  context "without real data" do
    subject do
      ZendeskAPI::Collection.new(client, ZendeskAPI::User)
    end

    before(:each) do
      stub_json_request(:get, %r{users\?page=2}, json(
        :users => [{:id => 2}],
        :next_page => "/users?page=3&per_page=1",
        :previous_page => "/users?page=1&per_page=1"
      ))

      subject.per_page(1).page(2)
      subject.fetch(true)
    end

    context "pagination with no options" do
      before(:each) do
        stub_json_request(:get, %r{users\?page=(1|3)}, json(:users => [{:id => 3}]))

        subject.per_page(nil).page(nil)
      end

      it "should find the next page by calling fetch" do
        current = subject.to_a.dup
        nxt = subject.next

        nxt.size.should == 1
        nxt.should_not == current
      end

      it "should find the prev page by calling fetch" do
        current = subject.to_a.dup
        prev = subject.prev

        prev.size.should == 1
        prev.should_not == current
      end
    end

    context "pagination with options", :vcr do
      before(:each) { subject.per_page(1).page(2) }

      it "should increase page option and not call fetch" do
        subject.next.should == 3
      end

      it "should decrease page option and not call fetch" do
        subject.prev.should == 1
      end

      context "with page == 1" do
        before do
          subject.page(1)
          subject.clear_cache
          subject.should_not_receive(:fetch)
        end

        it "should do nothing on #prev" do
          subject.prev.should == []
        end
      end
    end
  end

  context "side loading" do
    before(:each) do
      subject.include(:nil_resources)
    end

    context "singular id on resource" do
      before(:each) do
        ZendeskAPI::TestResource.has ZendeskAPI::NilResource

        stub_json_request(:get, %r{test_resources\?include=nil_resources}, json(
          :test_resources => [{ :id => 1, :nil_resource_id => 4 }],
          :nil_resources => [{ :id => 1, :name => :bye }, { :id => 4, :name => :hi }]
        ))

        subject.fetch(true)

        @resource = subject.detect {|res| res.id == 1}
      end

      it "should side load nil_resources" do
        @resource.nil_resource.should_not be_nil
      end

      it "should side load the correct nil_resource" do
        @resource.nil_resource.name.should == "hi"
      end
    end

    context "multiple resources" do
      before(:each) do
        ZendeskAPI::TestResource.has ZendeskAPI::NilResource

        stub_json_request(:get, %r{test_resources\?include=nil_resources}, json(
          :test_resources => [{ :id => 1, :nil_resource_id => 4 }, { :id => 2, :nil_resource_id => 1 }],
          :nil_resources => [{ :id => 1, :name => :bye }, { :id => 4, :name => :hi }]
        ))

        subject.fetch(true)

      end

      context "first resource" do
        before(:each) { @resource = subject.detect {|res| res.id == 1} }

        it "should side load nil_resources" do
          @resource.nil_resource.should_not be_nil
        end

        it "should side load the correct nil_resource" do
          @resource.nil_resource.name.should == "hi"
        end
      end

      context "second resource" do
        before(:each) { @resource = subject.detect {|res| res.id == 2} }

        it "should side load nil_resources" do
          @resource.nil_resource.should_not be_nil
        end

        it "should side load the correct nil_resource" do
          @resource.nil_resource.name.should == "bye"
        end
      end
    end

    context "plural ids on resource" do
      before(:each) do
        ZendeskAPI::TestResource.has_many ZendeskAPI::NilResource

        stub_json_request(:get, %r{test_resources\?include=nil_resources}, json(
          :test_resources => [{ :id => 1, :nil_resource_ids => [1, 4] }],
          :nil_resources => [{ :id => 1, :name => :hi }, { :id => 4, :name => :hello }, { :id => 5, :name => :goodbye }]
        ))

        subject.fetch(true)

        @resource = subject.detect {|res| res.id == 1}
      end

      it "should side load nil_resources" do
        @resource.nil_resources.should_not be_empty
      end

      it "should side load the correct nil_resources" do
        @resource.nil_resources.map(&:name).should == %w{hi hello}
      end
    end

    context "ids in side load" do
      before(:each) do
        ZendeskAPI::TestResource.has_many ZendeskAPI::NilResource

        stub_json_request(:get, %r{test_resources\?include=nil_resources}, json(
          :test_resources => [{ :id => 1 }],
          :nil_resources => [{ :id => 1, :test_resource_id => 2 }, { :id => 2, :test_resource_id => 1 }, { :id => 4, :test_resource_id => 1 }]
        ))

        subject.fetch(true)
        @resource = subject.detect {|res| res.id == 1}
      end

      it "should side load nil_resources" do
        @resource.nil_resources.should_not be_empty
      end

      it "should side load the correct nil_resources" do
        @resource.nil_resources.map(&:id).should == [2, 4]
      end
    end

    context "id in side load" do
      before(:each) do
        ZendeskAPI::TestResource.has ZendeskAPI::NilResource

        stub_json_request(:get, %r{test_resources\?include=nil_resources}, json(
          :test_resources => [{ :id => 1 }],
          :nil_resources => [{ :id => 1, :test_resource_id => 2 }, { :id => 2, :test_resource_id => 1 }]
        ))

        subject.fetch(true)
        @resource = subject.detect {|res| res.id == 1}
      end

      it "should side load nil_resources" do
        @resource.nil_resource.should_not be_nil
      end

      it "should side load the correct nil_resources" do
        @resource.nil_resource.id.should == 2
      end
    end

    context "with name as key" do
      before(:each) do
        ZendeskAPI::TestResource.has ZendeskAPI::NilResource, :include_key => :name

        stub_json_request(:get, %r{test_resources\?include=nil_resources}, json(
          :test_resources => [{ :id => 1, :nil_resource_id => 4 }],
          :nil_resources => [{ :name => 1 }, { :name => 4 }]
        ))

        subject.fetch(true)

        @resource = subject.detect {|res| res.id == 1}
      end

      it "should side load nil_resources" do
        @resource.nil_resource.should_not be_nil
      end

      it "should side load the correct nil_resource" do
        @resource.nil_resource.name.should == 4
      end
    end

    context "sub-loading" do
      before(:each) do
        ZendeskAPI::TestResource.has ZendeskAPI::TestResource::TestChild
        ZendeskAPI::TestResource::TestChild.has ZendeskAPI::NilResource

        stub_json_request(:get, %r{test_resources\?include=nil_resources}, json(
          :test_resources => [{ :id => 1, :test_child => { :nil_resource_id => 4 } }],
          :nil_resources => [{ :id => 1 }, { :id => 4 }]
        ))

        subject.fetch(true)

        @resource = subject.detect {|res| res.id == 1}.test_child
      end

      it "should side load nil_resources" do
        @resource.nil_resource.should_not be_nil
      end

      it "should side load the correct nil_resource" do
        @resource.nil_resource.id.should == 4
      end
    end
  end

  context "method missing" do
    before(:each) { subject.stub(:fetch).and_return([1, 2, nil, 3]) }

    context "with an class method on the resource class" do
      it "should pass methods to class if defined" do
        subject.test.should == "hi"
      end
    end

    it "should pass all methods not defined to resources" do
      subject.compact.should == [1, 2, 3]
    end

    it "should take a block" do
      subject.map {|i| i.to_i + 1}.should == [2, 3, 1, 4]
    end

    it "should create a new collection if it isn't an array method" do
      subject.recent.should be_instance_of(ZendeskAPI::Collection)
    end

    it "should pass the correct query_path to the new collection" do
      subject.recent.instance_variable_get(:@collection_path).last.should == :recent
    end
  end

  context "with a module (Search)" do
    subject { ZendeskAPI::Collection.new(client, ZendeskAPI::Search, :query => "hello") }

    before(:each) do
      stub_json_request(:get, %r{search\?query=hello}, json(:results => []))
    end

    it "should not blow up" do
      subject.to_a.should == []
    end
  end

  context "with different path" do
    subject do
      ZendeskAPI::Collection.new(client, ZendeskAPI::TestResource, :collection_path => ["test_resources", "active"])
    end

    before(:each) do
      stub_json_request(:post, %r{test_resources/active})
    end

    context "deferral" do
      it "should defer #create to the resource class with proper path" do
        subject.create
      end
    end
  end
end


text:
E_BADARGS=65

EXPECTED_ARGS=3

if [ $# -ne $EXPECTED_ARGS ]
then
  echo " This script expect $EXPECTED_ARGS arguments instead of $#"
  exit $E_BADARGS
fi

MV=$(which mv)
RM=$(which rm)
DATE=$(which date)
SED=$(which sed)
CAT=$(which cat)
AWK=$(which awk)

COMPOSER=$(which composer)

### CONFIG
DEP_NAME=$1
DEP_BRANCH=$2
DEP_USER=$3

. $($(which dirname) $($(which readlink) -f "$0"))/autodeploy-common.sh

# Clonar RAMA REPO con submoduless en dir tmp
# clone-with-subs.sh $REPO $BRANCH $TARGET
. $LIB/clone-with-subs.sh $REPO_BARE $DEP_BRANCH $TMP_DIR $TAG

# Copiar files y settings
# copy-files-settings.sh $SOURCE $TARGET
. $LIB/symfony-copy-files-settings.sh $DST_DIR $TMP_DIR

C_DIR=$(pwd)
cd $TMP_DIR
# ensure composer is installed
if [ "${COMPOSER}" = "" ]; then
  curl -sS https://getcomposer.org/installer | php
  COMPOSER="php composer.phar"
fi
${COMPOSER} self-update
${COMPOSER} install --optimize-autoloader

umask 002
php app/console assets:install web
ENDING=$(echo ${SITE_NAME} | ${AWK} -F. '{print $NF}')
case ${ENDING} in
  staging | devel | demo1 | demo2 )
    S_ENVIRONMENT="${ENDING}"
    php app/console statics:generator --env=${S_ENVIRONMENT}
    ;;
  * )
    S_ENVIRONMENT='prod'
    ;;
esac

cd $C_DIR

# Arreglar permisos
# fix-drupal-perms.sh $TARGET
if [ "${FIX_PERMS}" = 'true' ]; then
  . $LIB/symfony-fix-perms.sh $TMP_DIR
fi

# Firmar Robots
REPO_HASH=$($CAT $TMP_DIR/.git_hash)
REPO_DATE=$($CAT $TMP_DIR/.git_date)
SIGN="# Environment generated by $DEP_USER from $DEP_BRANCH (hash: $REPO_HASH, date: $REPO_DATE) for site $SITE_NAME on $($DATE '+%Y-%m-%d %H:%M %Z')"
$SED  -i  '1{s|^|'"${SIGN}\n"'|}' $TMP_DIR/web/robots.txt

# Eliminar archivos no para produccion
$RM $TMP_DIR/.git*

# Loggear despliegue
echo -e "$($DATE '+%Y-%m-%d %H:%M %Z')\t$DEP_BRANCH\t$REPO_DATE\t$REPO_HASH\t$DEP_USER" >> $LOG_FILE

$RM -r $DST_DIR
$MV $TMP_DIR $DST_DIR

# Reload apache
restartServerIfNecesary

# Borrar caches
pushd $(pwd)
cd $DST_DIR
if [ -e symfony ]; then
  php symfony cc
  php symfony doctrine:migrate
elif [ -e app/console ]; then
  php app/console cache:clear --env=${S_ENVIRONMENT}
  #php app/console doctrine:migrate
fi
popd

# Clean Varnish
cleanVarnishIfNecesary

exit 0


text:
<!DOCTYPE html>

  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">

    <meta name="viewport" content="width=device-width, initial-scale=1">

  <link rel="shortcut icon" type="image/x-icon" href="/favicon.ico" />

  <title>
      "Nancy Grows Up," the Media Age, and the Historian's Craft—The Appendix
    </title>
  <meta name="description" content="Historians have mostly relied on the printed page to communicate their work. But what about sound? Michael Schmidt looks to the alternate aural history of th...">

  <link rel="stylesheet" href="/scripts/fancybox/jquery.fancybox.css">

  <link rel="stylesheet" href="/css/main.css">

    <link rel="stylesheet" href="/css/issue-1-3.css">

  <link rel="canonical" href="http://theappendix.net/issues/2013/7/nancy-grows-up-the-media-age-and-the-historians-craft">
  <link rel="alternate" type="application/rss+xml" title="The Appendix" href="http://theappendix.net/feed.xml">

        Out Loud—July 2013—Vol. 1, No. 3

Issues

Blog

Contributors

About

"Nancy Grows Up," the Media Age, and the Historian's Craft

        By Michael Schmidt –

    Published September 3, 2013

Benjamin Breen, 2013, based on a photograph of Tony Schwartz in the 1950s

The Challenge of "Nancy Grows Up"

It begins with anxious crying. The plaintive sound only lasts a few moments before the screams drop into a slightly lower register and transform into a calm murmur. The sound repeats, then breaks into the rudiments of language. It sings—or tries—and falters. A man helps, playing a game with a familiar rhyme: "Jack and Jill went up the … to fetch a pail of … Jack fell down and broke his … and Jill came tumbling …"

She fills in the appropriate words and, as she does, we suddenly meet her.

For the remaining minute and forty-two seconds we hear and follow Nancy. We listen to her development as a person through a variety of situations: she wishes her father a happy birthday, she lists what she wants for Christmas ("a puppy and a whistle and a horn and a hat and a dress and a ballerina costume"), she explains how to housetrain a dog, and she expresses her feelings about the Russians sending the dog Laika into space. All the while Nancy's voice grows increasingly distinct, speaks longer, takes on and sheds accents, and uses increasingly sophisticated vocabulary. Finally, the recording ends, but it does so just as we witness what seems like a personal milestone. Nancy becomes silent just after we see the door open on her developing sexuality. In the last and longest of the voices, after updating us on what she has been doing at school, she sighs and confesses, "and I've been discovering boys."

"Nancy Grows Up"
"Nancy Grows Up"

Recorded over the course of the 1950s and the early 1960s, "Nancy Grows Up" gives us a beautiful and stimulating portrait of growth. It is an audio montage; Tony Schwartz, its creator, continuously taped his niece from her first month of life to the age of thirteen and, later, spliced together pieces chronologically. Schwartz likened what he did to time-lapse photography: it condenses the story of thirteen years, as Schwartz said, in less than two and a half minutes.

"Nancy Grows Up" is more than a simple novelty piece. Poetic and expository, it reveals a type of storytelling that has an enigmatic intelligibility. Offering a biographical history of development, "Nancy" narrates the phases and stages of a young girl's early life. It does so quite successfully and evocatively and achieves a rich unspoken analysis in its juxtaposition of different voices, words, and timbre.

Confronted with the possibilities of communication in "Nancy," one can't help but ask, "why have historians neglected sound?" Despite more than a century and a half of ongoing media revolutions, historians—especially professional academic historians—have largely worked within a self-imposed textual ghetto. Why have historians restricted themselves to written histories? Why only the monograph and journal article after the advent of the photo essay, the LP record, the radio show, documentary film, and animation short?

There do seem to be substantial reasons for why we have continued to rely almost exclusively on text. It is beyond the scope of this piece to attempt to give a comprehensive explanation of this phenomenon, but a few things come immediately to mind. Text's capacity to transmit large masses of information, for example, is attractive. The monograph and article also parallel and allow the exact reproduction of what has been most historians' primary source: written documents. Furthermore, the footnote, the sine qua non of historical scholarship and the linguistic technology for and symbol of the discipline's seriousness and rigor, appears almost inextricably grounded in the text.

Beginning to rethink the footnote outside the page only seemed possible recently. Internet-based publications have shown that digital footnotes can reference sources in more direct ways, offer more detail and information, and, possibly, shift the function of the footnote altogether. The blog maintained by The Appendix, for example, uses hyperlink footnotes to immediately show the content of a source or acquaint the reader with information about an obscure person or organization.

Text has served historians well, but it is useful to ask if we have missed whole modes of analysis and presentation with such a consistently narrow range of media. How, for example, has the primacy of text and the page shaped how we understand and judge historical scholarship as a whole? Hayden White famously asserted that historical interpretation is shaped by the plot structures of particular kinds of stories—the romance, the tragedy, the comedy, and the satire—but we can go one step further: history as a discipline has also been fundamentally structured by its medium. The way we conceive of the work of history and, thus, the field in which history can be told and debated are intimately intertwined with and determined by the advantages and limitations of the written word.

There is nothing essential linking history and text. Historians can and should embrace other media in the production of history. Fortunately, there are considerable guideposts for a journey into new media; our neglect has not been for a lack of evidence of the unique and intriguing capabilities of other media.

The use and exploration of sound and sound technology offer clear examples of this. "Nancy Grows Up" was not an isolated piece; it was part of a large, rich history of thinking about and through sound in the twentieth century. Even a brief account of sound technology shows that there is a considerable body of work in other media that historians could learn from and draw on.

Looking at some of the ideas and practices surrounding "Nancy" illuminates some of the ways non-historians have sought to engage sound narrative and documentation.

Telling with Sound: A Very Short History

The cover of Tony Schwartz's 1959 LP, The New York Taxi Driver.
Folkways Records

From the late 1920s until the early 1950s, American radio drama, comedies, and soap operas pioneered new ways of conveying stories and ideas through voice and other auditory material. These shows worked out, in the words of radio scholar Susan Douglas, a mode of "story listening." Although primarily a source of entertainment, Orson Welles's 1938 famous Mercury Theater production of War of the Worlds—and the consequent panic that a Martian invasion was under way—demonstrates the immense power and effect that audio stories could wield. Welles's ability to create hysteria and horror in his listeners was a direct consequence of his "media sense"—his talent at adapting storytelling to his artistic vehicle.

Across the pond, intellectuals quickly used the young technology as material for modernist experimentation. During the late 1920s and early 1930s, German artists sought to create a radio-specific art form, i.e., an artistic genre that would reveal and marshal radio's unique characteristics. The intriguing possibilities of the ether attracted a number of artists from outside the musical or theatrical world; established writers like Alfred Döblin and future film directors like Max Ophüls and Billy Wilder produced Hörbilder (literally, listening pictures) and Hörspiele (listening plays). In 1930, the avant-garde director Walter Ruttmann produced the following:

Walter Ruttmann, Wochenende, (1930)
Walter Ruttmann, Wochenende, (1930)

A film soundtrack without the accompanying picture, Wochenende is the story of a weekend. Ruttmann had spent much of the previous decade making "Absolute Film," abstract films which attempted to capture the essential qualities of the filmic medium. With Wochenende, he tried to do the same with sound. Working with new sound film technology, he isolated the soundtrack and built a narrative using a montage of noises, identifiable sounds, and speech-fragments.

Germans were not the only Europeans playing with the open possibilities of radio form. Around the same time, Lance Sieveking attempted his own experiments in "wireless imagination" at the BBC and Italian Futurists like Fillipo Marinetti produced music and theater for fascist radio.

Others, like Paul Daharme, Sir Oliver Lodge, and Rudolf Arnheim, wrote and theorized about the possibilities of the disembodied auditory content of radio during the interwar period. For many, the ethereal and mysterious qualities of radio could foster outlandish hopes and fantasies. Daharme and Lodge, for example, believed that the ether granted access to new psychological and metaphysical spaces. Daharme, a French advertiser and experimental radio practitioner, believed that broadcasting could reach directly into the unconscious and radio works could provoke a psychoactive space in which individuals would encounter their own theater of the mind. Lodge, a pioneer in radio technology and revered British scientist, argued that the ether comingled with the realm of the dead and that broadcasting could be used as a spiritualist tool to communicate with lost love ones.

Arnheim stayed a bit closer to the ground. Like Daharme and Lodge, however, he was also fascinated by radio's ability to detach sound from image. After years thinking about images as a film critic, he wrote Radio: The Art of Sound. In it he pondered the power of isolated sounds and the audio-specific methods through which radio could tell stories.

The ether was not only used for fiction and modernist abstraction, however. Radio journalists also produced documentary news programs. By the late 1930s, broadcast journalism had supplanted newspapers for immediate news coverage in the United States, and most Americans on the home front experienced World War II on a day-to-day basis through listening. Radio journalism employed all sorts of sounds—location noises, sound effects, monologues, and dialogues—in order to move audiences between "informational listening" (taking in facts) and "dimensional listening" (where, for example, "people were compelled to conjure up maps, topographies, street scenes in London after a bombing").

After their introduction in 1948, long playing records provided new materials and resources to explore the story-telling and documentary capabilities of sound. In addition to being repeatable, LPs had a distinct advantage over radio: their multi-faceted presentation format. Record producers and designers could use the non-aural parts of the LP—the label, cover, photos, and liner notes—to guide the listener's perceptions and stoke their imagination. Ever the brilliant pioneer, Schwartz made a number of innovative narrative and representational experimental recordings for Folkway Records, including An Actual Story in Sound of a Dog's Life, New York 19, Nueva York: A Tape Documentary of Puerto Rican New Yorkers, and The World in My Mailbox.

The cover of An Actual Story in Sound of a Dog's Life, 1958.
Folkways Records

"Nancy" was an intersection of techniques developed in radio and on LP. Originally produced for Schwartz's show Around New York on New York Public Radio, he reworked and released it more than once on record. First appearing as "History of a Voice" in 1962 on You're Stepping on My Shadow: "Sound Stories" of NYC, he re-presented it as "Nancy" on Records the Sounds of Children in 1970. Although utilizing the same base recordings, they told their story a bit differently: "History" utilizes voice-over narration like a radio news piece while "Nancy" edits together sounds in a way similar to Ruttmann. Both were packaged with a cover and notes.

During the period that Schwartz released "History" and "Nancy," other LP projects approached history more directly. In the early 1960s, for example, Time-Life released The Sounds of History, a twelve-volume set of records that intertwined short explanations of events, readings of documents and literature, recordings, and contemporary music to evoke sonic portraits of important eras in the history of the United States. Later in the decade, torch singer and Batman star Eartha Kitt helped record narrative biographies of important African Americans in the two-volume set Black Pioneers in American History.

The largest engagement with telling history on records during the period occurred, not surprisingly, in the sphere of music. Some did it within music itself—ambitious albums like Duke Ellington's Black, Brown, and Beige or the Kinks' Arthur (Or the Rise and Fall of the British Empire) attempt to paint large historical shifts through suite-like musical assemblages. Others used records to present the history of music through documents; record companies, for example, offered overviews of musical genres by collecting together and chronologically ordering recordings. These projects could become quite ambitious—the most cursory and expansive collection of this sort, the 1962 record collection 2,000 Years of Music, tried to capture "a concise history of the development of music from the earliest times through the 18th century" on four LP sides.

"Nancy" and the New Work of History

This is a just sketch, but it gives us a sense of the wide range of work that has been done exploring the narrative and communication possibilities of sound technology before the digital age. They demonstrate the ample resources and precedents to which historians might turn and build on if we wished to expand beyond paper and the PDF. Despite this extensive engagement with sound as a narrative medium, however, these experiments and treatises have largely taken place outside the historical discipline. Sound creators and thinkers have remained outliers and outsiders.

This non-engagement with sound seems surprising, given the significant place that speech plays in the profession. Historians have taught through lectures for centuries, and conference presentations have become an expected part of membership in the profession. These forms of audio scholarship have not been engaged as 'works' of history, however, unless published in journals or in edited volumes. It is quite possible that universities' insistence on written scholarship as the litmus test for academic success has played a crucial role in the centrality of the text within history.

But what might sonic forms of historical scholarship look and sound like? How can historians marshal these forms to tell history? This question remains largely unanswered at the moment, and this openness is full of exciting possibilities.

Listening to "Nancy" once again in another context may give us some hints, however. Let's listen to the final segment of it, along with something a little more:

Radiolab, "Time", (2007)
Radiolab, "Time", (2007)

In 2007, "Nancy" was used in its entirety in the Radiolab episode "Time." Radiolab and other public radio programs like This American Life have built on the foundations of sonic thinking and experimentation outlined above and embodied by Schwartz and "Nancy." These programs remain most Americans' contact (if they have any at all) with the legacy and form of these sonic experiments. Although it is not strictly concerned with history, Radiolab consistently employs sophisticated ideas, arguments, and narratives from current historical scholarship. The discussion of time employed as part of their discussion of "Nancy," for example, is indebted to cultural histories of the standardization of time like Wolfgang Schivelbusch's The Railway Journey.

Radio and sound recordings are not the only vehicles that we historians have excluded. The other media that seem most obvious for us to embrace—television and film—have also been pushed beyond the disciplinary pale. Ken Burns's documentaries and the History Channel, for example, are seldom considered part of the scholarly conversation and are often seen as non-specialist intrusions into "serious history," despite their formative impact on the popular imagination of the past. Incursions by historians into other types of media—like the film version of Natalie Zemon Davis's The Return of Martin Guerre or Niall Ferguson's multi-episode version of The Ascent of Money—have been relatively rare and are often conducted or spearheaded by people not considered part of the scholarly community.

The main point is not that all historians need to begin making sound documentaries, but that there are rich resources outside the text that we have neglected. Sound recording is but one device. Indeed, my own experience within the classroom has demonstrated that historians are increasingly moving towards multi-media presentations within teaching—using music on Youtube, photographs, blogs, and film footage—both to expand the range of sources and to try to engage students through the media that are the most familiar to them. Scholarship should follow suit. The increasing move towards the digitalization of academic work—as PDFs or online books—is an incredible opportunity to begin to rethink the historical work. At the same time, it could allow us to dialogue with audiences that are receptive to Errol Morris's documentaries and podcasts of Fresh Air but who find academic monographs tedious or difficult to approach.

If we accept Walter Benjamin's argument that perception and communication are historical and formed by their social and technological contexts, then historians are lagging behind. Creating scholarship has long required that historians learn the art of writing; there is no reason that the historian's craft could not begin to include a fluency in other technologies and media. If, as historians, we took such a turn, we could open up new horizons for historical scholarship and begin to speak a language more attuned to a larger public.

Editor's Note: For a related exploration of 'sonic forms of historical scholarship' see Amber Abbas's "For the Sound of Her Voice" elsewhere in this issue.

**Michael Schmidt** is a Ph.D candidate in modern German history and sound culture at the University of Texas at Austin.

Elsewhere in this issue…

              1.
              Letter From the Editors

              2.
              Letters to The Appendix

              3.
              Happy Birds: Darwin on Avian Song

              4.
              For the Sound of Her Voice

              5.
              Tuned to the Senses: An Archaeoacoustic Perspective on Ancient Chavín

              6.
              Deadly Notes: Atlantic Soundscapes and the Writing of the Middle Passage

              7.
              "Come hear this ditty": Seventeenth-Century Drinking Songs and the Challenges of Hearing the Past

              8.
              Psalms and Silence: The Soundtrack of John Williams's Captivity

              9.
              Supernatural Sound: Science and Shamanism in the Arctic

              10.
              "To Wait Together upon the Lord in Pure Silence"

              11.
              The Descent of the Lyre

              12.
              Solitude and Sandaya: The Strange History of Pianos in Burma

              13.
              Listening to the Past: An African-American Lullaby

              14.
              Inside the American Museum of Natural History's Hidden Masterpiece

              15.
              Controlling Sound: Musical Torture from the Shoah to Guantánamo

              16.
              Biophony and the Deep History of Sound

              17.
              From Folklore to Exotica: Yma Sumac and the Performance of Inca Identity

              18.
              "Nancy Grows Up," the Media Age, and the Historian's Craft

              19.
              Rules of the Tribe: Hardcore Punks and Hair Metal in the 1980s

              20.
              Curculionidae: Scolytinae. A Parasitology of Sound

              21.
              Interview with Alexander Rose of the Long Now Foundation: 10,000 Years Chiming

              22.
              Open Sound, Musical Curation, and the Delightful Objectness of Wax: Interviews with Light in the Attic and Clifford Allen

              23.
              Heavy Metal as Public History: A Review of Turisas, Live at the Gramercy Theater

              24.
              The Origins of the Blues

              25.
              Kinyras

              26.
              The Appendix, Appendixed.

      Home

      Issues

      Blog

      Contributors

      Index

      About

      The Appendix was published between 2012 and 2015, released under the CC-BY license, and hosted on GitHub.

      Publication details are available on the colophon.


text:
package com.github.onsdigital.data;

import com.github.onsdigital.data.objects.DataDimension;
import org.junit.Before;
import org.junit.Test;

import java.util.HashMap;

import static org.junit.Assert.*;

public class DataCubeTest {
    DataCube cube;

    @Before
    public void setUp() throws Exception {

        String d1[] = {"Tom", "David", "Kane", "Pastor", "Onkar"};
        String d2[] = {"Travel", "Subsistence", "Housing"};

        DataDimension people = new DataDimension("people", d1);
        DataDimension expenses = new DataDimension("people", d2);

        HashMap<String, DataDimension> dimensions = new HashMap<>();
        dimensions.put("people", people);
        dimensions.put("expenses", expenses);

        this.cube = new DataCube(dimensions);
    }

    @Test
    public void shouldInitialiseWithCorrectSize() throws Exception {
        //Given
        // the example cube from setUp

        //When
        // initialised

        // We expect
        // exactly 15 elements
        assertEquals(15, cube.values.length);
    }

    @Test
    public void putShouldChangeSomething() throws Exception {
        //Given
        // the empty cube from setUp
        HashMap<String, String> index = new HashMap<>();
        index.put("people", "Kane");
        index.put("expenses", "Housing");

        //When
        // we add to that cube

        this.cube.put(index, 1.00);

        // We expect
        // something to be changed
        boolean changed = false;
        for(int i = 0; i < cube.values.length; i++) {
            if(this.cube.values[i] > 0) {
                changed = true;
                break;
            }
        }

        assertEquals(changed, true);
    }

    @Test
         public void getShouldReturnWhatYouPut() throws Exception {
        //Given
        // the empty cube from setUp and an index
        HashMap<String, String> index = new HashMap<>();
        index.put("people", "Kane");
        index.put("expenses", "Housing");

        //When
        // we add to that cube
        double addedValue = 1.00;

        this.cube.put(index, addedValue);

        // We expect
        // something to be changed

        double gotValue = this.cube.get(index);

        assertTrue(addedValue == gotValue);
    }

    /**
     *  Overloading dimensions allows us to access slices and their source
     *  using the same indices
     *
     *
     * @throws Exception
     */
    @Test
     public void shouldBeAbleToOverloadDimensionsOnPut() throws Exception {
        //Given
        // the empty cube from setUp and an index
        HashMap<String, String> index = new HashMap<>();
        index.put("people", "Kane");
        index.put("expenses", "Housing");
        index.put("DUMMY", "DUMMY"); // With a value that is irrelevant to the cube dimensions

        //When
        // we add to that cube using put
        double addedValue = 1.00;
        this.cube.put(index, addedValue);

        // We expect
        // to be able to get the result back without referring to the dummy dimension
        index.remove("DUMMY");
        double gotValue = this.cube.get(index);

        assertTrue(addedValue == gotValue);
    }

    @Test
    public void shouldBeAbleToOverloadDimensionsOnGet() throws Exception {
        //Given
        // the empty cube from setUp with a value added
        HashMap<String, String> index = new HashMap<>();
        index.put("people", "Kane");
        index.put("expenses", "Housing");

        double addedValue = 1.00;
        this.cube.put(index, addedValue);

        //When
        // we add rubbish to the index dimensions
        index.put("DUMMY", "DUMMY");

        // We expect
        // something to be able to reference the result all the same
        double gotValue = this.cube.get(index);

        assertTrue(addedValue == gotValue);
    }
}


text:
id: 908
title: Are you fasting on Thursday?
date: 2009-07-28T21:37:13+00:00
author: Vicki
layout: post
guid: http://blog.vickiboykis.com/wlb/?p=908
permalink: /2009/07/are-you-fasting-on-thursday/
categories:
  - Uncategorized
tags:
  - fast
  - identity
  - Israel
  - Jewishness
  - me
  - Mr. B
  - religion
---

  The fast in Jerusalem, via upyernoz on Flickr.

Thursday is [Tisha B’Av](http://www.jewfaq.org/holidayd.htm). This is a holiday in Judaism where you fast.  Religious Jews (and yours truly) fast on Tisha B’Av, or as I like to call it, HOLY CRAP B’Av, because on this day in history several bad things happened to Jews:

  * **The [

  The fast in Jerusalem, via upyernoz on Flickr.

Thursday is [Tisha B’Av](http://www.jewfaq.org/holidayd.htm). This is a holiday in Judaism where you fast.  Religious Jews (and yours truly) fast on Tisha B’Av, or as I like to call it, HOLY CRAP B’Av, because on this day in history several bad things happened to Jews:

  * **The](http://www.jewfaq.org/defs/temple.htm) were [destroyed](http://en.wikipedia.org/wiki/Temple_in_Jerusalem)**, resulting in immense national Jewish grief over the loss of our primary place of worship, not to mention thousands of dollars of Ikea furniture inside the temple
      * In 70 CE, I should mention that the **destruction of the Second Temple** resulted in what many widely regard to be the beginning of the Jewish Diaspora, which resulted in Nothing Good (except for bagels.)
  * In 134 CE, the **razing of the city of Jerusalem** occurred
  * In 1290, The **Jews were expelled from England**
  * In 1492, the **Jews were expelled from Spain**
  * In 1942, **mass deportation began of Jews from the Warsaw Ghetto**, en route to Treblinka
  * In 2005, I **may have stepped** on a nail

The fast is meant as a mourning period for all of the things we lost on Tisha B’Av over history. This involves not eating for 25 hours (Jews start holidays at sundown the night before the date and end at sunset on the next day.)

Given the primarily nationalist nature of the holiday and that it is based on events that can be historically proven (as opposed to some theoretical occurrences in the Bible,) Tisha B’Av is one of the few Jewish religious holidays that I partake in seriously, aside from Hanukah, because, come on, gelt.

So seriously did I partake in it last year that I started seeing spots and almost fainted.  Fast fail.  So obviously, I’m doing it again this year.

The year before, I was in Israel and everyone around me was all drinking their [Cafe Aromas](http://www.aroma.co.il/Default.aspx?alias=www.aroma.co.il/en) and eating delicious food.  So, I didn’t pass out, but I did want to punch someone. Also, I almost yelled at our waitress at [Yotvata](http://www.frommers.com/destinations/telaviv/D38812.html) in Hebrew when we went to break the fast there.

If you’re interested to know how I’ll fare this year, [follow along on Twitter](http://twitter.com/vboykis)! Or fast along.  Just pace yourself.  Tisha B’Av is where we separate the men from the boys, the women from the girls, and me from everyone else who can actually handle a fast.


text:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="320dp"
    android:layout_height="300dp"
    android:orientation="vertical" >

    <TextView
        android:id="@+id/sogou_game_sdk_pay_voucher_view_tv"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginBottom="13dp"
        android:layout_marginLeft="33dp"
        android:layout_marginTop="13dp"
        android:text="@string/sogou_game_sdk_pay_voucher_view_tv1"
        android:textColor="@color/sogou_game_sdk_color_c72f2a"
        android:textSize="13dp" />

    <Button
        android:id="@+id/sogou_game_sdk_pay_voucher_view_bt"
        android:layout_width="25dp"
        android:layout_height="25dp"
        android:layout_alignParentRight="true"
        android:background="@drawable/sogou_game_sdk_pay_voucher_view_bt_close" />

    <ListView
        android:id="@+id/sogou_game_sdk_pay_voucher_view_lv"
        android:layout_width="match_parent"
        android:layout_height="220dp"
        android:layout_below="@id/sogou_game_sdk_pay_voucher_view_tv"
        android:layout_marginLeft="6dp"
        android:layout_marginRight="6dp"
        android:cacheColorHint="#00000000"
        android:divider="@null"
        android:dividerHeight="10dp"
        android:listSelector="@color/sogou_game_sdk_transparent"
        android:scrollbars="none" >
    </ListView>

    <TextView
        android:id="@+id/sogou_game_sdk_pay_voucher_view_untv"
        android:layout_width="wrap_content"
        android:layout_height="23dp"
        android:layout_alignParentRight="true"
        android:layout_below="@id/sogou_game_sdk_pay_voucher_view_lv"
        android:layout_marginRight="36dp"
        android:layout_marginTop="13dp"
        android:visibility="gone"
        android:text="@string/sogou_game_sdk_pay_voucher_view_tv2"
        android:textColor="@color/sogou_game_sdk_color_black"
        android:textSize="15dp" />

    <LinearLayout
        android:id="@+id/sogou_game_sdk_empty_view"
        android:layout_width="match_parent"
        android:layout_height="240dp"
        android:layout_below="@id/sogou_game_sdk_pay_voucher_view_tv"
        android:orientation="vertical"
        android:visibility="gone" >

        <ImageView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="center_horizontal"
            android:src="@drawable/myapp_non_download_img" />

        <TextView
            android:id="@+id/txt_empty_msg"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="center_horizontal"
            android:layout_marginTop="44dp"
            android:text="@string/blank_page_manager_msg"
            android:textColor="#999999"
            android:textSize="18dip" />
    </LinearLayout>

</RelativeLayout>


text:
package ssh

import (
	bosherr "github.com/cloudfoundry/bosh-utils/errors"
	boshsys "github.com/cloudfoundry/bosh-utils/system"

	boshdir "github.com/cloudfoundry/bosh-cli/director"
)

type NonInteractiveRunner struct {
	comboRunner ComboRunner
}

func NewNonInteractiveRunner(comboRunner ComboRunner) NonInteractiveRunner {
	return NonInteractiveRunner{comboRunner}
}

func (r NonInteractiveRunner) Run(connOpts ConnectionOpts, result boshdir.SSHResult, rawCmd []string) error {
	if len(result.Hosts) == 0 {
		return bosherr.Errorf("Non-interactive SSH expects at least one host")
	}

	if len(rawCmd) == 0 {
		return bosherr.Errorf("Non-interactive SSH expects non-empty command")
	}

	cmdFactory := func(host boshdir.Host, sshArgs SSHArgs) boshsys.Command {
		return boshsys.Command{
			Name: "ssh",
			Args: append(append(sshArgs.OptsForHost(host), sshArgs.LoginForHost(host)...), rawCmd...),
		}
	}

	return r.comboRunner.Run(connOpts, result, cmdFactory)
}


text:
local ipairs = ipairs
local t_insert = table.insert
local t_remove = table.remove
local m_min = math.min

local dataTypes = {
	Bool = {
		size = 1,
		read = function(b, o, d)
			return b:byte(o) == 1
		end,
	},
	Int = {
		size = 4,
		read = function(b, o, d)
			if o > #b - 3 then return -1337 end
			return bytesToInt(b, o)
		end,
	},
	UInt = {
		size = 4,
		read = function(b, o, d)
			if o > #b - 3 then return 1337 end
			return bytesToUInt(b, o)
		end,
	},
	Interval = {
		size = 8,
		read = function(b, o, d)
			if o > #b - 7 then return { 1337, 1337 } end
			return { bytesToInt(b, o), bytesToInt(b, o + 4) }
		end,
	},
	Float = {
		size = 4,
		read = function(b, o, d)
			if o > #b - 3 then return -1337 end
			return bytesToFloat(b, o)
		end,
	},
	String = {
		size = 4,
		read = function(b, o, d)
			if o > #b - 3 then return "<no offset>" end
			local stro = bytesToUInt(b, o)
			if stro > #b - 3 then return "<bad offset>" end
			return convertUTF16to8(b, d + stro)
		end,
	},
	Enum = {
		size = 4,
		ref = true,
		read = function(b, o, d)
			if o > #b - 3 then return 1337 end
			return bytesToUInt(b, o)
		end,
	},
	Key = {
		size = 8,
		ref = true,
		read = function(b, o, d)
			if o > #b - 7 then return 1337 end
			return bytesToUInt(b, o)
		end,
	},
}

local DatFileClass = newClass("DatFile", function(self, name, raw)
	self.name = name
	self.raw = raw

	if not main.datSpecs[self.name] then
		main.datSpecs[self.name] = { }
	end
	self.spec = main.datSpecs[self.name]

	self.cols = { }
	self.colMap = { }
	self.indexes = { }

	local colMeta = { __index = function(t, key)
		local colIndex = self.colMap[key]
		if not colIndex then
			error("Unknown key "..key.." for "..self.name..".dat")
		end
		t[key] = self:ReadCell(t._rowIndex, colIndex)
		return rawget(t, key)
	end }
	self.rowCache = setmetatable({ }, { __index = function(t, rowIndex)
		if rowIndex < 1 or rowIndex > self.rowCount then
			return
		end
		t[rowIndex] = setmetatable({ _rowIndex = rowIndex }, colMeta)
		return t[rowIndex]
	end })

	self.rows = { }
	self.rowCount = bytesToUInt(self.raw)
	self.dataOffset = self.raw:find("\xBB\xBB\xBB\xBB\xBB\xBB\xBB\xBB", 5, true) or (#self.raw + 1)
	self.rowSize = (self.dataOffset - 5) / self.rowCount
	for i = 1, self.rowCount do
		self.rows[i] = 5 + (i-1) * self.rowSize
	end

	--ConPrintf("Loaded '%s': %d Rows at %d Bytes", self.name, self.rowCount, self.rowSize)

	self:OnSpecChanged()
end)

function DatFileClass:OnSpecChanged()
	wipeTable(self.cols)
	wipeTable(self.colMap)
	wipeTable(self.indexes)
	wipeTable(self.rowCache)
	local offset = 0
	for i, specCol in ipairs(self.spec) do
		local dataType = dataTypes[specCol.type]
		local size = specCol.list and 8 or dataType.size
		self.cols[i] = {
			size = size,
			offset = offset,
			isRef = dataType.ref,
		}
		offset = offset + size
		if #specCol.name > 0 then
			self.colMap[specCol.name] = i
		end
	end
	self.specSize = offset
	self.cols[#self.spec + 1] = {
		size = self.rowSize - offset,
		offset = offset,
	}
end

function DatFileClass:GetRow(key, value)
	local keyIndex = self.colMap[key]
	if not keyIndex then
		error("Unknown key "..key.." for "..self.name..".dat")
	end
	if not self.indexes[key] then
		self.indexes[key] = { }
	end
	for rowIndex = 1, self.rowCount do
		if not self.indexes[key][rowIndex] then
			self.indexes[key][rowIndex] = self:ReadCell(rowIndex, keyIndex)
		end
		if self.indexes[key][rowIndex] == value then
			return self.rowCache[rowIndex]
		end
	end
end

function DatFileClass:GetRowByIndex(rowIndex)
	return self.rowCache[rowIndex]
end

function DatFileClass:Rows()
	local i = 0
	return function()
		i = i + 1
		if i <= self.rowCount then
			return self:GetRowByIndex(i)
		end
	end
end

function DatFileClass:GetRowList(key, value, match)
	local keyIndex = self.colMap[key]
	if not keyIndex then
		error("Unknown key "..key.." for "..self.name..".dat")
	end
	local isList = self.spec[keyIndex].list
	if not self.indexes[key] then
		self.indexes[key] = { }
	end
	local out = { }
	for rowIndex = 1, self.rowCount do
		if not self.indexes[key][rowIndex] then
			self.indexes[key][rowIndex] = self:ReadCell(rowIndex, keyIndex)
		end
		local index = self.indexes[key][rowIndex]
		if isList then
			for _, indexVal in ipairs(index) do
				if (match and indexVal:match(value)) or (not match and indexVal == value) then
					t_insert(out, self.rowCache[rowIndex])
					break
				end
			end
		else
			if (match and index:match(value)) or (not match and index == value) then
				t_insert(out, self.rowCache[rowIndex])
			end
		end
	end
	return out
end

function DatFileClass:ReadCell(rowIndex, colIndex)
	local spec = self.spec[colIndex]
	local col = self.cols[colIndex]
	local base = self.rows[rowIndex] + col.offset
	if spec.list then
		local dataType = dataTypes[spec.type]
		local count = bytesToUInt(self.raw, base)
		local offset = bytesToUInt(self.raw, base + 4) + self.dataOffset
		local out = { }
		for i = 1, m_min(count, 1000) do
			out[i] = self:ReadValue(spec, offset)
			offset = offset + dataType.size
		end
		return out
	else
		return self:ReadValue(spec, base)
	end
end

function DatFileClass:ReadValue(spec, offset)
	local dataType = dataTypes[spec.type]
	local val = dataType.read(self.raw, offset, self.dataOffset)
	if not dataType.ref then
		return val
	end
	if val == 0xFEFEFEFE then
		return
	end
	local other = main.datFileByName[spec.refTo]
	if not other then
		return
	end
	if spec.type == "Enum" and spec.refTo ~= self.name then
		return val
	end
	return other.rowCache[val + 1]
end

function DatFileClass:ReadCellText(rowIndex, colIndex)
	local spec = self.spec[colIndex]
	local col = self.cols[colIndex]
	local base = self.rows[rowIndex] + col.offset
	if spec.list then
		local dataType = dataTypes[spec.type]
		local count = bytesToUInt(self.raw, base)
		local offset = bytesToUInt(self.raw, base + 4) + self.dataOffset
		local out = { }
		for i = 1, m_min(count, 1000) do
			out[i] = self:ReadValueText(spec, offset)
			offset = offset + dataType.size
		end
		return out
	else
		return self:ReadValueText(spec, base)
	end
end

function DatFileClass:ReadValueText(spec, offset)
	local dataType = dataTypes[spec.type]
	local val = dataType.read(self.raw, offset, self.dataOffset)
	if dataType.ref then
		if val == 0xFEFEFEFE then
			return ""
		end
		local other = main.datFileByName[spec.refTo]
		if other then
			local otherRow = other.rows[val + ((spec.type == "Enum" and spec.refTo ~= self.name) and 0 or 1)]
			if not otherRow then
				return "<bad ref #"..val..">"
			end
			if other.spec[1] then
				return other:ReadValueText(other.spec[1], otherRow)
			end
		end
	end
	if spec.type == "Interval" then
		return val[1] == val[2] and val[1] or (val[1] .. " to " .. val[2])
	else
		return val
	end
end

function DatFileClass:ReadCellRaw(rowIndex, colIndex)
	local col = self.cols[colIndex]
	local base = self.rows[rowIndex] + col.offset
	return self.raw:byte(base, base + col.size - 1)
end


text:
import { acos } from 'dummy/helpers/acos';
import { module, test } from 'qunit';

module('Unit | Helper | acos', function () {
  test('acos works', function (assert) {
    const result = acos([1]);
    assert.strictEqual(result, 0);
  });
});


text:
SELECT
    relname AS "relation",
    pg_size_pretty (
        pg_total_relation_size (C .oid)
    ) AS "total_size"
FROM
    pg_class C
LEFT JOIN pg_namespace N ON (N.oid = C .relnamespace)
WHERE
    nspname NOT IN (
        'pg_catalog',
        'information_schema'
    )
AND C .relkind <> 'i'
AND nspname !~ '^pg_toast'
ORDER BY
    pg_total_relation_size (C .oid) DESC
LIMIT 15;


text:
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
    id="Rhymestore" version="2.5">

    <display-name>The Rhymestore Project</display-name>

    <!-- Startup ContextListener -->
    <listener>
        <listener-class>com.rhymestore.web.ContextListener</listener-class>
    </listener>

    <!-- Servlets -->
    <servlet>
        <servlet-name>MVCServlet</servlet-name>
        <servlet-class>org.sjmvc.web.MVCServlet</servlet-class>
        <load-on-startup>1</load-on-startup>
    </servlet>

    <!-- Servlet mappings -->
    <servlet-mapping>
        <servlet-name>MVCServlet</servlet-name>
        <url-pattern>/web/*</url-pattern>
    </servlet-mapping>

    <!-- Main document -->
    <welcome-file-list>
        <welcome-file>jsp/index.jsp</welcome-file>
    </welcome-file-list>

    <!-- Taglibs -->
    <jsp-config>
        <taglib>
            <taglib-uri>http://rhymestore.com/taglib/rhymestore</taglib-uri>
            <taglib-location>/WEB-INF/tld/rhymestore.tld</taglib-location>
        </taglib>
    </jsp-config>

    <!-- Security -->
    <security-constraint>
        <web-resource-collection>
            <web-resource-name>Rhymestore Administration</web-resource-name>
            <url-pattern>/web/rhymes/add</url-pattern>
            <url-pattern>/web/rhymes/delete</url-pattern>
        </web-resource-collection>
        <auth-constraint>
            <role-name>rhymestore-rw</role-name>
        </auth-constraint>
    </security-constraint>

    <login-config>
        <auth-method>BASIC</auth-method>
        <realm-name>Basic Authentication</realm-name>
    </login-config>

    <security-role>
        <role-name>rhymestore-rw</role-name>
    </security-role>

</web-app>


text:
._4_DomApiChanges section[role=main] {
    margin-left: 120px;
    margin-right: 120px;
}

.tests {
    display: none;
}

@media screen and (-ms-view-state: snapped) {
    ._4_DomApiChanges section[role=main] {
        margin-left: 20px;
        margin-right: 20px;
    }
}

@media screen and (-ms-view-state: fullscreen-portrait) {
    ._4_DomApiChanges section[role=main] {
        margin-left: 100px;
        margin-right: 100px;
    }
}


text:
namespace llvm {
  class raw_ostream;
}

namespace swift {

class AssociatedTypeDecl;
class ProtocolDecl;
class ProtocolTypeAlias;
class Requirement;

namespace rewriting {

// Entry points used by AbstractGenericSignatureRequest and
// InferredGenericSignatureRequest; see RequirementLowering.cpp for
// documentation
// comments.

void desugarRequirement(Requirement req, SourceLoc loc,
                        SmallVectorImpl<Requirement> &result,
                        SmallVectorImpl<RequirementError> &errors);

void inferRequirements(Type type, SourceLoc loc, ModuleDecl *module,
                       SmallVectorImpl<StructuralRequirement> &result);

void realizeRequirement(DeclContext *dc,
                        Requirement req, RequirementRepr *reqRepr,
                        bool shouldInferRequirements,
                        SmallVectorImpl<StructuralRequirement> &result,
                        SmallVectorImpl<RequirementError> &errors);

void realizeInheritedRequirements(TypeDecl *decl, Type type,
                                  bool shouldInferRequirements,
                                  SmallVectorImpl<StructuralRequirement> &result,
                                  SmallVectorImpl<RequirementError> &errors);

// Defined in ConcreteContraction.cpp.
bool performConcreteContraction(
    ArrayRef<StructuralRequirement> requirements,
    SmallVectorImpl<StructuralRequirement> &result,
    SmallVectorImpl<RequirementError> &errors,
    bool debug);

} // end namespace rewriting

} // end namespace swift

#endif


text:
package com.tinytimrob.jfreetype2;

/** An enumeration used to specify which kerning values to return in {@link FreeTypeFace#getKerning}. */
public enum FreeTypeKerningMode
{
	/** Return scaled and grid-fitted kerning distances (value is 0). */
	DEFAULT,

	/** Return scaled but un-grid-fitted kerning distances. */
	UNFITTED,

	/** Return the kerning vector in original font units. */
	UNSCALED
}


text:
cmake_minimum_required(VERSION 3.0.2)

include(${CMAKE_CURRENT_LIST_DIR}/../_execute.cmake)
execute_cmake()