text:
<?xml version="1.0" encoding="UTF-8"?>
<definitions id="definitions"
	xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL"
	xmlns:activiti="http://activiti.org/bpmn"
	targetNamespace="Examples">

	<process id="timerOnCallActivity">

		<startEvent id="theStart" />
		<sequenceFlow id="flow1" sourceRef="theStart" targetRef="callActivity" />

    	<sequenceFlow id="flow3" sourceRef="callActivity" targetRef="theEnd" />

    	<callActivity id="callActivity" calledElement="subprocess"/>

		<boundaryEvent id="boundaryTimer" cancelActivity="true" attachedToRef="callActivity">
			<timerEventDefinition>
			  	<timeDuration>PT2H</timeDuration>
			</timerEventDefinition>
		</boundaryEvent>
		<sequenceFlow id="flow2" sourceRef="boundaryTimer" targetRef="taskAfterCatch" />
		<userTask id="taskAfterCatch" name="task outside subprocess" />

		<endEvent id="theEnd" />

	</process>

  	<process id="subprocess">

    <startEvent id="subprocessStart"/>
    <sequenceFlow id="subFlow1" sourceRef="subprocessStart" targetRef="innerSubprocess"/>

    <subProcess id="innerSubprocess">
      	<startEvent id="innerSubprocessStart"/>
      	<sequenceFlow id="innerSubFlow1" sourceRef="innerSubprocessStart" targetRef="innerFork"/>

      	<parallelGateway id="innerFork"/>
      	<sequenceFlow id="innerSubFlow2" sourceRef="innerFork" targetRef="innerTask1"/>
      	<sequenceFlow id="innerSubFlow3" sourceRef="innerFork" targetRef="innerTask2"/>

      	<userTask id="innerTask1" name="Inner subprocess task 1"/>
      	<userTask id="innerTask2" name="Inner subprocess task 2"/>

    </subProcess>

  </process>

</definitions>


text:
/*************************************************************************/
/*  animated_sprite_2d.cpp                                               */
/*************************************************************************/
/*                       This file is part of:                           */
/*                           GODOT ENGINE                                */
/*                      https://godotengine.org                          */
/*************************************************************************/
/* Copyright (c) 2007-2020 Juan Linietsky, Ariel Manzur.                 */
/* Copyright (c) 2014-2020 Godot Engine contributors (cf. AUTHORS.md).   */
/*                                                                       */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the       */
/* "Software"), to deal in the Software without restriction, including   */
/* without limitation the rights to use, copy, modify, merge, publish,   */
/* distribute, sublicense, and/or sell copies of the Software, and to    */
/* permit persons to whom the Software is furnished to do so, subject to */
/* the following conditions:                                             */
/*                                                                       */
/* The above copyright notice and this permission notice shall be        */
/* included in all copies or substantial portions of the Software.       */
/*                                                                       */
/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,       */
/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF    */
/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/
/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY  */
/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,  */
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE     */
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.                */
/*************************************************************************/

#include "animated_sprite_2d.h"

#include "core/os/os.h"
#include "scene/scene_string_names.h"

#define NORMAL_SUFFIX "_normal"
#define SPECULAR_SUFFIX "_specular"

#ifdef TOOLS_ENABLED
Dictionary AnimatedSprite2D::_edit_get_state() const {
	Dictionary state = Node2D::_edit_get_state();
	state["offset"] = offset;
	return state;
}

void AnimatedSprite2D::_edit_set_state(const Dictionary &p_state) {
	Node2D::_edit_set_state(p_state);
	set_offset(p_state["offset"]);
}

void AnimatedSprite2D::_edit_set_pivot(const Point2 &p_pivot) {
	set_offset(get_offset() - p_pivot);
	set_position(get_transform().xform(p_pivot));
}

Point2 AnimatedSprite2D::_edit_get_pivot() const {
	return Vector2();
}

bool AnimatedSprite2D::_edit_use_pivot() const {
	return true;
}

Rect2 AnimatedSprite2D::_edit_get_rect() const {
	return _get_rect();
}

bool AnimatedSprite2D::_edit_use_rect() const {
	if (!frames.is_valid() || !frames->has_animation(animation) || frame < 0 || frame >= frames->get_frame_count(animation)) {
		return false;
	}
	Ref<Texture2D> t;
	if (animation) {
		t = frames->get_frame(animation, frame);
	}
	return t.is_valid();
}
#endif

Rect2 AnimatedSprite2D::get_anchorable_rect() const {
	return _get_rect();
}

Rect2 AnimatedSprite2D::_get_rect() const {
	if (!frames.is_valid() || !frames->has_animation(animation) || frame < 0 || frame >= frames->get_frame_count(animation)) {
		return Rect2();
	}

	Ref<Texture2D> t;
	if (animation) {
		t = frames->get_frame(animation, frame);
	}
	if (t.is_null()) {
		return Rect2();
	}
	Size2 s = t->get_size();

	Point2 ofs = offset;
	if (centered) {
		ofs -= Size2(s) / 2;
	}

	if (s == Size2(0, 0)) {
		s = Size2(1, 1);
	}

	return Rect2(ofs, s);
}

void SpriteFrames::add_frame(const StringName &p_anim, const Ref<Texture2D> &p_frame, int p_at_pos) {
	Map<StringName, Anim>::Element *E = animations.find(p_anim);
	ERR_FAIL_COND_MSG(!E, "Animation '" + String(p_anim) + "' doesn't exist.");

	if (p_at_pos >= 0 && p_at_pos < E->get().frames.size()) {
		E->get().frames.insert(p_at_pos, p_frame);
	} else {
		E->get().frames.push_back(p_frame);
	}

	emit_changed();
}

int SpriteFrames::get_frame_count(const StringName &p_anim) const {
	const Map<StringName, Anim>::Element *E = animations.find(p_anim);
	ERR_FAIL_COND_V_MSG(!E, 0, "Animation '" + String(p_anim) + "' doesn't exist.");

	return E->get().frames.size();
}

void SpriteFrames::remove_frame(const StringName &p_anim, int p_idx) {
	Map<StringName, Anim>::Element *E = animations.find(p_anim);
	ERR_FAIL_COND_MSG(!E, "Animation '" + String(p_anim) + "' doesn't exist.");

	E->get().frames.remove(p_idx);
	emit_changed();
}

void SpriteFrames::clear(const StringName &p_anim) {
	Map<StringName, Anim>::Element *E = animations.find(p_anim);
	ERR_FAIL_COND_MSG(!E, "Animation '" + String(p_anim) + "' doesn't exist.");

	E->get().frames.clear();
	emit_changed();
}

void SpriteFrames::clear_all() {
	animations.clear();
	add_animation("default");
}

void SpriteFrames::add_animation(const StringName &p_anim) {
	ERR_FAIL_COND_MSG(animations.has(p_anim), "SpriteFrames already has animation '" + p_anim + "'.");

	animations[p_anim] = Anim();
	animations[p_anim].normal_name = String(p_anim) + NORMAL_SUFFIX;
	animations[p_anim].specular_name = String(p_anim) + SPECULAR_SUFFIX;
}

bool SpriteFrames::has_animation(const StringName &p_anim) const {
	return animations.has(p_anim);
}

void SpriteFrames::remove_animation(const StringName &p_anim) {
	animations.erase(p_anim);
}

void SpriteFrames::rename_animation(const StringName &p_prev, const StringName &p_next) {
	ERR_FAIL_COND_MSG(!animations.has(p_prev), "SpriteFrames doesn't have animation '" + String(p_prev) + "'.");
	ERR_FAIL_COND_MSG(animations.has(p_next), "Animation '" + String(p_next) + "' already exists.");

	Anim anim = animations[p_prev];
	animations.erase(p_prev);
	animations[p_next] = anim;
	animations[p_next].normal_name = String(p_next) + NORMAL_SUFFIX;
	animations[p_next].specular_name = String(p_next) + SPECULAR_SUFFIX;
}

Vector<String> SpriteFrames::_get_animation_list() const {
	Vector<String> ret;
	List<StringName> al;
	get_animation_list(&al);
	for (List<StringName>::Element *E = al.front(); E; E = E->next()) {
		ret.push_back(E->get());
	}

	return ret;
}

void SpriteFrames::get_animation_list(List<StringName> *r_animations) const {
	for (const Map<StringName, Anim>::Element *E = animations.front(); E; E = E->next()) {
		r_animations->push_back(E->key());
	}
}

Vector<String> SpriteFrames::get_animation_names() const {
	Vector<String> names;
	for (const Map<StringName, Anim>::Element *E = animations.front(); E; E = E->next()) {
		names.push_back(E->key());
	}
	names.sort();
	return names;
}

void SpriteFrames::set_animation_speed(const StringName &p_anim, float p_fps) {
	ERR_FAIL_COND_MSG(p_fps < 0, "Animation speed cannot be negative (" + itos(p_fps) + ").");
	Map<StringName, Anim>::Element *E = animations.find(p_anim);
	ERR_FAIL_COND_MSG(!E, "Animation '" + String(p_anim) + "' doesn't exist.");
	E->get().speed = p_fps;
}

float SpriteFrames::get_animation_speed(const StringName &p_anim) const {
	const Map<StringName, Anim>::Element *E = animations.find(p_anim);
	ERR_FAIL_COND_V_MSG(!E, 0, "Animation '" + String(p_anim) + "' doesn't exist.");
	return E->get().speed;
}

void SpriteFrames::set_animation_loop(const StringName &p_anim, bool p_loop) {
	Map<StringName, Anim>::Element *E = animations.find(p_anim);
	ERR_FAIL_COND_MSG(!E, "Animation '" + String(p_anim) + "' doesn't exist.");
	E->get().loop = p_loop;
}

bool SpriteFrames::get_animation_loop(const StringName &p_anim) const {
	const Map<StringName, Anim>::Element *E = animations.find(p_anim);
	ERR_FAIL_COND_V_MSG(!E, false, "Animation '" + String(p_anim) + "' doesn't exist.");
	return E->get().loop;
}

void SpriteFrames::_set_frames(const Array &p_frames) {
	clear_all();
	Map<StringName, Anim>::Element *E = animations.find(SceneStringNames::get_singleton()->_default);
	ERR_FAIL_COND(!E);

	E->get().frames.resize(p_frames.size());
	for (int i = 0; i < E->get().frames.size(); i++) {
		E->get().frames.write[i] = p_frames[i];
	}
}

Array SpriteFrames::_get_frames() const {
	return Array();
}

Array SpriteFrames::_get_animations() const {
	Array anims;
	for (Map<StringName, Anim>::Element *E = animations.front(); E; E = E->next()) {
		Dictionary d;
		d["name"] = E->key();
		d["speed"] = E->get().speed;
		d["loop"] = E->get().loop;
		Array frames;
		for (int i = 0; i < E->get().frames.size(); i++) {
			frames.push_back(E->get().frames[i]);
		}
		d["frames"] = frames;
		anims.push_back(d);
	}

	return anims;
}

void SpriteFrames::_set_animations(const Array &p_animations) {
	animations.clear();
	for (int i = 0; i < p_animations.size(); i++) {
		Dictionary d = p_animations[i];

		ERR_CONTINUE(!d.has("name"));
		ERR_CONTINUE(!d.has("speed"));
		ERR_CONTINUE(!d.has("loop"));
		ERR_CONTINUE(!d.has("frames"));

		Anim anim;
		anim.speed = d["speed"];
		anim.loop = d["loop"];
		Array frames = d["frames"];
		for (int j = 0; j < frames.size(); j++) {
			RES res = frames[j];
			anim.frames.push_back(res);
		}

		animations[d["name"]] = anim;
	}
}

