text:
ActiveRecord::Schema.define(:version => 20101222210343) do

  create_table "addresses", :force => true do |t|
    t.integer  "provider_account_id"
    t.string   "name"
    t.string   "public_ip"
    t.string   "instance_id"
    t.datetime "created_at"
    t.datetime "updated_at"
    t.string   "state"
    t.boolean  "is_enabled",          :default => true
  end

  add_index "addresses", ["name"], :name => "index_addresses_on_name"
  add_index "addresses", ["public_ip"], :name => "index_addresses_on_public_ip"

  create_table "audit_logs", :force => true do |t|
    t.string   "provider_account_name"
    t.integer  "provider_account_id"
    t.string   "cluster_name"
    t.integer  "cluster_id"
    t.integer  "auditable_id"
    t.string   "auditable_type"
    t.string   "auditable_name"
    t.string   "author_login"
    t.integer  "author_id"
    t.string   "summary"
    t.text     "changes"
    t.datetime "created_at"
    t.datetime "updated_at"
    t.string   "server_name"
    t.integer  "server_id"
  end

  add_index "audit_logs", ["auditable_id", "auditable_type"], :name => "index_audit_logs_on_auditable_id_and_auditable_type"
  add_index "audit_logs", ["auditable_name"], :name => "index_audit_logs_on_auditable_name"
  add_index "audit_logs", ["author_id"], :name => "index_audit_logs_on_author_id"
  add_index "audit_logs", ["author_login"], :name => "index_audit_logs_on_author_login"
  add_index "audit_logs", ["cluster_id"], :name => "index_audit_logs_on_cluster_id"
  add_index "audit_logs", ["cluster_name"], :name => "index_audit_logs_on_cluster_name"
  add_index "audit_logs", ["provider_account_id"], :name => "index_audit_logs_on_provider_account_id"
  add_index "audit_logs", ["provider_account_name"], :name => "index_audit_logs_on_provider_account_name"
  add_index "audit_logs", ["server_id"], :name => "index_audit_logs_on_server_id"
  add_index "audit_logs", ["server_name"], :name => "index_audit_logs_on_server_name"
  add_index "audit_logs", ["summary"], :name => "index_audit_logs_on_summary"

  create_table "auto_scaling_groups", :force => true do |t|
    t.integer  "launch_configuration_id"
    t.integer  "provider_account_id"
    t.string   "name",                    :limit => 256,                         :null => false
    t.integer  "min_size"
    t.integer  "max_size"
    t.integer  "desired_capacity"
    t.integer  "cooldown"
    t.datetime "created_at"
    t.datetime "updated_at"
    t.string   "state",                                  :default => "disabled"
  end

  add_index "auto_scaling_groups", ["launch_configuration_id"], :name => "index_lc_id_on_asg"
  add_index "auto_scaling_groups", ["provider_account_id"], :name => "index_pa_id_on_asg"

  create_table "auto_scaling_groups_instances", :id => false, :force => true do |t|
    t.integer "auto_scaling_group_id"
    t.integer "i_id"
  end

  add_index "auto_scaling_groups_instances", ["auto_scaling_group_id"], :name => "index_asg_id_on_asgi"
  add_index "auto_scaling_groups_instances", ["i_id"], :name => "index_i_id_on_asgi"

  create_table "auto_scaling_groups_load_balancers", :id => false, :force => true do |t|
    t.integer "auto_scaling_group_id"
    t.integer "load_balancer_id"
  end

  add_index "auto_scaling_groups_load_balancers", ["auto_scaling_group_id"], :name => "asglb_asg_id_index"
  add_index "auto_scaling_groups_load_balancers", ["load_balancer_id"], :name => "asglb_lb_id_index"

  create_table "auto_scaling_groups_zones", :id => false, :force => true do |t|
    t.integer "auto_scaling_group_id"
    t.integer "zone_id"
  end

  add_index "auto_scaling_groups_zones", ["auto_scaling_group_id"], :name => "asgaz_asg_id_index"
  add_index "auto_scaling_groups_zones", ["zone_id"], :name => "asgaz_az_id_index"

  create_table "auto_scaling_triggers", :force => true do |t|
    t.integer  "auto_scaling_group_id"
    t.integer  "provider_account_id"
    t.string   "name",                         :limit => 64,                               :null => false
    t.integer  "period"
    t.string   "lower_threshold"
    t.string   "upper_threshold"
    t.integer  "breach_duration"
    t.datetime "created_at"
    t.datetime "updated_at"
    t.string   "lower_breach_scale_increment"
    t.string   "upper_breach_scale_increment"
    t.string   "state",                                      :default => "disabled"
    t.string   "measure_name",                               :default => "CPUUtilization"
    t.string   "statistic",                                  :default => "Average"
    t.string   "unit"
  end

  add_index "auto_scaling_triggers", ["auto_scaling_group_id"], :name => "index_asg_id_on_asgt"
  add_index "auto_scaling_triggers", ["provider_account_id"], :name => "index_pa_id_on_asgt"

  create_table "block_device_mappings", :force => true do |t|
    t.integer  "launch_configuration_id"
    t.string   "virtual_name"
    t.string   "device_name"
    t.datetime "created_at"
    t.datetime "updated_at"
  end

  add_index "block_device_mappings", ["launch_configuration_id"], :name => "index_block_device_mappings_on_launch_configuration_id"

  create_table "cloud_resources", :force => true do |t|
    t.string   "type"
    t.integer  "provider_account_id"
    t.integer  "zone_id"
    t.string   "cloud_id"
    t.string   "name"
    t.string   "state",                    :default => "unknown"
    t.datetime "create_time"
    t.datetime "update_time"
    t.integer  "size"
    t.string   "parent_cloud_id"
    t.boolean  "is_enabled",               :default => true
    t.text     "meta_data"
    t.datetime "created_at"
    t.datetime "updated_at"
    t.string   "owner_id"
    t.string   "description"
    t.integer  "server_resources_count",   :default => 0
    t.integer  "instance_resources_count", :default => 0
    t.string   "progress"
    t.string   "attachment_state"
    t.string   "attach_time"
    t.datetime "start_time"
    t.integer  "instance_id"
    t.string   "cloud_instance_id"
  end

  add_index "cloud_resources", ["description"], :name => "index_cloud_resources_on_description"
  add_index "cloud_resources", ["owner_id"], :name => "index_cloud_resources_on_owner_id"
  add_index "cloud_resources", ["provider_account_id", "cloud_id"], :name => "index_cloud_resources_on_provider_account_id_and_cloud_id", :unique => true
  add_index "cloud_resources", ["provider_account_id", "cloud_instance_id"], :name => "index_crs_on_paid_and_ciid"
  add_index "cloud_resources", ["provider_account_id", "instance_id"], :name => "index_cloud_resources_on_provider_account_id_and_instance_id"
  add_index "cloud_resources", ["provider_account_id", "parent_cloud_id"], :name => "index_cloud_resources_on_provider_account_id_and_parent_cloud_id"
  add_index "cloud_resources", ["provider_account_id", "type"], :name => "index_cloud_resources_on_provider_account_id_and_type"
  add_index "cloud_resources", ["zone_id"], :name => "index_cloud_resources_on_zone_id"

  create_table "cloud_resources_clusters", :id => false, :force => true do |t|
    t.integer "cloud_resource_id"
    t.integer "cluster_id"
  end

  add_index "cloud_resources_clusters", ["cloud_resource_id"], :name => "index_cloud_resources_clusters_on_cloud_resource_id"
  add_index "cloud_resources_clusters", ["cluster_id"], :name => "index_cloud_resources_clusters_on_cluster_id"

  create_table "cluster_parameters", :force => true do |t|
    t.integer  "cluster_id"
    t.integer  "position"
    t.string   "type"
    t.string   "name"
    t.text     "value"
    t.boolean  "is_protected", :default => false
    t.datetime "created_at"
    t.datetime "updated_at"
    t.boolean  "is_readonly",  :default => false
  end

  create_table "clusters", :force => true do |t|
    t.string   "name"
    t.string   "description"
    t.text     "startup_script"
    t.datetime "created_at"
    t.datetime "updated_at"
    t.integer  "provider_account_id"
    t.integer  "servers_count",       :default => 0
    t.string   "state",               :default => "active"
  end

  add_index "clusters", ["provider_account_id"], :name => "index_clusters_on_provider_account_id"
  add_index "clusters", ["state"], :name => "index_clusters_on_state"

  create_table "clusters_users", :id => false, :force => true do |t|
    t.integer "cluster_id"
    t.integer "user_id"
  end

  add_index "clusters_users", ["cluster_id"], :name => "index_clusters_users_on_cluster_id"
  add_index "clusters_users", ["user_id"], :name => "index_clusters_users_on_user_id"

  create_table "dns_hostname_assignments", :force => true do |t|
    t.integer  "dns_hostname_id", :null => false
    t.integer  "server_id",       :null => false
    t.datetime "created_at"
    t.datetime "updated_at"
  end

  add_index "dns_hostname_assignments", ["dns_hostname_id"], :name => "unique_dns_hostname_id_idx", :unique => true
  add_index "dns_hostname_assignments", ["server_id"], :name => "index_dns_hostname_assignments_on_server_id"

  create_table "dns_hostnames", :force => true do |t|
    t.string   "name",                :limit => 64, :null => false
    t.datetime "created_at"
    t.datetime "updated_at"
    t.integer  "provider_account_id",               :null => false
  end

  add_index "dns_hostnames", ["name"], :name => "index_dns_hostnames_on_name"
  add_index "dns_hostnames", ["provider_account_id", "name"], :name => "unique_provider_account_hostname", :unique => true

  create_table "dns_leases", :force => true do |t|
    t.integer  "dns_hostname_assignment_id",                :null => false
    t.integer  "instance_id"
    t.integer  "idx",                        :default => 0, :null => false
    t.datetime "created_at"
    t.datetime "updated_at"
  end

  add_index "dns_leases", ["dns_hostname_assignment_id", "idx"], :name => "index_dns_leases_on_dns_hostname_assignment_id_and_idx"
  add_index "dns_leases", ["instance_id", "dns_hostname_assignment_id"], :name => "unique_instance_hostname_assignment_idx", :unique => true

  create_table "dns_requests", :force => true do |t|
    t.enum     "request_type",               :limit => [:release, :acquire], :default => :acquire, :null => false
    t.integer  "dns_hostname_assignment_id",                                                       :null => false
    t.integer  "instance_id",                                                                      :null => false
    t.datetime "created_at"
    t.datetime "updated_at"
  end

  add_index "dns_requests", ["dns_hostname_assignment_id", "request_type", "instance_id"], :name => "hostname_assignment_request_instance_idx"
  add_index "dns_requests", ["instance_id"], :name => "index_dns_requests_on_instance_id"
  add_index "dns_requests", ["request_type"], :name => "index_dns_requests_on_request_type"

  create_table "events", :force => true do |t|
    t.integer  "provider_account_id"
    t.string   "provider_account_name"
    t.integer  "security_group_id"
    t.string   "security_group_name"
    t.integer  "server_id"
    t.string   "server_name"
    t.integer  "user_id"
    t.string   "user_login"
    t.string   "subject"
    t.string   "action"
    t.string   "object"
    t.string   "description"
    t.datetime "created_at"
    t.datetime "updated_at"
  end

  add_index "events", ["action"], :name => "index_events_on_action"
  add_index "events", ["description"], :name => "index_events_on_description"
  add_index "events", ["object"], :name => "index_events_on_object"
  add_index "events", ["provider_account_id"], :name => "index_events_on_provider_account_id"
  add_index "events", ["provider_account_name"], :name => "index_events_on_provider_account_name"
  add_index "events", ["security_group_id"], :name => "index_events_on_security_group_id"
  add_index "events", ["security_group_name"], :name => "index_events_on_security_group_name"
  add_index "events", ["server_id"], :name => "index_events_on_server_id"
  add_index "events", ["server_name"], :name => "index_events_on_server_name"
  add_index "events", ["subject"], :name => "index_events_on_subject"
  add_index "events", ["user_id"], :name => "index_events_on_user_id"
  add_index "events", ["user_login"], :name => "index_events_on_user_login"

  create_table "firewall_rules", :force => true do |t|
    t.integer  "provider_account_id"
    t.string   "name"
    t.string   "type"
    t.string   "protocol"
    t.string   "from_port"
    t.string   "to_port"
    t.string   "ip_range"
    t.datetime "created_at"
    t.datetime "updated_at"
    t.string   "group_user_id"
    t.string   "group_name"
    t.boolean  "is_enabled",          :default => true
  end

  add_index "firewall_rules", ["name"], :name => "index_firewall_rules_on_name"
  add_index "firewall_rules", ["provider_account_id"], :name => "index_firewall_rules_on_provider_account_id"

  create_table "firewall_rules_security_groups", :id => false, :force => true do |t|
    t.integer "firewall_rule_id"
    t.integer "security_group_id"
  end

  add_index "firewall_rules_security_groups", ["firewall_rule_id"], :name => "index_firewall_rules_security_groups_on_firewall_rule_id"
  add_index "firewall_rules_security_groups", ["security_group_id"], :name => "index_firewall_rules_security_groups_on_security_group_id"

  create_table "four_oh_fours", :force => true do |t|
    t.string   "url"
    t.string   "referer"
    t.integer  "count",      :default => 0
    t.datetime "created_at"
    t.datetime "updated_at"
  end

  add_index "four_oh_fours", ["url", "referer"], :name => "index_four_oh_fours_on_url_and_referer", :unique => true
  add_index "four_oh_fours", ["url"], :name => "index_four_oh_fours_on_url"

  create_table "iam_conditions", :force => true do |t|
    t.integer  "iam_statement_id"
    t.string   "type"
    t.string   "operator"
    t.string   "name"
    t.string   "value"
    t.datetime "created_at"
    t.datetime "updated_at"
  end

  add_index "iam_conditions", ["iam_statement_id", "name"], :name => "index_iam_conditions_on_iam_statement_id_and_name"
  add_index "iam_conditions", ["iam_statement_id", "type"], :name => "index_iam_conditions_on_iam_statement_id_and_type"

  create_table "iam_policies", :force => true do |t|
    t.integer  "provider_account_id"
    t.string   "name"
    t.text     "description"
    t.string   "cloud_id"
    t.string   "version"
    t.datetime "created_at"
    t.datetime "updated_at"
  end

  add_index "iam_policies", ["provider_account_id", "cloud_id"], :name => "index_iam_policies_on_provider_account_id_and_cloud_id", :unique => true
  add_index "iam_policies", ["provider_account_id", "name"], :name => "index_iam_policies_on_provider_account_id_and_name", :unique => true

  create_table "iam_resources", :force => true do |t|
    t.integer  "provider_account_id"
    t.string   "cloud_id"
    t.string   "name"
    t.string   "type"
    t.string   "resource_path"
    t.datetime "created_at"
    t.datetime "updated_at"
  end

  add_index "iam_resources", ["provider_account_id", "cloud_id"], :name => "index_iam_resources_on_provider_account_id_and_cloud_id", :unique => true
  add_index "iam_resources", ["provider_account_id", "name"], :name => "index_iam_resources_on_provider_account_id_and_name", :unique => true
  add_index "iam_resources", ["provider_account_id", "resource_path"], :name => "index_iam_resources_on_provider_account_id_and_resource_path", :unique => true
  add_index "iam_resources", ["provider_account_id", "type"], :name => "index_iam_resources_on_provider_account_id_and_type"

  create_table "iam_statements", :force => true do |t|
    t.integer  "iam_policy_id"
    t.string   "sid"
    t.string   "effect"
    t.string   "action"
    t.string   "not_action"
    t.string   "resource"
    t.string   "not_resource"
    t.datetime "created_at"
    t.datetime "updated_at"
  end

  add_index "iam_statements", ["iam_policy_id", "sid"], :name => "index_iam_statements_on_iam_policy_id_and_sid", :unique => true

  create_table "instance_allocation_records", :force => true do |t|
    t.integer  "stat_record_id"
    t.integer  "cluster_id"
    t.string   "cluster_name",   :default => "Default"
    t.integer  "server_id"
    t.string   "server_name",    :default => "Default"
    t.string   "instance_type"
    t.integer  "running"
    t.datetime "created_at"
    t.datetime "updated_at"
    t.integer  "zone_id"
  end

  add_index "instance_allocation_records", ["stat_record_id"], :name => "index_iars_on_srids"
  add_index "instance_allocation_records", ["zone_id"], :name => "index_instance_allocation_records_on_zone_id"

  create_table "instance_kind_categories", :force => true do |t|
    t.integer  "provider_id"
    t.string   "name"
    t.text     "description"
    t.integer  "position"
    t.datetime "created_at"
    t.datetime "updated_at"
  end

  create_table "instance_kinds", :force => true do |t|
    t.integer  "instance_kind_category_id"
    t.string   "code_name"
    t.string   "name"
    t.text     "description"
    t.boolean  "is_default"
    t.integer  "position"
    t.datetime "created_at"
    t.datetime "updated_at"
    t.integer  "ram_mb",                    :default => 0
    t.integer  "cpu_cores",                 :default => 0
    t.integer  "cpu_units",                 :default => 0
    t.integer  "storage_gb",                :default => 0
    t.string   "io_performance"
    t.integer  "platform_bit",              :default => 32
  end

  create_table "instance_list_readers", :force => true do |t|
    t.integer  "provider_account_id"
    t.string   "type"
    t.string   "name"
    t.string   "email"
    t.string   "s3_user_id"
    t.string   "permission"
    t.boolean  "is_owner"
    t.boolean  "is_enabled"
    t.datetime "created_at"
    t.datetime "updated_at"
  end

  add_index "instance_list_readers", ["provider_account_id"], :name => "index_instance_list_readers_on_provider_account_id"
  add_index "instance_list_readers", ["s3_user_id"], :name => "index_instance_list_readers_on_s3_user_id"

  create_table "instance_resources", :force => true do |t|
    t.string   "type"
    t.integer  "instance_id"
    t.integer  "cloud_resource_id"
    t.string   "state"
    t.text     "state_description"
    t.boolean  "force_allocation"
    t.string   "params"
    t.datetime "created_at"
    t.datetime "updated_at"
    t.string   "mount_point"
    t.string   "mount_type"
  end

  add_index "instance_resources", ["cloud_resource_id"], :name => "index_instance_resources_on_cloud_resource_id"
  add_index "instance_resources", ["instance_id", "type"], :name => "index_instance_resources_on_instance_id_and_type"

  create_table "instance_type_categories", :force => true do |t|
    t.integer  "provider_id"
    t.string   "name"
    t.text     "description"
    t.integer  "position"
    t.datetime "created_at"
    t.datetime "updated_at"
  end

  create_table "instances", :force => true do |t|
    t.string   "instance_id"
    t.integer  "provider_account_id"
    t.integer  "server_id"
    t.integer  "server_pool_id"
    t.string   "image_id"
    t.string   "instance_type"
    t.string   "key_name"
    t.string   "state"
    t.string   "public_dns"
    t.string   "private_dns"
    t.datetime "launch_time"
    t.string   "ramdisk_id"
    t.string   "kernel_id"
    t.string   "reason"
    t.string   "product_codes"
    t.integer  "index"
    t.datetime "created_at"
    t.datetime "updated_at"
    t.string   "volume_name"
    t.string   "dns_name"
    t.string   "public_ip"
    t.string   "server_name"
    t.boolean  "is_locked"
    t.string   "device",                          :default => "/dev/sdh"
    t.string   "pending_volume_id"
    t.boolean  "force_volume_id_allocation"
    t.string   "pending_public_ip"
    t.boolean  "force_public_ip_allocation"
    t.boolean  "is_ready",                        :default => false
    t.integer  "cluster_id"
    t.string   "private_ip"
    t.integer  "bootstrap_attempt",               :default => 0
    t.boolean  "has_key",                         :default => false
    t.text     "status_message"
    t.integer  "user_id"
    t.boolean  "dns_active",                      :default => true
    t.integer  "zone_id"
    t.integer  "pending_launch_configuration_id"
    t.integer  "auto_scaling_group_id"
  end

  add_index "instances", ["auto_scaling_group_id"], :name => "index_instances_on_auto_scaling_group_id"
  add_index "instances", ["cluster_id"], :name => "index_instances_on_cluster_id"
  add_index "instances", ["dns_name"], :name => "index_instances_on_dns_name"
  add_index "instances", ["instance_id"], :name => "index_instances_on_instance_id"
  add_index "instances", ["key_name"], :name => "index_instances_on_key_name"
  add_index "instances", ["provider_account_id"], :name => "index_instances_on_provider_account_id"
  add_index "instances", ["public_ip"], :name => "index_instances_on_public_ip"
  add_index "instances", ["server_id"], :name => "index_instances_on_server_id"
  add_index "instances", ["server_name"], :name => "index_instances_on_server_name"
  add_index "instances", ["state"], :name => "index_instances_on_state"
  add_index "instances", ["volume_name"], :name => "index_instances_on_volume_name"
  add_index "instances", ["zone_id"], :name => "index_instances_on_zone_id"

  create_table "instances_security_groups", :id => false, :force => true do |t|
    t.integer "instance_id"
    t.integer "security_group_id"
  end

  add_index "instances_security_groups", ["instance_id"], :name => "index_instances_security_groups_on_instance_id"
  add_index "instances_security_groups", ["security_group_id"], :name => "index_instances_security_groups_on_security_group_id"

  create_table "invitations", :force => true do |t|
    t.integer  "sender_id"
    t.string   "email"
    t.string   "token"
    t.datetime "sent_at"
    t.datetime "created_at"
    t.datetime "updated_at"
  end

  add_index "invitations", ["token"], :name => "index_invitations_on_token", :unique => true

  create_table "key_pairs", :force => true do |t|
    t.integer  "provider_account_id"
    t.string   "name"
    t.string   "fingerprint"
    t.text     "private_key"
    t.text     "public_key"
    t.datetime "created_at"
    t.datetime "updated_at"
    t.string   "state"
  end

  add_index "key_pairs", ["name"], :name => "index_key_pairs_on_name"
  add_index "key_pairs", ["provider_account_id", "name"], :name => "index_key_pairs_on_provider_account_id_and_name", :unique => true

  create_table "launch_configurations", :force => true do |t|
    t.integer  "provider_account_id"
    t.integer  "server_id"
    t.string   "name"
    t.string   "launch_configuration_name"
    t.string   "description"
    t.string   "instance_type"
    t.string   "image_id"
    t.string   "ramdisk_id"
    t.string   "kernel_id"
    t.string   "key_name"
    t.text     "user_data"
    t.datetime "created_time"
    t.datetime "created_at"
    t.datetime "updated_at"
    t.enum     "state",                      :limit => [:disabled, :active], :default => :disabled
    t.integer  "server_profile_revision_id"
    t.integer  "server_image_id"
  end

  add_index "launch_configurations", ["image_id"], :name => "index_launch_configurations_on_image_id"
  add_index "launch_configurations", ["launch_configuration_name"], :name => "index_launch_configurations_on_launch_configuration_name"
  add_index "launch_configurations", ["name"], :name => "index_launch_configurations_on_name"
  add_index "launch_configurations", ["provider_account_id", "launch_configuration_name"], :name => "unique_provider_account_id_launch_configuration_name", :unique => true
  add_index "launch_configurations", ["provider_account_id"], :name => "index_launch_configurations_on_provider_account_id"
  add_index "launch_configurations", ["server_id"], :name => "index_launch_configurations_on_server_id"
  add_index "launch_configurations", ["server_image_id"], :name => "index_launch_configurations_on_server_image_id"

  create_table "launch_configurations_security_groups", :id => false, :force => true do |t|
    t.integer "launch_configuration_id"
    t.integer "security_group_id"
  end

  add_index "launch_configurations_security_groups", ["launch_configuration_id"], :name => "index_configurations_groups_on_configuration_id"
  add_index "launch_configurations_security_groups", ["security_group_id"], :name => "index_configurations_groups_on_group_id"

  create_table "load_balancer_listeners", :force => true do |t|
    t.integer  "load_balancer_id"
    t.integer  "load_balancer_port"
    t.integer  "instance_port"
    t.string   "protocol"
    t.datetime "created_at"
    t.datetime "updated_at"
  end

  add_index "load_balancer_listeners", ["load_balancer_id", "load_balancer_port", "instance_port", "protocol"], :name => "index_ports_on_listener", :unique => true

  create_table "load_balancers", :force => true do |t|
    t.integer  "provider_account_id"
    t.string   "load_balancer_name"
    t.datetime "created_time"
    t.string   "d_n_s_name"
    t.datetime "created_at"
    t.datetime "updated_at"
  end

  add_index "load_balancers", ["provider_account_id", "load_balancer_name"], :name => "index_on_load_balancers_pa_id_and_lb_name"

  create_table "load_balancers_zones", :id => false, :force => true do |t|
    t.integer "zone_id"
    t.integer "load_balancer_id"
  end

  add_index "load_balancers_zones", ["load_balancer_id"], :name => "index_lb_id_on_azslbs"
  add_index "load_balancers_zones", ["zone_id"], :name => "index_az_id_on_azslbs"

  create_table "logged_exceptions", :force => true do |t|
    t.string   "exception_class"
    t.string   "controller_name"
    t.string   "action_name"
    t.text     "message"
    t.text     "backtrace"
    t.text     "environment"
    t.text     "request"
    t.datetime "created_at"
  end

  create_table "messages", :force => true do |t|
    t.integer  "provider_account_id"
    t.string   "type"
    t.string   "message_id"
    t.string   "recipient"
    t.string   "sender"
    t.string   "handler"
    t.string   "state",               :default => "pending"
    t.datetime "sent_at"
    t.datetime "received_at"
    t.datetime "created_at"
    t.datetime "updated_at"
    t.string   "message"
    t.text     "data"
    t.string   "status",              :default => "ok"
    t.integer  "operation_id"
    t.integer  "flags"
  end

  add_index "messages", ["operation_id"], :name => "index_messages_on_operation_id"
  add_index "messages", ["provider_account_id", "state"], :name => "index_messages_on_provider_account_id_and_state"
  add_index "messages", ["provider_account_id", "status"], :name => "index_messages_on_provider_account_id_and_status"
  add_index "messages", ["provider_account_id", "type"], :name => "index_messages_on_provider_account_id_and_type"
  add_index "messages", ["type"], :name => "index_messages_on_type"

  create_table "open_id_authentication_associations", :force => true do |t|
    t.integer "issued"
    t.integer "lifetime"
    t.string  "handle"
    t.string  "assoc_type"
    t.binary  "server_url"
    t.binary  "secret"
  end

  create_table "open_id_authentication_nonces", :force => true do |t|
    t.integer "timestamp",  :null => false
    t.string  "server_url"
    t.string  "salt",       :null => false
  end

  create_table "operating_systems", :force => true do |t|
    t.integer  "provider_id"
    t.string   "name"
    t.string   "description"
    t.integer  "position"
    t.datetime "created_at"
    t.datetime "updated_at"
  end

  create_table "operation_logs", :force => true do |t|
    t.integer  "operation_id"
    t.string   "step_name"
    t.boolean  "is_success"
    t.string   "result_code"
    t.text     "result_message"
    t.datetime "created_at"
    t.datetime "updated_at"
  end

  create_table "operations", :force => true do |t|
    t.integer  "instance_id"
    t.string   "state",          :default => "proceed"
    t.string   "type"
    t.integer  "current_step",   :default => -1
    t.string   "name"
    t.text     "args"
    t.integer  "attempts",       :default => 0
    t.string   "result_code"
    t.text     "result_message"
    t.datetime "created_at"
    t.datetime "updated_at"
    t.datetime "timeout_at"
    t.string   "parameter"
    t.integer  "task_id"
  end

  add_index "operations", ["state"], :name => "index_operations_on_state"

  create_table "provider_account_parameters", :force => true do |t|
    t.integer  "provider_account_id"
    t.integer  "position"
    t.string   "name"
    t.text     "value"
    t.boolean  "is_protected"
    t.datetime "created_at"
    t.datetime "updated_at"
    t.boolean  "is_readonly",         :default => false
  end

  add_index "provider_account_parameters", ["name"], :name => "index_provider_account_parameters_on_name"
  add_index "provider_account_parameters", ["provider_account_id", "name"], :name => "index_account_parameters_on_account_id_and_name", :unique => true

  create_table "provider_accounts", :force => true do |t|
    t.string   "name"
    t.string   "description"
    t.string   "external_id"
    t.datetime "refresh_at"
    t.datetime "refreshed_at"
    t.datetime "created_at"
    t.datetime "updated_at"
    t.text     "startup_script"
    t.datetime "last_published"
    t.datetime "publish_at"
    t.integer  "publish_every",          :default => 60
    t.string   "s3_bucket"
    t.string   "s3_object"
    t.boolean  "is_publishing",          :default => true
    t.text     "static_dns_records"
    t.string   "account_id"
    t.boolean  "auto_lock_instances",    :default => false
    t.string   "default_security_group"
    t.string   "default_main_key"
    t.string   "type"
    t.integer  "provider_id"
    t.string   "messaging_uri",          :default => "",         :null => false
    t.string   "messaging_username",     :default => "",         :null => false
    t.string   "messaging_password",     :default => "",         :null => false
    t.string   "messaging_startup",      :default => "startup",  :null => false
    t.string   "messaging_shutdown",     :default => "shutdown", :null => false
    t.string   "messaging_info",         :default => "info",     :null => false
    t.string   "messaging_request",      :default => "request",  :null => false
    t.string   "messaging_control",      :default => "control",  :null => false
  end

  add_index "provider_accounts", ["id", "type"], :name => "index_provider_accounts_on_id_and_type"
  add_index "provider_accounts", ["provider_id"], :name => "index_provider_accounts_on_provider_id"

  create_table "provider_accounts_publishers", :id => false, :force => true do |t|
    t.integer "provider_account_id"
    t.integer "publisher_id"
  end

  add_index "provider_accounts_publishers", ["provider_account_id"], :name => "index_provider_accounts_publishers_on_provider_account_id"
  add_index "provider_accounts_publishers", ["publisher_id"], :name => "index_provider_accounts_publishers_on_publisher_id"

  create_table "provider_accounts_server_profiles", :id => false, :force => true do |t|
    t.integer "provider_account_id"
    t.integer "server_profile_id"
  end

  add_index "provider_accounts_server_profiles", ["provider_account_id"], :name => "index_provider_accounts_server_profiles_on_provider_account_id"
  add_index "provider_accounts_server_profiles", ["server_profile_id"], :name => "index_provider_accounts_server_profiles_on_server_profile_id"

  create_table "provider_accounts_users", :id => false, :force => true do |t|
    t.integer "provider_account_id"
    t.integer "user_id"
  end

  add_index "provider_accounts_users", ["provider_account_id"], :name => "index_provider_accounts_users_on_provider_account_id"
  add_index "provider_accounts_users", ["user_id"], :name => "index_provider_accounts_users_on_user_id"

  create_table "providers", :force => true do |t|
    t.string   "name"
    t.string   "long_name"
    t.text     "description"
    t.string   "main_documentation_url"
    t.string   "api_documentation_url"
    t.string   "endpoint_url"
    t.string   "state"
    t.string   "adapter_class"
    t.datetime "created_at"
    t.datetime "updated_at"
  end

  add_index "providers", ["name"], :name => "index_providers_on_name", :unique => true

  create_table "publisher_parameters", :force => true do |t|
    t.integer  "publisher_id"
    t.string   "name"
    t.string   "description"
    t.string   "value"
    t.string   "control_type"
    t.datetime "created_at"
    t.datetime "updated_at"
  end

  add_index "publisher_parameters", ["publisher_id"], :name => "index_publisher_parameters_on_publisher_id"

  create_table "publishers", :force => true do |t|
    t.string   "type"
    t.string   "description"
    t.datetime "last_published_at"
    t.datetime "next_publish_at"
    t.boolean  "is_enabled"
    t.string   "state"
    t.datetime "created_at"
    t.datetime "updated_at"
    t.integer  "provider_account_id"
    t.text     "state_text"
  end

  create_table "regions", :force => true do |t|
    t.integer  "provider_id"
    t.string   "name"
    t.text     "description"
    t.string   "endpoint_url"
    t.string   "state"
    t.text     "meta_data"
    t.datetime "created_at"
    t.datetime "updated_at"
    t.string   "short_name"
  end

  add_index "regions", ["name"], :name => "index_regions_on_name"
  add_index "regions", ["provider_id", "name"], :name => "index_regions_on_provider_id_and_name", :unique => true

  create_table "reserved_instances", :force => true do |t|
    t.integer  "provider_account_id"
    t.string   "reserved_instances_id"
    t.string   "instance_type"
    t.datetime "start"
    t.integer  "duration"
    t.float    "usage_price"
    t.float    "fixed_price"
    t.integer  "count"
    t.text     "description"
    t.string   "state"
    t.datetime "created_at"
    t.datetime "updated_at"
    t.integer  "zone_id"
  end

  add_index "reserved_instances", ["provider_account_id", "instance_type"], :name => "index_type_zone_on_reserved_instances"
  add_index "reserved_instances", ["provider_account_id", "reserved_instances_id"], :name => "index_ri_id_on_reserved_instances"
  add_index "reserved_instances", ["zone_id"], :name => "index_reserved_instances_on_zone_id"

  create_table "resource_bundles", :force => true do |t|
    t.string   "type"
    t.integer  "server_id"
    t.integer  "position"
    t.integer  "instance_id"
    t.string   "state"
    t.datetime "created_at"
    t.datetime "updated_at"
    t.integer  "zone_id"
    t.boolean  "is_default"
  end

  add_index "resource_bundles", ["instance_id"], :name => "index_resource_bundles_on_instance_id"
  add_index "resource_bundles", ["server_id"], :name => "index_resource_bundles_on_server_id"
  add_index "resource_bundles", ["type"], :name => "index_resource_bundles_on_type"
  add_index "resource_bundles", ["zone_id"], :name => "index_resource_bundles_on_zone_id"

  create_table "roles", :force => true do |t|
    t.string "name"
  end

  create_table "roles_users", :id => false, :force => true do |t|
    t.integer "role_id"
    t.integer "user_id"
  end

  add_index "roles_users", ["role_id"], :name => "index_roles_users_on_role_id"
  add_index "roles_users", ["user_id"], :name => "index_roles_users_on_user_id"

  create_table "security_groups", :force => true do |t|
    t.integer  "provider_account_id"
    t.string   "owner_id"
    t.string   "name"
    t.string   "description"
    t.datetime "created_at"
    t.datetime "updated_at"
    t.string   "state"
  end

  add_index "security_groups", ["name"], :name => "index_security_groups_on_name"
  add_index "security_groups", ["provider_account_id", "name"], :name => "index_security_groups_on_provider_account_id_and_name", :unique => true

  create_table "security_groups_servers", :id => false, :force => true do |t|
    t.integer "security_group_id"
    t.integer "server_id"
  end

  add_index "security_groups_servers", ["security_group_id"], :name => "index_security_groups_servers_on_security_group_id"
  add_index "security_groups_servers", ["server_id"], :name => "index_security_groups_servers_on_server_id"

  create_table "security_groups_users", :id => false, :force => true do |t|
    t.integer "security_group_id"
    t.integer "user_id"
  end

  add_index "security_groups_users", ["security_group_id"], :name => "index_security_groups_users_on_security_group_id"
  add_index "security_groups_users", ["user_id"], :name => "index_security_groups_users_on_user_id"

  create_table "server_images", :force => true do |t|
    t.string   "image_id"
    t.integer  "provider_account_id"
    t.string   "name"
    t.string   "type"
    t.string   "kernel_id"
    t.string   "ramdisk_id"
    t.string   "owner_id"
    t.boolean  "is_public"
    t.string   "state"
    t.string   "location"
    t.string   "architecture"
    t.string   "server_image_type"
    t.datetime "created_at"
    t.datetime "updated_at"
    t.boolean  "is_enabled",          :default => true
  end

  add_index "server_images", ["image_id"], :name => "index_server_images_on_image_id"
  add_index "server_images", ["name"], :name => "index_server_images_on_name"
  add_index "server_images", ["provider_account_id"], :name => "index_server_images_on_provider_account_id"

  create_table "server_parameters", :force => true do |t|
    t.integer  "server_id"
    t.integer  "position"
    t.string   "name"
    t.text     "value"
    t.boolean  "is_protected"
    t.datetime "created_at"
    t.datetime "updated_at"
    t.boolean  "is_readonly",  :default => false
  end

  add_index "server_parameters", ["server_id"], :name => "index_server_parameters_on_server_id"

  create_table "server_profile_revision_parameters", :force => true do |t|
    t.integer  "server_profile_revision_id"
    t.integer  "position"
    t.string   "type"
    t.string   "name"
    t.text     "value"
    t.boolean  "is_protected",               :default => false
    t.datetime "created_at"
    t.datetime "updated_at"
  end

  add_index "server_profile_revision_parameters", ["server_profile_revision_id"], :name => "index_sprp_spr_id"

  create_table "server_profile_revisions", :force => true do |t|
    t.integer  "server_profile_id"
    t.integer  "revision",          :default => 0
    t.integer  "creator_id"
    t.text     "commit_message"
    t.string   "image_id"
    t.string   "ramdisk_id"
    t.string   "kernel_id"
    t.text     "startup_script"
    t.datetime "created_at"
    t.datetime "updated_at"
    t.string   "instance_type",     :default => "m1.small"
  end

  create_table "server_profile_user_accesses", :force => true do |t|
    t.integer  "server_profile_id"
    t.integer  "user_id"
    t.string   "role",              :default => "reader"
    t.datetime "created_at"
    t.datetime "updated_at"
  end

  create_table "server_profiles", :force => true do |t|
    t.string   "name"
    t.text     "description"
    t.integer  "creator_id"
    t.datetime "created_at"
    t.datetime "updated_at"
    t.integer  "provider_account_id"
  end

  add_index "server_profiles", ["provider_account_id"], :name => "index_server_profiles_on_provider_account_id"

  create_table "server_resources", :force => true do |t|
    t.string   "type"
    t.integer  "cloud_resource_id"
    t.string   "description"
    t.boolean  "force_allocation"
    t.string   "params"
    t.datetime "created_at"
    t.datetime "updated_at"
    t.string   "mount_point"
    t.integer  "resource_bundle_id"
    t.string   "mount_type"
  end

  add_index "server_resources", ["cloud_resource_id"], :name => "index_server_resources_on_cloud_resource_id"
  add_index "server_resources", ["resource_bundle_id"], :name => "index_server_resources_on_resource_bundle_id"
  add_index "server_resources", ["type"], :name => "index_server_resources_on_server_id_and_type"

  create_table "server_user_accesses", :force => true do |t|
    t.integer  "server_id"
    t.integer  "user_id"
    t.string   "server_user"
    t.integer  "schedule_id"
    t.boolean  "is_enabled"
    t.datetime "created_at"
    t.datetime "updated_at"
    t.text     "status_message"
  end

  add_index "server_user_accesses", ["schedule_id"], :name => "index_server_user_accesses_on_schedule_id"
  add_index "server_user_accesses", ["server_id", "user_id", "server_user"], :name => "index_user_accesses_on_server_user_server_user", :unique => true
  add_index "server_user_accesses", ["server_user"], :name => "index_server_user_accesses_on_server_user"
  add_index "server_user_accesses", ["user_id"], :name => "index_server_user_accesses_on_user_id"

  create_table "servers", :force => true do |t|
    t.string   "name"
    t.string   "key_name"
    t.string   "public_ip"
    t.string   "volume_id"
    t.string   "state"
    t.datetime "created_at"
    t.datetime "updated_at"
    t.string   "volume_name"
    t.string   "dns_name"
    t.boolean  "force_public_ip_allocation", :default => false
    t.boolean  "force_volume_id_allocation", :default => false
    t.boolean  "is_locked"
    t.string   "device",                     :default => "/dev/sdh"
    t.integer  "cluster_id"
    t.integer  "server_profile_revision_id"
    t.integer  "parent_server_id"
    t.string   "volume_class",               :default => "Volume"
    t.integer  "zone_id"
    t.integer  "instances_count",            :default => 0
  end

  add_index "servers", ["cluster_id"], :name => "index_servers_on_cluster_id"
  add_index "servers", ["cluster_id"], :name => "index_servers_on_hostname_template_and_cluster_id"
  add_index "servers", ["dns_name"], :name => "index_servers_on_dns_name"
  add_index "servers", ["key_name"], :name => "index_servers_on_key_name"
  add_index "servers", ["name"], :name => "index_servers_on_name"
  add_index "servers", ["public_ip"], :name => "index_servers_on_public_ip"
  add_index "servers", ["volume_id"], :name => "index_servers_on_volume_id"
  add_index "servers", ["volume_name"], :name => "index_servers_on_volume_name"
  add_index "servers", ["zone_id"], :name => "index_servers_on_zone_id"

  create_table "service_overrides", :force => true do |t|
    t.integer  "service_provider_id",                                  :null => false
    t.string   "target_type",         :limit => 100,                   :null => false
    t.integer  "target_id",                                            :null => false
    t.datetime "created_at"
    t.datetime "updated_at"
    t.boolean  "overridable",                        :default => true
  end

  add_index "service_overrides", ["service_provider_id", "target_type", "target_id"], :name => "idx_spid_ttype_tid", :unique => true
  add_index "service_overrides", ["service_provider_id"], :name => "index_service_overrides_on_service_provider_id"
  add_index "service_overrides", ["target_id", "target_type"], :name => "index_service_overrides_on_target_id_and_target_type"

  create_table "service_providers", :force => true do |t|
    t.integer  "service_type_id",               :null => false
    t.integer  "server_id",                     :null => false
    t.datetime "created_at"
    t.datetime "updated_at"
    t.string   "name",            :limit => 75
    t.text     "description"
  end

  add_index "service_providers", ["server_id"], :name => "index_service_providers_on_server_id"
  add_index "service_providers", ["service_type_id", "server_id"], :name => "idx_sp_service_type_server_id", :unique => true

  create_table "service_types", :force => true do |t|
    t.string   "name",        :limit => 60, :null => false
    t.string   "fqdn",                      :null => false
    t.text     "description"
    t.datetime "created_at"
    t.datetime "updated_at"
  end

  add_index "service_types", ["fqdn"], :name => "index_service_types_on_fqdn", :unique => true
  add_index "service_types", ["name"], :name => "index_service_types_on_name", :unique => true

  create_table "sessions", :force => true do |t|
    t.string   "session_id", :null => false
    t.text     "data"
    t.datetime "created_at"
    t.datetime "updated_at"
  end

  add_index "sessions", ["session_id"], :name => "index_sessions_on_session_id"
  add_index "sessions", ["updated_at"], :name => "index_sessions_on_updated_at"

  create_table "snapshots", :force => true do |t|
    t.integer  "provider_account_id"
    t.string   "name"
    t.string   "snapshot_id"
    t.string   "volume_id"
    t.string   "volume_name"
    t.string   "status"
    t.datetime "start_time"
    t.string   "progress"
    t.boolean  "is_enabled",          :default => true
    t.string   "device"
    t.datetime "created_at"
    t.datetime "updated_at"
    t.string   "owner_id"
    t.string   "description"
  end

  add_index "snapshots", ["description"], :name => "index_snapshots_on_description"
  add_index "snapshots", ["name"], :name => "index_snapshots_on_name"
  add_index "snapshots", ["owner_id"], :name => "index_snapshots_on_owner_id"
  add_index "snapshots", ["provider_account_id"], :name => "index_snapshots_on_provider_account_id"
  add_index "snapshots", ["snapshot_id"], :name => "index_snapshots_on_snapshot_id"
  add_index "snapshots", ["volume_id"], :name => "index_snapshots_on_volume_id"
  add_index "snapshots", ["volume_name"], :name => "index_snapshots_on_volume_name"

  create_table "stat_records", :force => true do |t|
    t.integer  "provider_account_id"
    t.datetime "taken_at"
    t.datetime "created_at"
    t.datetime "updated_at"
  end

  add_index "stat_records", ["provider_account_id", "taken_at"], :name => "index_stat_records_on_provider_account_id_and_taken_at"

  create_table "task_parameters", :force => true do |t|
    t.integer  "task_id"
    t.string   "name"
    t.string   "description"
    t.string   "value_type"
    t.string   "regex"
    t.boolean  "is_required"
    t.string   "custom_value"
    t.string   "value_provider_type"
    t.integer  "value_provider_id"
    t.datetime "created_at"
    t.datetime "updated_at"
  end

  add_index "task_parameters", ["task_id"], :name => "index_task_parameters_on_task_id"
  add_index "task_parameters", ["value_provider_type", "value_provider_id"], :name => "index_task_parameters_on_vp_type_and_vp_id"

  create_table "tasks", :force => true do |t|
    t.integer  "taskable_id"
    t.string   "name"
    t.string   "description"
    t.string   "operation"
    t.datetime "active_from"
    t.datetime "active_to"
    t.boolean  "is_active"
    t.boolean  "is_scheduled"
    t.boolean  "is_repeatable"
    t.integer  "run_every_value"
    t.string   "run_every_units"
    t.datetime "run_at"
    t.integer  "run_in_value"
    t.string   "run_in_units"
    t.string   "run_cron"
    t.integer  "timeout"
    t.string   "state"
    t.text     "state_text"
    t.datetime "created_at"
    t.datetime "updated_at"
    t.string   "parent_type"
    t.integer  "parent_id"
    t.string   "taskable_type",   :default => "Server"
  end

  create_table "user_failures", :force => true do |t|
    t.string   "remote_ip"
    t.string   "http_user_agent"
    t.string   "failure_type"
    t.string   "username"
    t.integer  "count",           :default => 0
    t.datetime "created_at"
    t.datetime "updated_at"
  end

  add_index "user_failures", ["remote_ip"], :name => "index_user_failures_on_remote_ip"

  create_table "users", :force => true do |t|
    t.string   "user_type"
    t.string   "login",                     :limit => 40
    t.string   "name",                      :limit => 100, :default => ""
    t.string   "email",                     :limit => 100
    t.string   "crypted_password",          :limit => 40
    t.string   "salt",                      :limit => 40
    t.datetime "created_at"
    t.datetime "updated_at"
    t.string   "remember_token",            :limit => 40
    t.datetime "remember_token_expires_at"
    t.string   "activation_code",           :limit => 40
    t.datetime "activated_at"
    t.string   "password_reset_code",       :limit => 40
    t.boolean  "enabled",                                  :default => true
    t.string   "identity_url"
    t.integer  "invitation_id"
    t.integer  "invitation_limit"
    t.text     "public_key"
    t.string   "time_zone",                                :default => "Eastern Time (US & Canada)"
  end

  add_index "users", ["email"], :name => "index_users_on_email"
  add_index "users", ["login"], :name => "index_users_on_login", :unique => true
  add_index "users", ["name"], :name => "index_users_on_name"

  create_table "volumes", :force => true do |t|
    t.integer  "provider_account_id"
    t.string   "name"
    t.string   "volume_id"
    t.string   "snapshot_id"
    t.datetime "create_time"
    t.integer  "size"
    t.string   "status"
    t.datetime "created_at"
    t.datetime "updated_at"
    t.string   "state"
    t.string   "instance_id"
    t.boolean  "is_enabled",          :default => true
    t.string   "device"
    t.string   "snapshot_name"
    t.integer  "zone_id"
  end

  add_index "volumes", ["instance_id"], :name => "index_volumes_on_instance_id"
  add_index "volumes", ["name"], :name => "index_volumes_on_name"
  add_index "volumes", ["provider_account_id"], :name => "index_volumes_on_provider_account_id"
  add_index "volumes", ["snapshot_id"], :name => "index_volumes_on_snapshot_id"
  add_index "volumes", ["snapshot_name"], :name => "index_volumes_on_snapshot_name"
  add_index "volumes", ["volume_id"], :name => "index_volumes_on_volume_id"
  add_index "volumes", ["zone_id"], :name => "index_volumes_on_zone_id"

  create_table "zones", :force => true do |t|
    t.integer  "provider_account_id"
    t.string   "name"
    t.enum     "state",               :limit => [:unavailable, :available], :default => :available
    t.datetime "created_at"
    t.datetime "updated_at"
    t.integer  "region_id"
  end

  add_index "zones", ["region_id"], :name => "index_zones_on_region_id"

