text:
#pragma once

#include "il2cpp-config.h"

#ifndef _MSC_VER
# include <alloca.h>
#else
# include <malloc.h>
#endif

#include <stdint.h>

// System.Collections.Hashtable
struct Hashtable_t3875263730;
// System.Collections.Generic.Dictionary`2<System.String,System.Boolean>
struct Dictionary_2_t1848703245;
// System.Boolean[]
struct BooleanU5BU5D_t3804927312;

#include "System_System_Collections_Specialized_NameValueCol3455488335.h"

#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif

// System.Net.WebHeaderCollection
struct  WebHeaderCollection_t1099177929  : public NameValueCollection_t3455488335
{
public:
	// System.Boolean System.Net.WebHeaderCollection::internallyCreated
	bool ___internallyCreated_15;

public:
	inline static int32_t get_offset_of_internallyCreated_15() { return static_cast<int32_t>(offsetof(WebHeaderCollection_t1099177929, ___internallyCreated_15)); }
	inline bool get_internallyCreated_15() const { return ___internallyCreated_15; }
	inline bool* get_address_of_internallyCreated_15() { return &___internallyCreated_15; }
	inline void set_internallyCreated_15(bool value)
	{
		___internallyCreated_15 = value;
	}
};

struct WebHeaderCollection_t1099177929_StaticFields
{
public:
	// System.Collections.Hashtable System.Net.WebHeaderCollection::restricted
	Hashtable_t3875263730 * ___restricted_12;
	// System.Collections.Hashtable System.Net.WebHeaderCollection::multiValue
	Hashtable_t3875263730 * ___multiValue_13;
	// System.Collections.Generic.Dictionary`2<System.String,System.Boolean> System.Net.WebHeaderCollection::restricted_response
	Dictionary_2_t1848703245 * ___restricted_response_14;
	// System.Boolean[] System.Net.WebHeaderCollection::allowed_chars
	BooleanU5BU5D_t3804927312* ___allowed_chars_16;

public:
	inline static int32_t get_offset_of_restricted_12() { return static_cast<int32_t>(offsetof(WebHeaderCollection_t1099177929_StaticFields, ___restricted_12)); }
	inline Hashtable_t3875263730 * get_restricted_12() const { return ___restricted_12; }
	inline Hashtable_t3875263730 ** get_address_of_restricted_12() { return &___restricted_12; }
	inline void set_restricted_12(Hashtable_t3875263730 * value)
	{
		___restricted_12 = value;
		Il2CppCodeGenWriteBarrier(&___restricted_12, value);
	}

	inline static int32_t get_offset_of_multiValue_13() { return static_cast<int32_t>(offsetof(WebHeaderCollection_t1099177929_StaticFields, ___multiValue_13)); }
	inline Hashtable_t3875263730 * get_multiValue_13() const { return ___multiValue_13; }
	inline Hashtable_t3875263730 ** get_address_of_multiValue_13() { return &___multiValue_13; }
	inline void set_multiValue_13(Hashtable_t3875263730 * value)
	{
		___multiValue_13 = value;
		Il2CppCodeGenWriteBarrier(&___multiValue_13, value);
	}

	inline static int32_t get_offset_of_restricted_response_14() { return static_cast<int32_t>(offsetof(WebHeaderCollection_t1099177929_StaticFields, ___restricted_response_14)); }
	inline Dictionary_2_t1848703245 * get_restricted_response_14() const { return ___restricted_response_14; }
	inline Dictionary_2_t1848703245 ** get_address_of_restricted_response_14() { return &___restricted_response_14; }
	inline void set_restricted_response_14(Dictionary_2_t1848703245 * value)
	{
		___restricted_response_14 = value;
		Il2CppCodeGenWriteBarrier(&___restricted_response_14, value);
	}

	inline static int32_t get_offset_of_allowed_chars_16() { return static_cast<int32_t>(offsetof(WebHeaderCollection_t1099177929_StaticFields, ___allowed_chars_16)); }
	inline BooleanU5BU5D_t3804927312* get_allowed_chars_16() const { return ___allowed_chars_16; }
	inline BooleanU5BU5D_t3804927312** get_address_of_allowed_chars_16() { return &___allowed_chars_16; }
	inline void set_allowed_chars_16(BooleanU5BU5D_t3804927312* value)
	{
		___allowed_chars_16 = value;
		Il2CppCodeGenWriteBarrier(&___allowed_chars_16, value);
	}
};

#ifdef __clang__
#pragma clang diagnostic pop
#endif


text: from ibis.bigquery.udf.api import udf  # noqa: F401

redpajama_set_name: RedPajamaGithub


text:
using System;
using Microsoft.Xna.Framework;
using Forge.GameObjects;

namespace Forge.Graphics
{
    /// <summary>
    ///  A camera that smoothly follows a GameObject.
    /// </summary>
    public class FollowCamera : Camera
    {
        /// <summary>
        ///  Follow camera constructor.
        /// </summary>
        public FollowCamera(SizeF viewport)
            : base(viewport)
        {
        }

        /// <summary>
        ///  Follow camera constructor.
        /// </summary>
        /// <param name="target">Target to follow.</param>
        public FollowCamera(SizeF viewport, GameObject target)
            : base(viewport, (target != null ? target.Transform.WorldPosition : Vector2.Zero))
        {
            if (target == null)
            {
                throw new ArgumentNullException(nameof(target));
            }

            Target = target;
        }

        /// <summary>
        ///  Get or set the target to follow.
        /// </summary>
        public GameObject Target { get; set; }

        /// <summary>
        ///  Update logic.
        /// </summary>
        public override void Update(GameTime gameTime)
        {
            // TODO: Smooth scrolling and partial character following.
            if (Target != null)
            {
                Position = Target.Transform.WorldPosition;
            }
        }
    }
}


text:
package com.xbit.engine.base.objects;

import java.util.ArrayList;
import java.util.Random;

import com.xbit.engine.base.Game;
import com.xbit.engine.base.Player;
import com.xbit.engine.base.ResourceLoader;
import com.xbit.engine.base.Time;
import com.xbit.engine.math.Transform;
import com.xbit.engine.math.vec2;
import com.xbit.engine.math.vec3;
import com.xbit.engine.render.Material;
import com.xbit.engine.render.Mesh;
import com.xbit.engine.render.Shader;
import com.xbit.engine.render.Texture;
import com.xbit.engine.render.Vertex;

public class Enemy
{
	public static final float SCALE = 0.8f;
	public static final float SIZEY = SCALE;
	public static final float SIZEX = (float)((double)SIZEY / (1.910344827586206896551724137931 * 2));
	public static final float ZERO = 0;

	public static final float OFFSET_X = 0.05f;
	public static final float OFFSET_Y = 0.01f;
	public static final float OFFSET_FROM_GROUND = -0.075f;

	public static final float TEX_MAX_X = -1.0f - OFFSET_X;
	public static final float TEX_MIN_X =  0.0f - OFFSET_X;
	public static final float TEX_MAX_Y =  1.0f - OFFSET_Y;
	public static final float TEX_MIN_Y =  0.0f - OFFSET_Y;

