text:
<?xml version="1.0" encoding="utf-8"?>
<!--
   Copyright 2015 sourcestream GmbH

   Licensed under the Apache License, Version 2.0 (the "License");
   you may not use this file except in compliance with the License.
   You may obtain a copy of the License at

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

   Unless required by applicable law or agreed to in writing, software
   distributed under the License is distributed on an "AS IS" BASIS,
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.
-->
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:paddingBottom="19.5dp"
    android:paddingTop="4dp">

    <ImageView
        android:id="@+id/profilePath"
        android:layout_width="40dp"
        android:layout_height="63dp"
        android:layout_marginLeft="15dp"
        android:layout_marginRight="15dp"
        android:adjustViewBounds="true"
        android:scaleType="fitCenter" />

    <LinearLayout
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_gravity="center_vertical"
        android:layout_marginTop="-4dp"
        android:orientation="vertical">

        <TextView
            android:id="@+id/name"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:textColor="@color/movieDetailsCastTitle"
            android:textSize="16sp" />

        <TextView
            android:id="@+id/character"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:textColor="@color/movieDetailsCastCharacter" />
    </LinearLayout>
</LinearLayout>


text:
using Elasticsearch.Net;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Nest
{
	public partial interface IUpgradeStatusRequest { }

	public partial class UpgradeStatusRequest { }

	[DescriptorFor("IndicesGetUpgrade")]
	public partial class UpgradeStatusDescriptor { }
}

redpajama_set_name: RedPajamaGithub


text:
namespace Android.View
{
	public class LayoutChangeEventArgs : System.EventArgs
	{
	    public LayoutChangeEventArgs(int left, int top, int right, int bottom, int oldLeft, int oldTop, int oldRight,
	                                 int oldBottom)
	    {
	        Left = left;
	        Top = top;
	        Right = right;
	        Bottom = bottom;
	        OldLeft = oldLeft;
	        OldTop = oldTop;
	        OldRight = oldRight;
	        OldBottom = oldBottom;
	    }

	    public int Left { get; private set; }
        public int Top { get; private set; }
        public int Right { get; private set; }
        public int Bottom { get; private set; }
        public int OldLeft { get; private set; }
        public int OldTop { get; private set; }
        public int OldRight { get; private set; }
        public int OldBottom { get; private set; }
    }
}


text:
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)

using System;
using System.Windows.Input;

namespace ICSharpCode.AvalonEdit.AddIn
{
	/// <summary>
	/// Custom commands for CodeEditor.
	/// </summary>
	public static class CustomCommands
	{
		public static readonly RoutedCommand CtrlSpaceCompletion = new RoutedCommand(
			"CtrlSpaceCompletion", typeof(CodeEditor),
			new InputGestureCollection {
				new KeyGesture(Key.Space, ModifierKeys.Control)
			});
	}
}


text:
"""Illustrates the use of Struct classes, and their differences
from normal classes and namedtuples.
"""

from collections import namedtuple
from simplestruct import Struct, Field

###############################################################################
# Definition                                                                  #
###############################################################################

# Standard Python class.
class PyPoint:
    def __init__(self, x, y):
        self.x = x
        self.y = y

# Struct class.
class SPoint(Struct):
    # Field declaration order matters.
    x = Field   # shorthand for "x = Field()"
    y = Field
    # The constructor is implicitly defined.

# namedtuple class
NTPoint = namedtuple('NTPoint', 'x y')

###############################################################################
# Construction and pretty-printing                                            #
###############################################################################

# Initialization is the same for all three classes.
py_point = PyPoint(1, 2)
struct_point = SPoint(1, 2)
tuple_point = NTPoint(1, 2)

# Structs and namedtuples both have pretty-printing.
print('==== Printing ====')
print(py_point)         # <__main__.Pypoint object at ...>
print(struct_point)     # SPoint(x=1, y=2)
print(tuple_point)      # NTPoint(x=1, y=2)

# Structs print their contents using whichever formatting method
# was called originally. namedtuples always use repr.
struct_point2 = SPoint('a', 'b')
tuple_point2 = NTPoint('a', 'b')
print(str(struct_point2))        # SPoint(a, b)
print(repr(struct_point2))       # SPoint('a', 'b')
print(str(tuple_point2))         # NTPoint('a', 'b')
print(repr(tuple_point2))        # NTPoint('a', 'b')

# All three classes can also be constructed using
# keywords, *args, and **kargs.
py_point2 = PyPoint(1, y=2)
struct_point2 = SPoint(*[1, 2])
tuple_point2 = NTPoint(**{'x': 1, 'y': 2})

###############################################################################
# Equality and hashing                                                        #
###############################################################################

# Structs and namedtuples both have structural equality.
print('\n==== Equality ====')
print(py_point == py_point2)            # False
print(struct_point == struct_point2)    # True
print(tuple_point == tuple_point2)      # True

# Structs, unlike namedtuple, are only equal to other
# instances of the same class.
class OtherSPoint(Struct):
    x, y = Field, Field
OtherNTPoint = namedtuple('OtherNTPoint', 'x y')
struct_point2 = OtherSPoint(1, 2)
tuple_point2 = OtherNTPoint(1, 2)
print(struct_point == struct_point2)    # False
print(tuple_point == tuple_point2)      # True

# Structs and namedtuples have hash functions based on
# structural value.
print('\n==== Hashing ====')
print(hash(py_point) == hash(py_point2))        # False (almost certainly)
print(hash(struct_point) == hash(struct_point)) # True
print(hash(tuple_point) == hash(tuple_point2))  # True

###############################################################################
# Other features                                                              #
###############################################################################

# Structs implement some of the same convenience methods as namedtuples.
print('\n==== Convenience methods ====')
print(struct_point._asdict())       # OrderedDict([('x', 1), ('y', 2)])
print(tuple_point._asdict())        # OrderedDict([('x', 1), ('y', 2)])
print(struct_point._replace(x=3))   # SPoint(x=3, y=2)
print(tuple_point._replace(x=3))    # NTPoint(x=3, y=2)
# Note that _replace() creates a copy without modifying the original object.

# Both can be iterated over and decomposed into their components.
print(len(struct_point))    # 2
x, y = struct_point
print((x, y))               # (1, 2)
print(len(tuple_point))     # 2
x, y = tuple_point
print((x, y))               # (1, 2)


text:
package org.tylproject.vaadin.addon.datanav.events;

import com.vaadin.data.Item;
import org.tylproject.vaadin.addon.datanav.DataNavigation;

import java.util.EventObject;

/**
 * Created by evacchi on 19/11/14.
 */
public class ItemNavigationEvent extends EventObject {
    private final Object newItemId;
    private final Object oldItemId;
    private Item newItem;
    private Item oldItem;

    public ItemNavigationEvent(DataNavigation source, Object newItemId, Object oldItemId)  {
        super(source);
        this.newItemId = newItemId;
        this.oldItemId = oldItemId;
    }

    public Object getNewItemId() {
        return newItemId;
    }
    public Item getNewItem() {
        if (newItemId == null) return null;
        if (newItem == null) {
            newItem = getSource().getContainer().getItem(newItemId);
        }
        return newItem;
    }

    public Object getOldItemId() {
        return oldItemId;
    }
    public Item getOldItem() {
        if (oldItemId == null) return null;
        if (oldItem == null) {
            oldItem = getSource().getContainer().getItem(oldItemId);
        }
        return oldItem;
    }

    @Override
    public DataNavigation getSource() {
        return (DataNavigation) super.getSource();
    }
}


text:
using namespace chrono;
using namespace chrono::collision;

using std::cout;
using std::endl;

// Drop the robot on SCM terrain
bool drop = true;

// Phase durations
double duration_pose = 1.0;          // Interval to assume initial pose
double duration_settle_robot = 0.5;  // Interval to allow robot settling on terrain
double duration_sim = 10;            // Duration of actual locomotion simulation

// Output frequencies
double output_fps = 100;
double render_fps = 60;

// Output directories
const std::string out_dir = GetChronoOutputPath() + "ROBOSIMIAN_SCM";
const std::string pov_dir = out_dir + "/POVRAY";
const std::string img_dir = out_dir + "/IMG";

// =============================================================================

bool GetProblemSpecs(int argc,
                     char** argv,
                     double& time_step,
                     robosimian::LocomotionMode& mode,
                     int& num_cycles,
                     double& dbp_incr,
                     double& terrain_length,
                     bool& render,
                     bool& data_output,
                     bool& image_output,
                     bool& povray_output);

// =============================================================================

class DBPcontroller : public robosimian::RS_Driver::PhaseChangeCallback {
  public:
    DBPcontroller(robosimian::RoboSimian* robot);
    ~DBPcontroller() { delete m_csv; }

    virtual void OnPhaseChange(robosimian::RS_Driver::Phase old_phase, robosimian::RS_Driver::Phase new_phase) override;

    void SetCycleFreq(int freq) { m_cycle_freq = freq; }
    void SetIncrement(double incr) { m_dbp_incr = incr; }
    bool Stop() const { return m_avg_speed < 0; }
    void WriteOutput(const std::string& filename) { m_csv->write_to_file(filename); }

    double GetDistance() const { return m_robot->GetChassisPos().x() - m_start_x; }
    double GetDuration() const { return m_robot->GetSystem()->GetChTime() - m_start_time; }
    double GetAvgSpeed() const { return GetDistance() / GetDuration(); }

  private:
    robosimian::RoboSimian* m_robot;
    std::shared_ptr<ChLoadBodyForce> m_load;

    double m_weight;    // total robot weight
    double m_dbp;       // DBP factor (ratio of robot weight)
    double m_dbp_incr;  // DBP factor increment

    int m_cycle_number;  // current cycle
    int m_cycle_freq;    // number of cycles between DBP increases

    double m_start_x;     // cached robot location
    double m_start_time;  // cached time at last location
    double m_avg_speed;   // average speed over last segment