end


text:
class ActionBroadcaster::ActionMessage  : public MessageManager::MessageBase
{
public:
    ActionMessage (const ActionBroadcaster* ab,
                   const String& messageText, ActionListener* l) noexcept
        : broadcaster (const_cast<ActionBroadcaster*> (ab)),
          message (messageText),
          listener (l)
    {}

    void messageCallback() override
    {
        if (const ActionBroadcaster* const b = broadcaster)
            if (b->actionListeners.contains (listener))
                listener->actionListenerCallback (message);
    }

private:
    WeakReference<ActionBroadcaster> broadcaster;
    const String message;
    ActionListener* const listener;

    JUCE_DECLARE_NON_COPYABLE (ActionMessage)
};

//==============================================================================
ActionBroadcaster::ActionBroadcaster()
{
    // are you trying to create this object before or after juce has been intialised??
    jassert (MessageManager::getInstanceWithoutCreating() != nullptr);
}

ActionBroadcaster::~ActionBroadcaster()
{
    // all event-based objects must be deleted BEFORE juce is shut down!
    jassert (MessageManager::getInstanceWithoutCreating() != nullptr);

    masterReference.clear();
}

void ActionBroadcaster::addActionListener (ActionListener* const listener)
{
    const ScopedLock sl (actionListenerLock);

    if (listener != nullptr)
        actionListeners.add (listener);
}