	public static final int STATE_IDLE = 0;
	public static final int STATE_CHASE = 1;
	public static final int STATE_ATTACK = 2;
	public static final int STATE_DYING = 3;
	public static final int STATE_DEAD = 4;

	public static final float MOVE_SPEED = 2.0f;
	public static final float MOVEMENT_STOP_DISTANCE = 1.5f;
	public static final float ENEMY_SIZE = 0.2f;

	public static final float SHOOT_DISTANCE = 1000.0f;
	public static final float SHOT_ANGLE = 10.0f;
	public static final float ATTACK_CHANCE = 0.5f;
	public static final int MAX_HEALTH = 100;
	public static final int DAMAGE_MIN = 5;
	public static final int DAMAGE_MAX = 30;

	private static Mesh mesh;
	private static ArrayList<Texture> animations;

	private Material material;
	private Transform transform;
	private Random random;
	private int state;
	private int health;
	private boolean canLook;
	private boolean canAttack;
	private double deathTime;

	public Enemy(Transform transform)
	{
		if (animations == null)
		{
			animations = new ArrayList<Texture>();

			animations.add(ResourceLoader.loadTexture("SSWVA1.png"));
			animations.add(ResourceLoader.loadTexture("SSWVB1.png"));
			animations.add(ResourceLoader.loadTexture("SSWVC1.png"));
			animations.add(ResourceLoader.loadTexture("SSWVD1.png"));

			animations.add(ResourceLoader.loadTexture("SSWVE0.png"));
			animations.add(ResourceLoader.loadTexture("SSWVF0.png"));
			animations.add(ResourceLoader.loadTexture("SSWVG0.png"));
			animations.add(ResourceLoader.loadTexture("SSWVH0.png"));

			animations.add(ResourceLoader.loadTexture("SSWVI0.png"));
			animations.add(ResourceLoader.loadTexture("SSWVJ0.png"));
			animations.add(ResourceLoader.loadTexture("SSWVK0.png"));
			animations.add(ResourceLoader.loadTexture("SSWVL0.png"));

			animations.add(ResourceLoader.loadTexture("SSWVM0.png"));
		}

		if (mesh == null)
		{
			mesh = new Mesh();

			Vertex[] vertices = new Vertex[]
				{
					new Vertex(new vec3(-SIZEX, ZERO,  ZERO), new vec2(TEX_MAX_X, TEX_MAX_Y)),
					new Vertex(new vec3(-SIZEX, SIZEY, ZERO), new vec2(TEX_MAX_X, TEX_MIN_Y)),
					new Vertex(new vec3( SIZEX, SIZEY, ZERO), new vec2(TEX_MIN_X, TEX_MIN_Y)),
					new Vertex(new vec3( SIZEX, ZERO,  ZERO), new vec2(TEX_MIN_X, TEX_MAX_Y)),
				};

			int[] indices = new int[]
				{
					0, 1, 2,
					0, 2, 3
				};

			mesh.addVertices(vertices, indices, false);
		}

		this.transform = transform;
		this.state = STATE_IDLE;
		this.health = MAX_HEALTH;
		this.material = new Material(animations.get(0));
		this.random = new Random();
		this.canLook = false;
		this.canAttack = false;
		this.deathTime = 0;
	}

	public void update()
	{
		transform.getTranslation().setY(OFFSET_FROM_GROUND);

		vec3 directionToCamera = Transform.getCamera().getPos().sub(transform.getTranslation());
		float angleToFaceTheCamera = (float)Math.toDegrees(Math.atan(directionToCamera.getZ() / directionToCamera.getX()));
		float distance = directionToCamera.length();
		vec3 orientation = directionToCamera.div(distance);

		if (directionToCamera.getX() < 0)
			angleToFaceTheCamera += 180;

		transform.getRotation().setY(angleToFaceTheCamera + 90);

		switch (state)
		{
		case STATE_IDLE:
			idleUpdate(orientation, distance);
			break;
		case STATE_CHASE:
			chaseUpdate(orientation, distance);
			break;
		case STATE_ATTACK:
			attackUpdate(orientation, distance);
			break;
		case STATE_DYING:
			dyingUpdate(orientation, distance);
			break;
		case STATE_DEAD:
			deadUpdate(orientation, distance);
			break;
		}
	}

	public void damage(int amt)
	{
		if (state == STATE_IDLE)
			state = STATE_CHASE;

		health -= amt;

		if (health <= 0)
			state = STATE_DYING;
	}

	private void idleUpdate(vec3 orientation, float distance)
	{
		double time = (double)Time.getTime()/(double)Time.SECOND;
		double timeDecimals = time - Math.floor(time);

		if (timeDecimals < 0.5)
		{
			canLook = true;
			material.setTexture(animations.get(0));
		}
		else
		{
			material.setTexture(animations.get(1));

			if (canLook)
			{
				vec2 lineStart = new vec2(transform.getTranslation().getX(), transform.getTranslation().getZ());
				vec2 castDirection = new vec2(orientation.getX(), orientation.getZ()).rotate((random.nextFloat() - 0.5f));
				vec2 lineEnd = lineStart.add(castDirection.mul(SHOOT_DISTANCE));

				vec2 collisionVector = Game.getLevel().checkIntersections(lineStart, lineEnd, false);

				vec2 playerIntersectVector = new vec2(Transform.getCamera().getPos().getX(), Transform.getCamera().getPos().getZ());

				if (playerIntersectVector != null && (collisionVector == null || playerIntersectVector.sub(lineStart).length() < collisionVector.sub(lineStart).length()))
					state = STATE_CHASE;

				canLook = false;
			}
		}
	}

	private void chaseUpdate(vec3 orientation, float distance)
	{
		double time = (double)Time.getTime()/(double)Time.SECOND;
		double timeDecimals = time - Math.floor(time);

		if (timeDecimals < 0.5)
		{
			material.setTexture(animations.get(0));
		}
		else if (timeDecimals < 0.25f)
		{
			material.setTexture(animations.get(1));
		}
		else if (timeDecimals < 0.72f)
		{
			material.setTexture(animations.get(2));
		}
		else
		{
			material.setTexture(animations.get(3));
		}

		if (random.nextDouble() < ATTACK_CHANCE * Time.getDelta())
			state = STATE_ATTACK;

		if (distance > MOVEMENT_STOP_DISTANCE)
		{
			float moveAmount = MOVE_SPEED * (float)Time.getDelta();

			vec3 oldPos = transform.getTranslation();
			vec3 newPos = transform.getTranslation().add(orientation.mul(moveAmount));

			vec3 collisionVector = Game.getLevel().checkCollision(oldPos, newPos, ENEMY_SIZE, ENEMY_SIZE);

			vec3 movementVector = collisionVector.mul(orientation);

			if (movementVector.length() > 0)
				transform.setTranslation(transform.getTranslation().add(movementVector.mul(moveAmount)));

			if (movementVector.sub(orientation).length() != 0)
				Game.getLevel().openDoors(transform.getTranslation(), false);
		}
		else
		{
			state = STATE_ATTACK;
		}
	}