void SpriteFrames::_bind_methods() {
	ClassDB::bind_method(D_METHOD("add_animation", "anim"), &SpriteFrames::add_animation);
	ClassDB::bind_method(D_METHOD("has_animation", "anim"), &SpriteFrames::has_animation);
	ClassDB::bind_method(D_METHOD("remove_animation", "anim"), &SpriteFrames::remove_animation);
	ClassDB::bind_method(D_METHOD("rename_animation", "anim", "newname"), &SpriteFrames::rename_animation);

	ClassDB::bind_method(D_METHOD("get_animation_names"), &SpriteFrames::get_animation_names);

	ClassDB::bind_method(D_METHOD("set_animation_speed", "anim", "speed"), &SpriteFrames::set_animation_speed);
	ClassDB::bind_method(D_METHOD("get_animation_speed", "anim"), &SpriteFrames::get_animation_speed);

	ClassDB::bind_method(D_METHOD("set_animation_loop", "anim", "loop"), &SpriteFrames::set_animation_loop);
	ClassDB::bind_method(D_METHOD("get_animation_loop", "anim"), &SpriteFrames::get_animation_loop);

	ClassDB::bind_method(D_METHOD("add_frame", "anim", "frame", "at_position"), &SpriteFrames::add_frame, DEFVAL(-1));
	ClassDB::bind_method(D_METHOD("get_frame_count", "anim"), &SpriteFrames::get_frame_count);
	ClassDB::bind_method(D_METHOD("get_frame", "anim", "idx"), &SpriteFrames::get_frame);
	ClassDB::bind_method(D_METHOD("set_frame", "anim", "idx", "txt"), &SpriteFrames::set_frame);
	ClassDB::bind_method(D_METHOD("remove_frame", "anim", "idx"), &SpriteFrames::remove_frame);
	ClassDB::bind_method(D_METHOD("clear", "anim"), &SpriteFrames::clear);
	ClassDB::bind_method(D_METHOD("clear_all"), &SpriteFrames::clear_all);

	ClassDB::bind_method(D_METHOD("_set_frames"), &SpriteFrames::_set_frames);
	ClassDB::bind_method(D_METHOD("_get_frames"), &SpriteFrames::_get_frames);

	ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "frames", PROPERTY_HINT_NONE, "", 0), "_set_frames", "_get_frames"); //compatibility

	ClassDB::bind_method(D_METHOD("_set_animations"), &SpriteFrames::_set_animations);
	ClassDB::bind_method(D_METHOD("_get_animations"), &SpriteFrames::_get_animations);

	ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "animations", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NOEDITOR | PROPERTY_USAGE_INTERNAL), "_set_animations", "_get_animations"); //compatibility
}

SpriteFrames::SpriteFrames() {
	add_animation(SceneStringNames::get_singleton()->_default);
}

void AnimatedSprite2D::_validate_property(PropertyInfo &property) const {
	if (!frames.is_valid()) {
		return;
	}
	if (property.name == "animation") {
		property.hint = PROPERTY_HINT_ENUM;
		List<StringName> names;
		frames->get_animation_list(&names);
		names.sort_custom<StringName::AlphCompare>();

		bool current_found = false;

		for (List<StringName>::Element *E = names.front(); E; E = E->next()) {
			if (E->prev()) {
				property.hint_string += ",";
			}

			property.hint_string += String(E->get());
			if (animation == E->get()) {
				current_found = true;
			}
		}

		if (!current_found) {
			if (property.hint_string == String()) {
				property.hint_string = String(animation);
			} else {
				property.hint_string = String(animation) + "," + property.hint_string;
			}
		}
	}

	if (property.name == "frame") {
		property.hint = PROPERTY_HINT_RANGE;
		if (frames->has_animation(animation) && frames->get_frame_count(animation) > 1) {
			property.hint_string = "0," + itos(frames->get_frame_count(animation) - 1) + ",1";
		}
		property.usage |= PROPERTY_USAGE_KEYING_INCREMENTS;
	}
}

void AnimatedSprite2D::_notification(int p_what) {
	switch (p_what) {
		case NOTIFICATION_INTERNAL_PROCESS: {
			if (frames.is_null()) {
				return;
			}
			if (!frames->has_animation(animation)) {
				return;
			}
			if (frame < 0) {
				return;
			}

			float speed = frames->get_animation_speed(animation) * speed_scale;
			if (speed == 0) {
				return; //do nothing
			}

			float remaining = get_process_delta_time();

			while (remaining) {
				if (timeout <= 0) {
					timeout = _get_frame_duration();

					int fc = frames->get_frame_count(animation);
					if ((!backwards && frame >= fc - 1) || (backwards && frame <= 0)) {
						if (frames->get_animation_loop(animation)) {
							if (backwards) {
								frame = fc - 1;
							} else {
								frame = 0;
							}

							emit_signal(SceneStringNames::get_singleton()->animation_finished);
						} else {
							if (backwards) {
								frame = 0;
							} else {
								frame = fc - 1;
							}

							if (!is_over) {
								is_over = true;
								emit_signal(SceneStringNames::get_singleton()->animation_finished);
							}
						}
					} else {
						if (backwards) {
							frame--;
						} else {
							frame++;
						}
					}

					update();
					_change_notify("frame");
					emit_signal(SceneStringNames::get_singleton()->frame_changed);
				}

				float to_process = MIN(timeout, remaining);
				remaining -= to_process;
				timeout -= to_process;
			}
		} break;

		case NOTIFICATION_DRAW: {
			if (frames.is_null()) {
				return;
			}
			if (frame < 0) {
				return;
			}
			if (!frames->has_animation(animation)) {
				return;
			}

			Ref<Texture2D> texture = frames->get_frame(animation, frame);
			if (texture.is_null()) {
				return;
			}

			Ref<Texture2D> normal = frames->get_normal_frame(animation, frame);
			Ref<Texture2D> specular = frames->get_specular_frame(animation, frame);

			RID ci = get_canvas_item();

			Size2i s;
			s = texture->get_size();
			Point2 ofs = offset;
			if (centered) {
				ofs -= s / 2;
			}

			if (Engine::get_singleton()->get_use_pixel_snap()) {
				ofs = ofs.floor();
			}
			Rect2 dst_rect(ofs, s);

			if (hflip) {
				dst_rect.size.x = -dst_rect.size.x;
			}
			if (vflip) {
				dst_rect.size.y = -dst_rect.size.y;
			}

			texture->draw_rect_region(ci, dst_rect, Rect2(Vector2(), texture->get_size()), Color(1, 1, 1), false, normal, specular, Color(specular_color.r, specular_color.g, specular_color.b, shininess));

		} break;
	}
}

void AnimatedSprite2D::set_sprite_frames(const Ref<SpriteFrames> &p_frames) {
	if (frames.is_valid()) {
		frames->disconnect("changed", callable_mp(this, &AnimatedSprite2D::_res_changed));
	}
	frames = p_frames;
	if (frames.is_valid()) {
		frames->connect("changed", callable_mp(this, &AnimatedSprite2D::_res_changed));
	}

	if (!frames.is_valid()) {
		frame = 0;
	} else {
		set_frame(frame);
	}

	_change_notify();
	_reset_timeout();
	update();
	update_configuration_warning();
}

Ref<SpriteFrames> AnimatedSprite2D::get_sprite_frames() const {
	return frames;
}

void AnimatedSprite2D::set_frame(int p_frame) {
	if (!frames.is_valid()) {
		return;
	}

	if (frames->has_animation(animation)) {
		int limit = frames->get_frame_count(animation);
		if (p_frame >= limit) {
			p_frame = limit - 1;
		}
	}

	if (p_frame < 0) {
		p_frame = 0;
	}

	if (frame == p_frame) {
		return;
	}

	frame = p_frame;
	_reset_timeout();
	update();
	_change_notify("frame");
	emit_signal(SceneStringNames::get_singleton()->frame_changed);
}

int AnimatedSprite2D::get_frame() const {
	return frame;
}

void AnimatedSprite2D::set_speed_scale(float p_speed_scale) {
	float elapsed = _get_frame_duration() - timeout;

	speed_scale = MAX(p_speed_scale, 0.0f);

	// We adapt the timeout so that the animation speed adapts as soon as the speed scale is changed
	_reset_timeout();
	timeout -= elapsed;
}

float AnimatedSprite2D::get_speed_scale() const {
	return speed_scale;
}

void AnimatedSprite2D::set_centered(bool p_center) {
	centered = p_center;
	update();
	item_rect_changed();
}

bool AnimatedSprite2D::is_centered() const {
	return centered;
}

void AnimatedSprite2D::set_offset(const Point2 &p_offset) {
	offset = p_offset;
	update();
	item_rect_changed();
	_change_notify("offset");
}

Point2 AnimatedSprite2D::get_offset() const {
	return offset;
}

void AnimatedSprite2D::set_flip_h(bool p_flip) {
	hflip = p_flip;
	update();
}

bool AnimatedSprite2D::is_flipped_h() const {
	return hflip;
}

void AnimatedSprite2D::set_flip_v(bool p_flip) {
	vflip = p_flip;
	update();
}

bool AnimatedSprite2D::is_flipped_v() const {
	return vflip;
}

void AnimatedSprite2D::_res_changed() {
	set_frame(frame);
	_change_notify("frame");
	_change_notify("animation");
	update();
}

void AnimatedSprite2D::_set_playing(bool p_playing) {
	if (playing == p_playing) {
		return;
	}
	playing = p_playing;
	_reset_timeout();
	set_process_internal(playing);
}

bool AnimatedSprite2D::_is_playing() const {
	return playing;
}

void AnimatedSprite2D::play(const StringName &p_animation, const bool p_backwards) {
	backwards = p_backwards;

	if (p_animation) {
		set_animation(p_animation);
		if (backwards && get_frame() == 0) {
			set_frame(frames->get_frame_count(p_animation) - 1);
		}
	}

	_set_playing(true);
}

void AnimatedSprite2D::stop() {
	_set_playing(false);
}

bool AnimatedSprite2D::is_playing() const {
	return playing;
}

float AnimatedSprite2D::_get_frame_duration() {
	if (frames.is_valid() && frames->has_animation(animation)) {
		float speed = frames->get_animation_speed(animation) * speed_scale;
		if (speed > 0) {
			return 1.0 / speed;
		}
	}
	return 0.0;
}

void AnimatedSprite2D::_reset_timeout() {
	if (!playing) {
		return;
	}

	timeout = _get_frame_duration();
	is_over = false;
}

void AnimatedSprite2D::set_animation(const StringName &p_animation) {
	ERR_FAIL_COND_MSG(frames == nullptr, vformat("There is no animation with name '%s'.", p_animation));
	ERR_FAIL_COND_MSG(frames->get_animation_names().find(p_animation) == -1, vformat("There is no animation with name '%s'.", p_animation));

	if (animation == p_animation) {
		return;
	}

	animation = p_animation;
	_reset_timeout();
	set_frame(0);
	_change_notify();
	update();
}

StringName AnimatedSprite2D::get_animation() const {
	return animation;
}

String AnimatedSprite2D::get_configuration_warning() const {
	if (frames.is_null()) {
		return TTR("A SpriteFrames resource must be created or set in the \"Frames\" property in order for AnimatedSprite to display frames.");
	}

	return String();
}