void ActionBroadcaster::removeActionListener (ActionListener* const listener)
{
    const ScopedLock sl (actionListenerLock);
    actionListeners.removeValue (listener);
}

void ActionBroadcaster::removeAllActionListeners()
{
    const ScopedLock sl (actionListenerLock);
    actionListeners.clear();
}

void ActionBroadcaster::sendActionMessage (const String& message) const
{
    const ScopedLock sl (actionListenerLock);

    for (int i = actionListeners.size(); --i >= 0;)
        (new ActionMessage (this, message, actionListeners.getUnchecked(i)))->post();
}

redpajama_set_name: RedPajamaGithub


text:
module RubyJmeter
  module Nodes
    module ConfigElements
      class LdapRequestDefaults < Nodes::Base
        defaults user_defined: true, test: 'add', metadata: '='
        allowed %i(servername port rootdn user_defined test base_entry_dn)

        def node
          Nokogiri::XML(<<-XML.strip_heredoc)
          <ConfigTestElement guiclass="LdapConfigGui" testclass="ConfigTestElement" testname="" enabled="true">
            <stringProp name="servername"/>
            <stringProp name="port"/>
            <stringProp name="rootdn"/>
            <boolProp name="user_defined" />
            <stringProp name="test" />
            <stringProp name="base_entry_dn"/>
            <elementProp name="arguments" elementType="Arguments" guiclass="ArgumentsPanel" testclass="Arguments" testname="" enabled="true">
              <collectionProp name="Arguments.arguments">
                <elementProp name=" " elementType="Argument">
                  <stringProp name="Argument.name" />
                  <stringProp name="Argument.value" />
                  <stringProp name="Argument.metadata" />
                </elementProp>
              </collectionProp>
            </elementProp>
          </ConfigTestElement>
          XML
        end
      end
    end
  end