	private void attackUpdate(vec3 orientation, float distance)
	{
		double time = (double)Time.getTime()/(double)Time.SECOND;
		double timeDecimals = time - Math.floor(time);

		if (timeDecimals < 0.25)
		{
			canAttack = true;
			material.setTexture(animations.get(5));
		}
		else if (timeDecimals < 0.5)
		{
			material.setTexture(animations.get(6));
		}
		else if (timeDecimals < 0.75)
		{
			material.setTexture(animations.get(7));

			if (canAttack)
			{
				vec2 lineStart = new vec2(transform.getTranslation().getX(), transform.getTranslation().getZ());
				vec2 castDirection = new vec2(orientation.getX(), orientation.getZ()).rotate((random.nextFloat() - 0.5f) * SHOT_ANGLE);
				vec2 lineEnd = lineStart.add(castDirection.mul(SHOOT_DISTANCE));

				vec2 collisionVector = Game.getLevel().checkIntersections(lineStart, lineEnd, false);

				vec2 playerIntersectVector = Game.getLevel().lineIntersectRect(lineStart, lineEnd, new vec2(Transform.getCamera().getPos().getX(), Transform.getCamera().getPos().getZ()), new vec2(Player.PLAYER_SIZE, Player.PLAYER_SIZE));

				if (playerIntersectVector != null && (collisionVector == null || playerIntersectVector.sub(lineStart).length() < collisionVector.sub(lineStart).length()))
					Game.getLevel().damagePlayer(random.nextInt(DAMAGE_MAX - DAMAGE_MIN) + DAMAGE_MIN);

				if (collisionVector == null)
					System.err.println("Error: You enemy hasnt hit anything (and that is impossible unless you cant win without hacking)");

				state = STATE_CHASE;
				canAttack = false;
			}
			else
			{
				material.setTexture(animations.get(5));
			}
		}
	}

	private void dyingUpdate(vec3 orientation, float distance)
	{
		double time = ((double)Time.getTime())/((double)Time.SECOND);

		if (deathTime == 0)
			deathTime = time;

		final float time1 = 0.1f;
		final float time2 = 0.3f;
		final float time3 = 0.45f;
		final float time4 = 0.6f;

		if (time < deathTime + time1)
		{
			material.setTexture(animations.get(8));
			transform.setScale(1,0.96428571428571428571428571428571f,1);
		}
		else if (time < deathTime + time2)
		{
			material.setTexture(animations.get(9));
			transform.setScale(1.7f,0.9f,1);
		}
		else if (time < deathTime + time3)
		{
			material.setTexture(animations.get(10));
			transform.setScale(1.7f,0.9f,1);
		}
		else if (time < deathTime + time4)
		{
			material.setTexture(animations.get(11));
			transform.setScale(1.7f,0.5f,1);
		}
		else
		{
			state = STATE_DEAD;
		}
	}

	private void deadUpdate(vec3 orientation, float distance)
	{
		material.setTexture(animations.get(12));
		transform.setScale(1.7586206896551724137931034482759f,0.28571428571428571428571428571429f,1);
	}

	public void render()
	{
		Shader shader = Game.getLevel().getShader();
		shader.updateUniforms(transform.getTransformation(), transform.getProjectedTransformation(), material);
		mesh.draw();
	}

	public Transform getTransform()
	{
		return transform;
	}

	public vec2 getEnemySize()
	{
		return new vec2(ENEMY_SIZE, ENEMY_SIZE);
	}
}


text:
package labels

import (
	"sigs.k8s.io/kustomize/api/filters/filtersutil"
	"sigs.k8s.io/kustomize/api/filters/fsslice"
	"sigs.k8s.io/kustomize/api/types"
	"sigs.k8s.io/kustomize/kyaml/kio"
	"sigs.k8s.io/kustomize/kyaml/yaml"
)

type labelMap map[string]string

// Filter sets labels.
type Filter struct {
	// Labels is the set of labels to apply to the inputs
	Labels labelMap `yaml:"labels,omitempty"`

	// FsSlice identifies the label fields.
	FsSlice types.FsSlice
}

var _ kio.Filter = Filter{}

func (f Filter) Filter(nodes []*yaml.RNode) ([]*yaml.RNode, error) {
	keys := yaml.SortedMapKeys(f.Labels)
	_, err := kio.FilterAll(yaml.FilterFunc(
		func(node *yaml.RNode) (*yaml.RNode, error) {
			for _, k := range keys {
				if err := node.PipeE(fsslice.Filter{
					FsSlice: f.FsSlice,
					SetValue: filtersutil.SetEntry(
						k, f.Labels[k], yaml.NodeTagString),
					CreateKind: yaml.MappingNode, // Labels are MappingNodes.
					CreateTag:  yaml.NodeTagMap,
				}); err != nil {
					return nil, err
				}
			}
			return node, nil
		})).Filter(nodes)
	return nodes, err
}


text:
Work.

About.

Explore.


text:
module ApiHelper
  def api(path, query = {})
    "/#{Api::EntryPoint.prefix}/#{Api::EntryPoint.version}#{path}?#{query.to_query}"
  end

  def auth_header(key)
    { 'Authorization' => key }
  end

  def encode_data(data)
    Base64.encode64(data.to_json)
  end

  def json_response
    JSON.parse(response.body)
  end

  def clear_repository(project)
    project.repository.drop
  end

  def insert_documents(project, event_name, documents)
    project.repository[event_name].insert(documents)
  end
end


text:
// Copyright 2017 The Bazel Authors. All rights reserved.
//
// 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.

#include <sstream>
#include <string>
#include <vector>

#include "src/tools/launcher/java_launcher.h"
#include "src/tools/launcher/util/launcher_util.h"