    utils::CSV_writer* m_csv;
    ChTimer<> m_timer;
};

DBPcontroller::DBPcontroller(robosimian::RoboSimian* robot)
    : m_robot(robot),
      m_dbp(0),
      m_dbp_incr(0.04),
      m_cycle_number(0),
      m_cycle_freq(2),
      m_start_x(0),
      m_start_time(0),
      m_avg_speed(0) {
    // Cache robot weight
    double mass = robot->GetMass();
    double g = std::abs(robot->GetSystem()->Get_G_acc().z());
    m_weight = mass * g;

    // Create a body force load on the robot chassis.
    // This is a horizontal force applied at the chassis center.
    auto force_container = chrono_types::make_shared<ChLoadContainer>();
    robot->GetSystem()->Add(force_container);
    m_load = chrono_types::make_shared<ChLoadBodyForce>(robot->GetChassisBody(), VNULL, false, VNULL, true);
    force_container->Add(m_load);

    m_timer.reset();
    m_timer.start();

    // Prepare CSV output
    m_csv = new utils::CSV_writer(",");
    *m_csv << "DBP_factor"
           << "DBP_force"
           << "Avg_speed" << endl;
}

void DBPcontroller::OnPhaseChange(robosimian::RS_Driver::Phase old_phase, robosimian::RS_Driver::Phase new_phase) {
    m_timer.stop();
    cout << "Elapsed time: " << m_timer() << endl;
    m_timer.reset();
    m_timer.start();

    if (new_phase == robosimian::RS_Driver::CYCLE) {
        if (m_cycle_number == 0) {
            m_start_x = m_robot->GetChassisPos().x();
            m_start_time = m_robot->GetSystem()->GetChTime();
        } else if (m_cycle_number % m_cycle_freq == 0) {
            // Save average speed at current DBP factor
            m_avg_speed = GetAvgSpeed();
            cout << "*** DBP: " << m_dbp << " force: " << m_dbp * m_weight << " avg. speed: " << m_avg_speed << endl;
            *m_csv << m_dbp << m_dbp * m_weight << m_avg_speed << endl;
            // Cache new start time and location
            m_start_x = m_robot->GetChassisPos().x();
            m_start_time = m_robot->GetSystem()->GetChTime();
            // Increment DBP force
            m_dbp += m_dbp_incr;
            m_load->SetForce(ChVector<>(-m_dbp * m_weight, 0, 0), false);
        }

        cout << "  FL wheel location:  " << m_robot->GetWheelPos(robosimian::LimbID::FL).x() << endl;
        cout << "  FR wheel location:  " << m_robot->GetWheelPos(robosimian::LimbID::FR).x() << endl;
        cout << "  Chassis location:   " << m_robot->GetChassisPos().x() << endl;
        cout << "  Distance travelled: " << GetDistance() << endl;

        m_cycle_number++;
    }
}

// =============================================================================

std::shared_ptr<vehicle::SCMDeformableTerrain> CreateTerrain(robosimian::RoboSimian* robot,
                                                             double length,
                                                             double width,
                                                             double height,
                                                             double offset) {
    // Deformable terrain properties (LETE sand)
    ////double Kphi = 5301e3;    // Bekker Kphi
    ////double Kc = 102e3;       // Bekker Kc
    ////double n = 0.793;        // Bekker n exponent
    ////double coh = 1.3e3;      // Mohr cohesive limit (Pa)
    ////double phi = 31.1;       // Mohr friction limit (degrees)
    ////double K = 1.2e-2;       // Janosi shear coefficient (m)
    ////double E_elastic = 2e8;  // Elastic stiffness (Pa/m), before plastic yeld
    ////double damping = 3e4;    // Damping coefficient (Pa*s/m)

    // Deformable terrain properties (CDT FGS dry - 6/29/2018)
    double Kphi = 6259.1e3;  // Bekker Kphi
    double Kc = 5085.6e3;    // Bekker Kc
    double n = 1.42;         // Bekker n exponent
    double coh = 1.58e3;     // Mohr cohesive limit (Pa)
    double phi = 34.1;       // Mohr friction limit (degrees)
    double K = 22.17e-3;     // Janosi shear coefficient (m)
    double E_elastic = 2e8;  // Elastic stiffness (Pa/m), before plastic yeld
    double damping = 3e4;    // Damping coefficient (Pa*s/m)

    auto terrain = chrono_types::make_shared<vehicle::SCMDeformableTerrain>(robot->GetSystem());
    terrain->SetPlane(ChCoordsys<>(ChVector<>(length / 2 - offset, 0, height), QUNIT));
    terrain->SetSoilParameters(Kphi, Kc, n, coh, phi, K, E_elastic, damping);
    terrain->SetPlotType(vehicle::SCMDeformableTerrain::PLOT_SINKAGE, 0, 0.15);
    terrain->Initialize(length, width, 1.0 / 64);

    // Enable moving patch feature
    terrain->AddMovingPatch(robot->GetChassisBody(), ChVector<>(0, 0, 0), ChVector<>(3.0, 2.0, 1.0));

    return terrain;
}

void SetContactProperties(robosimian::RoboSimian* robot) {
    assert(robot->GetSystem()->GetContactMethod() == ChContactMethod::SMC);

    float friction = 0.4f;
    float Y = 1e7f;
    float cr = 0.0f;

    robot->GetSledContactMaterial()->SetFriction(friction);
    robot->GetSledContactMaterial()->SetRestitution(cr);

    robot->GetWheelContactMaterial()->SetFriction(friction);
    robot->GetWheelContactMaterial()->SetRestitution(cr);

    std::static_pointer_cast<ChMaterialSurfaceSMC>(robot->GetSledContactMaterial())->SetYoungModulus(Y);
    std::static_pointer_cast<ChMaterialSurfaceSMC>(robot->GetWheelContactMaterial())->SetYoungModulus(Y);
}

// =============================================================================