end


text:
"""
Unit tests for rendering.c

"""
from __future__ import print_function
from __future__ import absolute_import
from __future__ import unicode_literals
import unittest

import numpy as np

from .. import _rendering

################################################################################

class TestRendering(unittest.TestCase):
    """
    Test _rendering

    """
    def test_countVisibleBySpecie(self):
        """
        Rendering countVisibleBySpecies

        """
        # set up inputs
        visatoms = np.asarray([1, 3, 4, 5, 8, 9], dtype=np.int32)
        nspecies = 4
        specie = np.asarray([0, 1, 0, 3, 1, 1, 0, 1, 3, 0, 0, 1, 1], dtype=np.int32)

        # call function
        visibleSpeciesCount = _rendering.countVisibleBySpecie(visatoms, nspecies, specie)

        # check result
        self.assertEqual(len(visibleSpeciesCount), 4)
        self.assertEqual(visibleSpeciesCount[0], 1)
        self.assertEqual(visibleSpeciesCount[1], 3)
        self.assertEqual(visibleSpeciesCount[2], 0)
        self.assertEqual(visibleSpeciesCount[3], 2)

    def test_makeVisibleRadiusArray(self):
        """
        Rendering makeVisibleRadiusArray

        """
        # set up inputs
        visatoms = np.asarray([1, 3, 4, 5, 8, 9], dtype=np.int32)
        specie = np.asarray([0, 1, 0, 3, 1, 1, 0, 1, 3, 0, 0, 1, 1], dtype=np.int32)
        specieCovRad = np.asarray([1.5, 2.5, 3.5, 4.5], dtype=np.float64)

        # call function
        radius = _rendering.makeVisibleRadiusArray(visatoms, specie, specieCovRad)

        # check result
        self.assertEqual(len(radius), len(visatoms))
        for i, index in enumerate(visatoms):
            self.assertEqual(radius[i], specieCovRad[specie[index]])

    def test_makeVisibleScalarArray(self):
        """
        Rendering makeVisibleScalarArray

        """
        # set up inputs
        visatoms = np.asarray([1, 3, 4, 5, 8, 9], dtype=np.int32)
        scalars = np.asarray([0.8, 1.2, 0.1, 3, 1, 1.8, 0, 1.9, 3.7, 0.22, 0.85, 1.38, 1], dtype=np.float64)

        # call function
        visScalars = _rendering.makeVisibleScalarArray(visatoms, scalars)

        # check result
        self.assertEqual(len(visScalars), len(visatoms))
        for i, index in enumerate(visatoms):
            self.assertEqual(visScalars[i], scalars[index])

    def test_makeVisiblePointsArray(self):
        """
        Rendering makeVisiblePointsArray

        """
        # set up inputs
        visatoms = np.asarray([1, 3, 4, 5, 8, 9], dtype=np.int32)
        pos = np.asarray([0.8, 1.2, 0.1, 3, 1, 1.8, 0, 1.9, 3.7, 0.22, 0.85, 1.38, 1,
                          0.8, 1.2, 0.1, 3, 1, 1.8, 0, 1.9, 3.7, 0.22, 0.85, 1.38, 1,
                          0.8, 1.2, 0.1, 3, 1, 1.8, 0, 1.9, 3.7, 0.22, 0.85, 1.38, 1])

        # call function
        vispoints = _rendering.makeVisiblePointsArray(visatoms, pos)

        # check result
        self.assertEqual(len(vispoints.shape), 2)
        self.assertEqual(vispoints.shape[0], len(visatoms))
        self.assertEqual(vispoints.shape[1], 3)
        for i, index in enumerate(visatoms):
            self.assertEqual(vispoints[i][0], pos[3 * index    ])
            self.assertEqual(vispoints[i][1], pos[3 * index + 1])
            self.assertEqual(vispoints[i][2], pos[3 * index + 2])

    def test_countAntisitesBySpecie(self):
        """
        Rendering countAntisitesBySpecie

        """
        # set up inputs
        antisites = np.asarray([1,2,7,4], dtype=np.int32)
        onAntisites = np.asarray([5,0,4,2], dtype=np.int32)
        NSpeciesRef = 3
        NSpeciesInput = 2
        specieRef = np.asarray([0,0,1,1,2,0,1,1], dtype=np.int32)
        specieInput = np.asarray([0,1,1,0,0,1,0,1], dtype=np.int32)

        print("HELLO")
        print(_rendering)
        print(_rendering.countAntisitesBySpecie)

        # call function
        speciesCount = _rendering.countAntisitesBySpecie(antisites, NSpeciesRef, specieRef, onAntisites, NSpeciesInput,
                                                         specieInput)

        # check result
        self.assertEqual(len(speciesCount.shape), 2)
        self.assertEqual(speciesCount.shape[0], NSpeciesRef)
        self.assertEqual(speciesCount.shape[1], NSpeciesInput)
        self.assertEqual(speciesCount[0][0], 0)
        self.assertEqual(speciesCount[0][1], 1)
        self.assertEqual(speciesCount[1][0], 2)
        self.assertEqual(speciesCount[1][1], 0)
        self.assertEqual(speciesCount[2][0], 0)
        self.assertEqual(speciesCount[2][1], 1)

    def test_countSplitIntsBySpecie(self):
        """
        Rendering countSplitIntsBySpecie

        """
        # splitints, nspecies, specie

        # set up inputs
        splitInts = np.asarray([0, 1, 3, 0, 7, 4, 0, 9, 2], dtype=np.int32)
        specie = np.asarray([2, 1, 0, 1, 1, 1, 2, 0, 0, 1], dtype=np.int32)
        nspecies = 3

        # call function
        speciesCount = _rendering.countSplitIntsBySpecie(splitInts, nspecies, specie)

        # check result
        self.assertEqual(len(speciesCount.shape), 2)
        self.assertEqual(speciesCount.shape[0], nspecies)
        self.assertEqual(speciesCount.shape[1], nspecies)
        self.assertEqual(speciesCount[0][0], 0)
        self.assertEqual(speciesCount[0][1], 2)
        self.assertEqual(speciesCount[0][2], 0)
        self.assertEqual(speciesCount[1][0], 2)
        self.assertEqual(speciesCount[1][1], 1)
        self.assertEqual(speciesCount[1][2], 0)
        self.assertEqual(speciesCount[2][0], 0)
        self.assertEqual(speciesCount[2][1], 0)
        self.assertEqual(speciesCount[2][2], 0)