void AnimatedSprite2D::set_specular_color(const Color &p_color) {
	specular_color = p_color;
	update();
}

Color AnimatedSprite2D::get_specular_color() const {
	return specular_color;
}

void AnimatedSprite2D::set_shininess(float p_shininess) {
	shininess = CLAMP(p_shininess, 0.0, 1.0);
	update();
}

float AnimatedSprite2D::get_shininess() const {
	return shininess;
}

void AnimatedSprite2D::_bind_methods() {
	ClassDB::bind_method(D_METHOD("set_sprite_frames", "sprite_frames"), &AnimatedSprite2D::set_sprite_frames);
	ClassDB::bind_method(D_METHOD("get_sprite_frames"), &AnimatedSprite2D::get_sprite_frames);

	ClassDB::bind_method(D_METHOD("set_animation", "animation"), &AnimatedSprite2D::set_animation);
	ClassDB::bind_method(D_METHOD("get_animation"), &AnimatedSprite2D::get_animation);

	ClassDB::bind_method(D_METHOD("_set_playing", "playing"), &AnimatedSprite2D::_set_playing);
	ClassDB::bind_method(D_METHOD("_is_playing"), &AnimatedSprite2D::_is_playing);

	ClassDB::bind_method(D_METHOD("play", "anim", "backwards"), &AnimatedSprite2D::play, DEFVAL(StringName()), DEFVAL(false));
	ClassDB::bind_method(D_METHOD("stop"), &AnimatedSprite2D::stop);
	ClassDB::bind_method(D_METHOD("is_playing"), &AnimatedSprite2D::is_playing);

	ClassDB::bind_method(D_METHOD("set_centered", "centered"), &AnimatedSprite2D::set_centered);
	ClassDB::bind_method(D_METHOD("is_centered"), &AnimatedSprite2D::is_centered);

	ClassDB::bind_method(D_METHOD("set_offset", "offset"), &AnimatedSprite2D::set_offset);
	ClassDB::bind_method(D_METHOD("get_offset"), &AnimatedSprite2D::get_offset);

	ClassDB::bind_method(D_METHOD("set_flip_h", "flip_h"), &AnimatedSprite2D::set_flip_h);
	ClassDB::bind_method(D_METHOD("is_flipped_h"), &AnimatedSprite2D::is_flipped_h);

	ClassDB::bind_method(D_METHOD("set_flip_v", "flip_v"), &AnimatedSprite2D::set_flip_v);
	ClassDB::bind_method(D_METHOD("is_flipped_v"), &AnimatedSprite2D::is_flipped_v);

	ClassDB::bind_method(D_METHOD("set_frame", "frame"), &AnimatedSprite2D::set_frame);
	ClassDB::bind_method(D_METHOD("get_frame"), &AnimatedSprite2D::get_frame);

	ClassDB::bind_method(D_METHOD("set_speed_scale", "speed_scale"), &AnimatedSprite2D::set_speed_scale);
	ClassDB::bind_method(D_METHOD("get_speed_scale"), &AnimatedSprite2D::get_speed_scale);

	ClassDB::bind_method(D_METHOD("set_specular_color", "color"), &AnimatedSprite2D::set_specular_color);
	ClassDB::bind_method(D_METHOD("get_specular_color"), &AnimatedSprite2D::get_specular_color);

	ClassDB::bind_method(D_METHOD("set_shininess", "shininess"), &AnimatedSprite2D::set_shininess);
	ClassDB::bind_method(D_METHOD("get_shininess"), &AnimatedSprite2D::get_shininess);

	ADD_SIGNAL(MethodInfo("frame_changed"));
	ADD_SIGNAL(MethodInfo("animation_finished"));

	ADD_GROUP("Animation", "");
	ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "frames", PROPERTY_HINT_RESOURCE_TYPE, "SpriteFrames"), "set_sprite_frames", "get_sprite_frames");
	ADD_PROPERTY(PropertyInfo(Variant::STRING_NAME, "animation"), "set_animation", "get_animation");
	ADD_PROPERTY(PropertyInfo(Variant::INT, "frame"), "set_frame", "get_frame");
	ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "speed_scale"), "set_speed_scale", "get_speed_scale");
	ADD_PROPERTY(PropertyInfo(Variant::BOOL, "playing"), "_set_playing", "_is_playing");
	ADD_GROUP("Lighting", "");
	ADD_PROPERTY(PropertyInfo(Variant::COLOR, "specular_color", PROPERTY_HINT_COLOR_NO_ALPHA), "set_specular_color", "get_specular_color");
	ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "shininess", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_shininess", "get_shininess");
	ADD_GROUP("Offset", "");
	ADD_PROPERTY(PropertyInfo(Variant::BOOL, "centered"), "set_centered", "is_centered");
	ADD_PROPERTY(PropertyInfo(Variant::VECTOR2, "offset"), "set_offset", "get_offset");
	ADD_PROPERTY(PropertyInfo(Variant::BOOL, "flip_h"), "set_flip_h", "is_flipped_h");
	ADD_PROPERTY(PropertyInfo(Variant::BOOL, "flip_v"), "set_flip_v", "is_flipped_v");
}

AnimatedSprite2D::AnimatedSprite2D() {
	centered = true;
	hflip = false;
	vflip = false;

	frame = 0;
	speed_scale = 1.0f;
	playing = false;
	backwards = false;
	animation = "default";
	timeout = 0;
	is_over = false;
	specular_color = Color(1, 1, 1, 1);
	shininess = 1.0;
}

redpajama_set_name: RedPajamaGithub


text:
layout: page
title: Bartlett Warden Media Party
date: 2016-05-24
author: Brian Roman
tags: weekly links, java
status: published
summary: Cras vitae orci vitae magna rhoncus fermentum. Aenean sit amet.
banner: images/banner/people.jpg
booking:
  startDate: 06/11/2019
  endDate: 06/15/2019
  ctyhocn: SHDVAHX
  groupCode: BWMP
published: true
---
Nunc luctus lobortis nunc, ut commodo nisl vehicula eu. Pellentesque sodales nibh metus, vitae lacinia ante rhoncus id. Sed non molestie lorem. Nunc ligula risus, ullamcorper id velit et, tincidunt cursus velit. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Donec vitae porta ipsum. Vivamus ac magna ante.
Praesent at odio sed ex mattis rutrum. Maecenas faucibus tortor magna, nec suscipit justo pellentesque sed. Nulla mattis vel neque sed congue. Integer enim ante, sollicitudin vitae enim sit amet, feugiat sagittis orci. Ut et velit laoreet, egestas lectus in, pretium tortor. Nam sed ullamcorper metus, eu sagittis erat. Nam tincidunt nisl vel ultrices tincidunt. Morbi dapibus vitae dui in pretium.

* Phasellus vitae erat quis justo consequat imperdiet
* Donec posuere turpis sed leo ornare interdum
* Donec sodales justo eget libero varius, id tincidunt metus rutrum.

Duis vitae nisi ultricies, ornare eros cursus, feugiat ligula. Donec congue commodo ornare. Fusce pulvinar commodo nulla a luctus. Duis efficitur sem sed gravida fermentum. Vivamus accumsan ac magna a vulputate. Nulla ultrices ex tellus, id elementum massa finibus ac. Integer pretium sollicitudin suscipit. Suspendisse eget convallis mauris, non consequat leo. Nulla facilisi. Maecenas porttitor nunc et risus vulputate, in rhoncus enim suscipit. Sed pellentesque tortor eu aliquam varius. Proin felis eros, ornare nec urna ac, tincidunt gravida quam.


text:
from flask.ext.wtf import Form, RecaptchaField
from wtforms import TextField, PasswordField, BooleanField
from wtforms.validators import Required, EqualTo, Email

class LoginForm(Form):

    email = TextField('Email address', [Required(), Email()])
    password = PasswordField('Password', [Required()])

class RegisterForm(Form):

    name = TextField('NickName', [Required()])
    email = TextField('Email address', [Required(), Email()])
    password = PasswordField('Password', [Required()])
    confirm = PasswordField('Repeat Password', [
    Required(),
    EqualTo('password', message='Passwords must match')
        ])
    accept_tos = BooleanField('I accept the TOS', [Required()])
    recaptcha = RecaptchaField()


text:
ActiveRecord::Schema.define(:version => 1) do
  create_table "redditables", :force => true do |t|
    t.timestamps null: false
  end

  create_table "reddit_posts", :force => true do |t|
    t.integer :redditable_id
    t.string :redditable_type
    t.string :url
    t.string :reddit_owner
    t.timestamps null: false
  end

  add_index :reddit_posts, [:redditable_id, :redditable_type]
end


text:
"use strict";

var copyPrototype = require("./copy-prototype");

module.exports = copyPrototype(Function.prototype);


text:
FactoryGirl.define do
  factory :content, class: Spree::Content do
    association :page, factory: :page
    sequence(:title) { |n| "Page Content ##{n}" }
    body { FFaker::Lorem.paragraphs.join '\n\n' }
    hide_title false
    link ""
    link_text ""
    context ""
    attachment nil
  end
end


text:
using System;
using System.Collections.Generic;
using Elasticsearch.Net;
using Nest;
using Tests.Framework;
using Tests.Framework.Integration;
using Tests.Framework.MockData;
using Xunit;

namespace Tests.Document.Single.Update
{
	[Collection(IntegrationContext.Indexing)]
	public class UpdateApiTests : ApiIntegrationTestBase<IUpdateResponse<Project>, IUpdateRequest<Project, Project>, UpdateDescriptor<Project, Project>, UpdateRequest<Project, Project>>
	{
		public UpdateApiTests(IndexingCluster cluster, EndpointUsage usage) : base(cluster, usage) { }

		protected override void BeforeAllCalls(IElasticClient client, IDictionary<ClientMethod, string> values)
		{
			foreach (var id in values.Values)
				this.Client.Index(Project.Instance, i=>i.Id(id));
		}

		protected override LazyResponses ClientUsage() => Calls(
			fluent: (client, f) => client.Update<Project>(CallIsolatedValue, f),
			fluentAsync: (client, f) => client.UpdateAsync<Project>(CallIsolatedValue, f),
			request: (client, r) => client.Update<Project>(r),
			requestAsync: (client, r) => client.UpdateAsync<Project>(r)
		);

		protected override bool ExpectIsValid => true;
		protected override int ExpectStatusCode => 200;
		protected override HttpMethod HttpMethod => HttpMethod.POST;
		protected override string UrlPath => $"/project/project/{CallIsolatedValue}/_update";

		protected override bool SupportsDeserialization => false;

		protected override object ExpectJson { get; } = new
		{
			doc = Project.InstanceAnonymous,
			doc_as_upsert = true,
			detect_noop = true
		};

		protected override UpdateDescriptor<Project, Project> NewDescriptor() => new UpdateDescriptor<Project, Project>(DocumentPath<Project>.Id(CallIsolatedValue));

		protected override Func<UpdateDescriptor<Project, Project>, IUpdateRequest<Project, Project>> Fluent => u => u
			 .Doc(Project.Instance)
			 .DocAsUpsert()
			 .DetectNoop();

		protected override UpdateRequest<Project, Project> Initializer => new UpdateRequest<Project, Project>(CallIsolatedValue)
		{
			Doc = Project.Instance,
			DocAsUpsert = true,
			DetectNoop = true
		};
	}
}


text:
<?php

if (!defined('INSITE'))
    die('Remote access denied!');

if (!defined('DATE_RSS'))
    define('DATE_RSS', 'D, d M Y H:i:s O');