int main(int argc, char* argv[]) {
    // ----------------------------
    // Parse command line arguments
    // ----------------------------
    robosimian::LocomotionMode mode;
    double time_step;
    int num_cycles;
    double dbp_incr;
    double terrain_length;
    bool render;
    bool data_output;
    bool povray_output;
    bool image_output;

    // Extract arguments
    if (!GetProblemSpecs(argc, argv, time_step, mode, num_cycles, dbp_incr, terrain_length, render, data_output,
                         image_output, povray_output)) {
        cout << "-------------" << endl;
        return 1;
    }

    double terrain_width = 2.0;
    double location_offset = 2.0;

    // ------------
    // Timed events
    // ------------

    double time_create_terrain = duration_pose;  // create terrain after robot assumes initial pose

    // -------------
    // Create system
    // -------------

    ChSystemSMC my_sys;
    my_sys.SetSolverMaxIterations(200);
    my_sys.SetSolverType(ChSolver::Type::BARZILAIBORWEIN);
    my_sys.Set_G_acc(ChVector<double>(0, 0, -9.8));
    ////my_sys.Set_G_acc(ChVector<double>(0, 0, 0));

    // -----------------------
    // Create RoboSimian robot
    // -----------------------

    std::string mode_name;
    switch (mode) {
        case robosimian::LocomotionMode::WALK:
            mode_name = "walk";
            break;
        case robosimian::LocomotionMode::SCULL:
            mode_name = "scull";
            break;
        case robosimian::LocomotionMode::INCHWORM:
            mode_name = "inchworm";
            break;
        case robosimian::LocomotionMode::DRIVE:
            mode_name = "drive";
            break;
    }

    robosimian::RoboSimian robot(&my_sys, true, true);

    // Set output directory

    robot.SetOutputDirectory(out_dir, mode_name);

    // Set actuation mode for wheel motors

    ////robot.SetMotorActuationMode(robosimian::ActuationMode::ANGLE);

    // Control collisions (default: true for sled and wheels only)

    ////robot.SetCollide(robosimian::CollisionFlags::NONE);
    ////robot.SetCollide(robosimian::CollisionFlags::ALL);
    ////robot.SetCollide(robosimian::CollisionFlags::LIMBS);
    ////robot.SetCollide(robosimian::CollisionFlags::CHASSIS | robosimian::CollisionFlags::WHEELS);

    // Set visualization modes (default: all COLLISION)

    ////robot.SetVisualizationTypeChassis(robosimian::VisualizationType::MESH);
    ////robot.SetVisualizationTypeLimb(robosimian::FL, robosimian::VisualizationType::COLLISION);
    ////robot.SetVisualizationTypeLimb(robosimian::FR, robosimian::VisualizationType::COLLISION);
    ////robot.SetVisualizationTypeLimb(robosimian::RL, robosimian::VisualizationType::COLLISION);
    ////robot.SetVisualizationTypeLimb(robosimian::RR, robosimian::VisualizationType::COLLISION);
    ////robot.SetVisualizationTypeLimbs(robosimian::VisualizationType::NONE);
    ////robot.SetVisualizationTypeChassis(robosimian::VisualizationType::MESH);
    ////robot.SetVisualizationTypeSled(robosimian::VisualizationType::MESH);
    ////robot.SetVisualizationTypeLimbs(robosimian::VisualizationType::MESH);

    // Initialize Robosimian robot

    ////robot.Initialize(ChCoordsys<>(ChVector<>(0, 0, 0), QUNIT));
    robot.Initialize(ChCoordsys<>(ChVector<>(0, 0, 0), Q_from_AngX(CH_C_PI)));

    // -----------------------------------
    // Create a driver and attach to robot
    // -----------------------------------

    std::shared_ptr<robosimian::RS_Driver> driver;
    switch (mode) {
        case robosimian::LocomotionMode::WALK:
            driver = chrono_types::make_shared<robosimian::RS_Driver>(
                "",                                                           // start input file
                GetChronoDataFile("robot/robosimian/actuation/walking_cycle.txt"),  // cycle input file
                "",                                                           // stop input file
                true);
            break;
        case robosimian::LocomotionMode::SCULL:
            driver = chrono_types::make_shared<robosimian::RS_Driver>(
                GetChronoDataFile("robot/robosimian/actuation/sculling_start.txt"),   // start input file
                GetChronoDataFile("robot/robosimian/actuation/sculling_cycle2.txt"),  // cycle input file
                GetChronoDataFile("robot/robosimian/actuation/sculling_stop.txt"),    // stop input file
                true);
            break;
        case robosimian::LocomotionMode::INCHWORM:
            driver = chrono_types::make_shared<robosimian::RS_Driver>(
                GetChronoDataFile("robot/robosimian/actuation/inchworming_start.txt"),  // start input file
                GetChronoDataFile("robot/robosimian/actuation/inchworming_cycle.txt"),  // cycle input file
                GetChronoDataFile("robot/robosimian/actuation/inchworming_stop.txt"),   // stop input file
                true);
            break;
        case robosimian::LocomotionMode::DRIVE:
            driver = chrono_types::make_shared<robosimian::RS_Driver>(
                GetChronoDataFile("robot/robosimian/actuation/driving_start.txt"),  // start input file
                GetChronoDataFile("robot/robosimian/actuation/driving_cycle.txt"),  // cycle input file
                GetChronoDataFile("robot/robosimian/actuation/driving_stop.txt"),   // stop input file
                true);
            break;
    }

    driver->SetTimeOffsets(duration_pose, duration_settle_robot);
    robot.SetDriver(driver);

    // -----------------------------------------------------
    // Drawback pull setup (as phase-change callback object)
    // -----------------------------------------------------

    cout << "Problem parameters" << endl;
    cout << "  Locomotion mode:       " << mode_name << endl;
    cout << "  Integration step size: " << time_step << endl;
    cout << "  Number cycles:         " << num_cycles << endl;
    cout << "  DBP increment:         " << dbp_incr << endl;
    cout << "  Terrain length:        " << terrain_length << endl;
    cout << "  Render?        " << (render ? "YES" : "NO") << endl;
    cout << "  Data output?   " << (data_output ? "YES" : "NO") << endl;
    cout << "  Image output?  " << (image_output ? "YES" : "NO") << endl;
    cout << "  PovRay output? " << (povray_output ? "YES" : "NO") << endl;
    cout << "RoboSimian total mass: " << robot.GetMass() << endl;

    DBPcontroller DBP_controller(&robot);
    DBP_controller.SetCycleFreq(num_cycles);
    DBP_controller.SetIncrement(dbp_incr);
    driver->RegisterPhaseChangeCallback(&DBP_controller);

    // -------------------------------
    // Create the visualization window
    // -------------------------------

    std::shared_ptr<robosimian::RoboSimianVisualSystemIrrlicht> vis;
    if (render) {
        vis = chrono_types::make_shared<robosimian::RoboSimianVisualSystemIrrlicht>(&robot, driver.get());
        vis->AttachSystem(&my_sys);
        vis->SetWindowTitle("RoboSimian - SCM terrain");
        vis->SetWindowSize(800, 600);
        vis->Initialize();
        vis->AddLogo();
        vis->AddSkyBox();
        vis->AddCamera(ChVector<>(1, -2.75, 0.2), ChVector<>(1, 0, 0));
        vis->AddLight(ChVector<>(100, +100, 100), 290, ChColor(0.7f, 0.7f, 0.7f));
        vis->AddLight(ChVector<>(100, -100, 80), 190, ChColor(0.7f, 0.8f, 0.8f));
        ////vis->AddLightWithShadow(ChVector<>(10.0, -6.0, 3.0), ChVector<>(0, 0, 0), 3, -10, 10, 40, 512);
        ////vis->EnableShadows();
    }

    // -----------------------------
    // Initialize output directories
    // -----------------------------

    if (!filesystem::create_directory(filesystem::path(out_dir))) {
        cout << "Error creating directory " << out_dir << endl;
        return 1;
    }
    if (povray_output) {
        if (!filesystem::create_directory(filesystem::path(pov_dir))) {
            cout << "Error creating directory " << pov_dir << endl;
            return 1;
        }
    }
    if (image_output) {
        if (!filesystem::create_directory(filesystem::path(img_dir))) {
            cout << "Error creating directory " << img_dir << endl;
            return 1;
        }
    }

    // ---------------------------------
    // Run simulation for specified time
    // ---------------------------------

    int output_steps = (int)std::ceil((1.0 / output_fps) / time_step);
    int render_steps = (int)std::ceil((1.0 / render_fps) / time_step);
    int sim_frame = 0;
    int render_frame = 0;

    std::shared_ptr<vehicle::SCMDeformableTerrain> terrain;
    bool terrain_created = false;

    while (true) {
        if (render && !vis->Run()) {
            break;
        }

        if (DBP_controller.Stop()) {
            break;
        }

        if (robot.GetChassisPos().x() > terrain_length - 2 * location_offset) {
            cout << "Reached end of terrain patch!" << endl;
            cout << "  time = " << my_sys.GetChTime() << endl;
            cout << "  Chassis location: " << robot.GetChassisPos().x() << endl;
            break;
        }

        if (drop && !terrain_created && my_sys.GetChTime() > time_create_terrain) {
            // Set terrain height
            double z = robot.GetWheelPos(robosimian::FR).z() - 0.15;

            // Create terrain
            terrain = CreateTerrain(&robot, terrain_length, terrain_width, z, location_offset);
            vis->BindItem(terrain->GetGroundObject());
            SetContactProperties(&robot);

            // Release robot
            robot.GetChassisBody()->SetBodyFixed(false);

            terrain_created = true;
        }

        if (render) {
            vis->BeginScene();
            vis->Render();
        }

        if (data_output && sim_frame % output_steps == 0) {
            robot.Output();
        }

        // Output POV-Ray date and/or snapshot images
        if (sim_frame % render_steps == 0) {
            if (povray_output) {
                char filename[100];
                sprintf(filename, "%s/data_%04d.dat", pov_dir.c_str(), render_frame + 1);
                utils::WriteVisualizationAssets(&my_sys, filename);
            }
            if (render && image_output) {
                char filename[100];
                sprintf(filename, "%s/img_%04d.jpg", img_dir.c_str(), render_frame + 1);
                vis->WriteImageToFile(filename);
            }

            render_frame++;
        }

        robot.DoStepDynamics(time_step);

        sim_frame++;

        if (render) {
            vis->EndScene();
        }
    }

    DBP_controller.WriteOutput(out_dir + "/DBP_" + mode_name + ".csv");

    return 0;
}

// =============================================================================

bool GetProblemSpecs(int argc,
                     char** argv,
                     double& time_step,
                     robosimian::LocomotionMode& mode,
                     int& num_cycles,
                     double& dbp_incr,
                     double& terrain_length,
                     bool& render,
                     bool& data_output,
                     bool& image_output,
                     bool& povray_output) {
    // Default values
    time_step = 5e-4;
    render = true;
    mode = robosimian::LocomotionMode::WALK;
    num_cycles = 2;
    dbp_incr = 0.04;
    terrain_length = 8.0;
    data_output = false;
    povray_output = false;
    image_output = false;

    ChCLI cli(argv[0]);

    cli.AddOption<int>("Demo", "mode", "Locomotion mode (0:walk, 1:scull, 2:inchworm, 3:drive)", "0");
    cli.AddOption<double>("Demo", "step_size", "Integration step size [s]", std::to_string(time_step));
    cli.AddOption<int>("Demo", "cycles", "Number of cycles for constant DBP force", std::to_string(num_cycles));
    cli.AddOption<double>("Demo", "increment", "DBP factor increment", std::to_string(dbp_incr));
    cli.AddOption<double>("Demo", "terrain_length", "Length of terrain patch", std::to_string(terrain_length));
    cli.AddOption<bool>("Demo", "render", "Irrlicht rendering?", std::to_string(render));
    cli.AddOption<bool>("Demo", "output", "Generate result output files", std::to_string(data_output));
    cli.AddOption<bool>("Demo", "pov_output", "Generate POV-Ray output files", std::to_string(povray_output));
    cli.AddOption<bool>("Demo", "img_output", "Generate Irrlicht capture output files", std::to_string(image_output));

    if (!cli.Parse(argc, argv)) {
        cli.Help();
        return false;
    }

    switch (cli.GetAsType<int>("mode")) {
        case 0:
            mode = robosimian::LocomotionMode::WALK;
            break;
        case 1:
            mode = robosimian::LocomotionMode::SCULL;
            break;
        case 2:
            mode = robosimian::LocomotionMode::INCHWORM;
            break;
        case 3:
            mode = robosimian::LocomotionMode::DRIVE;
            break;
        default:
            cout << "Invalid locomotion mode" << endl;
            cli.Help();
            return false;
    }

    time_step = cli.GetAsType<double>("step_size");
    num_cycles = cli.GetAsType<int>("cycles");
    dbp_incr = cli.GetAsType<double>("increment");
    terrain_length = cli.GetAsType<double>("terrain_length");
    render = cli.GetAsType<bool>("render");
    data_output = cli.GetAsType<bool>("output");
    povray_output = cli.GetAsType<bool>("pov_output");
    image_output = cli.GetAsType<bool>("img_output");

    image_output = image_output && render;

    return true;
}


text:
package com.conveyal.gtfs.storage;

import java.io.*;
import java.util.BitSet;
import java.util.zip.GZIPInputStream;

/**
 * Loads an ESRI ASCII grid containing integers and allows looking up values as booleans (where > 0).
 * This is used for
 */
public class BooleanAsciiGrid {

    int ncols;
    int nrows;
    double xllcorner;
    double yllcorner;
    double cellsize;
    double nodata;

    BitSet grid;