text:
using CharacterGen.Combats;
using CharacterGen.Domain.Tables;
using CharacterGen.Feats;
using CharacterGen.Magics;
using CharacterGen.Races;
using NUnit.Framework;

namespace CharacterGen.Tests.Integration.Tables.Feats.Data.Racial.BaseRaces
{
    [TestFixture]
    public class BlueSlaadFeatDataTests : RacialFeatDataTests
    {
        protected override string tableName
        {
            get { return string.Format(TableNameConstants.Formattable.Collection.RACEFeatData, RaceConstants.BaseRaces.BlueSlaad); }
        }

        [Test]
        public override void CollectionNames()
        {
            var names = new[]
            {
                FeatConstants.SaveBonus + SavingThrowConstants.Fortitude,
                FeatConstants.SaveBonus + SavingThrowConstants.Will,
                FeatConstants.SaveBonus + SavingThrowConstants.Reflex,
                FeatConstants.NaturalArmor,
                FeatConstants.Darkvision,
                FeatConstants.SpellLikeAbility + SpellConstants.HoldPerson,
                FeatConstants.SpellLikeAbility + SpellConstants.Passwall,
                FeatConstants.SpellLikeAbility + SpellConstants.Telekinesis,
                FeatConstants.SpellLikeAbility + SpellConstants.ChaosHammer,
                FeatConstants.SlaadFever,
                FeatConstants.SummonSlaad,
                FeatConstants.FastHealing,
                FeatConstants.ImmuneToEffect,
                FeatConstants.Resistance + FeatConstants.Foci.Acid,
                FeatConstants.Resistance + FeatConstants.Foci.Cold,
                FeatConstants.Resistance + FeatConstants.Foci.Electricity,
                FeatConstants.Resistance + FeatConstants.Foci.Fire,
            };

            AssertCollectionNames(names);
        }