if (!defined('DATE_ATOM'))
    define('DATE_ATOM', 'Y-m-d\TH:i:sP');

/**
 * Инициализация юзерей
 * @return null
 */
function users_init() {
    users::o()->init();
    if (!defined("DELAYED_SINIT"))
        users::o()->write_session();
    tpl::o()->assign('groups', users::o()->get_group());
    tpl::o()->assign('curlang', users::o()->get_lang());
    tpl::o()->assign('curtheme', users::o()->get_theme());
    tpl::o()->assign('curtheme_color', users::o()->get_theme(true));
    tpl::o()->assign('curuser', users::o()->v('username'));
    tpl::o()->assign('curgroup', users::o()->v('group'));
}

if (!defined('DELAYED_UINIT'))
    users_init();

tpl::o()->assign('URL_PATTERN', display::url_pattern);
tpl::o()->assign('slbox_mbinited', false);

// Кой-чаво для Smarty
// Для модификаторов нет описания, ибо проще посмотреть сами функции.
$bbcodes = bbcodes::o();
$input = input::o();
$display = display::o();

if (config::o()->v('torrents_on'))
    lang::o()->get('torrents', null, true, true);

/* @var $blocks blocks */
$blocks = n("blocks");
/* @var $message message */
$message = n("message");
tpl::o()->register_modifier('unserialize', 'unserialize');
tpl::o()->register_modifier('arr_current', 'current');
tpl::o()->register_modifier('arr_key', 'key');
tpl::o()->register_modifier('l2ip', 'long2ip');
tpl::o()->register_modifier('long', 'longval');
tpl::o()->register_modifier('is', 'is');
tpl::o()->register_modifier('sl', 'slashes_smarty');
tpl::o()->register_modifier('uamp', 'w3c_amp_replace');
tpl::o()->register_modifier('ue', 'urlencode');
tpl::o()->register_modifier('gval', 'smarty_group_value');
tpl::o()->register_modifier('null_text', array(
    $input,
    'set_null_text'));
tpl::o()->register_modifier('cut', array(
    $display,
    "cut_text"));
tpl::o()->register_modifier('he', array(
    $display,
    "html_encode"));
tpl::o()->register_modifier("ft", array(
    $bbcodes,
    "format_text"));
tpl::o()->register_modifier("ge", array(
    $display,
    "estimated_time"));
tpl::o()->register_modifier("ul", 'smarty_user_link');
tpl::o()->register_modifier('gc', array(
    $display,
    "group_color"));
tpl::o()->register_modifier('gcl', 'smarty_group_color_link');
tpl::o()->register_modifier("ua", array(
    $display,
    "useravatar"));
tpl::o()->register_modifier("pf", "smarty_print_format");
tpl::o()->register_modifier('cs', array(
    $display,
    "convert_size"));
tpl::o()->register_modifier("zodiac_sign", array(
    $display,
    'zodiac_image'));
tpl::o()->register_modifier("decus", array(
    users::o(),
    'decode_settings'));
tpl::o()->register_modifier("filetype", array(
    file::o(),
    'get_filetype'));
tpl::o()->register_modifier("is_writable", array(
    file::o(),
    'is_writable'));
tpl::o()->register_modifier('rnl', 'replace_newline');

/**
 * @note Создание тега для atom:id(для торрентов)(atom_tag)
 * params:
 * int time время постинга
 * string title заголовок
 * int id ID
 */
tpl::o()->register_function("atom_tag", "smarty_make_atom_tag");
/*
  tpl::o()->register_modifier("parse_array", array(
  $display,
  'parse_smarty_array')); */
/**
 * @note Вывод статистики запросов(query_stat)
 */
tpl::o()->register_function("query_stat", "query_stat");
/**
 * @note Получение ключа формы(fk)
 * params:
 * int ajax 2, если в AJAX, возвращается, как элемент объекта(напр. fk:'1',)
 * 1 если в AJAX, возвращается, как часть строки запроса(напр. ?fk=1&)
 * иначе если элемент формы(напр. <input type='hidden' value='1' name='fk'>)
 * по-умолчанию возвращается лишь значение ключа
 * string var имя ключа
 */
tpl::o()->register_function("fk", "get_formkey");
/**
 * @note Отображение блоков(display_blocks)
 * params:
 * string pos положение
 */
tpl::o()->register_function("display_blocks", array(
    $blocks,
    'display'));
/**
 * @note Вывод сообщения на экран(message)
 * params:
 * string lang_var языковая переменная, в соответствии с которой будет выводится на экран сообщение,
 * либо цельный текст.
 * array vars массив значений, включаемых в сообщение, работают, блягодаря функции vsprintf
 * string type тип выводимого значения, в зависимости от него будут выбраны различные стили вывода сообщения(error|success|info)
 * bool die если параметр установлен на true, то сразу после выведения сообщения, скрипт останавливается
 * string title заголовок, выше сообщения
 * string align расположение текста в сообщении(left|right|center)
 * bool no_image если параметр установлен на true, то статусная картинка не выводится
 * bool only_box если параметр установлен на true, то выводится только message.tpl
 */
tpl::o()->register_function('message', array($message, "info"));
/**
 * @note BBCode форма для ввода текста(input_form)
 * params:
 * string name имя формы
 * string text текст формы
 */
tpl::o()->register_function("input_form", array(
    $bbcodes,
    'input_form'));
/**
 * @note Генерация ЧПУ(gen_link)
 * params:
 * string module имя модуля
 * bool page является ли указанный модуль ссылкой на документ?
 * bool no_end нужно ли в конец добавлять .html/index.html?
 * bool nobaseurl не добавлять в начало $baseurl
 * bool slashes экранирует результат для JavaScript, иначе & заменяется на &
 * string _filetype тип файла(вместо html)
 * string assign передать значение функции в переменную с именем assign?
 * mixed параметры ссылки
 */
tpl::o()->register_function("gen_link", array(
    furl::o(),
    'construct'));
/**
 * @note Форматирование времени UNIXTIME в человекопонятный формат(date)
 * params:
 * int time время
 * string format формат вывода(ymd или ymdhis, к примеру)
 */
tpl::o()->register_function("date", array(
    $display,
    'date'));
tpl::o()->register_modifier("date_time", array(
    $display,
    'date'));
/**
 * @note Поле выбора даты(select_date)
 * params:
 * string name префикс полей
 * string type тип формы(ymd, ymdhis, к примеру)
 * int time данное время в формате UNIXTIME
 * bool fromnull начинать с 0?
 */
tpl::o()->register_function("select_date", array(
    $input,
    "select_date"));

/**
 * @note Поле выбора часового пояса(select_gmt)
 * params:
 * string name имя поля
 * float current текущее значение
 */
tpl::o()->register_function("select_gmt", array(
    $input,
    'select_gmt'));
/**
 * @note Поле выбора страны(select_countries)
 * params:
 * array country выводимая страна(не для списка)(вкл. в себя name и image)
 * string name имя поля
 * int current текущее значение
 */
tpl::o()->register_function("select_countries", array(
    $input,
    'select_countries'));
/**
 * @note Получение кол-во используемой памяти(get_memory_usage)
 */
tpl::o()->register_function("get_memory_usage", "smarty_get_memory_usage");

/**
 * @note Поле выбора дирректорий(select_folder)
 * params:
 * string name имя поля
 * string folder имя дирректории в корне
 * int current текущее значение
 * bool onlydir только дирректории?
 * bool null пустое значение?
 * string regexp рег. выражение
 * int match номер группы рег. выражения
 */
tpl::o()->register_function("select_folder", array(
    $input,
    'select_folder'));
/**
 * @note Поле выбора групп(select_groups)
 * params:
 * string name имя поля
 * int current текущее значение
 * bool guest в т.ч. и гость?
 * bool null пустое значение?
 * bool multiple множественная выборка?
 */
tpl::o()->register_function("select_groups", array(
    $input,
    'select_groups'));
/**
 * @note Поле выбора интервала подписок(select_mailer)
 * params:
 * string name имя поля
 * int current текущее значение
 */
tpl::o()->register_function("select_mailer", array(
    $input,
    'select_mailer'));
/**
 * @note Поле выбора периода(select_periods)
 * params:
 * string name имя поля
 * int current текущее значение
 */
tpl::o()->register_function("select_periods", array(
    $input,
    'select_periods'));
/**
 * @note Поле выбора типа обратной связи(select_feedback)
 * params:
 * string name имя поля
 * int current текущее значение
 * bool null пустое значение?
 */
tpl::o()->register_function("select_feedback", array(
    $input,
    'select_feedback'));
/**
 * @note Генератор пароля(passgen)
 * params:
 * string pname имя поля пароля
 * string paname имя поля повтора пароля
 */
tpl::o()->register_function("passgen", 'smarty_passgen');
/**
 * @note Поле выбора категорий(select_categories)
 * params:
 * string name имя поля
 * int size размер поля(если больше 1 множественная выборка)
 * int current текущее значение
 * bool null пустое значение?
 */
tpl::o()->register_function("select_categories", array(
    $input,
    'select_categories'));
/**
 * @note Простой селектор(simple_selector)
 * params:
 * string name имя поля
 * array values массив значений
 * bool keyed ключи в качестве значения опций?
 * mixed current текущее значение
 * int size размер поля(если больше 1 множественная выборка)
 * bool null пустое значение?
 * string lang_prefix языковой префикс для значений
 */
tpl::o()->register_function("simple_selector", array(
    $input,
    'simple_selector'));
/**
 * @note Создание настроек для модуля(modsettings_create)
 */
tpl::o()->register_function("modsettings_create", array(
    modsettings::o(),
    'create'));
unset($bbcodes);
unset($input);
unset($display);

unset($blocks);
unset($message);
/// Конец
/// Обнаруживаем IE
if (preg_match("/MSIE\\s*([0-9]+)/siu", $_SERVER ['HTTP_USER_AGENT'], $matches)) {
    lang::o()->get("ie_error");
    // Выгоняем IE ниже 8 версии
    if ($matches [1] < 8) {
        tpl::o()->display('ie_error.tpl');
        die();
    }
    tpl::o()->assign('MSIE', $matches [1]);
}

if (function_exists("get_magic_quotes_gpc") && get_magic_quotes_gpc()) {
    if (!empty($_GET)) {
        $_GET = strip_magic_quotes($_GET);
    }
    if (!empty($_POST)) {
        $_POST = strip_magic_quotes($_POST);
    }
    if (!empty($_COOKIE)) {
        $_COOKIE = strip_magic_quotes($_COOKIE);
    }
}
// INCLUDE BACK-END
globals::s('POST', $_POST);
$_POST = xss_array_protect($_POST);
$_GET = xss_array_protect($_GET);
$_REQUEST = $_POST + $_GET;
?>


text:
void defineFunc();

void tuple_to_var_expr_vector(
        const std::string debug_name,
        const boost::python::tuple &args_passed,
        std::vector<Halide::Var> &var_args,
        std::vector<Halide::Expr> &expr_args);