namespace bazel {
namespace launcher {

using std::getline;
using std::ofstream;
using std::ostringstream;
using std::string;
using std::stringstream;
using std::vector;

// The runfile path of java binary, eg. local_jdk/bin/java.exe
static constexpr const char* JAVA_BIN_PATH = "java_bin_path";
static constexpr const char* JAR_BIN_PATH = "jar_bin_path";
static constexpr const char* CLASSPATH = "classpath";
static constexpr const char* JAVA_START_CLASS = "java_start_class";
static constexpr const char* JVM_FLAGS = "jvm_flags";

// Check if a string start with a certain prefix.
// If it's true, store the substring without the prefix in value.
// If value is quoted, then remove the quotes.
static bool GetFlagValue(const string& str, const string& prefix,
                         string* value_ptr) {
  if (str.compare(0, prefix.length(), prefix)) {
    return false;
  }
  string& value = *value_ptr;
  value = str.substr(prefix.length());
  int len = value.length();
  if (len >= 2 && value[0] == '"' && value[len - 1] == '"') {
    value = value.substr(1, len - 2);
  }
  return true;
}

// Parses one launcher flag and updates this object's state accordingly.
//
// Returns true if the flag is a valid launcher flag; false otherwise.
bool JavaBinaryLauncher::ProcessWrapperArgument(const string& argument) {
  string flag_value;
  if (argument.compare("--debug") == 0) {
    string default_jvm_debug_port;
    if (GetEnv("DEFAULT_JVM_DEBUG_PORT", &default_jvm_debug_port)) {
      this->jvm_debug_port = default_jvm_debug_port;
    } else {
      this->jvm_debug_port = "5005";
    }
  } else if (GetFlagValue(argument, "--debug=", &flag_value)) {
    this->jvm_debug_port = flag_value;
  } else if (GetFlagValue(argument, "--main_advice=", &flag_value)) {
    this->main_advice = flag_value;
  } else if (GetFlagValue(argument, "--main_advice_classpath=", &flag_value)) {
    this->main_advice_classpath = flag_value;
  } else if (GetFlagValue(argument, "--jvm_flag=", &flag_value)) {
    this->jvm_flags_cmdline.push_back(flag_value);
  } else if (GetFlagValue(argument, "--jvm_flags=", &flag_value)) {
    stringstream flag_value_ss(flag_value);
    string item;
    while (getline(flag_value_ss, item, ' ')) {
      this->jvm_flags_cmdline.push_back(item);
    }
  } else if (argument.compare("--singlejar") == 0) {
    this->singlejar = true;
  } else if (argument.compare("--print_javabin") == 0) {
    this->print_javabin = true;
  } else if (GetFlagValue(argument, "--classpath_limit=", &flag_value)) {
    this->classpath_limit = std::stoi(flag_value);
  } else {
    return false;
  }
  return true;
}

vector<string> JavaBinaryLauncher::ProcessesCommandLine() {
  vector<string> args;
  bool first = 1;
  for (const auto& arg : this->GetCommandlineArguments()) {
    // Skip the first arugment.
    if (first) {
      first = 0;
      continue;
    }
    string flag_value;
    // TODO(pcloudy): Should rename this flag to --native_launcher_flag.
    // But keep it as it is for now to be consistent with the shell script
    // launcher.
    if (GetFlagValue(arg, "--wrapper_script_flag=", &flag_value)) {
      if (!ProcessWrapperArgument(flag_value)) {
        die("invalid wrapper argument '%s'", arg);
      }
    } else if (!args.empty() || !ProcessWrapperArgument(arg)) {
      args.push_back(arg);
    }
  }
  return args;
}

string JavaBinaryLauncher::CreateClasspathJar(const string& classpath) {
  static constexpr const char* URI_PREFIX = "file:/";
  ostringstream manifest_classpath;
  manifest_classpath << "Class-Path:";
  stringstream classpath_ss(classpath);
  string path;
  while (getline(classpath_ss, path, ';')) {
    manifest_classpath << ' ';
    manifest_classpath << URI_PREFIX;
    for (const auto& x : path) {
      if (x == ' ') {
        manifest_classpath << "%20";
      } else {
        manifest_classpath << x;
      }
    }
  }

  string binary_base_path =
      GetBinaryPathWithoutExtension(this->GetCommandlineArguments()[0]);
  string rand_id = "-" + GetRandomStr(10);
  string jar_manifest_file_path = binary_base_path + rand_id + ".jar_manifest";
  ofstream jar_manifest_file(jar_manifest_file_path);
  jar_manifest_file << "Manifest-Version: 1.0\n";
  // No line in the MANIFEST.MF file may be longer than 72 bytes.
  // A space prefix indicates the line is still the content of the last
  // attribute.
  string manifest_classpath_str = manifest_classpath.str();
  for (size_t i = 0; i < manifest_classpath_str.length(); i += 71) {
    if (i > 0) {
      jar_manifest_file << " ";
    }
    jar_manifest_file << manifest_classpath_str.substr(i, 71) << "\n";
  }
  jar_manifest_file.close();

  // Create the command for generating classpath jar.
  // We pass the command to cmd.exe to use redirection for suppressing output.
  string manifest_jar_path = binary_base_path + rand_id + "-classpath.jar";
  string jar_bin = this->Rlocation(this->GetLaunchInfoByKey(JAR_BIN_PATH));
  vector<string> arguments;
  arguments.push_back("/c");

  ostringstream jar_command;
  jar_command << jar_bin << " cvfm ";
  jar_command << manifest_jar_path << " ";
  jar_command << jar_manifest_file_path << " ";
  jar_command << "> nul";
  arguments.push_back(jar_command.str());

  if (this->LaunchProcess("cmd.exe", arguments) != 0) {
    die("Couldn't create classpath jar: %s", manifest_jar_path.c_str());
  }

  // Delete jar_manifest_file after classpath jar is created.
  DeleteFileByPath(jar_manifest_file_path.c_str());

  return manifest_jar_path;
}

ExitCode JavaBinaryLauncher::Launch() {
  // Parse the original command line.
  vector<string> remaining_args = this->ProcessesCommandLine();

  // Set JAVA_RUNFILES
  string java_runfiles;
  if (!GetEnv("JAVA_RUNFILES", &java_runfiles)) {
    java_runfiles = this->GetRunfilesPath();
  }
  SetEnv("JAVA_RUNFILES", java_runfiles);

  // Print Java binary path if needed
  string java_bin = this->Rlocation(this->GetLaunchInfoByKey(JAVA_BIN_PATH),
                                    /*need_workspace_name =*/false);
  if (this->print_javabin ||
      this->GetLaunchInfoByKey(JAVA_START_CLASS) == "--print_javabin") {
    printf("%s\n", java_bin.c_str());
    return 0;
  }

  ostringstream classpath;

  // Run deploy jar if needed, otherwise generate the CLASSPATH by rlocation.
  if (this->singlejar) {
    string deploy_jar =
        GetBinaryPathWithoutExtension(this->GetCommandlineArguments()[0]) +
        "_deploy.jar";
    if (!DoesFilePathExist(deploy_jar.c_str())) {
      die("Option --singlejar was passed, but %s does not exist.\n  (You may "
          "need to build it explicitly.)",
          deploy_jar.c_str());
    }
    classpath << deploy_jar << ';';
  } else {
    // Add main advice classpath if exists
    if (!this->main_advice_classpath.empty()) {
      classpath << this->main_advice_classpath << ';';
    }
    string path;
    stringstream classpath_ss(this->GetLaunchInfoByKey(CLASSPATH));
    while (getline(classpath_ss, path, ';')) {
      classpath << this->Rlocation(path) << ';';
    }
  }

  // Set jvm debug options
  ostringstream jvm_debug_flags;
  if (!this->jvm_debug_port.empty()) {
    string jvm_debug_suspend;
    if (!GetEnv("DEFAULT_JVM_DEBUG_SUSPEND", &jvm_debug_suspend)) {
      jvm_debug_suspend = "y";
    }
    jvm_debug_flags << "-agentlib:jdwp=transport=dt_socket,server=y";
    jvm_debug_flags << ",suspend=" << jvm_debug_suspend;
    jvm_debug_flags << ",address=" << jvm_debug_port;

    string value;
    if (GetEnv("PERSISTENT_TEST_RUNNER", &value) && value == "true") {
      jvm_debug_flags << ",quiet=y";
    }
  }

  // Get jvm flags from JVM_FLAGS environment variable and JVM_FLAGS launch info
  vector<string> jvm_flags;
  string jvm_flags_env;
  GetEnv("JVM_FLAGS", &jvm_flags_env);
  string flag;
  stringstream jvm_flags_env_ss(jvm_flags_env);
  while (getline(jvm_flags_env_ss, flag, ' ')) {
    jvm_flags.push_back(flag);
  }
  stringstream jvm_flags_launch_info_ss(this->GetLaunchInfoByKey(JVM_FLAGS));
  while (getline(jvm_flags_launch_info_ss, flag, ' ')) {
    jvm_flags.push_back(flag);
  }

  // Check if TEST_TMPDIR is available to use for scratch.
  string test_tmpdir;
  if (GetEnv("TEST_TMPDIR", &test_tmpdir) &&
      DoesDirectoryPathExist(test_tmpdir.c_str())) {
    jvm_flags.push_back("-Djava.io.tmpdir=" + test_tmpdir);
  }

  // Construct the final command line arguments
  vector<string> arguments;
  // Add classpath flags
  arguments.push_back("-classpath");
  // Check if CLASSPATH is over classpath length limit.
  // If it does, then we create a classpath jar to pass CLASSPATH value.
  string classpath_str = classpath.str();
  string classpath_jar = "";
  if (classpath_str.length() > this->classpath_limit) {
    classpath_jar = CreateClasspathJar(classpath_str);
    arguments.push_back(classpath_jar);
  } else {
    arguments.push_back(classpath_str);
  }
  // Add JVM debug flags
  string jvm_debug_flags_str = jvm_debug_flags.str();
  if (!jvm_debug_flags_str.empty()) {
    arguments.push_back(jvm_debug_flags_str);
  }
  // Add JVM flags parsed from env and launch info.
  for (const auto& arg : jvm_flags) {
    arguments.push_back(arg);
  }
  // Add JVM flags parsed from command line.
  for (const auto& arg : this->jvm_flags_cmdline) {
    arguments.push_back(arg);
  }
  // Add main advice class
  if (!this->main_advice.empty()) {
    arguments.push_back(this->main_advice);
  }
  // Add java start class
  arguments.push_back(this->GetLaunchInfoByKey(JAVA_START_CLASS));
  // Add the remaininng arguements, they will be passed to the program.
  for (const auto& arg : remaining_args) {
    arguments.push_back(arg);
  }

  ExitCode exit_code = this->LaunchProcess(java_bin, arguments);

  // Delete classpath jar file after execution.
  if (!classpath_jar.empty()) {
    DeleteFileByPath(classpath_jar.c_str());
  }

  return exit_code;
}

}  // namespace launcher
}  // namespace bazel