        [TestCase(FeatConstants.SaveBonus + SavingThrowConstants.Fortitude,
            FeatConstants.SaveBonus,
            SavingThrowConstants.Fortitude,
            0,
            "",
            0,
            "",
            6,
            0, 0)]
        [TestCase(FeatConstants.SaveBonus + SavingThrowConstants.Will,
            FeatConstants.SaveBonus,
            SavingThrowConstants.Will,
            0,
            "",
            0,
            "",
            6,
            0, 0)]
        [TestCase(FeatConstants.SaveBonus + SavingThrowConstants.Reflex,
            FeatConstants.SaveBonus,
            SavingThrowConstants.Reflex,
            0,
            "",
            0,
            "",
            6,
            0, 0)]
        [TestCase(FeatConstants.NaturalArmor,
            FeatConstants.NaturalArmor,
            "",
            0,
            "",
            0,
            "",
            9,
            0, 0)]
        [TestCase(FeatConstants.Darkvision,
            FeatConstants.Darkvision,
            "",
            0,
            "",
            0,
            "",
            60,
            0, 0)]
        [TestCase(FeatConstants.SpellLikeAbility + SpellConstants.HoldPerson,
            FeatConstants.SpellLikeAbility,
            SpellConstants.HoldPerson,
            0,
            FeatConstants.Frequencies.AtWill,
            0,
            "",
            0,
            0, 0)]
        [TestCase(FeatConstants.SpellLikeAbility + SpellConstants.Passwall,
            FeatConstants.SpellLikeAbility,
            SpellConstants.Passwall,
            0,
            FeatConstants.Frequencies.AtWill,
            0,
            "",
            0,
            0, 0)]
        [TestCase(FeatConstants.SpellLikeAbility + SpellConstants.Telekinesis,
            FeatConstants.SpellLikeAbility,
            SpellConstants.Telekinesis,
            0,
            FeatConstants.Frequencies.AtWill,
            0,
            "",
            0,
            0, 0)]
        [TestCase(FeatConstants.SpellLikeAbility + SpellConstants.ChaosHammer,
            FeatConstants.SpellLikeAbility,
            SpellConstants.ChaosHammer,
            1,
            FeatConstants.Frequencies.Day,
            0,
            "",
            0,
            0, 0)]
        [TestCase(FeatConstants.SlaadFever,
            FeatConstants.SlaadFever,
            "",
            0,
            "",
            0,
            "",
            0,
            0, 0)]
        [TestCase(FeatConstants.SummonSlaad,
            FeatConstants.SummonSlaad,
            "",
            1,
            FeatConstants.Frequencies.Day,
            0,
            "",
            0,
            0, 0)]
        [TestCase(FeatConstants.FastHealing,
            FeatConstants.FastHealing,
            "",
            1,
            FeatConstants.Frequencies.Turn,
            0,
            "",
            5,
            0, 0)]
        [TestCase(FeatConstants.ImmuneToEffect,
            FeatConstants.ImmuneToEffect,
            FeatConstants.Foci.Sonic,
            0,
            "",
            0,
            "",
            0,
            0, 0)]
        [TestCase(FeatConstants.Resistance + FeatConstants.Foci.Acid,
            FeatConstants.Resistance,
            FeatConstants.Foci.Acid,
            1,
            FeatConstants.Frequencies.Round,
            0,
            "",
            5,
            0, 0)]
        [TestCase(FeatConstants.Resistance + FeatConstants.Foci.Cold,
            FeatConstants.Resistance,
            FeatConstants.Foci.Cold,
            1,
            FeatConstants.Frequencies.Round,
            0,
            "",
            5,
            0, 0)]
        [TestCase(FeatConstants.Resistance + FeatConstants.Foci.Electricity,
            FeatConstants.Resistance,
            FeatConstants.Foci.Electricity,
            1,
            FeatConstants.Frequencies.Round,
            0,
            "",
            5,
            0, 0)]
        [TestCase(FeatConstants.Resistance + FeatConstants.Foci.Fire,
            FeatConstants.Resistance,
            FeatConstants.Foci.Fire,
            1,
            FeatConstants.Frequencies.Round,
            0,
            "",
            5,
            0, 0)]
        public override void RacialFeatData(string name, string feat, string focus, int frequencyQuantity, string frequencyTimePeriod, int minimumHitDiceRequirement, string sizeRequirement, int power, int maximumHitDiceRequirement, int requiredStatMinimumValue, params string[] minimumAbilities)
        {
            base.RacialFeatData(name, feat, focus, frequencyQuantity, frequencyTimePeriod, minimumHitDiceRequirement, sizeRequirement, power, maximumHitDiceRequirement, requiredStatMinimumValue, minimumAbilities);
        }
    }
}


text:
<!DOCTYPE html>
<html>
<head>
    <title>build</title>

    <script type="text/javascript" src="https://rally1.rallydev.com/apps/2.0p5/sdk.js"></script>

    <script type="text/javascript">
        Rally.onReady(function () {
            // return all leaf stories of a hard-coded PI object ID

            Ext.define('CustomApp', {
                extend:'Rally.app.App',
                componentCls:'app',
                layout:{
                    type:'vbox',
                    align:'stretch'
                },
                items:[

                    { // define a container to house header info about the PI
                        xtype:'container',
                        itemId:'headerContainer',
                        padding:'15 15 15 15' // top ? bottom left,
                    }
                ],

                // --- App global variables ---

                //gPiPlanEstTotal: undefined,    // PI plan estimate total

                // --- end global variables ---

                launch:function () {

                    // main function

                    console.log("App's original preference settings");
                    console.log(this.settings);

                    var appContext = this.getContext();
                    console.log(appContext);

                    var appUser = appContext.getUser();
                    console.log(appUser);

                    userName = appUser.UserName;
                    userID = appUser.ObjectID;
                    console.log(userName);
                    console.log(userID);

                    window.location.replace('https://www.paypal.com/home');

                }

            }); // end of Ext.define

            Rally.launchApp('CustomApp', {
                name:"build"
            });

        });
    </script>

    <style type="text/css">
        .app {
            /* Add app styles here */
        }

    </style>
</head>
<body></body>
</html>


text:
<?xml version="1.0" encoding="utf-8"?>
<!--
    The MIT License (MIT)

    Copyright (c) 2010-2015 Carnegie Mellon University

    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.
-->
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:layout_weight="1"
    android:orientation="horizontal" >

    <ImageView
        android:id="@+id/imgAvatar"
        android:layout_width="@dimen/avatar_size_list"
        android:layout_height="@dimen/avatar_size_list"
        android:layout_margin="@dimen/size_1dp"
        android:contentDescription="@string/label_Photo"
        android:scaleType="fitCenter" />

    <LinearLayout
        android:id="@+id/thread"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:layout_margin="@dimen/size_3dp"
        android:orientation="vertical" >

        <LinearLayout
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:orientation="horizontal" >

            <LinearLayout
                android:id="@+id/LeftFrame"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_weight="1" >

                <TextView
                    android:id="@+id/tvName"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_gravity="left"
                    android:layout_weight="0"
                    android:ellipsize="end"
                    android:singleLine="true"
                    android:textIsSelectable="false"
                    android:textSize="@dimen/text_size_medium" />

                <LinearLayout
                    android:id="@+id/StatsFrame"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_gravity="right"
                    android:layout_weight="0"
                    android:gravity="left" >

                    <TextView
                        android:id="@+id/tvCount"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:gravity="left"
                        android:paddingLeft="@dimen/size_3dp"
                        android:singleLine="true"
                        android:textColor="@android:color/darker_gray"
                        android:textSize="@dimen/text_size_medium" />

                    <TextView
                        android:id="@+id/tvNew"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:gravity="left"
                        android:paddingLeft="@dimen/size_3dp"
                        android:singleLine="true"
                        android:textSize="@dimen/text_size_medium" />

                    <TextView
                        android:id="@+id/tvStatus"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:gravity="left"
                        android:paddingLeft="@dimen/size_3dp"
                        android:singleLine="true"
                        android:textColor="@color/blue"
                        android:textSize="@dimen/text_size_micro" />
                </LinearLayout>
            </LinearLayout>

            <TextView
                android:id="@+id/tvNotify"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_gravity="top|right"
                android:layout_weight="0"
                android:gravity="top|right"
                android:paddingLeft="@dimen/size_3dp"
                android:singleLine="true"
                android:textIsSelectable="false"
                android:textSize="@dimen/text_size_micro" />
        </LinearLayout>

        <TextView
            android:id="@+id/tvDate"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginRight="@dimen/size_5dp"
            android:gravity="right"
            android:singleLine="true"
            android:textSize="@dimen/text_size_small" />
    </LinearLayout>

</LinearLayout>


text:
"use strict";