    public BooleanAsciiGrid (InputStream inputStream, boolean gzipped) {

        try {
            if (gzipped) inputStream = new GZIPInputStream(inputStream);
            BufferedReader reader = new BufferedReader(new InputStreamReader(inputStream));
            boolean inHeader = true;
            int nDataItemsRead = 0;
            for(String line = reader.readLine(); line != null; line = reader.readLine()) {
                String[] fields = line.trim().split("\\s+"); // split on one or more whitespace characters
                if (inHeader) {
                    inHeader = handleHeaderRow(fields);
                    if (inHeader) continue;
                    grid = new BitSet(ncols * nrows);
                }
                if (fields.length != ncols) {
                    throw new RuntimeException("Wrong number of data columns: " +  fields.length);
                }
                for (String field : fields) {
                    int value = Integer.parseInt(field);
                    grid.set(nDataItemsRead++, value > 0);
                }
            }
            if (nDataItemsRead != ncols * nrows) throw new RuntimeException("Too few data items: " + nDataItemsRead);
        } catch (IOException exception) {
            throw new RuntimeException(exception);
        }
    }

    /**
     * Get a grid for places where population density is over 5 people per square kilometer.
     * We use the Gridded Population of the World v3 data set for 2015 UN-adjusted population density.
     * This data set was downloaded at 1/4 degree resolution in ESRI ASCII grid format. The grid file was edited
     * manually to eliminate the no-data value header, since I could not find a way to operate on no-value cells in the
     * QGIS raster calculator. Then the raster calculator in QGIS was used with the formula ("glds00ag15@1" > 5),
     * which makes all cells with population density above the threshold have a value of one,
     * and all others a value of zero (since the no data value in the grid is -9999). This was then exported as another
     * ASCII grid file, which zips well. The license for this data set is Creative Commons Attribution.
     * See http://sedac.ciesin.columbia.edu/data/collection/gpw-v3
     */
    public static BooleanAsciiGrid forEarthPopulation() {
        try {
            InputStream gridStream = BooleanAsciiGrid.class.getResourceAsStream("gpwv3-quarter-boolean.asc");
            return new BooleanAsciiGrid(gridStream, false);
        } catch (Exception ex) {
            throw new RuntimeException(ex);
        }
    }

    /**
     * @param fields
     * @return whether we appear to still be in the header lines of the file
     */
    private boolean handleHeaderRow (String[] fields) {
        if (fields.length != 2) return false;
        String key = fields[0];
        if ("ncols".equals(key)) {
            ncols = Integer.parseInt(fields[1]);
        } else if ("nrows".equalsIgnoreCase(key)) {
            nrows = Integer.parseInt(fields[1]);
        } else if ("xllcorner".equalsIgnoreCase(key)) {
            xllcorner = Double.parseDouble(fields[1]);
        } else if ("yllcorner".equalsIgnoreCase(key)) {
            yllcorner = Double.parseDouble(fields[1]);
        } else if ("cellsize".equalsIgnoreCase(key)) {
            cellsize = Double.parseDouble(fields[1]);
        } else if ("NODATA_value".equalsIgnoreCase(key)) {
            nodata = Double.parseDouble(fields[1]);
        } else {
            return false;
        }
        return true;
    }

    public boolean getValueForCoords (double x, double y) {
        int xCell = (int)((x - xllcorner) / cellsize);
        int yCell = (int)((y - yllcorner) / cellsize);
        int index = (nrows - yCell - 1) * ncols + xCell; // Vertical flip
        if (index < 0 || index > grid.length()) return false;
        return grid.get(index);
    }

}


text:
/**
 * BSD-style license; for more info see http://pmd.sourceforge.net/license.html
 */
package net.sourceforge.pmd.lang.java;

import java.io.Reader;
import java.util.Map;

import net.sourceforge.pmd.lang.AbstractParser;
import net.sourceforge.pmd.lang.ParserOptions;
import net.sourceforge.pmd.lang.TokenManager;
import net.sourceforge.pmd.lang.ast.AbstractTokenManager;
import net.sourceforge.pmd.lang.ast.JavaCharStream;
import net.sourceforge.pmd.lang.ast.Node;
import net.sourceforge.pmd.lang.java.ast.JavaParser;
import net.sourceforge.pmd.lang.java.ast.ParseException;

/**
 * This is a generic Java specific implementation of the Parser interface. It
 * creates a JavaParser instance, and sets the exclude marker. It also exposes
 * the exclude map from the JavaParser instance.
 *
 * @see AbstractParser
 * @see JavaParser
 */
public abstract class AbstractJavaParser extends AbstractParser {
    private JavaParser parser;

    public AbstractJavaParser(ParserOptions parserOptions) {
	super(parserOptions);
    }

    @Override
    public TokenManager createTokenManager(Reader source) {
	return new JavaTokenManager(source);
    }

    /**
     * Subclass should override this method to modify the JavaParser as needed.
     */
    protected JavaParser createJavaParser(Reader source) throws ParseException {
	parser = new JavaParser(new JavaCharStream(source));
	String suppressMarker = getParserOptions().getSuppressMarker();
	if (suppressMarker != null) {
	    parser.setSuppressMarker(suppressMarker);
	}
	return parser;
    }

    public boolean canParse() {
	return true;
    }

    public Node parse(String fileName, Reader source) throws ParseException {
	AbstractTokenManager.setFileName(fileName);
	return createJavaParser(source).CompilationUnit();
    }

    public Map<Integer, String> getSuppressMap() {
	return parser.getSuppressMap();
    }
}


text:
package timecloud.controller.transfer;

import java.sql.SQLException;
import java.util.Collection;
import java.util.Observer;
import timecloud.dto.transfer.TransferDTO;
import timecloud.model.transfer.Transfer;

/**
 *
 * Controller interface defining the available operations on Transfers
 *
 * @author Pieter Van Eeckhout
 */
public interface TransferController extends Observer {

    /**
     *
     * Save an transfer to the DB and the repository
     *
     * @param episodeID the id of the episode of the transfer
     * @param transferDTO The data of the transfer to be saved. If the
     * transferID is set, the transfer will be updated. Else it will be created.
     * @throws java.sql.SQLException
     * @see Transfer
     * @see TransferDTO
     */
    void save(long episodeID, TransferDTO transferDTO) throws SQLException;

    /**
     *
     * Fills the transfer collection with all the transfers stored in the
     * database.
     *
     * @throws java.sql.SQLException
     * @see Transfer
     */
    void getAllFromDB() throws SQLException;

    /**
     *
     * Returns the transfer with the supplied ID.
     *
     * @param transferNumber the ID of the requested transfer.
     * @return An Transfer object.
     * @throws java.sql.SQLException
     * @see Transfer
     */
    Transfer getTransfer(long transferNumber) throws SQLException;

    /**
     *
     * Returns a collection of all the transfers stored in the database the episode.
     *
     * @param episodeID the id of the episode of the transfers
     * @return Collection containing the Transfers.
     * @throws java.sql.SQLException
     * @see Transfer
     */
    Collection<Transfer> getAllTransfers(long episodeID) throws SQLException;

    /**
     *
     * Deletes the transfer with the supplied ID.
     *
     * @param transferID The ID of the transfer to delete.
     * @throws java.sql.SQLException
     */
    void delete(long transferID) throws SQLException;

}


text:
package config

import (
	"io/ioutil"

	"github.com/BurntSushi/toml"
)

type Size int

const (
	DefaultAddr     string = "127.0.0.1:6380"
	DefaultHttpAddr string = "127.0.0.1:11181"

	DefaultDBName string = "goleveldb"

	DefaultDataDir string = "./data"
)

const (
	MaxBinLogFileSize int = 1024 * 1024 * 1024
	MaxBinLogFileNum  int = 10000

	DefaultBinLogFileSize int = MaxBinLogFileSize
	DefaultBinLogFileNum  int = 10
)

type LevelDBConfig struct {
	Compression     bool `toml:"compression"`
	BlockSize       int  `toml:"block_size"`
	WriteBufferSize int  `toml:"write_buffer_size"`
	CacheSize       int  `toml:"cache_size"`
	MaxOpenFiles    int  `toml:"max_open_files"`
}

type LMDBConfig struct {
	MapSize int  `toml:"map_size"`
	NoSync  bool `toml:"nosync"`
}

type BinLogConfig struct {
	MaxFileSize int `toml:"max_file_size"`
	MaxFileNum  int `toml:"max_file_num"`
}

type Config struct {
	DataDir string `toml:"data_dir"`

	DBName string `toml:"db_name"`

	LevelDB LevelDBConfig `toml:"leveldb"`

	LMDB LMDBConfig `toml:"lmdb"`

	BinLog BinLogConfig `toml:"binlog"`

	SlaveOf string `toml:"slaveof"`

	AccessLog string `toml:"access_log"`
}

func NewConfigWithFile(fileName string) (*Config, error) {
	data, err := ioutil.ReadFile(fileName)
	if err != nil {
		return nil, err
	}

	return NewConfigWithData(data)
}

func NewConfigWithData(data []byte) (*Config, error) {
	cfg := NewConfigDefault()

	_, err := toml.Decode(string(data), cfg)
	if err != nil {
		return nil, err
	}

	return cfg, nil
}

func NewConfigDefault() *Config {
	cfg := new(Config)

	cfg.DataDir = DefaultDataDir

	cfg.DBName = DefaultDBName

	// disable binlog
	cfg.BinLog.MaxFileNum = 0
	cfg.BinLog.MaxFileSize = 0

	// disable replication
	cfg.SlaveOf = ""

	// disable access log
	cfg.AccessLog = ""

	cfg.LMDB.MapSize = 20 * 1024 * 1024
	cfg.LMDB.NoSync = true

	return cfg
}