text:
"""
Instagram OAuth2 backend, docs at:
    http://psa.matiasaguirre.net/docs/backends/instagram.html
"""
from social.backends.oauth import BaseOAuth2

class InstagramOAuth2(BaseOAuth2):
    name = 'instagram'
    AUTHORIZATION_URL = 'https://instagram.com/oauth/authorize'
    ACCESS_TOKEN_URL = 'https://instagram.com/oauth/access_token'
    ACCESS_TOKEN_METHOD = 'POST'

    def get_user_id(self, details, response):
        return response['user']['id']

    def get_user_details(self, response):
        """Return user details from Instagram account"""
        username = response['user']['username']
        email = response['user'].get('email', '')
        fullname, first_name, last_name = self.get_user_names(
            response['user'].get('full_name', '')
        )
        return {'username': username,
                'fullname': fullname,
                'first_name': first_name,
                'last_name': last_name,
                'email': email}

    def user_data(self, access_token, *args, **kwargs):
        """Loads user data from service"""
        return self.get_json('https://api.instagram.com/v1/users/self',
                             params={'access_token': access_token})


text:
describe('Route', function () {
	var exceptions = {
		data: 'Invalid route',
		name: 'Route has an invalid name',
		url: 'Route has an invalid URL'
	}

	/* Constructor tests */

	it('throws an exception when no object is passed to the constructor.', function () {
		expect(function () {
			new Route();
		}).toThrow(exceptions.data);
	});

	it('throws an exception when null is passed to the constructor.', function () {
		expect(function () {
			new Route(null);
		}).toThrow(exceptions.data);
	});

	it('throws an exception when what is passed to the constructor is not an object.', function () {
		expect(function () {
			new Route(1234);
		}).toThrow(exceptions.data);
	});

	// Name

	it('throws an exception when no name is supplied.', function () {
		expect(function () {
			new Route({ url: '/test/url' });
		}).toThrow(exceptions.name);
	});

	it('throws an exception when the name is null.', function () {
		expect(function () {
			new Route({ name: null, url: '/test/url' });
		}).toThrow(exceptions.name);
	});

	it('throws an exception when the name is an empty string.', function () {
		expect(function () {
			new Route({ name: '', url: '/test/url' });
		}).toThrow(exceptions.name);
	});

	it('throws an exception when the name is whitespace.', function () {
		expect(function () {
			new Route({ name: '   ', url: '/test/url' });
		}).toThrow(exceptions.name);
	});

	it('stores the name passed to the constructor in the name property.', function () {
		var r = new Route({ name: 'route-name', url: '/test/url' });

		expect(r.name).toBe('route-name');
	});

	it('trims the whitespace of the name passed to the constructor.', function () {
		var r = new Route({ name: '  route-name  ', url: '/test/url' });

		expect(r.name).toBe('route-name');
	});

	// URL

	it('throws an exception when no url is supplied.', function () {
		expect(function () {
			new Route({ name: 'route-name' });
		}).toThrow(exceptions.url);
	});

	it('throws an exception when the url is null.', function () {
		expect(function () {
			new Route({ name: 'route-name', url: null });
		}).toThrow(exceptions.url);
	});

	it('throws an exception when the url is an empty string.', function () {
		expect(function () {
			new Route({ name: 'route-name', url: '' });
		}).toThrow(exceptions.url);
	});

	it('throws an exception when the url is whitespace.', function () {
		expect(function () {
			new Route({ name: 'route-name', url: '   ' });
		}).toThrow(exceptions.url);
	});

	it('stores the url passed to the constructor in the url property.', function () {
		var r = new Route({ name: 'route-name', url: '/test/url' });

		expect(r.url).toBe('/test/url');
	});

	it('trims the whitespace of the url passed to the constructor.', function () {
		var r = new Route({ name: 'route-name', url: '  /test/url  ' });

		expect(r.url).toBe('/test/url');
	});

	it('throws an exception when the url does not begin with a /.', function () {
		expect(function () {
			new Route({ name: 'route-name', url: 'test/url' });
		}).toThrow(exceptions.url);
	});

	it('throws an exception when the url contains whitespace.', function () {
		expect(function () {
			new Route({ name: 'route-name', url: '/te st/url' });
		}).toThrow(exceptions.url);
	});

	it('throws an exception when a variable in the url has a number following the colon.', function () {
		expect(function () {
			new Route({ name: 'route-name', url: '/test/:2url' });
		}).toThrow(exceptions.url);
	});

	it('throws an exception when a variable in the url contains a -.', function () {
		expect(function () {
			new Route({ name: 'route-name', url: '/test/:u-rl' });
		}).toThrow(exceptions.url);
	});

	it('allows the url to be /', function () {
		var route = new Route({ name: 'default', url: '/' });

		expect(route.url).toBe('/');
	});

	it('allows a variable in the url contains a _.', function () {
		var url = '/test/:u_rl';
		var route = new Route({ name: 'route-name', url: url });

		expect(route.url).toBe(url);
	});

	it('allows a url to contain a - in a non-variable segment.', function () {
		expect(function () {
			new Route({ name: 'route-name', url: '/test/:u-rl' });
		}).toThrow(exceptions.url);
	});

	it('allows a url to contain a _ in a non-variable segment.', function () {
		var url = '/te_st/url';
		var route = new Route({ name: 'test-route', url: url });

		expect(route.url).toBe(url);
	});

	it('allows a url to contain a number in a non-variable segment.', function () {
		var url = '/te-st/url';
		var route = new Route({ name: 'test-route', url: url });

		expect(route.url).toBe(url);
	});

	it('allows a url to contain an alphanumeric segment which starts with a number.', function () {
		var url = '/test/2url';
		var route = new Route({ name: 'test-route', url: url });

		expect(route.url).toBe(url);
	});

	/* Equals */

	it('returns true from equals when the names match.', function () {
		var name = "test-route";

		var r1 = new Route({ name: name, url: '/route1' });
		var r2 = new Route({ name: name, url: '/route2' });

		expect(r1.equals(r2)).toBe(true);
	});

	it('returns true from equals when the URLs match.', function () {
		var url = "/test-route";

		var r1 = new Route({ name: 'route1', url: url });
		var r2 = new Route({ name: 'route2', url: url });

		expect(r1.equals(r2)).toBe(true);
	});

	it('returns true from equals when the URL patterns match.', function () {
		var r1 = new Route({ name: 'route1', url: '/route/:foo' });
		var r2 = new Route({ name: 'route2', url: '/route/:bar' });

		expect(r1.equals(r2)).toBe(true);
	});

	it('returns false from equals when name and URL do not match.', function () {
		var r1 = new Route({ name: 'route1', url: '/foo/:id' });
		var r2 = new Route({ name: 'route2', url: '/bar/:id' });

		expect(r1.equals(r2)).toBe(false);
	});

	/* Matches */

	it('returns true from matches when the URL matches a route with no parameters.', function () {
		expect(new Route({
			name: 'route-name',
			url: '/foo/bar'
		}).matches('/foo/bar')).toBe(true);
	});

	it('returns true when the URL mathes a route with a parameter.', function () {
		expect(new Route({
			name: 'route-name',
			url: '/foo/:bar'
		}).matches('/foo/1')).toBe(true);
	});

	it('returns true when the URL mathes a route with multiple parameters.', function () {
		expect(new Route({
			name: 'route-name',
			url: '/foo/:id/bar/:tar'
		}).matches('/foo/1/bar/par')).toBe(true);
	});

	it('returns false when the URL partially mathes a route.', function () {
		expect(new Route({
			name: 'route-name',
			url: '/foo/bar'
		}).matches('/foo')).toBe(false);
	});

	it('returns false when a route only partially matches the URL.', function () {
		expect(new Route({
			name: 'route-name',
			url: '/foo/bar'
		}).matches('/foo/bar/tar')).toBe(false);
	});

	/* Parameters */

	it('returns an empty object from parameters when the route has no parameters.', function () {
		var route = new Route({
			name: 'test-route',
			url: '/foo/bar'
		});

		var parameters = route.parameters('/foo/bar');

		expect(typeof parameters).toBe('object');
		expect(Object.keys(parameters).length).toBe(0);
	});

	it('returns an object populated with a single field when the route has a single parameter.', function () {
		var route = new Route({
			name: 'test-route',
			url: '/foo/:id'
		});

		var parameters = route.parameters('/foo/bar');

		expect(typeof parameters).toBe('object');
		expect(Object.keys(parameters).length).toBe(1);
		expect(parameters.id).toBe('bar');
	});

	it('returns a property where the route parameter contains a - character.', function () {
		var route = new Route({
			name: 'test-route',
			url: '/foo/:id'
		});

		var parameters = route.parameters('/foo/bar-tar');

		expect(parameters.id).toBe('bar-tar');
	});

	it('returns a property where the route parameter contains a _ character.', function () {
		var route = new Route({
			name: 'test-route',
			url: '/foo/:id'
		});

		var parameters = route.parameters('/foo/bar_tar');

		expect(parameters.id).toBe('bar_tar');
	});

	it('returns an object populated with a multiple field when the route has multiple parameters.', function () {
		var route = new Route({
			name: 'test-route',
			url: '/foo/:id/bar/:name'
		});

		var parameters = route.parameters('/foo/1/bar/test');

		expect(typeof parameters).toBe('object');
		expect(Object.keys(parameters).length).toBe(2);
		expect(parameters.id).toBe('1');
		expect(parameters.name).toBe('test');
	});

	/* Component */

	it('sets the component to be the name of the route if no component is supplied.', function () {
		var route = new Route({ name: 'route', url: '/foo/bar' });

		expect(route.component).toBe('route');
	});

	it('sets the component to be the name of the route if component is null.', function () {
		var route = new Route({ name: 'route', url: '/foo/bar', component: null });

		expect(route.component).toBe('route');
	});

	it('sets the component to be the name of the route if component is whitespace.', function () {
		var route = new Route({ name: 'route', url: '/foo/bar', component: '   ' });

		expect(route.component).toBe('route');
	});

	it('sets the component property to the value of the component passed into the constructor', function () {
		var route = new Route({ name: 'route', url: '/foo/bar', component: 'routecomponent' });

		expect(route.component).toBe('routecomponent');
	});

	it('sets the component property to the value trimmed of whitespace of the component passed into the constructor', function () {
		var route = new Route({ name: 'route', url: '/foo/bar', component: '  routecomponent  ' });

		expect(route.component).toBe('routecomponent');
	});

	it('registers a knockout component with the route name when an object is passed in the component argument.', function () {
		var name = 'route';
		var route = new Route({
			name: name,
			url: '/foo/bar',
			component: {
				template: 'Hello',
				viewModel: {}
			}
		});

		expect(route.component).toBe(name);
		expect(ko.components.isRegistered(name)).toBe(true);
	});

	it('returns the url from format when there are no parameters required.', function () {
		var route = new Route({ name: 'default', url: '/' });

		expect(route.format()).toBe('/');
	});

	it('ignores any parameters passed to format when none are needed.', function () {
		var route = new Route({ name: 'default', url: '/dashboard' });

		expect(route.format({ id: 1 })).toBe('/dashboard');
	});

	it('replaces a parameter in the url when format is called.', function () {
		var route = new Route({ name: 'default', url: '/item/:id' });

		expect(route.format({ id: 3 })).toBe('/item/3');
	});

	it('replaces multiple parameters in the url when format is called.', function () {
		var route = new Route({ name: 'default', url: '/parent/:parent/child/:child' });

		expect(route.format({ parent: 3, child: 'foo' })).toBe('/parent/3/child/foo');
	});

	it('returns null when no parameters are supplied to format when the route requires them.', function () {
		var route = new Route({ name: 'default', url: '/item/:id' });

		expect(route.format()).toBe(null);
	});

	it('returns null when an expected parameter is not present.', function () {
		var route = new Route({ name: 'default', url: '/parent/:parent/child/:child' });

		expect(route.format({ parent: 3 })).toBe(null);
	});

	it('unwraps a knockout object when formatting a URL.', function () {
		var route = new Route({ name: 'default', url: '/item/:id' });

		expect(route.format({ id: ko.observable(3) })).toBe('/item/3');
	});
});