namespace func_and_stage_implementation_details {
// These are methods shared with Stage

// we use hh and bp to avoid colisions with h, b used in the rest of the code
namespace hh = Halide;
namespace bp = boost::python;

template<typename FuncOrStage>
FuncOrStage &func_parallel0(FuncOrStage &that, hh::VarOrRVar var)
{
    return that.parallel(var);
}

template<typename FuncOrStage>
FuncOrStage &func_parallel1(FuncOrStage &that, hh::VarOrRVar var, int factor)
{
    return that.parallel(var, factor);
}

template<typename FuncOrStage>
FuncOrStage &func_split(FuncOrStage &that, hh::VarOrRVar var, hh::VarOrRVar outer, hh::VarOrRVar inner, int factor)
{
    return that.split(var, outer, inner, factor);
}

template<typename FuncOrStage>
FuncOrStage &func_vectorize0(FuncOrStage &that, hh::VarOrRVar var)
{
    return that.vectorize(var);
}

template<typename FuncOrStage>
FuncOrStage &func_vectorize1(FuncOrStage &that, hh::VarOrRVar var, int factor)
{
    return that.vectorize(var, factor);
}

template<typename FuncOrStage>
FuncOrStage &func_unroll0(FuncOrStage &that, hh::VarOrRVar var)
{
    return that.unroll(var);
}

template<typename FuncOrStage>
FuncOrStage &func_unroll1(FuncOrStage &that, hh::VarOrRVar var, int factor)
{
    return that.unroll(var, factor);
}

template<typename FuncOrStage>
FuncOrStage &func_tile0(FuncOrStage &that, hh::VarOrRVar x, hh::VarOrRVar y,
                        hh::VarOrRVar xo, hh::VarOrRVar yo,
                        hh::VarOrRVar xi, hh::VarOrRVar yi,
                        hh::Expr xfactor, hh::Expr yfactor)
{
    return that.tile(x, y, xo, yo, xi, yi, xfactor, yfactor);
}

template<typename FuncOrStage>
FuncOrStage &func_tile1(FuncOrStage &that, hh::VarOrRVar x, hh::VarOrRVar y,
                        hh::VarOrRVar xi, hh::VarOrRVar yi,
                        hh::Expr xfactor, hh::Expr yfactor)
{
    return that.tile(x, y, xi, yi, xfactor, yfactor);
}

template<typename FuncOrStage, typename PythonIterable>
FuncOrStage &func_reorder0(FuncOrStage &that, PythonIterable args_passed)
{
    std::vector<hh::VarOrRVar> var_or_rvar_args;

    const size_t args_len = bp::len(args_passed);
    for(size_t i=0; i < args_len; i+=1)
    {
        bp::object o = args_passed[i];
        bp::extract<hh::VarOrRVar> var_or_rvar_extract(o);

        if(var_or_rvar_extract.check())
        {
            var_or_rvar_args.push_back(var_or_rvar_extract());
        }
        else
        {
            for(size_t j=0; j < args_len; j+=1)
            {
                bp::object o = args_passed[j];
                const std::string o_str = bp::extract<std::string>(bp::str(o));
                printf("Func::reorder args_passed[%lu] == %s\n", j, o_str.c_str());
            }
            throw std::invalid_argument("Func::reorder() only handles a list of (convertible to) VarOrRVar.");
        }
    }

    return that.reorder(var_or_rvar_args);
}

template<typename FuncOrStage>
FuncOrStage &func_reorder1(FuncOrStage &that, bp::object v0,
                           bp::object v1, bp::object v2, bp::object v3, bp::object v4, bp::object v5)
{
    bp::list args_list;
    for(const bp::object &v : {v0, v1, v2, v3, v4, v5})
    {
        if(not v.is_none())
        {
            args_list.append(v);
        }
    }

    return func_reorder0<FuncOrStage, bp::list>(that, args_list);
}

template<typename FuncOrStage, typename PythonIterable>
FuncOrStage &func_reorder_storage0(FuncOrStage &that, PythonIterable args_passed)
{
    std::vector<hh::Var> var_args;

    const size_t args_len = bp::len(args_passed);
    for(size_t i=0; i < args_len; i+=1)
    {
        bp::object o = args_passed[i];
        bp::extract<hh::Var &> var_extract(o);

        if(var_extract.check())
        {
            var_args.push_back(var_extract());
        }
        else
        {
            for(size_t j=0; j < args_len; j+=1)
            {
                bp::object o = args_passed[j];
                const std::string o_str = bp::extract<std::string>(bp::str(o));
                printf("Func::reorder_storage args_passed[%lu] == %s\n", j, o_str.c_str());
            }
            throw std::invalid_argument("Func::reorder_storage() only handles a list of (convertible to) Var.");
        }
    }

    return that.reorder_storage(var_args);
}

template<typename FuncOrStage>
FuncOrStage &func_reorder_storage1(FuncOrStage &that, bp::object v0,
                                   bp::object v1, bp::object v2,
                                   bp::object v3, bp::object v4, bp::object v5)
{
    bp::list args_list;
    for(const bp::object &v : {v0, v1, v2, v3, v4, v5})
    {
        if(not v.is_none())
        {
            args_list.append(v);
        }
    }

    return func_reorder_storage0<FuncOrStage, bp::list>(that, args_list);
}

} // end of namespace func_and_stage_implementation_details

#endif // FUNC_H


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

<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.11"/>
<title>mpx-spring2017-npennf: idt_entry_struct Struct Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>

<link href="search/search.css" rel="stylesheet" type="text/css"/>

<link href="doxygen.css" rel="stylesheet" type="text/css" />

mpx-spring2017-npennf
    NPE-NPX.R6.04282017

An Operating System Project

Main Page

Data Structures

Files

          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)"
               onblur="searchBox.OnSearchFieldFocus(false)"
               onkeyup="searchBox.OnSearchFieldChange(event)"/>

Data Structures

Data Structure Index

Data Fields

Data Fields

idt_entry_struct Struct Reference

#include <tables.h>

Data Fields

u16int 	base_low

u16int 	sselect

u8int 	zero

u8int 	flags

u16int 	base_high

Field Documentation

          u16int base_high

          u16int base_low

          u8int flags

          u16int sselect

          u8int zero

The documentation for this struct was generated from the following file:

include/core/tables.h

<address class="footer">
Generated by

 1.8.11
</address>


text:
require 'spec_helper'