func (cfg *LevelDBConfig) Adjust() {
	if cfg.CacheSize <= 0 {
		cfg.CacheSize = 4 * 1024 * 1024
	}

	if cfg.BlockSize <= 0 {
		cfg.BlockSize = 4 * 1024
	}

	if cfg.WriteBufferSize <= 0 {
		cfg.WriteBufferSize = 4 * 1024 * 1024
	}

	if cfg.MaxOpenFiles < 1024 {
		cfg.MaxOpenFiles = 1024
	}
}

func (cfg *BinLogConfig) Adjust() {
	if cfg.MaxFileSize <= 0 {
		cfg.MaxFileSize = DefaultBinLogFileSize
	} else if cfg.MaxFileSize > MaxBinLogFileSize {
		cfg.MaxFileSize = MaxBinLogFileSize
	}

	if cfg.MaxFileNum <= 0 {
		cfg.MaxFileNum = DefaultBinLogFileNum
	} else if cfg.MaxFileNum > MaxBinLogFileNum {
		cfg.MaxFileNum = MaxBinLogFileNum
	}
}


text:
#if !defined(BOOST_SPIRIT_CHAR_APRIL_16_2006_1051AM)
#define BOOST_SPIRIT_CHAR_APRIL_16_2006_1051AM

#if defined(_MSC_VER)
#pragma once
#endif

#include <boost/spirit/home/support/common_terminals.hpp>
#include <boost/spirit/home/support/string_traits.hpp>
#include <boost/spirit/home/support/info.hpp>
#include <boost/spirit/home/support/detail/get_encoding.hpp>
#include <boost/spirit/home/support/char_set/basic_chset.hpp>
#include <boost/spirit/home/qi/char/char_parser.hpp>
#include <boost/spirit/home/qi/char/char_class.hpp>
#include <boost/spirit/home/qi/meta_compiler.hpp>
#include <boost/spirit/home/qi/auxiliary/lazy.hpp>
#include <boost/fusion/include/at.hpp>
#include <boost/mpl/if.hpp>
#include <boost/mpl/assert.hpp>
#include <boost/utility/enable_if.hpp>
#include <string>

#if defined(_MSC_VER)
#pragma once
#endif

namespace boost { namespace spirit
{
    ///////////////////////////////////////////////////////////////////////////
    // Enablers
    ///////////////////////////////////////////////////////////////////////////
    template <typename CharEncoding>
    struct use_terminal<qi::domain
      , terminal<
            tag::char_code<tag::char_, CharEncoding>    // enables char_
        >
    > : mpl::true_ {};

    template <typename CharEncoding, typename A0>
    struct use_terminal<qi::domain
      , terminal_ex<
            tag::char_code<tag::char_, CharEncoding>    // enables char_('x'), char_("x")
          , fusion::vector1<A0>                         // and char_("a-z0-9")
        >
    > : mpl::true_ {};

    template <typename CharEncoding, typename A0, typename A1>
    struct use_terminal<qi::domain
      , terminal_ex<
            tag::char_code<tag::char_, CharEncoding>    // enables char_('a','z')
          , fusion::vector2<A0, A1>
        >
    > : mpl::true_ {};

    template <typename CharEncoding>                    // enables *lazy* char_('x'), char_("x")
    struct use_lazy_terminal<                           // and char_("a-z0-9")
        qi::domain
      , tag::char_code<tag::char_, CharEncoding>
      , 1 // arity
    > : mpl::true_ {};

    template <typename CharEncoding>                    // enables *lazy* char_('a','z')
    struct use_lazy_terminal<
        qi::domain
      , tag::char_code<tag::char_, CharEncoding>
      , 2 // arity
    > : mpl::true_ {};

    template <>
    struct use_terminal<qi::domain, char>               // enables 'x'
      : mpl::true_ {};

    template <>
    struct use_terminal<qi::domain, char[2]>            // enables "x"
      : mpl::true_ {};

    template <>
    struct use_terminal<qi::domain, wchar_t>            // enables wchar_t
      : mpl::true_ {};

    template <>
    struct use_terminal<qi::domain, wchar_t[2]>         // enables L"x"
      : mpl::true_ {};
}}

namespace boost { namespace spirit { namespace qi
{
    using spirit::lit; // lit('x') is equivalent to 'x'

    ///////////////////////////////////////////////////////////////////////////
    // Parser for a single character
    ///////////////////////////////////////////////////////////////////////////
    template <typename CharEncoding, bool no_attribute, bool no_case = false>
    struct literal_char
      : char_parser<
            literal_char<CharEncoding, no_attribute, false>
          , typename CharEncoding::char_type
          , typename mpl::if_c<no_attribute, unused_type
              , typename CharEncoding::char_type>::type>
    {
        typedef typename CharEncoding::char_type char_type;
        typedef CharEncoding char_encoding;

        template <typename Char>
        literal_char(Char ch)
          : ch(static_cast<char_type>(ch)) {}

        template <typename Context, typename Iterator>
        struct attribute
        {
            typedef typename mpl::if_c<
                no_attribute, unused_type, char_type>::type
            type;
        };

        template <typename CharParam, typename Context>
        bool test(CharParam ch_, Context&) const
        {
            return traits::ischar<CharParam, char_encoding>::call(ch_) &&
                   ch == char_type(ch_);
        }

        template <typename Context>
        info what(Context& /*context*/) const
        {
            return info("literal-char", char_encoding::toucs4(ch));
        }

        char_type ch;
    };

    template <typename CharEncoding, bool no_attribute>
    struct literal_char<CharEncoding, no_attribute, true> // case insensitive
      : char_parser<
            literal_char<CharEncoding, no_attribute, true>
          , typename mpl::if_c<no_attribute, unused_type
              , typename CharEncoding::char_type>::type>
    {
        typedef typename CharEncoding::char_type char_type;
        typedef CharEncoding char_encoding;

        literal_char(char_type ch)
          : lo(static_cast<char_type>(char_encoding::tolower(ch)))
          , hi(static_cast<char_type>(char_encoding::toupper(ch))) {}

        template <typename Context, typename Iterator>
        struct attribute
        {
            typedef typename mpl::if_c<
                no_attribute, unused_type, char_type>::type
            type;
        };

        template <typename CharParam, typename Context>
        bool test(CharParam ch_, Context&) const
        {
            if (!traits::ischar<CharParam, char_encoding>::call(ch_))
                return false;

            char_type ch = char_type(ch_);  // optimize for token based parsing
            return this->lo == ch || this->hi == ch;
        }

        template <typename Context>
        info what(Context& /*context*/) const
        {
            return info("no-case-literal-char", char_encoding::toucs4(lo));
        }

        char_type lo, hi;
    };

    ///////////////////////////////////////////////////////////////////////////
    // Parser for a character range
    ///////////////////////////////////////////////////////////////////////////
    template <typename CharEncoding, bool no_case = false>
    struct char_range
      : char_parser<char_range<CharEncoding, false>, typename CharEncoding::char_type>
    {
        typedef typename CharEncoding::char_type char_type;
        typedef CharEncoding char_encoding;

        char_range(char_type from, char_type to)
          : from(from), to(to) {}

        template <typename CharParam, typename Context>
        bool test(CharParam ch_, Context&) const
        {
            if (!traits::ischar<CharParam, char_encoding>::call(ch_))
                return false;

            char_type ch = char_type(ch_);  // optimize for token based parsing
            return !(ch < from) && !(to < ch);
        }

        template <typename Context>
        info what(Context& /*context*/) const
        {
            info result("char-range", char_encoding::toucs4(from));
            boost::get<std::string>(result.value) += '-';
            boost::get<std::string>(result.value) += to_utf8(char_encoding::toucs4(to));
            return result;
        }

        char_type from, to;
    };

    template <typename CharEncoding>
    struct char_range<CharEncoding, true> // case insensitive
      : char_parser<char_range<CharEncoding, true>, typename CharEncoding::char_type>
    {
        typedef typename CharEncoding::char_type char_type;
        typedef CharEncoding char_encoding;

        char_range(char_type from, char_type to)
          : from_lo(static_cast<char_type>(char_encoding::tolower(from)))
          , to_lo(static_cast<char_type>(char_encoding::tolower(to)))
          , from_hi(static_cast<char_type>(char_encoding::toupper(from)))
          , to_hi(static_cast<char_type>(char_encoding::toupper(to)))
        {}

        template <typename CharParam, typename Context>
        bool test(CharParam ch_, Context&) const
        {
            if (!traits::ischar<CharParam, char_encoding>::call(ch_))
                return false;

            char_type ch = char_type(ch_);  // optimize for token based parsing
            return (!(ch < from_lo) && !(to_lo < ch))
                || (!(ch < from_hi) && !(to_hi < ch))
            ;
        }

        template <typename Context>
        info what(Context& /*context*/) const
        {
            info result("no-case-char-range", char_encoding::toucs4(from_lo));
            boost::get<std::string>(result.value) += '-';
            boost::get<std::string>(result.value) += to_utf8(char_encoding::toucs4(to_lo));
            return result;
        }

        char_type from_lo, to_lo, from_hi, to_hi;
    };

    ///////////////////////////////////////////////////////////////////////////
    // Parser for a character set
    ///////////////////////////////////////////////////////////////////////////
    template <typename CharEncoding, bool no_case = false>
    struct char_set
      : char_parser<char_set<CharEncoding, false>, typename CharEncoding::char_type>
    {
        typedef typename CharEncoding::char_type char_type;
        typedef CharEncoding char_encoding;

        template <typename String>
        char_set(String const& str)
        {
            typedef typename traits::char_type_of<String>::type in_type;

            BOOST_SPIRIT_ASSERT_MSG((
                (sizeof(char_type) == sizeof(in_type))
            ), cannot_convert_string, (String));

            char_type const* definition =
                (char_type const*)traits::get_c_string(str);
            char_type ch = *definition++;
            while (ch)
            {
                char_type next = *definition++;
                if (next == '-')
                {
                    next = *definition++;
                    if (next == 0)
                    {
                        chset.set(ch);
                        chset.set('-');
                        break;
                    }
                    chset.set(ch, next);
                }
                else
                {
                    chset.set(ch);
                }
                ch = next;
            }
        }

        template <typename CharParam, typename Context>
        bool test(CharParam ch, Context&) const
        {
            return traits::ischar<CharParam, char_encoding>::call(ch) &&
                   chset.test(char_type(ch));
        }

        template <typename Context>
        info what(Context& /*context*/) const
        {
            return info("char-set");
        }

        support::detail::basic_chset<char_type> chset;
    };