text:
<!DOCTYPE html>

	<title></title>

Funciones


text:
import { Injectable } from '@nestjs/common';
import { InjectModel } from '@nestjs/mongoose';
import { Model } from 'mongoose';
import { CreateCatDto } from './dto/create-cat.dto';
import { Cat } from './interfaces/cat.interface';

@Injectable()
export class CatsService {
  constructor(@InjectModel('Cat') private readonly catModel: Model<Cat>) {}

  async create(createCatDto: CreateCatDto): Promise<Cat> {
    const cat = new this.catModel(createCatDto);
    return cat.save();
  }

  async findAll(): Promise<Cat[]> {
    return this.catModel.find().exec();
  }
}


text:
package cloudformation

import (
	"encoding/json"
	"errors"
	"fmt"
)

// AWSElasticBeanstalkApplication AWS CloudFormation Resource (AWS::ElasticBeanstalk::Application)
// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-beanstalk.html
type AWSElasticBeanstalkApplication struct {

	// ApplicationName AWS CloudFormation Property
	// Required: false
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-beanstalk.html#cfn-elasticbeanstalk-application-name
	ApplicationName string `json:"ApplicationName,omitempty"`

	// Description AWS CloudFormation Property
	// Required: false
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-beanstalk.html#cfn-elasticbeanstalk-application-description
	Description string `json:"Description,omitempty"`
}