describe Mysql2::Client do
  before(:each) do
    @client = Mysql2::Client.new
  end

  if defined? Encoding
    it "should raise an exception on create for invalid encodings" do
      lambda {
        c = Mysql2::Client.new(:encoding => "fake")
      }.should raise_error(Mysql2::Error)
    end
  end

  it "should accept connect flags and pass them to #connect" do
    klient = Class.new(Mysql2::Client) do
      attr_reader :connect_args
      def connect *args
        @connect_args ||= []
        @connect_args << args
      end
    end
    client = klient.new :flags => Mysql2::Client::FOUND_ROWS
    (client.connect_args.last.last & Mysql2::Client::FOUND_ROWS).should be_true
  end

  it "should default flags to (REMEMBER_OPTIONS, LONG_PASSWORD, LONG_FLAG, TRANSACTIONS, PROTOCOL_41, SECURE_CONNECTION)" do
    klient = Class.new(Mysql2::Client) do
      attr_reader :connect_args
      def connect *args
        @connect_args ||= []
        @connect_args << args
      end
    end
    client = klient.new
    (client.connect_args.last.last & (Mysql2::Client::REMEMBER_OPTIONS |
                                     Mysql2::Client::LONG_PASSWORD |
                                     Mysql2::Client::LONG_FLAG |
                                     Mysql2::Client::TRANSACTIONS |
                                     Mysql2::Client::PROTOCOL_41 |
                                     Mysql2::Client::SECURE_CONNECTION)).should be_true
  end

  it "should have a global default_query_options hash" do
    Mysql2::Client.should respond_to(:default_query_options)
  end

  it "should be able to connect via SSL options" do
    pending("DON'T WORRY, THIS TEST PASSES :) - but is machine-specific. You need to have MySQL running with SSL configured and enabled. Then update the paths in this test to your needs and remove the pending state.")
    ssl_client = nil
    lambda {
      ssl_client = Mysql2::Client.new(
        :sslkey => '/path/to/client-key.pem',
        :sslcert => '/path/to/client-cert.pem',
        :sslca => '/path/to/ca-cert.pem',
        :sslcapath => '/path/to/newcerts/',
        :sslcipher => 'DHE-RSA-AES256-SHA'
      )
    }.should_not raise_error(Mysql2::Error)

    results = ssl_client.query("SHOW STATUS WHERE Variable_name = \"Ssl_version\" OR Variable_name = \"Ssl_cipher\"").to_a
    results[0]['Variable_name'].should eql('Ssl_cipher')
    results[0]['Value'].should_not be_nil
    results[0]['Value'].class.should eql(String)

    results[1]['Variable_name'].should eql('Ssl_version')
    results[1]['Value'].should_not be_nil
    results[1]['Value'].class.should eql(String)
  end

  it "should respond to #close" do
    @client.should respond_to(:close)
  end

  it "should be able to close properly" do
    @client.close.should be_nil
    lambda {
      @client.query "SELECT 1"
    }.should raise_error(Mysql2::Error)
  end

  it "should respond to #query" do
    @client.should respond_to(:query)
  end

  it "should expect read_timeout to be a positive integer" do
    lambda {
      Mysql2::Client.new(:read_timeout => -1)
    }.should raise_error(Mysql2::Error)
  end

  context "#query" do
    it "should only accept strings as the query parameter" do
      lambda {
        @client.query ["SELECT 'not right'"]
      }.should raise_error(TypeError)
    end

    it "should accept an options hash that inherits from Mysql2::Client.default_query_options" do
      @client.query "SELECT 1", :something => :else
      @client.query_options.should eql(@client.query_options.merge(:something => :else))
    end

    it "should return results as a hash by default" do
      @client.query("SELECT 1").first.class.should eql(Hash)
    end

    it "should be able to return results as an array" do
      @client.query("SELECT 1", :as => :array).first.class.should eql(Array)
      @client.query("SELECT 1").each(:as => :array)
    end

    it "should be able to return results with symbolized keys" do
      @client.query("SELECT 1", :symbolize_keys => true).first.keys[0].class.should eql(Symbol)
    end

    it "should require an open connection" do
      @client.close
      lambda {
        @client.query "SELECT 1"
      }.should raise_error(Mysql2::Error)
    end

    if RUBY_PLATFORM !~ /mingw|mswin/
      it "should not allow another query to be sent without fetching a result first" do
        @client.query("SELECT 1", :async => true)
        lambda {
          @client.query("SELECT 1")
        }.should raise_error(Mysql2::Error)
      end

      it "should timeout if we wait longer than :read_timeout" do
        client = Mysql2::Client.new(:read_timeout => 1)
        lambda {
          client.query("SELECT sleep(2)")
        }.should raise_error(Mysql2::Error)
      end

      # XXX this test is not deterministic (because Unix signal handling is not)
      # and may fail on a loaded system
      it "should run signal handlers while waiting for a response" do
        mark = {}
        trap(:USR1) { mark[:USR1] = Time.now }
        begin
          mark[:START] = Time.now
          pid = fork do
            sleep 1 # wait for client "SELECT sleep(2)" query to start
            Process.kill(:USR1, Process.ppid)
            sleep # wait for explicit kill to prevent GC disconnect
          end
          @client.query("SELECT sleep(2)")
          mark[:END] = Time.now
          mark.include?(:USR1).should be_true
          (mark[:USR1] - mark[:START]).should >= 1
          (mark[:USR1] - mark[:START]).should < 1.1
          (mark[:END] - mark[:USR1]).should > 0.9
          (mark[:END] - mark[:START]).should >= 2
          (mark[:END] - mark[:START]).should < 2.1
          Process.kill(:TERM, pid)
          Process.waitpid2(pid)
        ensure
          trap(:USR1, 'DEFAULT')
        end
      end

      it "#socket should return a Fixnum (file descriptor from C)" do
        @client.socket.class.should eql(Fixnum)
        @client.socket.should_not eql(0)
      end

      it "#socket should require an open connection" do
        @client.close
        lambda {
          @client.socket
        }.should raise_error(Mysql2::Error)
      end

      it "should close the connection when an exception is raised" do
        begin
          Timeout.timeout(1) do
            @client.query("SELECT sleep(2)")
          end
        rescue Timeout::Error
        end

        lambda {
          @client.query("SELECT 1")
        }.should raise_error(Mysql2::Error, 'closed MySQL connection')
      end

      it "should handle Timeouts without leaving the connection hanging if reconnect is true" do
        client = Mysql2::Client.new(:reconnect => true)
        begin
          Timeout.timeout(1) do
            client.query("SELECT sleep(2)")
          end
        rescue Timeout::Error
        end

        lambda {
          client.query("SELECT 1")
        }.should_not raise_error(Mysql2::Error)
      end

      it "threaded queries should be supported" do
        threads, results = [], {}
        connect = lambda{ Mysql2::Client.new(:host => "localhost", :username => "root") }
        Timeout.timeout(0.7) do
          5.times {
            threads << Thread.new do
              results[Thread.current.object_id] = connect.call.query("SELECT sleep(0.5) as result")
            end
          }
        end
        threads.each{|t| t.join }
        results.keys.sort.should eql(threads.map{|t| t.object_id }.sort)
      end

      it "evented async queries should be supported" do
        # should immediately return nil
        @client.query("SELECT sleep(0.1)", :async => true).should eql(nil)

        io_wrapper = IO.for_fd(@client.socket)
        loops = 0
        loop do
          if IO.select([io_wrapper], nil, nil, 0.05)
            break
          else
            loops += 1
          end
        end

        # make sure we waited some period of time
        (loops >= 1).should be_true

        result = @client.async_result
        result.class.should eql(Mysql2::Result)
      end
    end
  end

  it "should respond to #socket" do
    @client.should respond_to(:socket)
  end

  if RUBY_PLATFORM =~ /mingw|mswin/
    it "#socket should raise as it's not supported" do
      lambda {
        @client.socket
      }.should raise_error(Mysql2::Error)
    end
  end

  it "should respond to escape" do
    Mysql2::Client.should respond_to(:escape)
  end

  context "escape" do
    it "should return a new SQL-escape version of the passed string" do
      Mysql2::Client.escape("abc'def\"ghi\0jkl%mno").should eql("abc\\'def\\\"ghi\\0jkl%mno")
    end

    it "should return the passed string if nothing was escaped" do
      str = "plain"
      Mysql2::Client.escape(str).object_id.should eql(str.object_id)
    end

    it "should not overflow the thread stack" do
      lambda {
        Thread.new { Mysql2::Client.escape("'" * 256 * 1024) }.join
      }.should_not raise_error(SystemStackError)
    end

    it "should not overflow the process stack" do
      lambda {
        Thread.new { Mysql2::Client.escape("'" * 1024 * 1024 * 4) }.join
      }.should_not raise_error(SystemStackError)
    end

    if RUBY_VERSION =~ /1.9/
      it "should carry over the original string's encoding" do
        str = "abc'def\"ghi\0jkl%mno"
        escaped = Mysql2::Client.escape(str)
        escaped.encoding.should eql(str.encoding)

        str.encode!('us-ascii')
        escaped = Mysql2::Client.escape(str)
        escaped.encoding.should eql(str.encoding)
      end
    end
  end

  it "should respond to #escape" do
    @client.should respond_to(:escape)
  end

  context "#escape" do
    it "should return a new SQL-escape version of the passed string" do
      @client.escape("abc'def\"ghi\0jkl%mno").should eql("abc\\'def\\\"ghi\\0jkl%mno")
    end

    it "should return the passed string if nothing was escaped" do
      str = "plain"
      @client.escape(str).object_id.should eql(str.object_id)
    end

    it "should not overflow the thread stack" do
      lambda {
        Thread.new { @client.escape("'" * 256 * 1024) }.join
      }.should_not raise_error(SystemStackError)
    end

    it "should not overflow the process stack" do
      lambda {
        Thread.new { @client.escape("'" * 1024 * 1024 * 4) }.join
      }.should_not raise_error(SystemStackError)
    end

    it "should require an open connection" do
      @client.close
      lambda {
        @client.escape ""
      }.should raise_error(Mysql2::Error)
    end
  end

  it "should respond to #info" do
    @client.should respond_to(:info)
  end

  it "#info should return a hash containing the client version ID and String" do
    info = @client.info
    info.class.should eql(Hash)
    info.should have_key(:id)
    info[:id].class.should eql(Fixnum)
    info.should have_key(:version)
    info[:version].class.should eql(String)
  end

  if defined? Encoding
    context "strings returned by #info" do
      it "should default to the connection's encoding if Encoding.default_internal is nil" do
        Encoding.default_internal = nil
        @client.info[:version].encoding.should eql(Encoding.find('utf-8'))

        client2 = Mysql2::Client.new :encoding => 'ascii'
        client2.info[:version].encoding.should eql(Encoding.find('us-ascii'))
      end

      it "should use Encoding.default_internal" do
        Encoding.default_internal = Encoding.find('utf-8')
        @client.info[:version].encoding.should eql(Encoding.default_internal)
        Encoding.default_internal = Encoding.find('us-ascii')
        @client.info[:version].encoding.should eql(Encoding.default_internal)
      end
    end
  end

  it "should respond to #server_info" do
    @client.should respond_to(:server_info)
  end

  it "#server_info should return a hash containing the client version ID and String" do
    server_info = @client.server_info
    server_info.class.should eql(Hash)
    server_info.should have_key(:id)
    server_info[:id].class.should eql(Fixnum)
    server_info.should have_key(:version)
    server_info[:version].class.should eql(String)
  end

  it "#server_info should require an open connection" do
    @client.close
    lambda {
      @client.server_info
    }.should raise_error(Mysql2::Error)
  end

  if defined? Encoding
    context "strings returned by #server_info" do
      it "should default to the connection's encoding if Encoding.default_internal is nil" do
        Encoding.default_internal = nil
        @client.server_info[:version].encoding.should eql(Encoding.find('utf-8'))

        client2 = Mysql2::Client.new :encoding => 'ascii'
        client2.server_info[:version].encoding.should eql(Encoding.find('us-ascii'))
      end

      it "should use Encoding.default_internal" do
        Encoding.default_internal = Encoding.find('utf-8')
        @client.server_info[:version].encoding.should eql(Encoding.default_internal)
        Encoding.default_internal = Encoding.find('us-ascii')
        @client.server_info[:version].encoding.should eql(Encoding.default_internal)
      end
    end
  end

  it "should raise a Mysql2::Error exception upon connection failure" do
    lambda {
      bad_client = Mysql2::Client.new :host => "localhost", :username => 'asdfasdf8d2h', :password => 'asdfasdfw42'
    }.should raise_error(Mysql2::Error)

    lambda {
      good_client = Mysql2::Client.new
    }.should_not raise_error(Mysql2::Error)
  end

  context 'write operations api' do
    before(:each) do
      @client.query "USE test"
      @client.query "CREATE TABLE IF NOT EXISTS lastIdTest (`id` int(11) NOT NULL AUTO_INCREMENT, blah INT(11), PRIMARY KEY (`id`))"
    end

    after(:each) do
      @client.query "DROP TABLE lastIdTest"
    end

    it "should respond to #last_id" do
      @client.should respond_to(:last_id)
    end

    it "#last_id should return a Fixnum, the from the last INSERT/UPDATE" do
      @client.last_id.should eql(0)
      @client.query "INSERT INTO lastIdTest (blah) VALUES (1234)"
      @client.last_id.should eql(1)
    end

    it "should respond to #last_id" do
      @client.should respond_to(:last_id)
    end

    it "#last_id should return a Fixnum, the from the last INSERT/UPDATE" do
      @client.query "INSERT INTO lastIdTest (blah) VALUES (1234)"
      @client.affected_rows.should eql(1)
      @client.query "UPDATE lastIdTest SET blah=4321 WHERE id=1"
      @client.affected_rows.should eql(1)
    end
  end

  it "should respond to #thread_id" do
    @client.should respond_to(:thread_id)
  end

  it "#thread_id should be a Fixnum" do
    @client.thread_id.class.should eql(Fixnum)
  end

  it "should respond to #ping" do
    @client.should respond_to(:ping)
  end

  it "#thread_id should return a boolean" do
    @client.ping.should eql(true)
    @client.close
    @client.ping.should eql(false)
  end

if RUBY_VERSION =~ /1.9/
  it "should respond to #encoding" do
    @client.should respond_to(:encoding)
  end
end
end


text:
class Alignment
{

public:
	Alignment(size_t size, const SubstitutionMatrix& sm);

	typedef Matrix<AlnScoreType> ScoreMatrix;

	AlnScoreType globalAlignment(const std::string& consensus,
								 const std::vector<std::string>& reads);

	AlnScoreType addDeletion(unsigned int letterIndex) const;
	AlnScoreType addSubstitution(unsigned int letterIndex,
						   		 char base, const std::vector<std::string>& reads) const;
	AlnScoreType addInsertion(unsigned int positionIndex,
						   	  char base, const std::vector<std::string>& reads) const;

private:
	std::vector<ScoreMatrix> _forwardScores;
	std::vector<ScoreMatrix> _reverseScores;
	const SubstitutionMatrix& _subsMatrix;

	AlnScoreType getScoringMatrix(const std::string& v, const std::string& w,
							      ScoreMatrix& scoreMat);
};


text:
package com.amazonaws.services.connect.model.transform;

import javax.annotation.Generated;

import com.amazonaws.SdkClientException;
import com.amazonaws.services.connect.model.*;

import com.amazonaws.protocol.*;
import com.amazonaws.annotation.SdkInternalApi;

/**
 * ListLexBotsRequestMarshaller
 */
@Generated("com.amazonaws:aws-java-sdk-code-generator")
@SdkInternalApi
public class ListLexBotsRequestMarshaller {

    private static final MarshallingInfo<String> INSTANCEID_BINDING = MarshallingInfo.builder(MarshallingType.STRING).marshallLocation(MarshallLocation.PATH)
            .marshallLocationName("InstanceId").build();
    private static final MarshallingInfo<String> NEXTTOKEN_BINDING = MarshallingInfo.builder(MarshallingType.STRING)
            .marshallLocation(MarshallLocation.QUERY_PARAM).marshallLocationName("nextToken").build();
    private static final MarshallingInfo<Integer> MAXRESULTS_BINDING = MarshallingInfo.builder(MarshallingType.INTEGER)
            .marshallLocation(MarshallLocation.QUERY_PARAM).marshallLocationName("maxResults").build();

    private static final ListLexBotsRequestMarshaller instance = new ListLexBotsRequestMarshaller();

    public static ListLexBotsRequestMarshaller getInstance() {
        return instance;
    }

    /**
     * Marshall the given parameter object.
     */
    public void marshall(ListLexBotsRequest listLexBotsRequest, ProtocolMarshaller protocolMarshaller) {

        if (listLexBotsRequest == null) {
            throw new SdkClientException("Invalid argument passed to marshall(...)");
        }

        try {
            protocolMarshaller.marshall(listLexBotsRequest.getInstanceId(), INSTANCEID_BINDING);
            protocolMarshaller.marshall(listLexBotsRequest.getNextToken(), NEXTTOKEN_BINDING);
            protocolMarshaller.marshall(listLexBotsRequest.getMaxResults(), MAXRESULTS_BINDING);
        } catch (Exception e) {
            throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);
        }
    }

}