    template <typename CharEncoding>
    struct char_set<CharEncoding, true> // case insensitive
      : char_parser<char_set<CharEncoding, true>, typename CharEncoding::char_type>
    {
        typedef typename CharEncoding::char_type char_type;
        typedef CharEncoding char_encoding;

        template <typename String>
        char_set(String const& str)
        {
            typedef typename traits::char_type_of<String>::type in_type;

            BOOST_SPIRIT_ASSERT_MSG((
                (sizeof(char_type) == sizeof(in_type))
            ), cannot_convert_string, (String));

            char_type const* definition =
                (char_type const*)traits::get_c_string(str);
            char_type ch = *definition++;
            while (ch)
            {
                char_type next = *definition++;
                if (next == '-')
                {
                    next = *definition++;
                    if (next == 0)
                    {
                        chset.set(static_cast<char_type>(CharEncoding::tolower(ch)));
                        chset.set(static_cast<char_type>(CharEncoding::toupper(ch)));
                        chset.set('-');
                        break;
                    }
                    chset.set(static_cast<char_type>(CharEncoding::tolower(ch))
                      , static_cast<char_type>(CharEncoding::tolower(next)));
                    chset.set(static_cast<char_type>(CharEncoding::toupper(ch))
                      , static_cast<char_type>(CharEncoding::toupper(next)));
                }
                else
                {
                    chset.set(static_cast<char_type>(CharEncoding::tolower(ch)));
                    chset.set(static_cast<char_type>(CharEncoding::toupper(ch)));
                }
                ch = next;
            }
        }

        template <typename CharParam, typename Context>
        bool test(CharParam ch, Context&) const
        {
            return traits::ischar<CharParam, char_encoding>::call(ch) &&
                   chset.test(char_type(ch));
        }

        template <typename Context>
        info what(Context& /*context*/) const
        {
            return info("no-case-char-set");
        }

        support::detail::basic_chset<char_type> chset;
    };

    ///////////////////////////////////////////////////////////////////////////
    // Parser generators: make_xxx function (objects)
    ///////////////////////////////////////////////////////////////////////////
    namespace detail
    {
        template <typename Modifiers, typename Encoding>
        struct basic_literal
        {
            static bool const no_case =
                has_modifier<
                    Modifiers
                  , tag::char_code_base<tag::no_case>
                >::value;

            static bool const no_attr =
                !has_modifier<
                    Modifiers
                  , tag::lazy_eval
                >::value;

            typedef literal_char<
                typename spirit::detail::get_encoding<
                    Modifiers, Encoding, no_case>::type
              , no_attr
              , no_case>
            result_type;

            template <typename Char>
            result_type operator()(Char ch, unused_type) const
            {
                return result_type(ch);
            }

            template <typename Char>
            result_type operator()(Char const* str, unused_type) const
            {
                return result_type(str[0]);
            }
        };
    }

    template <typename Modifiers>
    struct make_primitive<char, Modifiers>
      : detail::basic_literal<Modifiers, char_encoding::standard> {};

    template <typename Modifiers>
    struct make_primitive<char const(&)[2], Modifiers>
      : detail::basic_literal<Modifiers, char_encoding::standard> {};

    template <typename Modifiers>
    struct make_primitive<wchar_t, Modifiers>
      : detail::basic_literal<Modifiers, char_encoding::standard_wide> {};

    template <typename Modifiers>
    struct make_primitive<wchar_t const(&)[2], Modifiers>
      : detail::basic_literal<Modifiers, char_encoding::standard_wide> {};

    template <typename CharEncoding, typename Modifiers>
    struct make_primitive<
        terminal<tag::char_code<tag::char_, CharEncoding> >, Modifiers>
    {
        typedef tag::char_code<tag::char_, CharEncoding> tag;
        typedef char_class<tag> result_type;
        result_type operator()(unused_type, unused_type) const
        {
            return result_type();
        }
    };

    template <typename CharEncoding, typename Modifiers, typename A0>
    struct make_primitive<
        terminal_ex<
            tag::char_code<tag::char_, CharEncoding>
          , fusion::vector1<A0>
        >
      , Modifiers>
    {
        static bool const no_case =
            has_modifier<
                Modifiers
              , tag::char_code<tag::no_case, CharEncoding>
            >::value;

        typedef typename
            mpl::if_<
                traits::is_string<A0>
              , char_set<CharEncoding, no_case>
              , literal_char<CharEncoding, false, no_case>
            >::type
        result_type;

        template <typename Terminal>
        result_type operator()(Terminal const& term, unused_type) const
        {
            return result_type(fusion::at_c<0>(term.args));
        }
    };

    template <typename CharEncoding, typename Modifiers, typename Char>
    struct make_primitive<
        terminal_ex<
            tag::char_code<tag::char_, CharEncoding>
          , fusion::vector1<Char(&)[2]> // For single char strings
        >
      , Modifiers>
    {
        static bool const no_case =
            has_modifier<
                Modifiers
              , tag::char_code<tag::no_case, CharEncoding>
            >::value;

        typedef literal_char<CharEncoding, false, no_case> result_type;

        template <typename Terminal>
        result_type operator()(Terminal const& term, unused_type) const
        {
            return result_type(fusion::at_c<0>(term.args)[0]);
        }
    };

    template <typename CharEncoding, typename Modifiers, typename A0, typename A1>
    struct make_primitive<
        terminal_ex<
            tag::char_code<tag::char_, CharEncoding>
          , fusion::vector2<A0, A1>
        >
      , Modifiers>
    {
        static bool const no_case =
            has_modifier<
                Modifiers
              , tag::char_code<tag::no_case, CharEncoding>
            >::value;

        typedef char_range<CharEncoding, no_case> result_type;

        template <typename Terminal>
        result_type operator()(Terminal const& term, unused_type) const
        {
            return result_type(
                fusion::at_c<0>(term.args)
              , fusion::at_c<1>(term.args)
            );
        }
    };
}}}

#endif


text:
/*
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package io.prestosql.operator;

import java.util.function.Function;
import java.util.function.IntPredicate;

import static java.util.Objects.requireNonNull;

public final class StaticLookupSourceProvider
        implements LookupSourceProvider
{
    private final LookupSource lookupSource;

    public StaticLookupSourceProvider(LookupSource lookupSource)
    {
        this.lookupSource = requireNonNull(lookupSource, "lookupSource is null");
    }

    @Override
    public <R> R withLease(Function<LookupSourceLease, R> action)
    {
        return action.apply(new SimpleLookupSourceLease());
    }

    @Override
    public void close()
    {
        lookupSource.close();
    }

    private class SimpleLookupSourceLease
            implements LookupSourceLease
    {
        @Override
        public LookupSource getLookupSource()
        {
            return lookupSource;
        }

        @Override
        public boolean hasSpilled()
        {
            return false;
        }

        @Override
        public long spillEpoch()
        {
            return 0;
        }

        @Override
        public IntPredicate getSpillMask()
        {
            return i -> false;
        }
    }
}


text:
module.exports = function(grunt){
  var pkg = grunt.file.readJSON('package.json');

  grunt.initConfig({
    compress: {
      main: {
        options: {
          archive: '../dist/lambda.zip',
        },
        files: [
          {
            src: 'storeSESBounce_lambda.py',
            cwd: '../src',
            expand: true
          }
        ]
      }
    },
    copy: {
      main: {
        files: [
          {expand: true, src: ['../deploy/policy.lam.json'], dest: '../dist/deploy/', filter: 'isFile'}
        ]
      }
    }
  })

  grunt.registerTask('produce-deployment-rules', function(){
    var propertiesReader = require('properties-reader');
    var sourceFiles = grunt.file.expand("../deploy/environments/*");
    sourceFiles.forEach(function(pathToSource){
      var filePathArray = pathToSource.split("/");
      var envName = filePathArray[filePathArray.length - 1].split(".")[0];
      var envProperties = propertiesReader(pathToSource);

      grunt.file.copy("../deploy/lambda.json", '../dist/deploy/environments/' + envName + '.lam.json', {
        process: function(text) {
          text = replaceText(text, envProperties);
          return text;
        }
      });
    });
  });

  function replaceText(text, envProperties){
    var textWithReplacements = text;
    envProperties.each(function(key, value) {
      textWithReplacements = textWithReplacements.replace(new RegExp('##' + key.replace('.', '\.') + '##', 'g'), value);
    });
    return textWithReplacements;
  }

  grunt.loadNpmTasks('grunt-contrib-compress');
  grunt.loadNpmTasks('grunt-contrib-copy');

  grunt.registerTask('default', ['compress', 'copy', 'produce-deployment-rules']);

};


text:
package com.alibaba.rocketmq.service;

import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.apache.commons.cli.Option;
import org.apache.commons.lang.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;

import com.alibaba.rocketmq.common.Table;
import com.alibaba.rocketmq.common.namesrv.NamesrvUtil;
import com.alibaba.rocketmq.tools.admin.DefaultMQAdminExt;
import com.alibaba.rocketmq.tools.command.namesrv.DeleteKvConfigCommand;
import com.alibaba.rocketmq.tools.command.namesrv.DeleteProjectGroupCommand;
import com.alibaba.rocketmq.tools.command.namesrv.GetProjectGroupCommand;
import com.alibaba.rocketmq.tools.command.namesrv.UpdateKvConfigCommand;
import com.alibaba.rocketmq.tools.command.namesrv.UpdateProjectGroupCommand;
import com.alibaba.rocketmq.tools.command.namesrv.WipeWritePermSubCommand;
import com.alibaba.rocketmq.validate.CmdTrace;

/**
 *
 * @author yankai913@gmail.com
 * @date 2014-2-17
 */