// AWSCloudFormationType returns the AWS CloudFormation resource type
func (r *AWSElasticBeanstalkApplication) AWSCloudFormationType() string {
	return "AWS::ElasticBeanstalk::Application"
}

// MarshalJSON is a custom JSON marshalling hook that embeds this object into
// an AWS CloudFormation JSON resource's 'Properties' field and adds a 'Type'.
func (r *AWSElasticBeanstalkApplication) MarshalJSON() ([]byte, error) {
	type Properties AWSElasticBeanstalkApplication
	return json.Marshal(&struct {
		Type       string
		Properties Properties
	}{
		Type:       r.AWSCloudFormationType(),
		Properties: (Properties)(*r),
	})
}

// UnmarshalJSON is a custom JSON unmarshalling hook that strips the outer
// AWS CloudFormation resource object, and just keeps the 'Properties' field.
func (r *AWSElasticBeanstalkApplication) UnmarshalJSON(b []byte) error {
	type Properties AWSElasticBeanstalkApplication
	res := &struct {
		Type       string
		Properties *Properties
	}{}
	if err := json.Unmarshal(b, &res); err != nil {
		fmt.Printf("ERROR: %s\n", err)
		return err
	}

	// If the resource has no Properties set, it could be nil
	if res.Properties != nil {
		*r = AWSElasticBeanstalkApplication(*res.Properties)
	}

	return nil
}

// GetAllAWSElasticBeanstalkApplicationResources retrieves all AWSElasticBeanstalkApplication items from an AWS CloudFormation template
func (t *Template) GetAllAWSElasticBeanstalkApplicationResources() map[string]AWSElasticBeanstalkApplication {
	results := map[string]AWSElasticBeanstalkApplication{}
	for name, untyped := range t.Resources {
		switch resource := untyped.(type) {
		case AWSElasticBeanstalkApplication:
			// We found a strongly typed resource of the correct type; use it
			results[name] = resource
		case map[string]interface{}:
			// We found an untyped resource (likely from JSON) which *might* be
			// the correct type, but we need to check it's 'Type' field
			if resType, ok := resource["Type"]; ok {
				if resType == "AWS::ElasticBeanstalk::Application" {
					// The resource is correct, unmarshal it into the results
					if b, err := json.Marshal(resource); err == nil {
						var result AWSElasticBeanstalkApplication
						if err := json.Unmarshal(b, &result); err == nil {
							results[name] = result
						}
					}
				}
			}
		}
	}
	return results
}

// GetAWSElasticBeanstalkApplicationWithName retrieves all AWSElasticBeanstalkApplication items from an AWS CloudFormation template
// whose logical ID matches the provided name. Returns an error if not found.
func (t *Template) GetAWSElasticBeanstalkApplicationWithName(name string) (AWSElasticBeanstalkApplication, error) {
	if untyped, ok := t.Resources[name]; ok {
		switch resource := untyped.(type) {
		case AWSElasticBeanstalkApplication:
			// We found a strongly typed resource of the correct type; use it
			return resource, nil
		case map[string]interface{}:
			// We found an untyped resource (likely from JSON) which *might* be
			// the correct type, but we need to check it's 'Type' field
			if resType, ok := resource["Type"]; ok {
				if resType == "AWS::ElasticBeanstalk::Application" {
					// The resource is correct, unmarshal it into the results
					if b, err := json.Marshal(resource); err == nil {
						var result AWSElasticBeanstalkApplication
						if err := json.Unmarshal(b, &result); err == nil {
							return result, nil
						}
					}
				}
			}
		}
	}
	return AWSElasticBeanstalkApplication{}, errors.New("resource not found")
}


text:
- Added support for multiple databases to `target_version`

## 1.4.0 (2022-10-31)

- Added check for `add_exclusion_constraint`
- Added support for `RACK_ENV`
- Fixed error when `Rails` defined without `Rails.env`
- Fixed error with `change_column_null` when table does not exist

## 1.3.2 (2022-10-09)

- Improved error message for `add_column` with `default: nil` with Postgres 10

## 1.3.1 (2022-09-21)

- Fixed check for `add_column` with `default: nil` with Postgres 10

## 1.3.0 (2022-08-30)

- Added check for `add_column` with `uuid` type and volatile default value