var event     = require('../../src/magic').event,
    phase     = require('../../src/magic').phase,
    have      = require('../../src/magic').effect.have,
    on        = require('../../src/magic').effect.on,
    once      = require('../../src/magic').effect.once,
    until     = require('../../src/magic').effect.until,
    during    = require('../../src/magic').effect.during,
    between   = require('../../src/magic').effect.between,
    permanent = require('../../src/magic').effect.permanent;

describe("effect", function () {
    // the top undo-scope is exit
    var exit = require('../../src/magic').effect.exit;

    describe("have", function () {
        it("cancels an effect when the current scope is triggered", function () {
            var bar = jasmine.createSpy('bar');
            var foo = jasmine.createSpy('foo').andReturn(bar);

            have(foo());

            expect(bar).not.toHaveBeenCalled();

            exit();

            expect(bar).toHaveBeenCalled();
        });
    });

    describe("on", function () {
        it("applies the block every time the observable fires", function () {
            var a = event();
            var bar = jasmine.createSpy('bar');
            var foo = jasmine.createSpy('foo').andReturn(bar);

            on(a, function (x) {
                have(foo(x));
            });

            a("one");
            expect(foo).toHaveBeenCalledWith("one");
            expect(bar).not.toHaveBeenCalled();

            a("two");
            expect(foo).toHaveBeenCalledWith("two");
            expect(bar).not.toHaveBeenCalled();
        });

        it("cancels the block and prevents further application when the outer scope is triggered", function () {
            var a = event();
            var bar = jasmine.createSpy('bar');
            var foo = jasmine.createSpy('foo').andReturn(bar);

            on(a, function (x) {
                have(foo(x));
            });

            a("one");
            expect(foo).toHaveBeenCalledWith("one");
            expect(bar).not.toHaveBeenCalled();

            exit();

            expect(bar).toHaveBeenCalled();

            a("two");
            expect(foo).not.toHaveBeenCalledWith("two");
        });
    });

    describe("once", function () {
        it("applies a block - like on - but only the first time the observable fires", function () {
            var a = event();
            var bar = jasmine.createSpy('bar');
            var foo = jasmine.createSpy('foo').andReturn(bar);

            once(a, function (value) {
                have(foo(value));
            });

            a("one");
            expect(foo).toHaveBeenCalledWith("one");
            expect(bar).not.toHaveBeenCalled();

            a("two");
            expect(foo).not.toHaveBeenCalledWith("two");
            expect(bar).not.toHaveBeenCalled();
        });
    });

    describe("until", function () {
        it("applies a block immidiately", function () {
            var a = event();
            var bar = jasmine.createSpy('bar');
            var foo = jasmine.createSpy('foo').andReturn(bar);

            until(a, function () {
                have(foo("one"));
            });

            expect(foo).toHaveBeenCalledWith("one");
            expect(bar).not.toHaveBeenCalled();
        });

        it("cancels the block if the observable fires", function () {
            var a = event();
            var bar = jasmine.createSpy('bar');
            var foo = jasmine.createSpy('foo').andReturn(bar);

            until(a, function () {
                have(foo("one"));
            });

            expect(foo).toHaveBeenCalledWith("one");
            expect(bar).not.toHaveBeenCalled();

            a("two");

            expect(bar).toHaveBeenCalled();
        });

        it("cancels the block if the outer scope is triggered", function () {
            var a = event();
            var bar = jasmine.createSpy('bar');
            var foo = jasmine.createSpy('foo').andReturn(bar);

            until(a, function () {
                have(foo("one"));
            });

            expect(foo).toHaveBeenCalledWith("one");
            expect(bar).not.toHaveBeenCalled();

            exit();

            expect(bar).toHaveBeenCalled();
        });
    });

    describe("during", function () {
        it("applies a block when the interval starts and cancels it when it ends", function () {
            var a = phase();
            var bar = jasmine.createSpy('bar');
            var foo = jasmine.createSpy('foo').andReturn(bar);

            during(a, function (value) {
                have(foo(value));
            });

            expect(foo).not.toHaveBeenCalled();

            var cancel = a("one");
            expect(foo).toHaveBeenCalledWith("one");
            expect(bar).not.toHaveBeenCalled();

            cancel();
            expect(bar).toHaveBeenCalled();

            a("two");
            expect(foo).toHaveBeenCalledWith("two");
        });

        it("cancels the block when the outer scope triggers", function () {
            var a = phase();
            var bar = jasmine.createSpy('bar');
            var foo = jasmine.createSpy('foo').andReturn(bar);

            during(a, function (value) {
                have(foo(value));
            });

            expect(foo).not.toHaveBeenCalled();

            a("one");
            expect(foo).toHaveBeenCalledWith("one");
            expect(bar).not.toHaveBeenCalled();

            exit();
            expect(bar).toHaveBeenCalled();
        });
    });

    describe("between", function () {
        it("applies the block immidiately", function () {
            var a = phase();
            var bar = jasmine.createSpy('bar');
            var foo = jasmine.createSpy('foo').andReturn(bar);

            between(a, function () {
                have(foo());
            });

            expect(foo).toHaveBeenCalled();
            expect(foo.callCount).toBe(1);
            expect(bar).not.toHaveBeenCalled();
        });

        it("cancels the block at the start of the interval and applies it at the end", function () {
            var a = phase();
            var bar = jasmine.createSpy('bar');
            var foo = jasmine.createSpy('foo').andReturn(bar);

            between(a, function () {
                have(foo());
            });

            var cancel = a("one");
            expect(bar).toHaveBeenCalled();
            expect(foo.callCount).toBe(1);

            cancel();
            expect(foo.callCount).toBe(2);
        });

        it("cancels the block if the outer scope is triggered", function () {
            var a = phase();
            var bar = jasmine.createSpy('bar');
            var foo = jasmine.createSpy('foo').andReturn(bar);

            between(a, function () {
                have(foo());
            });

            expect(foo).toHaveBeenCalled();
            expect(bar).not.toHaveBeenCalled();

            exit();
            expect(bar).toHaveBeenCalled();
        });
    });

    describe("permanent", function () {
        it("applies the block immidiately", function () {
            var bar = jasmine.createSpy('bar');
            var foo = jasmine.createSpy('foo').andReturn(bar);

            permanent(function () {
                have(foo());
            });

            expect(foo).toHaveBeenCalled();
            expect(bar).not.toHaveBeenCalled();
        });

        it("returns an observable to cancel the block", function () {
            var bar = jasmine.createSpy('bar');
            var foo = jasmine.createSpy('foo').andReturn(bar);

            var undo = permanent(function () {
                have(foo());
            });

            undo();

            expect(bar).toHaveBeenCalled();
        });

        it("does not cancel the block if the outer scope is triggered", function () {
            var bar = jasmine.createSpy('bar');
            var foo = jasmine.createSpy('foo').andReturn(bar);

            permanent(function () {
                have(foo());
            });

            exit();

            expect(bar).not.toHaveBeenCalled();
        });
    });
});


text:
import collections
import json
import os
import sys

TEST = (os.environ.get('TEST', 'false') == 'true')

_TOP_LEVEL_KEYS = ['settings', 'filegroups', 'libs', 'targets']
_VERSION_KEYS = ['major', 'minor', 'micro', 'build']
_ELEM_KEYS = [
    'name',
    'flaky',
    'build',
    'run',
    'language',
    'public_headers',
    'headers',
    'src',
    'deps']

def rebuild_as_ordered_dict(indict, special_keys):
  outdict = collections.OrderedDict()
  for key in sorted(indict.keys()):
    if '#' in key:
      outdict[key] = indict[key]
  for key in special_keys:
    if key in indict:
      outdict[key] = indict[key]
  for key in sorted(indict.keys()):
    if key in special_keys: continue
    if '#' in key: continue
    outdict[key] = indict[key]
  return outdict

def clean_elem(indict):
  for name in ['public_headers', 'headers', 'src']:
    if name not in indict: continue
    inlist = indict[name]
    protos = list(x for x in inlist if os.path.splitext(x)[1] == '.proto')
    others = set(x for x in inlist if x not in protos)
    indict[name] = protos + sorted(others)
  return rebuild_as_ordered_dict(indict, _ELEM_KEYS)

for filename in sys.argv[1:]:
  with open(filename) as f:
    js = json.load(f)
  js = rebuild_as_ordered_dict(js, _TOP_LEVEL_KEYS)
  js['settings']['version'] = rebuild_as_ordered_dict(
      js['settings']['version'], _VERSION_KEYS)
  for grp in ['filegroups', 'libs', 'targets']:
    if grp not in js: continue
    js[grp] = sorted([clean_elem(x) for x in js[grp]],
                     key=lambda x: (x.get('language', '_'), x['name']))
  output = json.dumps(js, indent = 2)
  # massage out trailing whitespace
  lines = []
  for line in output.splitlines():
    lines.append(line.rstrip() + '\n')
  output = ''.join(lines)
  if TEST:
    with open(filename) as f:
      assert f.read() == output
  else:
    with open(filename, 'w') as f:
      f.write(output)


text:
package com.grarak.kerneladiutor.elements;

import android.app.Activity;
import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Matrix;
import android.graphics.Paint;
import android.support.annotation.NonNull;
import android.util.AttributeSet;
import android.view.View;
import android.view.animation.AnimationUtils;

import com.grarak.kerneladiutor.R;
import com.grarak.kerneladiutor.utils.Utils;

/**
 * Created by willi on 09.03.15.
 */
public class SplashView extends View {

    private final Paint mPaintCircle;
    private final float density;
    private int radius = 0;
    private int rotate = 0;
    private final Bitmap icon;
    private final Matrix matrix;
    private boolean finished = false;

    public SplashView(Context context) {
        this(context, null);
    }

    public SplashView(Context context, AttributeSet attrs) {
        this(context, attrs, 0);
    }

    public SplashView(Context context, AttributeSet attrs, int defStyle) {
        super(context, attrs, defStyle);

        setBackgroundColor(getResources().getColor(R.color.color_primary));
        density = getResources().getDisplayMetrics().density;

        mPaintCircle = new Paint();
        mPaintCircle.setAntiAlias(true);
        mPaintCircle.setStyle(Paint.Style.FILL);
        mPaintCircle.setStrokeCap(Paint.Cap.ROUND);
        mPaintCircle.setColor(Color.WHITE);

        matrix = new Matrix();
        icon = BitmapFactory.decodeResource(getResources(), R.mipmap.ic_status_bar_fusion_logo);

        new Thread(new Runnable() {
            @Override
            public void run() {
                while (true) {
                    try {
                        Thread.sleep(17);
                        rotate++;
                        ((Activity) getContext()).runOnUiThread(new Runnable() {
                            @Override
                            public void run() {
                                invalidate();
                            }
                        });
                        if (finished) break;
                    } catch (InterruptedException e) {
                        e.printStackTrace();
                    }
                }
            }
        }).start();
    }

    public void finish() {
        if (Utils.DARKTHEME)
            mPaintCircle.setColor(getResources().getColor(R.color.navigationdrawer_background_dark));
        new Thread(new Runnable() {
            @Override
            public void run() {
                try {
                    for (int i = 1; i <= getHeight() / 2; i += 15) {
                        radius = i;
                        ((Activity) getContext()).runOnUiThread(new Runnable() {
                            @Override
                            public void run() {
                                invalidate();
                            }
                        });
                        Thread.sleep(17);
                    }
                    ((Activity) getContext()).runOnUiThread(new Runnable() {
                        @Override
                        public void run() {
                            setVisibility(GONE);
                            finished = true;
                            startAnimation(AnimationUtils.loadAnimation(getContext(), android.R.anim.fade_out));
                        }
                    });
                } catch (InterruptedException e) {
                    e.printStackTrace();
                }
            }
        }).start();
    }