@Service
public class NamesrvService extends AbstractService {

    static final Logger logger = LoggerFactory.getLogger(NamesrvService.class);

    static final DeleteKvConfigCommand deleteKvConfigCommand = new DeleteKvConfigCommand();

    public Collection<Option> getOptionsForDeleteKvConfig() {
        return getOptions(deleteKvConfigCommand);
    }

    @CmdTrace(cmdClazz = DeleteKvConfigCommand.class)
    public boolean deleteKvConfig(String namespace, String key) throws Throwable {
        Throwable t = null;
        DefaultMQAdminExt defaultMQAdminExt = getDefaultMQAdminExt();
        try {
            defaultMQAdminExt.start();
            defaultMQAdminExt.deleteKvConfig(namespace, key);
            return true;
        }
        catch (Throwable e) {
            logger.error(e.getMessage(), e);
            t = e;
        }
        finally {
            shutdownDefaultMQAdminExt(defaultMQAdminExt);
        }
        throw t;
    }

    static final DeleteProjectGroupCommand deleteProjectGroupCommand = new DeleteProjectGroupCommand();

    public Collection<Option> getOptionsForDeleteProjectGroup() {
        return getOptions(deleteProjectGroupCommand);
    }

    @CmdTrace(cmdClazz = DeleteProjectGroupCommand.class)
    public boolean deleteProjectGroup(String ip, String project) throws Throwable {
        Throwable t = null;
        DefaultMQAdminExt defaultMQAdminExt = getDefaultMQAdminExt();
        String namespace = NamesrvUtil.NAMESPACE_PROJECT_CONFIG;
        try {
            if (StringUtils.isNotBlank(ip)) {
                defaultMQAdminExt.start();
                defaultMQAdminExt.deleteKvConfig(namespace, ip);
                return true;
            }
            else if (StringUtils.isNotBlank(project)) {
                defaultMQAdminExt.start();
                defaultMQAdminExt.deleteIpsByProjectGroup(project);
                return true;
            }
            else {
                throw new IllegalStateException("project or ip can not be all blank!");
            }
        }
        catch (Throwable e) {
            logger.error(e.getMessage(), e);
            t = e;
        }
        finally {
            shutdownDefaultMQAdminExt(defaultMQAdminExt);
        }
        throw t;
    }

    static final GetProjectGroupCommand getProjectGroupCommand = new GetProjectGroupCommand();

    public Collection<Option> getOptionsForGetProjectGroup() {
        return getOptions(getProjectGroupCommand);
    }

    @CmdTrace(cmdClazz = GetProjectGroupCommand.class)
    public String getProjectGroup(String ip, String project) throws Throwable {
        Throwable t = null;
        DefaultMQAdminExt defaultMQAdminExt = getDefaultMQAdminExt();
        try {
            if (StringUtils.isNotBlank(ip)) {
                defaultMQAdminExt.start();
                String projectInfo = defaultMQAdminExt.getProjectGroupByIp(ip);
                return projectInfo;
            }
            else if (StringUtils.isNotBlank(project)) {
                defaultMQAdminExt.start();
                String ips = defaultMQAdminExt.getIpsByProjectGroup(project);
                return ips;
            }
            else {
                throw new IllegalStateException("project or ip can not be all blank!");
            }
        }
        catch (Throwable e) {
            logger.error(e.getMessage(), e);
            t = e;
        }
        finally {
            shutdownDefaultMQAdminExt(defaultMQAdminExt);
        }
        throw t;
    }

    static final UpdateKvConfigCommand updateKvConfigCommand = new UpdateKvConfigCommand();

    public Collection<Option> getOptionsForUpdateKvConfig() {
        return getOptions(updateKvConfigCommand);
    }

    @CmdTrace(cmdClazz = UpdateKvConfigCommand.class)
    public boolean updateKvConfig(String namespace, String key, String value) throws Throwable {
        Throwable t = null;
        DefaultMQAdminExt defaultMQAdminExt = new DefaultMQAdminExt();
        try {
            defaultMQAdminExt.start();
            defaultMQAdminExt.createAndUpdateKvConfig(namespace, key, value);
            return true;
        }
        catch (Throwable e) {
            logger.error(e.getMessage(), e);
            t = e;
        }
        finally {
            shutdownDefaultMQAdminExt(defaultMQAdminExt);
        }
        throw t;
    }

    static final UpdateProjectGroupCommand updateProjectGroupCommand = new UpdateProjectGroupCommand();

    public Collection<Option> getOptionsForUpdateProjectGroup() {
        return getOptions(updateProjectGroupCommand);
    }

    @CmdTrace(cmdClazz = UpdateProjectGroupCommand.class)
    public boolean updateProjectGroup(String ip, String project) throws Throwable {
        Throwable t = null;
        DefaultMQAdminExt defaultMQAdminExt = getDefaultMQAdminExt();
        String namespace = NamesrvUtil.NAMESPACE_PROJECT_CONFIG;
        try {
            defaultMQAdminExt.start();
            defaultMQAdminExt.createAndUpdateKvConfig(namespace, ip, project);
            return true;
        }
        catch (Throwable e) {
            logger.error(e.getMessage(), e);
            t = e;
        }
        finally {
            shutdownDefaultMQAdminExt(defaultMQAdminExt);
        }
        throw t;
    }

    static final WipeWritePermSubCommand wipeWritePermSubCommand = new WipeWritePermSubCommand();

    public Collection<Option> getOptionsForWipeWritePerm() {
        return getOptions(wipeWritePermSubCommand);
    }

    @CmdTrace(cmdClazz = WipeWritePermSubCommand.class)
    public Table wipeWritePerm(String brokerName) throws Throwable {
        Throwable t = null;
        DefaultMQAdminExt defaultMQAdminExt = getDefaultMQAdminExt();
        try {
            defaultMQAdminExt.start();
            List<String> namesrvList = defaultMQAdminExt.getNameServerAddressList();
            if (namesrvList != null) {
                List<Map<String, String>> result = new ArrayList<Map<String, String>>();
                for (String namesrvAddr : namesrvList) {
                    try {
                        int wipeTopicCount = defaultMQAdminExt.wipeWritePermOfBroker(namesrvAddr, brokerName);
                        Map<String, String> map = new HashMap<String, String>();
                        map.put("brokerName", brokerName);
                        map.put("namesrvAddr", namesrvAddr);
                        map.put("wipeTopicCount", String.valueOf(wipeTopicCount));
                        result.add(map);
                        // System.out.printf("wipe write perm of broker[%s] in name server[%s] OK, %d\n",//
                        // brokerName,//
                        // namesrvAddr,//
                        // wipeTopicCount//
                        // );
                    }
                    catch (Exception e) {
                        System.out.printf("wipe write perm of broker[%s] in name server[%s] Failed\n",//
                            brokerName,//
                            namesrvAddr//
                            );

                        logger.error(e.getMessage(), e);
                    }
                }
                Table table = Table.Maps2HTable(result);
                return table;
            }
        }
        catch (Throwable e) {
            logger.error(e.getMessage(), e);
            t = e;
        }
        finally {
            shutdownDefaultMQAdminExt(defaultMQAdminExt);
        }
        throw t;
    }
}


text:
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
	<item android:drawable="@drawable/ic_like_disabled" android:state_enabled="false" />
	<item android:drawable="@drawable/ic_like_selected" android:state_selected="true" />
	<item android:drawable="@drawable/ic_like_normal" />
</selector>