## 1.2.0 (2022-06-10)

- Added check for index corruption with Postgres 14.0 to 14.3

## 1.1.0 (2022-06-08)

- Added check for `force` option with `create_join_table`
- Improved errors for extra arguments
- Fixed ignoring extra arguments with `safe_by_default`
- Fixed missing options with `remove_index` and `safe_by_default`

## 1.0.0 (2022-03-21)

New safe operations with MySQL and MariaDB

- Setting `NOT NULL` on an existing column with strict mode enabled

New safe operations with Postgres

- Changing between `text` and `citext` when not indexed
- Changing a `string` column to a `citext` column when not indexed
- Changing a `citext` column to a `string` column with no `:limit` when not indexed
- Changing a `cidr` column to an `inet` column
- Increasing `:precision` of an `interval` or `time` column

New unsafe operations with Postgres

- Adding a column with a callable default value
- Decreasing `:precision` of a `datetime` column
- Decreasing `:limit` of a `timestamptz` column
- Passing a default value to `change_column_null`

Other

- Added experimental support for lock timeout retries
- Added `target_sql_mode` option
- Added error for `change_column_null` with default value with `safe_by_default` option
- Fixed instructions for `remove_columns` with options
- Dropped support for Postgres < 10, MySQL < 5.7, and MariaDB < 10.2

## 0.8.0 (2022-02-09)

- Fixed error with versioned schema with Active Record 7.0.2+
- Dropped support for Ruby < 2.6 and Active Record < 5.2

## 0.7.9 (2021-12-15)

- Fixed error with multiple databases with Active Record 7

## 0.7.8 (2021-08-03)

- Fixed issue with `add_reference ..., foreign_key: {to_table: ...}` with `safe_by_default`

## 0.7.7 (2021-06-07)

- Removed timeouts and `auto_analyze` from schema load

## 0.7.6 (2021-01-17)

- Fixed `NOT NULL` constraint check for quoted columns
- Fixed deprecation warning with Active Record 6.1

## 0.7.5 (2021-01-12)

- Added checks for `add_check_constraint` and `validate_check_constraint`

## 0.7.4 (2020-12-16)

- Added `safe_by_default` option to install generator
- Fixed warnings with Active Record 6.1

## 0.7.3 (2020-11-24)

- Added `safe_by_default` option

## 0.7.2 (2020-10-25)

- Added support for float timeouts

## 0.7.1 (2020-07-27)

- Added `target_version` option to replace database-specific options

## 0.7.0 (2020-07-22)

- Added `check_down` option
- Added check for `change_column` with `null: false`
- Added check for `validate_foreign_key`
- Improved error messages
- Made auto analyze less verbose in Postgres
- Decreasing the length limit of a `varchar` column or adding a limit is not safe in Postgres
- Removed safety checks for `db` rake tasks (Rails 5+ handles this)

## 0.6.8 (2020-05-13)

- `change_column_null` on a column with a `NOT NULL` constraint is safe in Postgres 12+

## 0.6.7 (2020-05-13)

- Improved comments in initializer
- Fixed string timeouts for Postgres

## 0.6.6 (2020-05-08)

- Added warnings for missing and long lock timeouts
- Added install generator

## 0.6.5 (2020-05-06)

- Fixed deprecation warnings with Ruby 2.7

## 0.6.4 (2020-04-16)

- Added check for `add_reference` with `foreign_key: true`

## 0.6.3 (2020-04-04)

- Increasing precision of `decimal` or `numeric` column is safe in Postgres 9.2+
- Making `decimal` or `numeric` column unconstrained is safe in Postgres 9.2+
- Changing between `timestamp` and `timestamptz` when session time zone is UTC in Postgres 12+
- Increasing the length of a `varchar` column from under 255 up to 255 in MySQL and MariaDB
- Increasing the length of a `varchar` column over 255 in MySQL and MariaDB

## 0.6.2 (2020-02-03)

- Fixed PostgreSQL version check

## 0.6.1 (2020-01-28)

- Fixed timeouts for PostgreSQL

## 0.6.0 (2020-01-24)

- Added `statement_timeout` and `lock_timeout`
- Adding a column with a non-null default value is safe in MySQL 8.0.12+ and MariaDB 10.3.2+
- Added `change_column_null` check for MySQL and MariaDB
- Added `auto_analyze` for MySQL and MariaDB
- Added `target_mysql_version` and `target_mariadb_version`
- Switched to `up` for backfilling

## 0.5.1 (2019-12-17)

- Fixed migration name in error messages

## 0.5.0 (2019-12-05)

- Added ability to disable checks
- Added Postgres-specific check for `change_column_null`
- Added optional remove index check

## 0.4.2 (2019-10-27)

- Allow `add_reference` with concurrent indexes

## 0.4.1 (2019-07-12)

- Added `target_postgresql_version`
- Added `unscoped` to backfill instructions

## 0.4.0 (2019-05-27)

- Added check for `add_foreign_key`
- Fixed instructions for adding default value with NOT NULL constraint
- Removed support for Rails 4.2

## 0.3.1 (2018-10-18)

- Fixed error with `remove_column` and `type` argument
- Improved message customization

## 0.3.0 (2018-10-15)

- Added support for custom checks
- Adding a column with a non-null default value is safe in Postgres 11+
- Added checks for `add_belongs_to`, `remove_belongs_to`, `remove_columns`, and `remove_reference`
- Customized messages

## 0.2.3 (2018-07-22)

- Added check for `change_column_null`
- Added support for alphabetize columns with Makara
- Fixed migration reversibility with `auto_analyze`

## 0.2.2 (2018-02-14)

- Friendlier output
- Better method of hooking into ActiveRecord

## 0.2.1 (2018-02-07)

- Recommend `disable_ddl_transaction!` over `commit_db_transaction`
- Suggest `jsonb` over `json` in Postgres 9.4+
- Changing `varchar` to `text` is safe in Postgres 9.1+
- Do not check number of columns for unique indexes

## 0.2.0 (2018-01-07)

- Added customizable error messages
- Updated instructions for adding a column with a default value

## 0.1.9 (2017-06-14)

- Added `start_after` option

## 0.1.8 (2017-05-31)

- Fixed error with `create_table`
- Added check for executing arbitrary SQL

## 0.1.7 (2017-05-29)

- Added check for `force` option with `create_table`
- Added `auto_analyze` option

## 0.1.6 (2017-03-23)

- Adding an index to a newly created table is now safe

## 0.1.5 (2016-07-23)

- Fixed error with Ruby 2.3 frozen strings

## 0.1.4 (2016-03-22)

- Added alphabetize columns

## 0.1.3 (2016-03-12)

- Disabled dangerous rake tasks in production
- Added ability to use `SAFETY_ASSURED` env var

## 0.1.2 (2016-02-24)

- Skip checks on down migrations and rollbacks
- Added check for indexes with more than 3 columns

## 0.1.1 (2015-11-29)

- Fixed `add_index` check for MySQL

## 0.1.0 (2015-11-22)

- First release