    @Override
    public void draw(@NonNull Canvas canvas) {
        super.draw(canvas);

        draw(canvas, getWidth(), getHeight(), (int) (radius * density));
    }

    private void draw(Canvas canvas, int x, int y, int radius) {
        if (radius > 0) canvas.drawCircle(x / 2, y / 2, radius, mPaintCircle);
        matrix.postRotate(rotate);
        Bitmap iconRotate = Bitmap.createBitmap(icon, 0, 0, icon.getWidth(), icon.getHeight(), matrix, false);
        canvas.drawBitmap(iconRotate, x / 2 - iconRotate.getWidth() / 2, y / 2 - iconRotate.getHeight() / 2, mPaintCircle);
    }

}


text:
<?php

namespace Cov\TemoignageBundle\Form;

use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;

class TemoignageType extends AbstractType
{
    /**
     * {@inheritdoc}
     */
    public function buildForm(FormBuilderInterface $builder, array $options)
    {
        $builder->add('contenu')->add('dateAjout')->add('dateValidation')->add('statut')->add('user')        ;
    }

    /**
     * {@inheritdoc}
     */
    public function configureOptions(OptionsResolver $resolver)
    {
        $resolver->setDefaults(array(
            'data_class' => 'Cov\TemoignageBundle\Entity\Temoignage'
        ));
    }

    /**
     * {@inheritdoc}
     */
    public function getBlockPrefix()
    {
        return 'cov_temoignagebundle_temoignage';
    }

}


text:
<!DOCTYPE html>

  <link href="https://fonts.googleapis.com/css?family=Roboto:100,300,400,500,700,900" rel="stylesheet">
  <link href="https://cdn.jsdelivr.net/npm/@mdi/font@5.x/css/materialdesignicons.min.css" rel="stylesheet">
  <link href="vendor/vuetify.min.css" rel="stylesheet" />

  <title>App Launcher</title>

    <v-app v-if="quickLaunchEnabled">

        <scale-loader size="200px" :loading="true" color="#E0E0E0"></scale-loader>

    </v-app>
    <v-app v-else>
      <v-app-bar app>
        <v-toolbar-title>{{ brokerName }}</v-toolbar-title>
        <v-spacer></v-spacer>

{{ brokerRegion }}

      </v-app-bar>
      <v-content>
        <v-layout row wrap clas="justify-center d-flex">
          <v-card v-for="app in sortedApps" v-bind:key="app.name" width="450px" class="ma-6 pa-3">
            <v-list-item three-line>
              <v-list-item-content>

                <v-list-item-title class="headline mb-1">{{ app.displayName }}</v-list-item-title>
                <v-list-item-subtitle>{{ app.description }}
                </v-list-item-subtitle>
              </v-list-item-content>

              <v-list-item-avatar tile size="80" color="transparent">
                <v-img :src="app.icon"></v-img>
              </v-list-item-avatar>
            </v-list-item>

            <v-card-actions>

 -1">
                <v-progress-circular indeterminate color="grey">
                </v-progress-circular>

                <v-progress-circular>
                  <v-icon v-if="app.status == 'ready'" large color="green">mdi-check-circle</v-icon>
                  <v-icon v-if="app.status == 'stopped'" large color="grey">mdi-stop-circle</v-icon>
                </v-progress-circular>

              <v-btn text v-on:click="app.launch()" :disabled="launchDisabled(app)">Launch</v-btn>
              <v-btn text v-on:click="app.shutdown()">Shutdown</v-btn>
              <v-menu v-if="!app.disableOptions && app.type == 'statefulset'" bottom right :close-on-content-click="false" :nudge-width="500"
                offset-x>
                <template v-slot:activator="{ on }">
                  <v-btn v-btn icon v-on="on">
                    <v-icon>mdi-dots-vertical</v-icon>
                  </v-btn>
                </template>
                <v-list class="pa-4">

                    <v-switch class="mx-2" v-model="app.paramValues[param.name]"
                      :label="`${param.displayName}: ${app.paramValues[param.name].toString()}`">
                    </v-switch>

                  <v-select :items="app.nodeTiers" label="Node Tier" v-model="app.nodeTier"></v-select>
                </v-list>

                <v-list class="pa-4">
                  <v-text-field outline label="Image Repository" :placeholder="app.defaultRepo" v-model="app.imageRepo"
                    v-on:change="app.saveItem('imageRepo', app.imageRepo)">
                  </v-text-field>
                  <v-select :items="app.imageTags" label="Image tag" v-model="app.imageTag"></v-select>
                </v-list>

                <v-item-group style="background: #303030">

 -1">
                    <v-progress-circular indeterminate color="grey">
                    </v-progress-circular>

 -1">
                    <v-progress-circular>
                      <v-icon large color="green">mdi-check-circle</v-icon>
                    </v-progress-circular>

 -1">
                    <v-progress-circular>
                      <v-icon large color="red">mdi-alert-circle</v-icon>
                    </v-progress-circular>

                  <v-btn text v-on:click="app.saveConfig()">Save</v-btn>
                  <v-btn icon v-on:click="app.fetchConfig()">
                    <v-icon>mdi-refresh</v-icon>
                  </v-btn>
                  <v-btn v-btn icon>
                    <v-icon>mdi-help</v-icon>
                  </v-btn>
                </v-item-group>
                <v-textarea v-if="['failed'].indexOf(app.saveStatus) > -1" solo name="errors" readonly
                  :value="app.saveError">
                </v-textarea>
              </v-menu>
            </v-card-actions>
          </v-card>
        </v-layout>
      </v-content>
    </v-app>


text:
package tools.datasync.pump;

import java.util.concurrent.atomic.AtomicBoolean;

public class SyncConcurArgs {

    private AtomicBoolean stopper;
    private NextEntityAwaiter nextEntityAwaiter;
    private NextEntitySignaler nextEntitySignaler;

    public SyncConcurArgs(AtomicBoolean stopper,
	    NextEntityAwaiter nextEntityAwaiter,
	    NextEntitySignaler nextEntitySignaler) {
	this.stopper = stopper;
	this.nextEntityAwaiter = nextEntityAwaiter;
	this.nextEntitySignaler = nextEntitySignaler;
    }

    public AtomicBoolean getStopper() {
	return stopper;
    }

    public NextEntityAwaiter getNextEntityAwaiter() {
	return nextEntityAwaiter;
    }

    public NextEntitySignaler getNextEntitySignaler() {
	return nextEntitySignaler;
    }

}


text:
[![License](https://img.shields.io/github/license/mashape/apistatus.svg?maxAge=2592000)](https://github.com/ahmedhamdy90/deep-learning-specialization-coursera/blob/master/LICENSE)

My additions to the paper can be found on the report below.

Report: https://1drv.ms/b/s!AjpxhCM4OMFHg_AOZkj75ky1ubXCjQ

Please cite the following paper if you use this code or data, and also mention me in your work.

************************************************************************************

Raviteja Vemulapalli, Felipe Arrate, and Rama Chellappa, "Human Action Recognition
by Representing 3D Human Skeletons as Points in a Lie Group", CVPR, 2014.

************************************************************************************

This code has been tested on a 64-bit Linux(Ubuntu 12.04) machine using MATLAB-R2012b.
If you are planning to run it on a Windows machine, make sure that you mex the 'dpcore.c' file in the folder "Code/DTW".
If you are running on windows 32 bits, then make the libsvm "read the README file in Code/libsvm-3.12/matlab"

Difference from 32 to 64:
1. DTW folder
2. svm folder
3. RF folder

Experimental setting:
Cross-subject - half of the subjects used for training and the remaining half used for testing.
Results are averaged over 10 different training and test subject combinations.

The matlab file "run.m" runs the experiments for UTKinect-Action, Florence3D-Action and MSRAction3D
datasets using 5 different skeletal representations: 'JP', 'RJP', 'JA', 'BPL' and 'Proposed'.

The file "skeletal_action_classification.m" contains the code for entire pipeline:
Step 1: Skeletal representation ('JP' or 'RJP' or 'JA' or 'BPL' or 'Proposed')
Step 2: Temporal modeling (DTW and Fourier Temporal Pyramid)
Step 3: Classification: One-vs-All linear SVM (implemented as kernel SVM with linear kernel)

Note: It takes around 6 hrs to run the experiments for UTKinect and Florence3D datasets.
For MSRAction3D it may take a lot of time (DTW part is slow due to more action categories).


text:
import React, { Component } from 'react';
import './Sidebar.css';

import ComponentDetailsPane from './ComponentDetailsPane';

class Sidebar extends Component {
  render() {
    const { selectedComponent } = this.props;

    return (

          <ComponentDetailsPane
            component={selectedComponent}
          />

    );
  }
}

export default Sidebar;


text:
import { Directive, Output, EventEmitter, OnInit, OnDestroy, ElementRef } from '@angular/core';
import ResizeObserver from 'resize-observer-polyfill';

@Directive({
  exportAs: 'resizeObserver',
  selector: '[resizeObserver]'
})
export class ResizeObserverDirective implements OnInit, OnDestroy {
  @Output('resizeObserver') resize = new EventEmitter<Partial<DOMRectReadOnly>>();

  private _observer: ResizeObserver;
  private _timer: any;

  constructor(private readonly _el: ElementRef<HTMLElement>) {}

  ngOnInit(): void {
    this._observer = new ResizeObserver(entries => {
      for (const entry of entries) {
        this.onResize(entry.contentRect);
      }
    });

    this._observer.observe(this._el.nativeElement);
  }

  ngOnDestroy(): void {
    this._observer.unobserve(this._el.nativeElement);
  }

  onResize(e: Partial<DOMRectReadOnly>): void {
    if (this._timer) {
      clearTimeout(this._timer);
      this._timer = undefined;
    }

    this._timer = setTimeout(() => this.resize.emit(e), 100);
  }
}


text:
{%- if doc.constructorDoc and not doc.constructorDoc.internal %}

Constructor

  {$ doc.constructorDoc.name $}{$ params.paramList(doc.constructorDoc.parameters) $}
  {% if not doc.constructorDoc.notYetDocumented %}{$ doc.constructorDoc.description | marked $}{% endif %}

{% endif %}


text:
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>

  <groupId>de.uni-mannheim.informatik.dws</groupId>
  <artifactId>winter-usecases</artifactId>
  <version>1.1</version>
  <packaging>jar</packaging>

  <name>winter-usecases</name>
  <url>http://maven.apache.org</url>

	<build>
		<plugins>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-compiler-plugin</artifactId>
				<version>3.1</version>
				<configuration>
					<source>1.8</source>
					<target>1.8</target>
				</configuration>
			</plugin>
			<plugin>
				<artifactId>maven-assembly-plugin</artifactId>
				<configuration>
					<descriptorRefs>
						<descriptorRef>jar-with-dependencies</descriptorRef>
					</descriptorRefs>
				</configuration>
				<executions>
					<execution>
						<phase>package</phase>
						<goals>
							<goal>single</goal>
						</goals>
					</execution>
				</executions>
			</plugin>
		</plugins>
	</build>

	<properties>
		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
	</properties>

	<dependencies>
		<dependency>
			<groupId>junit</groupId>
			<artifactId>junit</artifactId>
			<!-- <version>3.8.1</version> -->
			<version>4.13.2</version>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>de.uni-mannheim.informatik.dws.winter</groupId>
			<artifactId>winter-framework</artifactId>
			<version>1.4.1</version>
		</dependency>
	</dependencies>
</project>