text:
NOTE: AwsSum is now deprecated. Please use [aws-sdk](https://www.npmjs.org/package/aws-sdk) instead.

# awssum-amazon-s3 #

This is an ```AwsSum``` plugin!

You'll need to add [awssum-amazon-s3](https://github.com/awssum/awssum-amazon-s3/) to your package.json
dependencies. Both [awssum](https://github.com/awssum/awssum/) and
[awssum-amazon](https://github.com/awssum/awssum-amazon/) are pulled in as peer dependencies.

## Example ##

List all your buckets:

```
var fmt = require('fmt');
var amazonS3 = require('awssum-amazon-s3');

var s3 = new amazonS3.S3({
    'accessKeyId'     : process.env.ACCESS_KEY_ID,
    'secretAccessKey' : process.env.SECRET_ACCESS_KEY,
    'region'          : amazonS3.US_EAST_1
});

s3.ListBuckets(function(err, data) {
    fmt.dump(err, 'err');
    fmt.dump(data, 'data');
});
```

## Streaming ##

Streaming uploads:

```
var fmt = require('fmt');
var amazonS3 = require('awssum-amazon-s3');

var s3 = new amazonS3.S3({
    'accessKeyId'     : process.env.ACCESS_KEY_ID,
    'secretAccessKey' : process.env.SECRET_ACCESS_KEY,
    'region'          : amazonS3.US_EAST_1
});

// you must run fs.stat to get the file size for the content-length header (s3 requires this)
fs.stat(__filename, function(err, file_info) {
    var bodyStream = fs.createReadStream( __filename );

    var options = {
        BucketName    : bucket,
        ObjectName    : 'amazon.js',
        ContentLength : file_info.size,
        Body          : bodyStream
    };

    s3.PutObject(options, function(err, data) {
        fmt.dump(err, 'err');
        fmt.dump(data, 'data');
    });
});
```

Streaming downloads:

```
var fmt = require('fmt');
var amazonS3 = require('awssum-amazon-s3');

var s3 = new amazonS3.S3({
    'accessKeyId'     : process.env.ACCESS_KEY_ID,
    'secretAccessKey' : process.env.SECRET_ACCESS_KEY,
    'region'          : amazonS3.US_EAST_1
});

var options = {
    BucketName    : 'pie-17',
    ObjectName    : 'javascript-file.js',
};

s3.GetObject(options, { stream : true }, function(err, data) {
    fmt.dump(err, 'err');
    fmt.dump(data, 'data');

    // stream this file to stdout
    fmt.sep();
    fmt.title('The File');
    data.Stream.pipe(process.stdout);
    data.Stream.on('end', function() {
        fmt.sep();
    });
});
```

## Operations ##

### ListBuckets ###

Docs: [ListBuckets on AWS](http://docs.amazonwebservices.com/AmazonS3/latest/API/RESTServiceGET.html)

### DeleteBucket ###

Docs: [DeleteBucket on AWS](http://docs.amazonwebservices.com/AmazonS3/latest/API/RESTBucketDELETE.html)

### DeleteBucketCors ###

Docs: [DeleteBucketCors on AWS](http://docs.amazonwebservices.com/AmazonS3/latest/API/RESTBucketDELETEcors.html)

### DeleteBucketLifecycle ###

Docs: [DeleteBucketLifecycle on AWS](http://docs.amazonwebservices.com/AmazonS3/latest/API/RESTBucketDELETElifecycle.html)

### DeleteBucketPolicy ###

Docs: [DeleteBucketPolicy on AWS](http://docs.amazonwebservices.com/AmazonS3/latest/API/RESTBucketDELETEpolicy.html)

### DeleteBucketTagging ###

Docs: [DeleteBucketTagging on AWS]()

### DeleteBucketWebsite ###

Docs: [DeleteBucketWebsite on AWS](http://docs.amazonwebservices.com/AmazonS3/latest/API/RESTBucketDELETEwebsite.html)

### ListObjects ###

Docs: [ListObjects on AWS](http://docs.amazonwebservices.com/AmazonS3/latest/API/RESTBucketGET.html)

### GetBucketAcl ###

Docs: [GetBucketAcl on AWS](http://docs.amazonwebservices.com/AmazonS3/latest/API/RESTBucketGETacl.html)

### GetBucketCors ###

Docs: [GetBucketCors on AWS](http://docs.amazonwebservices.com/AmazonS3/latest/API/RESTBucketGETcors.html)

### GetBucketLifecycle ###

Docs: [GetBucketLifecycle on AWS](http://docs.amazonwebservices.com/AmazonS3/latest/API/RESTBucketGETlifecycle.html)

### GetBucketPolicy ###

Docs: [GetBucketPolicy on AWS](http://docs.amazonwebservices.com/AmazonS3/latest/API/RESTBucketGETpolicy.html)

### GetBucketTagging ###

Docs: [GetBucketTagging on AWS]()

### GetBucketLocation ###

Docs: [GetBucketLocation on AWS](http://docs.amazonwebservices.com/AmazonS3/latest/API/RESTBucketGETlocation.html)

### GetBucketLogging ###

Docs: [GetBucketLogging on AWS](http://docs.amazonwebservices.com/AmazonS3/latest/API/RESTBucketGETlogging.html)

### GetBucketNotification ###

Docs: [GetBucketNotification on AWS](http://docs.amazonwebservices.com/AmazonS3/latest/API/RESTBucketGETnotification.html)

### GetBucketObjectVersions ###

Docs: [GetBucketObjectVersions on AWS](http://docs.amazonwebservices.com/AmazonS3/latest/API/RESTBucketGETVersion.html)

### GetBucketRequestPayment ###

Docs: [GetBucketRequestPayment on AWS](http://docs.amazonwebservices.com/AmazonS3/latest/API/RESTrequestPaymentGET.html)

### GetBucketVersioning ###

Docs: [GetBucketVersioning on AWS](http://docs.amazonwebservices.com/AmazonS3/latest/API/RESTBucketGETversioningStatus.html)

### GetBucketWebsite ###

Docs: [GetBucketWebsite on AWS](http://docs.amazonwebservices.com/AmazonS3/latest/API/RESTBucketGETwebsite.html)

### CheckBucket ###

Docs: [CheckBucket on AWS](http://docs.amazonwebservices.com/AmazonS3/latest/API/RESTBucketHEAD.html)

### ListMultipartUploads ###

Docs: [ListMultipartUploads on AWS](http://docs.amazonwebservices.com/AmazonS3/latest/API/mpUploadListMPUpload.html)

### CreateBucket ###

Docs: [CreateBucket on AWS](http://docs.amazonwebservices.com/AmazonS3/latest/API/RESTBucketPUT.html)

### PutBucketAcl ###

Docs: [PutBucketAcl on AWS](http://docs.amazonwebservices.com/AmazonS3/latest/API/RESTBucketPUTacl.html)

### PutBucketCors ###

Docs: [PutBucketCors on AWS](http://docs.amazonwebservices.com/AmazonS3/latest/API/RESTBucketPUTcors.html)

### PutBucketLifecycle ###

Docs: [PutBucketLifecycle on AWS](http://docs.amazonwebservices.com/AmazonS3/latest/API/RESTBucketPUTlifecycle.html)

### PutBucketPolicy ###

Docs: [PutBucketPolicy on AWS](http://docs.amazonwebservices.com/AmazonS3/latest/API/RESTBucketPUTpolicy.html)

### PutBucketLogging ###

Docs: [PutBucketLogging on AWS](http://docs.amazonwebservices.com/AmazonS3/latest/API/RESTBucketPUTlogging.html)

### PutBucketNotification ###

Docs: [PutBucketNotification on AWS](http://docs.amazonwebservices.com/AmazonS3/latest/API/RESTBucketPUTnotification.html)

### PutBucketTagging ###

Docs: [PutBucketTagging on AWS]()

### PutBucketRequestPayment ###

Docs: [PutBucketRequestPayment on AWS](http://docs.amazonwebservices.com/AmazonS3/latest/API/RESTrequestPaymentPUT.html)

### PutBucketVersioning ###

Docs: [PutBucketVersioning on AWS](http://docs.amazonwebservices.com/AmazonS3/latest/API/RESTBucketPUTVersioningStatus.html)

### PutBucketWebsite ###

Docs: [PutBucketWebsite on AWS](http://docs.amazonwebservices.com/AmazonS3/latest/API/RESTBucketPUTwebsite.html)

### DeleteObject ###

Docs: [DeleteObject on AWS](http://docs.amazonwebservices.com/AmazonS3/latest/API/RESTObjectDELETE.html)

### DeleteMultipleObjects ###

Docs: [DeleteMultipleObjects on AWS](http://docs.amazonwebservices.com/AmazonS3/latest/API/multiobjectdeleteapi.html)

### GetObject ###

Docs: [GetObject on AWS](http://docs.amazonwebservices.com/AmazonS3/latest/API/RESTObjectGET.html)

### GetObjectAcl ###

Docs: [GetObjectAcl on AWS](http://docs.amazonwebservices.com/AmazonS3/latest/API/RESTObjectGETacl.html)

### GetObjectTorrent ###

Docs: [GetObjectTorrent on AWS](http://docs.amazonwebservices.com/AmazonS3/latest/API/RESTObjectGETtorrent.html)

### GetObjectMetadata ###

Docs: [GetObjectMetadata on AWS](http://docs.amazonwebservices.com/AmazonS3/latest/API/RESTObjectHEAD.html)

### OptionsObject ###

Docs: [OptionsObject on AWS](http://docs.amazonwebservices.com/AmazonS3/latest/API/RESTOPTIONSobject.html)

### PostObjectRestore ###

Docs: [PostObjectRestore on AWS](http://docs.amazonwebservices.com/AmazonS3/latest/API/RESTObjectPOSTrestore.html)

### PutObject ###

Docs: [PutObject on AWS](http://docs.amazonwebservices.com/AmazonS3/latest/API/RESTObjectPUT.html)

### PutObjectAcl ###

Docs: [PutObjectAcl on AWS](http://docs.amazonwebservices.com/AmazonS3/latest/API/RESTObjectPUTacl.html)

### CopyObject ###

Docs: [CopyObject on AWS](http://docs.amazonwebservices.com/AmazonS3/latest/API/RESTObjectCOPY.html)

### InitiateMultipartUpload ###

Docs: [InitiateMultipartUpload on AWS](http://docs.amazonwebservices.com/AmazonS3/latest/API/mpUploadInitiate.html)

### UploadPart ###

Docs: [UploadPart on AWS](http://docs.amazonwebservices.com/AmazonS3/latest/API/mpUploadUploadPart.html)

### UploadPartCopy ###

Docs: [UploadPartCopy on AWS](http://docs.amazonwebservices.com/AmazonS3/latest/API/mpUploadUploadPartCopy.html)

### CompleteMultipartUpload ###

Docs: [CompleteMultipartUpload on AWS](http://docs.amazonwebservices.com/AmazonS3/latest/API/mpUploadComplete.html)

### AbortMultipartUpload ###

Docs: [AbortMultipartUpload on AWS](http://docs.amazonwebservices.com/AmazonS3/latest/API/mpUploadAbort.html)

### ListParts ###

Docs: [ListParts on AWS](http://docs.amazonwebservices.com/AmazonS3/latest/API/mpUploadListParts.html)

# Author #

Written by [Andrew Chilton](http://chilts.org/) - [Blog](http://chilts.org/blog/) -
[Twitter](https://twitter.com/andychilton).

# License #

* [Copyright 2011-2013 Apps Attic Ltd.  All rights reserved.](http://appsattic.mit-license.org/2011/)
* [Copyright 2013 Andrew Chilton.  All rights reserved.](http://chilts.mit-license.org/2013/)

(Ends)