text:
        <a href="<?php echo home_url(); ?>" class="logo" title="General Design Co">

        <?php
        if (has_nav_menu('primary_navigation')) :
          wp_nav_menu(array('theme_location' => 'primary_navigation', 'container' => false, 'items_wrap' => '
%3$s
'));
        endif;
        ?>


text:
/* Listing 44-3 */

#include "curr_time.h"                      /* Declaration of currTime() */
#include "tlpi_hdr.h"

int
main(int argc, char *argv[])
{
    int pfd[2];                             /* Process synchronization pipe */
    int j, dummy;

    if (argc < 2 || strcmp(argv[1], "--help") == 0)
        usageErr("%s sleep-time...\n", argv[0]);

    setbuf(stdout, NULL);                   /* Make stdout unbuffered, since we
                                               terminate child with _exit() */
    printf("%s  Parent started\n", currTime("%T"));

    if (pipe(pfd) == -1)
        errExit("pipe");

    for (j = 1; j < argc; j++) {
        switch (fork()) {
        case -1:
            errExit("fork %d", j);

        case 0: /* Child */
            if (close(pfd[0]) == -1)        /* Read end is unused */
                errExit("close");

            /* Child does some work, and lets parent know it's done */

            sleep(getInt(argv[j], GN_NONNEG, "sleep-time"));
                                            /* Simulate processing */
            printf("%s  Child %d (PID=%ld) closing pipe\n",
                    currTime("%T"), j, (long) getpid());
            if (close(pfd[1]) == -1)
                errExit("close");

            /* Child now carries on to do other things... */

            _exit(EXIT_SUCCESS);

        default: /* Parent loops to create next child */
            break;
        }
    }

    /* Parent comes here; close write end of pipe so we can see EOF */

    if (close(pfd[1]) == -1)                /* Write end is unused */
        errExit("close");

    /* Parent may do other work, then synchronizes with children */

    if (read(pfd[0], &dummy, 1) != 0)
        fatal("parent didn't get EOF");
    printf("%s  Parent ready to go\n", currTime("%T"));

    /* Parent can now carry on to do other things... */

    exit(EXIT_SUCCESS);
}


text:
"""
Sandbox for developing natural language processing (NLP) tools for
Pylearn2, including datasets and models
"""


text:
<?php
namespace Acme\BaseBundle\Admin;

use Acme\AdminBundle\Admin\Admin as Base;

class ProductAdmin extends Base
{

}


text: [ApiDoc](http://pythonhosted.org/ApiDoc) is a way to document RESTful APIs.


text:
<!doctype html>

{{translate('htmlConfigPageTitle')}}
                            {{configEmail}}

{{translate('htmlConfigPageTitle')}}
                            {{translate('htmlConfigTextDemo')}}

{{translate('htmlConfigPageTitle')}}
                            {{configEmail}}

{{translate('htmlConfigPageTitle')}}
                            {{translate('htmlConfigTextDemo')}}

                    <button class="col-xxs-12 col-xs-8 col-xs-offset-2  btn btn-primary "
                            ng-click="switchUser()">
                        {{translate('htmlButtonChangeUser')}}
                    </button>

                            <button type="button" class="btn btn-info col-xxs-12 dropdown-toggle" data-toggle="dropdown">
                                {{srvLocale.lang.title}}
                            </button>

                                    {{lang.title}}

                        {{srvLocale.translations.htmlConnectorUnderConstruction}}

Salesforce.com

                                <button type="button" class="btn btn-disabled">></button>

Google Drive

                                <button type="button" class="btn btn-disabled">></button>

Dropbox

                                <button type="button" class="btn btn-disabled">></button>

                        <button type="button" class="btn btn-link col-xxs-12"
                        style="padding-top: 20px;padding-bottom: 40px;"
                                ng-click="openDialogSendFeedbackReport('Your Praise','OtherConnector',srvLocale.translations.htmlMsgFeedbackOtherConnector)">
                            {{srvLocale.translations.htmlMsgFeedbackOtherConnectorQuestion}}
                        </button>

                            Warning - Only available in Demo ! {{srvLocale.translations.htmlTextDemoModeMoreData}}

                            {{translate('htmlConfigTextAppVersion')}}
                            v
                             {{srvConfig.c4pBuildDate}} {{srvConfig.c4pConfigEnv}}
                            Beta


text:
package com.gdmcmm.android;

import android.app.Application;
import android.support.v4.app.Fragment;

/**
 * Created by Jimny
 * on 14-7-25.
 */
public class AppInstance extends Application {

    public interface FragmentNavigateListener {

        public void addFragmentToActivityFragmentManager(Fragment toAdd);

        public void pushFragmentToActivityFragmentManager(Fragment toPush);

        public void pushNoBackStackFragmentToActivityFragmentManager(Fragment toPush);

        public boolean popFragmentFromActivityFragmentManager();

        public void popFragmentToBase();

        public Fragment getTopFragment();
    }
}


text:
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information
namespace DotNetNuke.Entities.Urls
{
    using System;
    using System.Collections.Specialized;

    using DotNetNuke.Abstractions.Portals;
    using DotNetNuke.Entities.Portals;
    using DotNetNuke.Entities.Tabs;

    public abstract class FriendlyUrlProviderBase
    {
        internal FriendlyUrlProviderBase(NameValueCollection attributes)
        {
            if (!string.IsNullOrEmpty(attributes["urlFormat"]))
            {
                switch (attributes["urlFormat"].ToLowerInvariant())
                {
                    case "searchfriendly":
                        this.UrlFormat = UrlFormatType.SearchFriendly;
                        break;
                    case "humanfriendly":
                        this.UrlFormat = UrlFormatType.HumanFriendly;
                        break;
                    case "advanced":
                    case "customonly":
                        this.UrlFormat = UrlFormatType.Advanced;
                        break;
                    default:
                        this.UrlFormat = UrlFormatType.SearchFriendly;
                        break;
                }
            }
        }

        protected UrlFormatType UrlFormat { get; private set; }

        internal abstract string FriendlyUrl(TabInfo tab, string path);

        internal abstract string FriendlyUrl(TabInfo tab, string path, string pageName);

        internal abstract string FriendlyUrl(TabInfo tab, string path, string pageName, IPortalSettings portalSettings);

        internal abstract string FriendlyUrl(TabInfo tab, string path, string pageName, string portalAlias);
    }
}


text:
'use strict';

var $isNaN = require('./helpers/isNaN');
var $isFinite = require('./helpers/isFinite');

var sign = require('./helpers/sign');
var mod = require('./helpers/mod');

var IsCallable = require('is-callable');
var toPrimitive = require('es-to-primitive/es5');

// https://es5.github.io/#x9
var ES5 = {
	ToPrimitive: toPrimitive,

	ToBoolean: function ToBoolean(value) {
		return Boolean(value);
	},
	ToNumber: function ToNumber(value) {
		return Number(value);
	},
	ToInteger: function ToInteger(value) {
		var number = this.ToNumber(value);
		if ($isNaN(number)) { return 0; }
		if (number === 0 || !$isFinite(number)) { return number; }
		return sign(number) * Math.floor(Math.abs(number));
	},
	ToInt32: function ToInt32(x) {
		return this.ToNumber(x) >> 0;
	},
	ToUint32: function ToUint32(x) {
		return this.ToNumber(x) >>> 0;
	},
	ToUint16: function ToUint16(value) {
		var number = this.ToNumber(value);
		if ($isNaN(number) || number === 0 || !$isFinite(number)) { return 0; }
		var posInt = sign(number) * Math.floor(Math.abs(number));
		return mod(posInt, 0x10000);
	},
	ToString: function ToString(value) {
		return String(value);
	},
	ToObject: function ToObject(value) {
		this.CheckObjectCoercible(value);
		return Object(value);
	},
	CheckObjectCoercible: function CheckObjectCoercible(value, optMessage) {
		/* jshint eqnull:true */
		if (value == null) {
			throw new TypeError(optMessage || 'Cannot call method on ' + value);
		}
		return value;
	},
	IsCallable: IsCallable,
	SameValue: function SameValue(x, y) {
		if (x === y) { // 0 === -0, but they are not identical.
			if (x === 0) { return 1 / x === 1 / y; }
			return true;
		}
		return $isNaN(x) && $isNaN(y);
	}
};

module.exports = ES5;


text:
**Note:** The content you are looking for is now located at: <https://github.com/Azure/azure-iot-sdks/blob/master/doc/get_started/java-run-sample-toradex-linux
.md>.


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">

  <meta name="description" content="">
  <meta name="author" content="">
  <link rel="icon" href="favicon.ico">

  <title>Vía Crucis | Octava Estación</title>

  <link href="dist/css/bootstrap.min.css" rel="stylesheet">

  <link href="theme.css" rel="stylesheet">

  <link href="icons.css" rel="stylesheet">

            <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
              Toggle navigation

            </button>
             Vía Crucis

Primera Estación

Segunda Estación

Tercera Estación

Cuarta Estación

Quinta Estación

Sexta Estación

Séptima Estación

Octava Estación

Novena Estación

Décima Estación

Undécima Estación

Duodécima Estación

Decimotercera Estación

Decimocuarta Estación

Decimoquinta Estación

Octava Estación

Jesús consuela a las mujeres de Jerusalén

 V. Te adoramos, oh Cristo, y te bendecimos.

              R. Pues por tu santa cruz redimiste al mundo.

 [V. Adoramus te, Christe, et benedicimus tibi

              R. Quia per sanctam crucem tuam redemisti mundum.]

 Dice el evangelista San Lucas que a Jesús, camino del Calvario, lo seguía una gran multitud del pueblo; y unas mujeres se dolían y se lamentaban por Él. Jesús, volviéndose a ellas les dijo: «Hijas de Jerusalén, no lloréis por mí; llorad más bien por vosotras y por vuestros hijos»; añadiéndoles, en figuras, que si la ira de Dios se ensañaba como veían con el Justo, ya podían pensar cómo lo haría con los culpables.

 Mientras muchos espectadores se divierten y lanzan insultos contra Jesús, no faltan algunas mujeres que, desafiando las leyes que lo prohibían, tienen el valor de llorar y lamentar la suerte del divino Condenado. Jesús, sin duda, agradeció los buenos sentimientos de aquellas mujeres, y movido del amor a las mismas quiso orientar la nobleza de sus corazones hacia lo más necesario y urgente: la conversión suya y la de sus hijos. Jesús nos enseña a establecer la escala de los valores divinos en nuestra vida y nos da una lección sobre el santo temor de Dios.

 Padrenuestro, Avemaría y Gloria.

 Jesús, pequé: Ten piedad y misericordia de mí.

 Bendita y alabada sea la pasión y muerte de nuestro Señor Jesucristo y los dolores de su santísima Madre, triste y afligida al pie de la cruz. Amén, Jesús.

 Anterior

Siguiente

             Subir


text:
<?php
namespace Procure\Domain\PurchaseRequest\Definition;

/**
 *
 * @author Nguyen Mau Tri - ngmautri@gmail.com
 *
 */
class PrDefinition
{

    public static $fields = [

        /*
         * |=============================
         * | Procure\Domain\PurchaseRequest\PRDoc
         * |
         * |=============================
         */

        "instance",

        /*
         * |=============================
         * | Procure\Domain\PurchaseRequest\BasePR
         * |
         * |=============================
         */

        "attachmentList",

        /*
         * |=============================
         * | Procure\Domain\PurchaseRequest\AbstractPR
         * |
         * |=============================
         */

        "prAutoNumber",
        "prNumber",
        "prName",
        "keywords",
        "status",
        "checksum",
        "submittedOn",
        "totalRowManual",
        "department",

        /*
         * |=============================
         * | Procure\Domain\GenericDoc
         * |
         * |=============================
         */

        "refreshed",
        "constructedFromDB",

        /*
         * |=============================
         * | Procure\Domain\BaseDoc
         * |
         * |=============================
         */

        "rowsGenerator",
        "lazyRowSnapshotCollection",
        "lazyRowSnapshotCollectionReference",
        "rowCollection",
        "pictureList",
        "totalPicture",
        "totalAttachment",
        "docRows",
        "rowIdArray",
        "rowsOutput",
        "postingYear",
        "postingMonth",
        "docYear",
        "docMonth",
        "postingPeriodFrom",
        "postingPeriodTo",
        "postingPeriodId",
        "companyName",
        "companyId",
        "companyToken",
        "companyCode",
        "vendorId",
        "vendorToken",
        "vendorAddress",
        "vendorCountry",
        "completedAPRows",
        "completedGRRows",
        "paymentTermName",
        "paymentTermCode",
        "warehouseName",
        "warehouseCode",
        "paymentMethodName",
        "paymentMethodCode",
        "incotermCode",
        "incotermName",
        "createdByName",
        "lastChangedByName",
        "totalRows",
        "totalActiveRows",
        "maxRowNumber",
        "netAmount",
        "taxAmount",
        "grossAmount",
        "discountAmount",
        "billedAmount",
        "completedRows",
        "openAPAmount",
        "docCurrencyISO",
        "localCurrencyISO",
        "docCurrencyId",
        "localCurrencyId",

        /*
         * |=============================
         * | Procure\Domain\AbstractDoc
         * |
         * |=============================
         */

        "id",
        "token",
        "vendorName",
        "invoiceNo",
        "invoiceDate",
        "currencyIso3",
        "exchangeRate",
        "remarks",
        "createdOn",
        "currentState",
        "isActive",
        "trxType",
        "lastchangeOn",
        "postingDate",
        "grDate",
        "sapDoc",
        "contractNo",
        "contractDate",
        "quotationNo",
        "quotationDate",
        "sysNumber",
        "revisionNo",
        "deliveryMode",
        "incoterm",
        "incotermPlace",
        "paymentTerm",
        "docStatus",
        "workflowStatus",
        "transactionStatus",
        "docType",
        "paymentStatus",
        "totalDocValue",
        "totalDocTax",
        "totalDocDiscount",
        "totalLocalValue",
        "totalLocalTax",
        "totalLocalDiscount",
        "reversalBlocked",
        "uuid",
        "docVersion",
        "vendor",
        "pmtTerm",
        "company",
        "warehouse",
        "createdBy",
        "lastchangeBy",
        "currency",
        "paymentMethod",
        "localCurrency",
        "docCurrency",
        "incoterm2",
        "isDraft",
        "isPosted",
        "isReversed",
        "reversalDate",
        "reversalReason",
        "postingPeriod",
        "currentStatus",
        "transactionType",
        "discountRate",
        "docNumber",
        "docDate",
        "baseDocId",
        "baseDocType",
        "targetDocId",
        "targetDocType",
        "clearingDocId"
    ];

    public static $defaultExcludedFields = [
        "id",
        "uuid",
        "token",
        "checksum",
        "createdBy",
        "createdOn",
        "lastChangeOn",
        "lastChangeBy",
        "sysNumber",
        "company",
        "itemType",
        "revisionNo",
        "currencyIso3",
        "vendorName",
        "docStatus",
        "workflowStatus",
        "transactionStatus",
        "paymentStatus",
        "paymentStatus"
    ];

    public static $defaultIncludedFields = [
        "isActive",
        "prNumber",
        "keywords",
        "docDate",
        "submittedOn",
        "department",
        "warehouse",
        "remarks"
    ];
}


text:
package io.flutter.editor;

import com.intellij.codeInsight.actions.ReaderModeMatcher;
import com.intellij.codeInsight.actions.ReaderModeProvider;
import com.intellij.openapi.editor.Editor;
import com.intellij.openapi.module.Module;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.vfs.VirtualFile;
import io.flutter.pub.PubRoot;
import io.flutter.utils.FlutterModuleUtils;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

import java.util.List;

public class FlutterReaderModeMatcher implements ReaderModeMatcher {
  @Nullable
  @Override
  public Boolean matches(@NotNull Project project,
                         @NotNull VirtualFile file,
                         @Nullable Editor editor,
                         @NotNull ReaderModeProvider.ReaderMode mode) {
    if (ReaderModeProvider.ReaderMode.READ_ONLY == mode) {
      return null;
    }
    List<Module> contents = FlutterModuleUtils.findModulesWithFlutterContents(project);
    if (contents.isEmpty()) {
      return null;
    }
    PubRoot root = PubRoot.forDescendant(file, project);
    if (root == null) {
      return null;
    }
    return false;
  }
}


text:
package org.apache.synapse.transport.fix;

import quickfix.Message;
import quickfix.Group;
import quickfix.fix41.NewOrderSingle;
import quickfix.field.*;
import org.apache.axis2.context.MessageContext;
import org.apache.axiom.om.util.AXIOMUtil;
import org.custommonkey.xmlunit.XMLTestCase;

import java.util.Date;

public class MessageTest extends XMLTestCase {

    private static final String BEGIN_STRING    = "FIX.4.1";
    private static final String SENDER_ID       = "BANZAI";
    private static final String TARGET_ID = "SYNAPSE";
    private static final int SEQ_NUM            = 5;
    private static final String SYMBOL          = "APACHE";
    private static final String CLORD_ID        = "12345";
    private static final String CHECKSUM        = "67890";
    private static final String TX_DATE         = new Date().toString();
    private static final String SESSION_ID      = "FIX.4.1:BANZAI->SYNAPSE";

    public void testSimpleFIXMessage() throws Exception {
        Message message = new NewOrderSingle();
        message.getHeader().setField(new BeginString(BEGIN_STRING));
        message.getHeader().setField(new SenderCompID(SENDER_ID));
        message.getHeader().setField(new TargetCompID(TARGET_ID));
        message.getHeader().setField(new MsgSeqNum(SEQ_NUM));

        message.setField(new Symbol(SYMBOL));
        message.setField(new ClOrdID(CLORD_ID));
        message.setField(new TradeOriginationDate(TX_DATE));

        message.getTrailer().setField(new CheckSum(CHECKSUM));

        MessageContext msgCtx = new MessageContext();
        FIXUtils.getInstance().setSOAPEnvelope(message, SEQ_NUM, SESSION_ID, msgCtx);
        String result = msgCtx.getEnvelope().getBody().getFirstElement().toString();
        String expected =
                "<message inSession=\"" + SESSION_ID + "\" counter=\"" + SEQ_NUM + "\">" +
                    "" +
                        "<field id=\"" + BeginString.FIELD + "\">" + BEGIN_STRING + "</field>" +
                        "<field id=\"" + MsgSeqNum.FIELD + "\">" + SEQ_NUM + "</field>" +
                        "<field id=\"" + MsgType.FIELD + "\">" + NewOrderSingle.MSGTYPE + "</field>" +
                        "<field id=\"" + SenderCompID.FIELD + "\">" + SENDER_ID + "</field>" +
                        "<field id=\"" + TargetCompID.FIELD + "\">" + TARGET_ID + "</field>" +
                    "" +
                    "" +
                        "<field id=\"" + ClOrdID.FIELD + "\">" + CLORD_ID + "</field>" +
                        "<field id=\"" + Symbol.FIELD + "\">" + SYMBOL + "</field>" +
                        "<field id=\"" + TradeOriginationDate.FIELD + "\">" + TX_DATE + "</field>" +
                    "" +
                    "<trailer>" +
                        "<field id=\"" + CheckSum.FIELD + "\">" + CHECKSUM + "</field>" +
                    "</trailer>" +
                "</message>";

        assertXMLEqual(expected, AXIOMUtil.stringToOM(result).toString());
    }

    public void testAdvancedFIXMessage() throws Exception {
        Message message = new NewOrderSingle();
        message.getHeader().setField(new BeginString(BEGIN_STRING));
        message.getHeader().setField(new SenderCompID(SENDER_ID));
        message.getHeader().setField(new TargetCompID(TARGET_ID));
        message.getHeader().setField(new MsgSeqNum(SEQ_NUM));

        message.setField(new Symbol(SYMBOL));
        message.setField(new ClOrdID(CLORD_ID));
        message.setField(new TradeOriginationDate(TX_DATE));

        Group g1 = new Group(NoAllocs.FIELD, AllocAccount.FIELD);
        g1.setField(new AllocAccount("ABC"));
        g1.setField(new IndividualAllocID("PQR"));
        message.addGroup(g1);
        Group g2 = new Group(NoAllocs.FIELD, AllocAccount.FIELD);
        g2.setField(new AllocAccount("MNO"));
        g2.setField(new IndividualAllocID("XYZ"));
        message.addGroup(g2);

        message.getTrailer().setField(new CheckSum(CHECKSUM));

        MessageContext msgCtx = new MessageContext();
        FIXUtils.getInstance().setSOAPEnvelope(message, SEQ_NUM, SESSION_ID, msgCtx);
        String result = msgCtx.getEnvelope().getBody().getFirstElement().toString();
        String expected =
                "<message inSession=\"" + SESSION_ID + "\" counter=\"" + SEQ_NUM + "\">" +
                    "" +
                        "<field id=\"" + BeginString.FIELD + "\">" + BEGIN_STRING + "</field>" +
                        "<field id=\"" + MsgSeqNum.FIELD + "\">" + SEQ_NUM + "</field>" +
                        "<field id=\"" + MsgType.FIELD + "\">" + NewOrderSingle.MSGTYPE + "</field>" +
                        "<field id=\"" + SenderCompID.FIELD + "\">" + SENDER_ID + "</field>" +
                        "<field id=\"" + TargetCompID.FIELD + "\">" + TARGET_ID + "</field>" +
                    "" +
                    "" +
                        "<field id=\"" + ClOrdID.FIELD + "\">" + CLORD_ID + "</field>" +
                        "<field id=\"" + Symbol.FIELD + "\">" + SYMBOL + "</field>" +
                        "<field id=\"" + NoAllocs.FIELD + "\">2</field>" +
                        "<field id=\"" + TradeOriginationDate.FIELD + "\">" + TX_DATE + "</field>" +
                        "<groups id=\"" + NoAllocs.FIELD +"\">" +
                            "<group>" +
                                "<field id=\"" + AllocAccount.FIELD + "\">ABC</field>" +
                                "<field id=\"" + IndividualAllocID.FIELD + "\">PQR</field>" +
                            "</group>" +
                            "<group>" +
                                "<field id=\"" + AllocAccount.FIELD + "\">MNO</field>" +
                                "<field id=\"" + IndividualAllocID.FIELD + "\">XYZ</field>" +
                            "</group>" +
                        "</groups>" +
                    "" +
                    "<trailer>" +
                        "<field id=\"" + CheckSum.FIELD + "\">" + CHECKSUM + "</field>" +
                    "</trailer>" +
                "</message>";

        assertXMLEqual(expected, AXIOMUtil.stringToOM(result).toString());
    }
}