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

  create_table "actions", :force => true do |t|
    t.string   "name"
    t.text     "code"
    t.integer  "vendor_id"
    t.integer  "user_id"
    t.string   "whento"
    t.datetime "created_at",                  :null => false
    t.datetime "updated_at",                  :null => false
    t.string   "behavior"
    t.integer  "weight",     :default => 0
    t.string   "afield"
    t.float    "value",      :default => 0.0
    t.string   "field2"
    t.float    "value2"
    t.integer  "hidden_by"
    t.boolean  "hidden"
    t.datetime "hidden_at"
    t.integer  "company_id"
    t.string   "model_type"
    t.integer  "model_id"
    t.text     "js_code"
    t.integer  "created_by"
  end

  add_index "actions", ["user_id"], :name => "index_actions_on_user_id"
  add_index "actions", ["vendor_id"], :name => "index_actions_on_vendor_id"

  create_table "broken_items", :force => true do |t|
    t.string   "name"
    t.string   "sku"
    t.float    "quantity"
    t.integer  "vendor_id"
    t.integer  "shipper_id"
    t.text     "note"
    t.datetime "created_at",                      :null => false
    t.datetime "updated_at",                      :null => false
    t.boolean  "is_shipment_item"
    t.integer  "hidden_by"
    t.boolean  "hidden"
    t.datetime "hidden_at"
    t.integer  "company_id"
    t.integer  "user_id"
    t.integer  "price_cents",      :default => 0
    t.string   "currency"
  end

  create_table "buttons", :force => true do |t|
    t.string   "name"
    t.string   "sku"
    t.string   "old_category_name"
    t.integer  "weight"
    t.datetime "created_at",        :null => false
    t.datetime "updated_at",        :null => false
    t.integer  "vendor_id"
    t.boolean  "is_buyback"
    t.integer  "category_id"
    t.string   "color"
    t.integer  "position"
    t.boolean  "hidden"
    t.integer  "hidden_by"
    t.datetime "hidden_at"
    t.integer  "company_id"
    t.integer  "user_id"
  end

  create_table "cash_registers", :force => true do |t|
    t.string   "name"
    t.datetime "created_at",                                        :null => false
    t.datetime "updated_at",                                        :null => false
    t.integer  "vendor_id"
    t.string   "scale"
    t.string   "cash_drawer_path"
    t.boolean  "big_buttons"
    t.boolean  "hide_discounts"
    t.boolean  "no_print"
    t.string   "thermal_printer",       :default => "/dev/usb/lp0"
    t.string   "sticker_printer",       :default => "/dev/usb/lp1"
    t.string   "a4_printer"
    t.string   "pole_display"
    t.string   "customer_screen_blurb"
    t.boolean  "salor_printer"
    t.string   "color"
    t.string   "ip"
    t.boolean  "hide_buttons",          :default => true
    t.boolean  "show_plus_minus",       :default => true
    t.boolean  "detailed_edit"
    t.string   "cash_drawer_name"
    t.string   "thermal_printer_name"
    t.string   "sticker_printer_name"
    t.string   "scale_name"
    t.boolean  "always_open_drawer"
    t.string   "pole_display_name"
    t.boolean  "require_password"
    t.string   "locale"
    t.boolean  "hidden"
    t.integer  "hidden_by"
    t.datetime "hidden_at"
    t.integer  "company_id"
    t.integer  "user_id"
    t.string   "customerscreen_mode"
  end

  add_index "cash_registers", ["company_id"], :name => "index_cash_registers_on_company_id"
  add_index "cash_registers", ["hidden"], :name => "index_cash_registers_on_hidden"
  add_index "cash_registers", ["vendor_id"], :name => "index_cash_registers_on_vendor_id"

  create_table "categories", :force => true do |t|
    t.integer  "vendor_id"
    t.string   "name"
    t.datetime "created_at",                       :null => false
    t.datetime "updated_at",                       :null => false
    t.float    "quantity_sold",   :default => 0.0
    t.float    "cash_made"
    t.boolean  "button_category"
    t.integer  "position"
    t.string   "color"
    t.string   "sku"
    t.integer  "hidden_by"
    t.boolean  "hidden"
    t.datetime "hidden_at"
    t.integer  "company_id"
    t.integer  "user_id"
  end

  add_index "categories", ["company_id"], :name => "index_categories_on_company_id"
  add_index "categories", ["hidden"], :name => "index_categories_on_hidden"
  add_index "categories", ["vendor_id"], :name => "index_categories_on_vendor_id"

  create_table "companies", :force => true do |t|
    t.string   "name"
    t.string   "identifier"
    t.string   "mode",               :default => "local"
    t.string   "subdomain"
    t.boolean  "hidden"
    t.integer  "hidden_by"
    t.datetime "hidden_at"
    t.boolean  "active",             :default => true
    t.string   "email"
    t.string   "auth_user"
    t.string   "full_subdomain"
    t.string   "full_url"
    t.string   "virtualhost_filter"
    t.integer  "auth_https_mode"
    t.boolean  "https"
    t.boolean  "auth"
    t.string   "domain"
    t.boolean  "removal_pending"
    t.datetime "created_at",                              :null => false
    t.datetime "updated_at",                              :null => false
  end

  create_table "countries", :force => true do |t|
    t.string   "name"
    t.integer  "vendor_id"
    t.integer  "user_id"
    t.datetime "created_at", :null => false
    t.datetime "updated_at", :null => false
    t.integer  "hidden_by"
    t.boolean  "hidden"
    t.datetime "hidden_at"
    t.integer  "company_id"
  end

  create_table "cues", :force => true do |t|
    t.boolean  "is_handled",      :default => false
    t.boolean  "to_send",         :default => false
    t.boolean  "to_receive",      :default => false
    t.text     "payload"
    t.string   "url"
    t.string   "source_sku"
    t.string   "destination_sku"
    t.string   "owner_type"
    t.integer  "owner_id"
    t.datetime "created_at",                         :null => false
    t.datetime "updated_at",                         :null => false
  end

  create_table "customers", :force => true do |t|
    t.string   "first_name"
    t.string   "last_name"
    t.string   "street1"
    t.string   "street2"
    t.string   "postalcode"
    t.string   "state"
    t.string   "country"
    t.string   "city"
    t.string   "telephone"
    t.string   "cellphone"
    t.string   "email"
    t.datetime "created_at",   :null => false
    t.datetime "updated_at",   :null => false
    t.integer  "vendor_id"
    t.string   "company_name"
    t.string   "sku"
    t.integer  "hidden_by"
    t.string   "tax_number"
    t.boolean  "hidden"
    t.datetime "hidden_at"
    t.integer  "company_id"
    t.integer  "user_id"
  end

  add_index "customers", ["company_id"], :name => "index_customers_on_company_id"
  add_index "customers", ["hidden"], :name => "index_customers_on_hidden"
  add_index "customers", ["vendor_id"], :name => "index_customers_on_vendor_id"

  create_table "discounts", :force => true do |t|
    t.string   "name"
    t.datetime "start_date"
    t.datetime "end_date"
    t.integer  "vendor_id"
    t.integer  "category_id"
    t.integer  "location_id"
    t.string   "item_sku"
    t.string   "applies_to"
    t.datetime "created_at",  :null => false
    t.datetime "updated_at",  :null => false
    t.float    "amount"
    t.string   "amount_type"
    t.string   "sku"
    t.integer  "hidden_by"
    t.boolean  "hidden"
    t.datetime "hidden_at"
    t.integer  "company_id"
    t.integer  "user_id"
  end

  add_index "discounts", ["amount_type"], :name => "index_discounts_on_amount_type"
  add_index "discounts", ["applies_to"], :name => "index_discounts_on_applies_to"
  add_index "discounts", ["category_id"], :name => "index_discounts_on_category_id"
  add_index "discounts", ["company_id"], :name => "index_discounts_on_company_id"
  add_index "discounts", ["hidden"], :name => "index_discounts_on_hidden"
  add_index "discounts", ["item_sku"], :name => "index_discounts_on_item_sku"
  add_index "discounts", ["location_id"], :name => "index_discounts_on_location_id"
  add_index "discounts", ["sku"], :name => "index_discounts_on_sku"
  add_index "discounts", ["vendor_id"], :name => "index_discounts_on_vendor_id"

  create_table "discounts_order_items", :id => false, :force => true do |t|
    t.integer "order_item_id"
    t.integer "discount_id"
  end

  add_index "discounts_order_items", ["order_item_id", "discount_id"], :name => "index_discounts_order_items_on_order_item_id_and_discount_id"

  create_table "drawer_transactions", :force => true do |t|
    t.integer  "drawer_id"
    t.datetime "created_at",                         :null => false
    t.datetime "updated_at",                         :null => false
    t.text     "notes"
    t.boolean  "refund"
    t.string   "tag"
    t.integer  "cash_register_id"
    t.integer  "order_id"
    t.integer  "order_item_id"
    t.integer  "vendor_id"
    t.integer  "hidden_by"
    t.boolean  "hidden"
    t.datetime "hidden_at"
    t.integer  "company_id"
    t.integer  "user_id"
    t.boolean  "complete_order"
    t.integer  "nr"
    t.integer  "amount_cents",        :default => 0
    t.integer  "drawer_amount_cents", :default => 0
    t.string   "currency"
  end

  add_index "drawer_transactions", ["company_id"], :name => "index_drawer_transactions_on_company_id"
  add_index "drawer_transactions", ["complete_order"], :name => "index_drawer_transactions_on_complete_order"
  add_index "drawer_transactions", ["created_at"], :name => "index_drawer_transactions_on_created_at"
  add_index "drawer_transactions", ["drawer_id"], :name => "index_drawer_transactions_on_drawer_id"
  add_index "drawer_transactions", ["hidden"], :name => "index_drawer_transactions_on_hidden"
  add_index "drawer_transactions", ["order_id"], :name => "index_drawer_transactions_on_order_id"
  add_index "drawer_transactions", ["refund"], :name => "index_drawer_transactions_on_refund"
  add_index "drawer_transactions", ["user_id"], :name => "index_drawer_transactions_on_user_id"
  add_index "drawer_transactions", ["vendor_id"], :name => "index_drawer_transactions_on_vendor_id"

  create_table "drawers", :force => true do |t|
    t.datetime "created_at",                  :null => false
    t.datetime "updated_at",                  :null => false
    t.boolean  "hidden"
    t.integer  "hidden_by"
    t.datetime "hidden_at"
    t.integer  "vendor_id"
    t.integer  "company_id"
    t.integer  "amount_cents", :default => 0
    t.string   "currency"
  end

  create_table "emails", :force => true do |t|
    t.string   "sender"
    t.string   "receipient"
    t.string   "subject"
    t.text     "body"
    t.boolean  "technician"
    t.integer  "vendor_id"
    t.integer  "company_id"
    t.integer  "user_id"
    t.integer  "model_id"
    t.integer  "model_type"
    t.boolean  "hidden"
    t.integer  "hidden_by"
    t.datetime "hidden_at"
    t.datetime "created_at", :null => false
    t.datetime "updated_at", :null => false
  end

  create_table "histories", :force => true do |t|
    t.string   "url"
    t.string   "action_taken"
    t.string   "model_type"
    t.string   "ip"
    t.integer  "sensitivity"
    t.integer  "model_id"
    t.text     "changes_made"
    t.text     "params"
    t.datetime "created_at",   :null => false
    t.datetime "updated_at",   :null => false
    t.boolean  "hidden"
    t.integer  "hidden_by"
    t.datetime "hidden_at"
    t.integer  "vendor_id"
    t.integer  "company_id"
    t.integer  "user_id"
  end

  create_table "images", :force => true do |t|
    t.string   "name"
    t.string   "imageable_type"
    t.datetime "created_at",     :null => false
    t.datetime "updated_at",     :null => false
    t.integer  "imageable_id"
    t.integer  "company_id"
    t.integer  "vendor_id"
    t.string   "image_type"
    t.boolean  "hidden"
    t.integer  "hidden_by"
    t.datetime "hidden_at"
  end

  create_table "inventory_report_items", :force => true do |t|
    t.integer  "inventory_report_id"
    t.integer  "item_id"
    t.float    "real_quantity"
    t.float    "quantity"
    t.datetime "created_at",           :null => false
    t.datetime "updated_at",           :null => false
    t.integer  "vendor_id"
    t.boolean  "hidden"
    t.integer  "hidden_by"
    t.datetime "hidden_at"
    t.integer  "company_id"
    t.integer  "user_id"
    t.integer  "category_id"
    t.integer  "purchase_price_cents"
    t.integer  "price_cents"
    t.string   "name"
    t.string   "sku"
    t.string   "currency"
    t.integer  "tax_profile_id"
  end

  add_index "inventory_report_items", ["inventory_report_id"], :name => "index_inventory_report_items_on_inventory_report_id"
  add_index "inventory_report_items", ["item_id"], :name => "index_inventory_report_items_on_item_id"
  add_index "inventory_report_items", ["vendor_id"], :name => "index_inventory_report_items_on_vendor_id"

  create_table "inventory_reports", :force => true do |t|
    t.string   "name"
    t.datetime "created_at", :null => false
    t.datetime "updated_at", :null => false
    t.integer  "vendor_id"
    t.boolean  "hidden"
    t.integer  "hidden_by"
    t.datetime "hidden_at"
    t.integer  "company_id"
    t.integer  "user_id"
  end

  add_index "inventory_reports", ["vendor_id"], :name => "index_inventory_reports_on_vendor_id"

  create_table "invoice_blurbs", :force => true do |t|
    t.string   "lang"
    t.text     "body"
    t.boolean  "is_header"
    t.integer  "vendor_id"
    t.datetime "created_at",   :null => false
    t.datetime "updated_at",   :null => false
    t.text     "body_receipt"
    t.boolean  "hidden"
    t.integer  "hidden_by"
    t.datetime "hidden_at"
    t.integer  "company_id"
    t.integer  "user_id"
  end

  create_table "invoice_notes", :force => true do |t|
    t.string   "name"
    t.text     "note_header"
    t.text     "note_footer"
    t.integer  "origin_country_id"
    t.integer  "destination_country_id"
    t.integer  "vendor_id"
    t.integer  "user_id"
    t.integer  "sale_type_id"
    t.datetime "created_at",             :null => false
    t.datetime "updated_at",             :null => false
    t.boolean  "hidden"
    t.integer  "hidden_by"
    t.datetime "hidden_at"
    t.integer  "company_id"
  end

  create_table "item_shippers", :force => true do |t|
    t.integer  "shipper_id"
    t.integer  "item_id"
    t.float    "purchase_price"
    t.float    "list_price"
    t.string   "item_sku"
    t.string   "shipper_sku"
    t.datetime "created_at",     :null => false
    t.datetime "updated_at",     :null => false
    t.boolean  "hidden"
    t.integer  "hidden_by"
    t.datetime "hidden_at"
    t.integer  "vendor_id"
    t.integer  "company_id"
    t.integer  "user_id"
  end

  add_index "item_shippers", ["company_id"], :name => "index_item_shippers_on_company_id"
  add_index "item_shippers", ["hidden"], :name => "index_item_shippers_on_hidden"
  add_index "item_shippers", ["item_id"], :name => "index_item_shippers_on_item_id"
  add_index "item_shippers", ["shipper_id"], :name => "index_item_shippers_on_shipper_id"
  add_index "item_shippers", ["vendor_id"], :name => "index_item_shippers_on_vendor_id"

  create_table "item_stocks", :force => true do |t|
    t.integer  "item_id"
    t.float    "quantity",      :default => 0.0
    t.integer  "location_id"
    t.datetime "created_at",                     :null => false
    t.datetime "updated_at",                     :null => false
    t.integer  "vendor_id"
    t.boolean  "hidden"
    t.integer  "hidden_by"
    t.datetime "hidden_at"
    t.integer  "company_id"
    t.integer  "user_id"
    t.string   "location_type"
  end

  add_index "item_stocks", ["company_id"], :name => "index_item_stocks_on_company_id"
  add_index "item_stocks", ["hidden"], :name => "index_item_stocks_on_hidden"
  add_index "item_stocks", ["item_id"], :name => "index_item_stocks_on_item_id"
  add_index "item_stocks", ["location_id"], :name => "index_item_stocks_on_location_id"
  add_index "item_stocks", ["vendor_id"], :name => "index_item_stocks_on_vendor_id"

  create_table "item_types", :force => true do |t|
    t.string   "name"
    t.string   "behavior"
    t.datetime "created_at", :null => false
    t.datetime "updated_at", :null => false
    t.integer  "vendor_id"
    t.boolean  "hidden"
    t.integer  "hidden_by"
    t.datetime "hidden_at"
    t.integer  "company_id"
    t.integer  "user_id"
  end

  create_table "items", :force => true do |t|
    t.string   "name"
    t.text     "description"
    t.string   "sku"
    t.string   "image"
    t.integer  "vendor_id"
    t.datetime "created_at",                                  :null => false
    t.datetime "updated_at",                                  :null => false
    t.integer  "location_id"
    t.integer  "category_id"
    t.integer  "tax_profile_id"
    t.integer  "item_type_id"
    t.boolean  "activated"
    t.integer  "void"
    t.integer  "coupon_type"
    t.string   "coupon_applies"
    t.float    "quantity",                 :default => 0.0
    t.float    "quantity_sold",            :default => 0.0
    t.integer  "part_id"
    t.boolean  "calculate_part_price"
    t.float    "height",                   :default => 0.0
    t.float    "weight",                   :default => 0.0
    t.string   "height_metric"
    t.string   "weight_metric",            :default => "g"
    t.float    "length",                   :default => 0.0
    t.float    "width",                    :default => 0.0
    t.string   "length_metric"
    t.string   "width_metric"
    t.boolean  "is_gs1"
    t.boolean  "price_by_qty"
    t.float    "part_quantity",            :default => 0.0
    t.string   "behavior"
    t.string   "sales_metric"
    t.date     "expires_on"
    t.integer  "quantity_buyback",         :default => 0
    t.boolean  "default_buyback"
    t.float    "real_quantity",            :default => 0.0
    t.boolean  "weigh_compulsory"
    t.float    "min_quantity",             :default => 0.0
    t.boolean  "active",                   :default => true
    t.integer  "shipper_id"
    t.string   "shipper_sku"
    t.float    "packaging_unit",           :default => 1.0
    t.boolean  "ignore_qty"
    t.integer  "child_id"
    t.boolean  "must_change_price"
    t.boolean  "hidden_by_distiller"
    t.boolean  "track_expiry"
    t.string   "customs_code"
    t.string   "origin_country"
    t.text     "name_translations"
    t.integer  "hidden_by"
    t.boolean  "real_quantity_updated"
    t.boolean  "hidden"
    t.datetime "hidden_at"
    t.integer  "company_id"
    t.integer  "user_id"
    t.boolean  "is_part"
    t.string   "gs1_format",               :default => "2,3"
    t.integer  "price_cents",              :default => 0
    t.integer  "gift_card_amount_cents",   :default => 0
    t.integer  "purchase_price_cents",     :default => 0
    t.integer  "buy_price_cents",          :default => 0
    t.integer  "manufacturer_price_cents", :default => 0
    t.string   "currency"
    t.integer  "created_by"
    t.string   "longname"
    t.string   "shortname"
    t.date     "expiry_date"
  end

  add_index "items", ["category_id"], :name => "index_items_on_category_id"
  add_index "items", ["child_id"], :name => "index_items_on_child_id"
  add_index "items", ["company_id"], :name => "index_items_on_company_id"
  add_index "items", ["coupon_applies"], :name => "index_items_on_coupon_applies"
  add_index "items", ["coupon_type"], :name => "index_items_on_coupon_type"
  add_index "items", ["hidden"], :name => "index_items_on_hidden"
  add_index "items", ["item_type_id"], :name => "index_items_on_item_type_id"
  add_index "items", ["location_id"], :name => "index_items_on_location_id"
  add_index "items", ["name"], :name => "index_items_on_name"
  add_index "items", ["part_id"], :name => "index_items_on_part_id"
  add_index "items", ["sku"], :name => "index_items_on_sku"
  add_index "items", ["tax_profile_id"], :name => "index_items_on_tax_profile_id"
  add_index "items", ["vendor_id"], :name => "index_items_on_vendor_id"

  create_table "list_items", :force => true do |t|
    t.string   "name"
    t.integer  "quantity"
    t.datetime "created_at",       :null => false
    t.datetime "updated_at",       :null => false
    t.integer  "purchase_item_id"
    t.string   "sku"
    t.integer  "stock"
  end

  create_table "locations", :force => true do |t|
    t.string   "name"
    t.float    "x"
    t.float    "y"
    t.string   "shape"
    t.integer  "vendor_id"
    t.datetime "created_at",                     :null => false
    t.datetime "updated_at",                     :null => false
    t.string   "applies_to"
    t.float    "quantity_sold", :default => 0.0
    t.float    "cash_made",     :default => 0.0
    t.string   "sku",           :default => ""
    t.integer  "hidden_by"
    t.boolean  "hidden"
    t.datetime "hidden_at"
    t.integer  "company_id"
    t.integer  "user_id"
  end

  add_index "locations", ["company_id"], :name => "index_locations_on_company_id"
  add_index "locations", ["hidden"], :name => "index_locations_on_hidden"
  add_index "locations", ["vendor_id"], :name => "index_locations_on_vendor_id"

  create_table "loyalty_cards", :force => true do |t|
    t.integer  "points"
    t.integer  "num_swipes"
    t.integer  "num_used"
    t.integer  "customer_id"
    t.datetime "created_at",   :null => false
    t.datetime "updated_at",   :null => false
    t.string   "sku"
    t.string   "customer_sku"
    t.integer  "vendor_id"
    t.boolean  "hidden"
    t.integer  "hidden_by"
    t.datetime "hidden_at"
    t.integer  "company_id"
    t.integer  "user_id"
  end

  add_index "loyalty_cards", ["company_id"], :name => "index_loyalty_cards_on_company_id"
  add_index "loyalty_cards", ["customer_id"], :name => "index_loyalty_cards_on_customer_id"
  add_index "loyalty_cards", ["hidden"], :name => "index_loyalty_cards_on_hidden"
  add_index "loyalty_cards", ["sku"], :name => "index_loyalty_cards_on_sku"
  add_index "loyalty_cards", ["vendor_id"], :name => "index_loyalty_cards_on_vendor_id"

  create_table "node_messages", :force => true do |t|
    t.string   "source_sku"
    t.string   "dest_sku"
    t.string   "mdhash"
    t.datetime "created_at", :null => false
    t.datetime "updated_at", :null => false
  end

  create_table "node_queues", :force => true do |t|
    t.boolean  "handled",         :default => false
    t.boolean  "send",            :default => false
    t.boolean  "receive",         :default => false
    t.text     "payload"
    t.string   "url"
    t.string   "source_sku"
    t.string   "destination_sku"
    t.string   "owner_type"
    t.integer  "owner_ir"
    t.datetime "created_at",                         :null => false
    t.datetime "updated_at",                         :null => false
  end

  create_table "nodes", :force => true do |t|
    t.string   "name"
    t.string   "sku"
    t.string   "token"
    t.string   "node_type"
    t.string   "url"
    t.boolean  "is_self"
    t.text     "accepted_ips"
    t.integer  "vendor_id"
    t.datetime "created_at",                               :null => false
    t.datetime "updated_at",                               :null => false
    t.string   "status"
    t.boolean  "is_busy",               :default => false
    t.integer  "hidden",                :default => 0
    t.boolean  "accepts_tax_profiles",  :default => true
    t.boolean  "accepts_buttons",       :default => true
    t.boolean  "accepts_categories",    :default => true
    t.boolean  "accepts_items",         :default => true
    t.boolean  "accepts_customers",     :default => true
    t.boolean  "accepts_loyalty_cards", :default => true
    t.boolean  "accepts_discounts",     :default => true
  end

  create_table "notes", :force => true do |t|
    t.string   "title"
    t.text     "body"
    t.integer  "notable_id"
    t.string   "notable_type"
    t.integer  "user_id"
    t.datetime "created_at",   :null => false
    t.datetime "updated_at",   :null => false
    t.boolean  "hidden"
    t.integer  "hidden_by"
    t.datetime "hidden_at"
    t.integer  "vendor_id"
    t.integer  "company_id"
  end

  add_index "notes", ["notable_id"], :name => "index_notes_on_notable_id"
  add_index "notes", ["user_id"], :name => "index_notes_on_user_id"

  create_table "order_items", :force => true do |t|
    t.integer  "order_id"
    t.integer  "item_id"
    t.float    "quantity"
    t.datetime "created_at",                                   :null => false
    t.datetime "updated_at",                                   :null => false
    t.integer  "tax_profile_id"
    t.integer  "item_type_id"
    t.boolean  "activated"
    t.string   "behavior"
    t.float    "tax"
    t.integer  "category_id"
    t.integer  "location_id"
    t.boolean  "refunded"
    t.datetime "refunded_at"
    t.integer  "refunded_by"
    t.float    "rebate"
    t.integer  "coupon_id"
    t.boolean  "is_buyback"
    t.string   "sku"
    t.boolean  "weigh_compulsory"
    t.boolean  "no_inc"
    t.boolean  "action_applied"
    t.integer  "vendor_id"
    t.integer  "hidden_by"
    t.boolean  "hidden"
    t.datetime "hidden_at"
    t.integer  "company_id"
    t.integer  "user_id"
    t.float    "discount"
    t.boolean  "calculate_part_price"
    t.integer  "drawer_id"
    t.integer  "price_cents",                   :default => 0
    t.integer  "gift_card_amount_cents",        :default => 0
    t.integer  "tax_amount_cents",              :default => 0
    t.integer  "coupon_amount_cents",           :default => 0
    t.integer  "discount_amount_cents",         :default => 0
    t.integer  "rebate_amount_cents",           :default => 0
    t.integer  "total_cents",                   :default => 0
    t.datetime "completed_at"
    t.string   "currency"
    t.boolean  "is_proforma"
    t.boolean  "is_quote"
    t.boolean  "is_unpaid"
    t.boolean  "paid"
    t.datetime "paid_at"
    t.integer  "refund_payment_method_item_id"
  end

  add_index "order_items", ["activated"], :name => "index_order_items_on_activated"
  add_index "order_items", ["behavior"], :name => "index_order_items_on_behavior"
  add_index "order_items", ["category_id"], :name => "index_order_items_on_category_id"
  add_index "order_items", ["company_id"], :name => "index_order_items_on_company_id"
  add_index "order_items", ["completed_at"], :name => "index_order_items_on_completed_at"
  add_index "order_items", ["coupon_id"], :name => "index_order_items_on_coupon_id"
  add_index "order_items", ["drawer_id"], :name => "index_order_items_on_drawer_id"
  add_index "order_items", ["hidden"], :name => "index_order_items_on_hidden"
  add_index "order_items", ["is_buyback"], :name => "index_order_items_on_is_buyback"
  add_index "order_items", ["is_proforma"], :name => "index_order_items_on_is_proforma"
  add_index "order_items", ["is_quote"], :name => "index_order_items_on_is_quote"
  add_index "order_items", ["item_id"], :name => "index_order_items_on_item_id"
  add_index "order_items", ["item_type_id"], :name => "index_order_items_on_item_type_id"
  add_index "order_items", ["location_id"], :name => "index_order_items_on_location_id"
  add_index "order_items", ["no_inc"], :name => "index_order_items_on_no_inc"
  add_index "order_items", ["order_id"], :name => "index_order_items_on_order_id"
  add_index "order_items", ["refunded"], :name => "index_order_items_on_refunded"
  add_index "order_items", ["sku"], :name => "index_order_items_on_sku"
  add_index "order_items", ["tax"], :name => "index_order_items_on_tax"
  add_index "order_items", ["tax_profile_id"], :name => "index_order_items_on_tax_profile_id"
  add_index "order_items", ["total_cents"], :name => "index_order_items_on_total_cents"
  add_index "order_items", ["user_id"], :name => "index_order_items_on_user_id"
  add_index "order_items", ["vendor_id"], :name => "index_order_items_on_vendor_id"

  create_table "orders", :force => true do |t|
    t.datetime "created_at",                            :null => false
    t.datetime "updated_at",                            :null => false
    t.integer  "vendor_id"
    t.integer  "user_id"
    t.integer  "location_id"
    t.integer  "cash_register_id"
    t.integer  "customer_id"
    t.float    "rebate"
    t.integer  "lc_points"
    t.string   "tag"
    t.boolean  "buy_order"
    t.boolean  "was_printed"
    t.string   "sku"
    t.integer  "drawer_id"
    t.integer  "origin_country_id"
    t.integer  "destination_country_id"
    t.integer  "sale_type_id"
    t.text     "invoice_comment"
    t.text     "delivery_note_comment"
    t.integer  "nr"
    t.boolean  "is_proforma"
    t.integer  "hidden_by"
    t.boolean  "is_unpaid"
    t.integer  "qnr"
    t.boolean  "is_quote"
    t.boolean  "hidden"
    t.datetime "hidden_at"
    t.integer  "company_id"
    t.boolean  "paid"
    t.datetime "paid_at"
    t.float    "tax"
    t.integer  "tax_profile_id"
    t.integer  "total_cents",            :default => 0
    t.integer  "tax_amount_cents",       :default => 0
    t.integer  "cash_cents",             :default => 0
    t.integer  "lc_amount_cents",        :default => 0
    t.integer  "change_cents",           :default => 0
    t.integer  "payment_total_cents",    :default => 0
    t.integer  "noncash_cents",          :default => 0
    t.integer  "rebate_amount_cents",    :default => 0
    t.datetime "completed_at"
    t.string   "currency"
    t.integer  "proforma_order_id"
    t.datetime "payment_due"
    t.boolean  "subscription"
    t.integer  "subscription_interval"
    t.integer  "subscription_order_id"
    t.datetime "subscription_start"
    t.datetime "subscription_next"
    t.datetime "subscription_last"
  end

  add_index "orders", ["cash_register_id"], :name => "index_orders_on_cash_register_id"
  add_index "orders", ["company_id"], :name => "index_orders_on_company_id"
  add_index "orders", ["customer_id"], :name => "index_orders_on_customer_id"
  add_index "orders", ["drawer_id"], :name => "index_orders_on_drawer_id"
  add_index "orders", ["hidden"], :name => "index_orders_on_hidden"
  add_index "orders", ["location_id"], :name => "index_orders_on_location_id"
  add_index "orders", ["paid"], :name => "index_orders_on_paid"
  add_index "orders", ["user_id"], :name => "index_orders_on_user_id"
  add_index "orders", ["vendor_id"], :name => "index_orders_on_vendor_id"

  create_table "payment_method_items", :force => true do |t|
    t.integer  "order_id"
    t.datetime "created_at",                       :null => false
    t.datetime "updated_at",                       :null => false
    t.integer  "vendor_id"
    t.boolean  "hidden"
    t.integer  "hidden_by"
    t.datetime "hidden_at"
    t.integer  "company_id"
    t.integer  "user_id"
    t.integer  "drawer_id"
    t.integer  "payment_method_id"
    t.boolean  "cash"
    t.boolean  "change"
    t.integer  "cash_register_id"
    t.boolean  "unpaid"
    t.boolean  "quote"
    t.boolean  "refund"
    t.integer  "amount_cents",      :default => 0
    t.string   "currency"
    t.integer  "order_item_id"
    t.boolean  "is_proforma"
    t.boolean  "is_quote"
    t.boolean  "is_unpaid"
    t.boolean  "paid"
    t.datetime "paid_at"
    t.datetime "completed_at"
  end

  add_index "payment_method_items", ["cash"], :name => "index_payment_method_items_on_cash"
  add_index "payment_method_items", ["cash_register_id"], :name => "index_payment_method_items_on_cash_register_id"
  add_index "payment_method_items", ["change"], :name => "index_payment_method_items_on_change"
  add_index "payment_method_items", ["company_id"], :name => "index_payment_method_items_on_company_id"
  add_index "payment_method_items", ["completed_at"], :name => "index_payment_method_items_on_completed_at"
  add_index "payment_method_items", ["drawer_id"], :name => "index_payment_method_items_on_drawer_id"
  add_index "payment_method_items", ["hidden"], :name => "index_payment_method_items_on_hidden"
  add_index "payment_method_items", ["is_proforma"], :name => "index_payment_method_items_on_is_proforma"
  add_index "payment_method_items", ["is_quote"], :name => "index_payment_method_items_on_is_quote"
  add_index "payment_method_items", ["order_id"], :name => "index_payment_methods_on_order_id"
  add_index "payment_method_items", ["payment_method_id"], :name => "index_payment_method_items_on_payment_method_id"
  add_index "payment_method_items", ["refund"], :name => "index_payment_method_items_on_refund"
  add_index "payment_method_items", ["user_id"], :name => "index_payment_method_items_on_user_id"
  add_index "payment_method_items", ["vendor_id"], :name => "index_payment_method_items_on_vendor_id"

  create_table "payment_methods", :force => true do |t|
    t.string   "name"
    t.string   "internal_type"
    t.integer  "vendor_id"
    t.datetime "created_at",                   :null => false
    t.datetime "updated_at",                   :null => false
    t.integer  "hidden",        :default => 0
    t.boolean  "cash"
    t.boolean  "change"
    t.boolean  "unpaid"
    t.boolean  "quote"
    t.integer  "position"
    t.integer  "company_id"
    t.datetime "hidden_at"
    t.integer  "hidden_by"
  end

  create_table "plugins", :force => true do |t|
    t.string   "name"
    t.string   "filename"
    t.string   "base_path"
    t.integer  "company_id"
    t.integer  "vendor_id"
    t.boolean  "hidden"
    t.integer  "hidden_by"
    t.datetime "hidden_at"
    t.datetime "created_at", :null => false
    t.datetime "updated_at", :null => false
    t.text     "files"
    t.text     "meta"
  end

  add_index "plugins", ["company_id"], :name => "index_plugins_on_company_id"
  add_index "plugins", ["hidden_by"], :name => "index_plugins_on_hidden_by"
  add_index "plugins", ["vendor_id"], :name => "index_plugins_on_vendor_id"

  create_table "purchase_items", :force => true do |t|
    t.datetime "created_at", :null => false
    t.datetime "updated_at", :null => false
    t.string   "name"
  end

  create_table "receipts", :force => true do |t|
    t.string   "ip"
    t.integer  "cash_register_id"
    t.datetime "created_at",       :null => false
    t.datetime "updated_at",       :null => false
    t.integer  "vendor_id"
    t.integer  "order_id"
    t.binary   "content"
    t.boolean  "hidden"
    t.integer  "hidden_by"
    t.datetime "hidden_at"
    t.integer  "company_id"
    t.integer  "user_id"
    t.integer  "drawer_id"
  end

  create_table "reminders", :force => true do |t|
    t.datetime "created_at", :null => false
    t.datetime "updated_at", :null => false
  end

  create_table "roles", :force => true do |t|
    t.string   "name"
    t.integer  "vendor_id"
    t.integer  "company_id"
    t.datetime "created_at", :null => false
    t.datetime "updated_at", :null => false
    t.boolean  "hidden"
    t.integer  "hidden_by"
    t.datetime "hidden_at"
    t.integer  "user_id"
  end

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

  create_table "sale_types", :force => true do |t|
    t.string   "name"
    t.integer  "vendor_id"
    t.integer  "user_id"
    t.datetime "created_at", :null => false
    t.datetime "updated_at", :null => false
    t.integer  "hidden_by"
    t.boolean  "hidden"
    t.datetime "hidden_at"
    t.integer  "company_id"
  end

  create_table "shipment_items", :force => true do |t|
    t.string   "name"
    t.integer  "category_id"
    t.integer  "location_id"
    t.integer  "item_type_id"
    t.string   "sku"
    t.integer  "shipment_id"
    t.datetime "created_at",                                :null => false
    t.datetime "updated_at",                                :null => false
    t.boolean  "in_stock"
    t.float    "quantity"
    t.integer  "hidden_by"
    t.integer  "vendor_id"
    t.boolean  "hidden"
    t.datetime "hidden_at"
    t.integer  "company_id"
    t.integer  "user_id"
    t.integer  "price_cents",                :default => 0
    t.integer  "purchase_price_cents",       :default => 0
    t.string   "currency"
    t.integer  "total_cents"
    t.integer  "purchase_price_total_cents"
    t.integer  "tax_profile_id"
    t.float    "in_stock_quantity"
  end

  add_index "shipment_items", ["category_id"], :name => "index_shipment_items_on_category_id"
  add_index "shipment_items", ["company_id"], :name => "index_shipment_items_on_company_id"
  add_index "shipment_items", ["hidden"], :name => "index_shipment_items_on_hidden"
  add_index "shipment_items", ["item_type_id"], :name => "index_shipment_items_on_item_type_id"
  add_index "shipment_items", ["location_id"], :name => "index_shipment_items_on_location_id"
  add_index "shipment_items", ["shipment_id"], :name => "index_shipment_items_on_shipment_id"
  add_index "shipment_items", ["vendor_id"], :name => "index_shipment_items_on_vendor_id"

  create_table "shipment_items_stock_locations", :id => false, :force => true do |t|
    t.integer "shipment_item_id"
    t.integer "stock_location_id"
  end

  add_index "shipment_items_stock_locations", ["shipment_item_id", "stock_location_id"], :name => "shipment_items_stock"

  create_table "shipment_types", :force => true do |t|
    t.string   "name"
    t.integer  "user_id"
    t.datetime "created_at", :null => false
    t.datetime "updated_at", :null => false
    t.integer  "vendor_id"
    t.integer  "hidden_by"
    t.boolean  "hidden"
    t.datetime "hidden_at"
    t.integer  "company_id"
  end

  add_index "shipment_types", ["name"], :name => "index_shipment_types_on_name"
  add_index "shipment_types", ["user_id"], :name => "index_shipment_types_on_user_id"

  create_table "shipments", :force => true do |t|
    t.string   "receiver_id"
    t.string   "shipper_id"
    t.string   "shipper_type"
    t.string   "receiver_type"
    t.boolean  "paid"
    t.integer  "user_id"
    t.string   "status"
    t.datetime "created_at",                                :null => false
    t.datetime "updated_at",                                :null => false
    t.string   "name"
    t.integer  "vendor_id"
    t.integer  "shipment_type_id"
    t.string   "sku"
    t.integer  "hidden_by"
    t.boolean  "hidden"
    t.datetime "hidden_at"
    t.integer  "company_id"
    t.integer  "price_cents",                :default => 0
    t.string   "currency"
    t.integer  "total_cents"
    t.integer  "purchase_price_total_cents"
  end

  add_index "shipments", ["company_id"], :name => "index_shipments_on_company_id"
  add_index "shipments", ["hidden"], :name => "index_shipments_on_hidden"
  add_index "shipments", ["receiver_id"], :name => "index_shipments_on_receiver_id"
  add_index "shipments", ["shipper_id"], :name => "index_shipments_on_shipper_id"
  add_index "shipments", ["user_id"], :name => "index_shipments_on_user_id"
  add_index "shipments", ["vendor_id"], :name => "index_shipments_on_vendor_id"

  create_table "shippers", :force => true do |t|
    t.string   "name"
    t.string   "contact_person"
    t.string   "contact_phone"
    t.string   "contact_fax"
    t.string   "contact_email"
    t.integer  "user_id"
    t.text     "contact_address"
    t.datetime "created_at",      :null => false
    t.datetime "updated_at",      :null => false
    t.string   "reorder_type"
    t.string   "sku"
    t.integer  "vendor_id"
    t.integer  "hidden_by"
    t.boolean  "hidden"
    t.datetime "hidden_at"
    t.integer  "company_id"
    t.string   "import_format"
    t.string   "csv_url"
  end

  add_index "shippers", ["user_id"], :name => "index_shippers_on_user_id"

  create_table "stock_locations", :force => true do |t|
    t.string   "name"
    t.integer  "vendor_id"
    t.datetime "created_at", :null => false
    t.datetime "updated_at", :null => false
    t.integer  "hidden_by"
    t.boolean  "hidden"
    t.datetime "hidden_at"
    t.integer  "company_id"
    t.integer  "user_id"
  end

  add_index "stock_locations", ["vendor_id"], :name => "index_stock_locations_on_vendor_id"

  create_table "stock_transactions", :force => true do |t|
    t.integer  "company_id"
    t.integer  "vendor_id"
    t.integer  "user_id"
    t.integer  "cash_register_id"
    t.integer  "order_id"
    t.integer  "from_id"
    t.string   "from_type"
    t.integer  "to_id"
    t.string   "to_type"
    t.float    "from_quantity"
    t.float    "to_quantity"
    t.float    "quantity"
    t.boolean  "hidden"
    t.integer  "hidden_by"
    t.datetime "hidden_at"
    t.datetime "created_at",       :null => false
    t.datetime "updated_at",       :null => false
  end

  create_table "tax_profiles", :force => true do |t|
    t.string   "name"
    t.float    "value"
    t.integer  "default"
    t.datetime "created_at", :null => false
    t.datetime "updated_at", :null => false
    t.integer  "user_id"
    t.string   "sku"
    t.integer  "vendor_id"
    t.string   "letter"
    t.integer  "hidden_by"
    t.boolean  "hidden"
    t.datetime "hidden_at"
    t.integer  "company_id"
    t.string   "color"
  end

  add_index "tax_profiles", ["user_id"], :name => "index_tax_profiles_on_user_id"

  create_table "transaction_tags", :force => true do |t|
    t.string   "name"
    t.integer  "vendor_id"
    t.datetime "created_at", :null => false
    t.datetime "updated_at", :null => false
    t.integer  "hidden_by"
    t.boolean  "hidden"
    t.datetime "hidden_at"
    t.integer  "company_id"
    t.integer  "user_id"
  end

  create_table "user_logins", :force => true do |t|
    t.datetime "login"
    t.datetime "logout"
    t.float    "hourly_rate"
    t.integer  "user_id"
    t.integer  "vendor_id"
    t.integer  "shift_seconds"
    t.float    "amount_due"
    t.datetime "created_at",    :null => false
    t.datetime "updated_at",    :null => false
    t.integer  "company_id"
    t.boolean  "hidden"
    t.integer  "hidden_by"
    t.datetime "hidden_at"
  end

  add_index "user_logins", ["user_id"], :name => "index_employee_logins_on_employee_id"

  create_table "user_meta", :force => true do |t|
    t.integer  "user_id"
    t.string   "key"
    t.text     "value"
    t.datetime "created_at", :null => false
    t.datetime "updated_at", :null => false
  end

  add_index "user_meta", ["user_id"], :name => "index_user_meta_on_user_id"

  create_table "users", :force => true do |t|
    t.string   "email",                                 :default => "", :null => false
    t.string   "encrypted_password",     :limit => 128, :default => "", :null => false
    t.string   "reset_password_token"
    t.datetime "reset_password_sent_at"
    t.datetime "remember_created_at"
    t.integer  "sign_in_count",                         :default => 0
    t.datetime "current_sign_in_at"
    t.datetime "last_sign_in_at"
    t.string   "current_sign_in_ip"
    t.string   "last_sign_in_ip"
    t.datetime "created_at",                                            :null => false
    t.datetime "updated_at",                                            :null => false
    t.string   "username"
    t.integer  "vendor_id"
    t.string   "first_name"
    t.string   "last_name"
    t.string   "language"
    t.string   "theme"
    t.boolean  "js_keyboard"
    t.string   "apitoken"
    t.integer  "uses_drawer_id"
    t.integer  "auth_code"
    t.string   "last_path"
    t.string   "role_cache"
    t.float    "hourly_rate"
    t.string   "telephone"
    t.string   "cellphone"
    t.text     "address"
    t.integer  "current_order_id"
    t.integer  "company_id"
    t.boolean  "hidden"
    t.datetime "hidden_at"
    t.integer  "hidden_by"
    t.integer  "drawer_id"
    t.string   "id_hash"
  end

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

  create_table "vendors", :force => true do |t|
    t.string   "name"
    t.integer  "user_id"
    t.text     "description"
    t.datetime "created_at",                                                :null => false
    t.datetime "updated_at",                                                :null => false
    t.boolean  "multi_currency"
    t.string   "sku"
    t.string   "token"
    t.string   "email"
    t.boolean  "use_order_numbers",                 :default => true
    t.string   "unused_order_numbers",              :default => "--- []\n"
    t.integer  "largest_order_number",              :default => 0
    t.integer  "hidden_by"
    t.binary   "receipt_logo_header"
    t.binary   "receipt_logo_footer"
    t.boolean  "use_quote_numbers",                 :default => true
    t.string   "unused_quote_numbers",              :default => "--- []\n"
    t.integer  "largest_quote_number",              :default => 0
    t.string   "time_zone"
    t.string   "hash_id"
    t.boolean  "hidden"
    t.datetime "hidden_at"
    t.integer  "vendor_id"
    t.integer  "company_id"
    t.float    "lp_per_dollar"
    t.float    "dollar_per_lp"
    t.text     "address"
    t.string   "telephone"
    t.text     "receipt_blurb"
    t.integer  "pagination",                        :default => 10
    t.string   "stylesheets"
    t.string   "cash_drawer"
    t.boolean  "open_cash_drawer"
    t.datetime "last_wholesaler_check"
    t.text     "csv_imports"
    t.string   "csv_imports_url"
    t.boolean  "items_view_list"
    t.boolean  "salor_printer"
    t.text     "receipt_blurb_footer"
    t.boolean  "license_accepted"
    t.boolean  "csv_categories"
    t.boolean  "csv_buttons"
    t.boolean  "csv_discounts"
    t.boolean  "csv_customers"
    t.boolean  "csv_loyalty_cards"
    t.text     "invoice_blurb"
    t.text     "invoice_blurb_footer"
    t.string   "gs1_format",                        :default => "2,5,5"
    t.string   "country",                           :default => "us"
    t.integer  "largest_drawer_transaction_number", :default => 0
    t.boolean  "enable_technician_emails"
    t.string   "technician_email"
    t.string   "identifier"
    t.string   "full_subdomain"
    t.string   "full_url"
    t.string   "virtualhost_filter"
    t.integer  "auth_https_mode"
    t.boolean  "https"
    t.boolean  "auth"
    t.string   "domain"
    t.string   "subdomain"
    t.string   "currency",                          :default => "USD"
    t.integer  "pagination_invoice_one",            :default => 20
    t.integer  "pagination_invoice_other",          :default => 30
  end

  add_index "vendors", ["user_id"], :name => "index_vendors_on_user_id"

end


text:
using Microsoft.DotNet.Cli.Utils;

namespace Brthor.Dockerize
{
    public class DockerizeConfiguration
    {
        private string _generatedImageTag;

        /// <summary>
        /// The base docker image used for the generated docker file. If you change this from the default, be sure to
        /// update BaseRid if appropriate. Defaults to "microsoft/dotnet:2.0-runtime".
        /// </summary>
        public string BaseImage { get; }

        /// <summary>
        /// The RID of the specified Base Docker image. Defaults to "linux-x64".
        /// </summary>
        public string BaseRid { get; }

        public string GeneratedImageTag { get; }

        public string BuildConfiguration { get; }

        public string Username { get; }

        public DockerizeConfiguration(string projectName, string configuration, string tag, string baseRid, string baseImage,
            string username=null)
        {
            GeneratedImageTag = tag ?? projectName;
            BaseRid = baseRid ?? "linux-x64";
            BaseImage = baseImage ?? "microsoft/dotnet:2.0-runtime";
            BuildConfiguration = configuration ?? "Release";
            Username = username;

            Reporter.Output.WriteLine($"Dockerize.NET".Blue());
            Reporter.Output.WriteLine("Base Docker Image: ".White() +  $"{BaseImage}".Green());
            Reporter.Output.WriteLine("Base Rid of Docker Image: ".White() + $"{BaseRid}".Green());
            Reporter.Output.WriteLine("Tag: ".White() + $"{GeneratedImageTag}".Green());

            if (Username != null)
                Reporter.Output.WriteLine("Username: ".White() + $"{Username}".Green());
        }
    }
}

redpajama_set_name: RedPajamaGithub


text:
package net.deepwater.engine;

/**
 * Created by Kyle on 9/6/2015.
 */
public abstract class GameState extends EventListener{
    public abstract void update(float dt);
    public abstract void render();
    public abstract void start();
    public abstract void pause();
    public abstract void resume();
    public abstract void stop();
}


text:
/**
 * Created by ins0m on 26.01.14.
 */
$(document)
	.ready(function() {

		var theBigBar = $('#master-sidebar-big');
		var theSmallBar =$('#master-sidebar-small');
		theBigBar.sidebar().sidebar('show');
		theSmallBar.sidebar();

		$('#master-sidebar-expand').click(function() {
			if (theBigBar.sidebar('is open')){
				theSmallBar.sidebar('show');
				$('#master-sidebar-expand-icon').removeClass().addClass("right arrow icon");
			} else {
				theBigBar.sidebar('show');
				$('#master-sidebar-expand-icon').removeClass().addClass("left arrow icon");
			}

		});

        $('#background-blue-abstract').click(function() {
            $('body').css('background','url("../res/img/blue-abstract.jpg")');
            $('body').css('background-size','100% 100%');
        });

        $('#background-wood').click(function() {
            $('body').css('background','url("../res/img/wood.jpg")');
            $('body').css('background-size','100% 100%');
        });

		$('#background-grid').click(function() {
			$('body').css('background','url("../res/img/grid.jpg")');
			$('body').css('background-size','initial');
		});

		$('#background-black-c').click(function() {
			$('body').css('background','black');
			$('body').css('background-size','100% 100%');
		});

		$('#background-white').click(function() {
			$('body').css('background','white');
			$('body').css('background-size','100% 100%');
		});

		$('.ui.dropdown')
			.dropdown()
		;
	});


text:
from django.urls import path

from . import views

urlpatterns = [
    # Comapny
    path('', views.CompanyListView.as_view(), name="list"),
    path('create', views.CompanyCreate.as_view(), name="create"),
    path('create_from_krs', views.CompanyCreateFromKRSView.as_view(), name="create_from_krs"),
    path('<int:pk>/edit', views.CompanyUpdate.as_view(), name="edit"),
    path('<int:pk>/delete', views.CompanyDelete.as_view(), name="delete"),
    # url(r'(?P<code>[-\w]+)/history$',
    #     views.CompanyHistoryView.as_view(), name="view-history"),
    path('<int:pk>', views.CompanyDetailView.as_view(), name="detail"),
    # Brand
    path('brand', views.BrandListView.as_view(), name="brand-list"),
    path('create-brand', views.BrandCreate.as_view(), name="brand-create"),
    path('brand/<int:pk>/edit', views.BrandUpdate.as_view(), name="brand-edit"),
    path('brand/<int:pk>/delete', views.BrandDelete.as_view(), name="brand-delete"),
    path('brand/<int:pk>/', views.BrandDetailView.as_view(), name="brand-detail"),
    path('brand', views.BrandListView.as_view(), name="brand-list"),
    # Autocomplete
    path('autocomplete/company', views.CompanyAutocomplete.as_view(), name='company-autocomplete'),
    path(r'autocomplete/brand/', views.BrandAutocomplete.as_view(), name='brand-autocomplete'),
]


text:
package js_test

import "testing"

//gopherjs:prune-original
func TestIntConversion(t *testing.T) {
	// Same as upstream, but only test cases appropriate for a 32-bit environment.
	testIntConversion(t, 0)
	testIntConversion(t, 1)
	testIntConversion(t, -1)
	testIntConversion(t, 1<<20)
	testIntConversion(t, -1<<20)
}

func TestGarbageCollection(t *testing.T) {
	t.Skip("GC is not supported by GopherJS")
}


text:
from neutron.openstack.common import excutils
from neutron.openstack.common import jsonutils
from neutron.openstack.common import log as logging
from neutron.plugins.vmware.common import utils
from neutron.plugins.vmware.vshield.common import (
    constants as vcns_const)
from neutron.plugins.vmware.vshield.common import constants as common_constants
from neutron.plugins.vmware.vshield.common import exceptions
from neutron.plugins.vmware.vshield.tasks import constants
from neutron.plugins.vmware.vshield.tasks import tasks

LOG = logging.getLogger(__name__)

class EdgeApplianceDriver(object):
    def __init__(self):
        # store the last task per edge that has the latest config
        self.updated_task = {
            'nat': {},
            'route': {},
        }

    def _assemble_edge(self, name, appliance_size="compact",
                       deployment_container_id=None, datacenter_moid=None,
                       enable_aesni=True, hypervisor_assist=False,
                       enable_fips=False, remote_access=False):
        edge = {
            'name': name,
            'fqdn': name,
            'hypervisorAssist': hypervisor_assist,
            'type': 'gatewayServices',
            'enableAesni': enable_aesni,
            'enableFips': enable_fips,
            'cliSettings': {
                'remoteAccess': remote_access
            },
            'appliances': {
                'applianceSize': appliance_size
            },
            'vnics': {
                'vnics': []
            }
        }
        if deployment_container_id:
            edge['appliances']['deploymentContainerId'] = (
                deployment_container_id)
        if datacenter_moid:
            edge['datacenterMoid'] = datacenter_moid,

        return edge

    def _assemble_edge_appliance(self, resource_pool_id, datastore_id):
        appliance = {}
        if resource_pool_id:
            appliance['resourcePoolId'] = resource_pool_id
        if datastore_id:
            appliance['datastoreId'] = datastore_id
        return appliance

    def _assemble_edge_vnic(self, name, index, portgroup_id,
                            primary_address=None, subnet_mask=None,
                            secondary=None,
                            type="internal",
                            enable_proxy_arp=False,
                            enable_send_redirects=True,
                            is_connected=True,
                            mtu=1500):
        vnic = {
            'index': index,
            'name': name,
            'type': type,
            'portgroupId': portgroup_id,
            'mtu': mtu,
            'enableProxyArp': enable_proxy_arp,
            'enableSendRedirects': enable_send_redirects,
            'isConnected': is_connected
        }
        if primary_address and subnet_mask:
            address_group = {
                'primaryAddress': primary_address,
                'subnetMask': subnet_mask
            }
            if secondary:
                address_group['secondaryAddresses'] = {
                    'ipAddress': secondary,
                    'type': 'IpAddressesDto'
                }

            vnic['addressGroups'] = {
                'addressGroups': [address_group]
            }

        return vnic

    def _edge_status_to_level(self, status):
        if status == 'GREEN':
            status_level = common_constants.RouterStatus.ROUTER_STATUS_ACTIVE
        elif status in ('GREY', 'YELLOW'):
            status_level = common_constants.RouterStatus.ROUTER_STATUS_DOWN
        else:
            status_level = common_constants.RouterStatus.ROUTER_STATUS_ERROR
        return status_level

    def _enable_loadbalancer(self, edge):
        if not edge.get('featureConfigs') or (
            not edge['featureConfigs'].get('features')):
            edge['featureConfigs'] = {'features': []}
        edge['featureConfigs']['features'].append(
            {'featureType': 'loadbalancer_4.0',
             'enabled': True})

    def get_edge_status(self, edge_id):
        try:
            response = self.vcns.get_edge_status(edge_id)[1]
            status_level = self._edge_status_to_level(
                response['edgeStatus'])
        except exceptions.VcnsApiException as e:
            LOG.exception(_("VCNS: Failed to get edge status:\n%s"),
                          e.response)
            status_level = common_constants.RouterStatus.ROUTER_STATUS_ERROR
            try:
                desc = jsonutils.loads(e.response)
                if desc.get('errorCode') == (
                    vcns_const.VCNS_ERROR_CODE_EDGE_NOT_RUNNING):
                    status_level = (
                        common_constants.RouterStatus.ROUTER_STATUS_DOWN)
            except ValueError:
                LOG.exception(e.response)

        return status_level

    def get_edges_statuses(self):
        edges_status_level = {}
        edges = self._get_edges()
        for edge in edges['edgePage'].get('data', []):
            edge_id = edge['id']
            status = edge['edgeStatus']
            edges_status_level[edge_id] = self._edge_status_to_level(status)

        return edges_status_level

    def _update_interface(self, task):
        edge_id = task.userdata['edge_id']
        config = task.userdata['config']
        LOG.debug(_("VCNS: start updating vnic %s"), config)
        try:
            self.vcns.update_interface(edge_id, config)
        except exceptions.VcnsApiException as e:
            with excutils.save_and_reraise_exception():
                LOG.exception(_("VCNS: Failed to update vnic %(config)s:\n"
                                "%(response)s"), {
                                    'config': config,
                                    'response': e.response})
        except Exception:
            with excutils.save_and_reraise_exception():
                LOG.exception(_("VCNS: Failed to update vnic %d"),
                              config['index'])

        return constants.TaskStatus.COMPLETED

    def update_interface(self, router_id, edge_id, index, network,
                         address=None, netmask=None, secondary=None,
                         jobdata=None):
        LOG.debug(_("VCNS: update vnic %(index)d: %(addr)s %(netmask)s"), {
            'index': index, 'addr': address, 'netmask': netmask})
        if index == vcns_const.EXTERNAL_VNIC_INDEX:
            name = vcns_const.EXTERNAL_VNIC_NAME
            intf_type = 'uplink'
        elif index == vcns_const.INTERNAL_VNIC_INDEX:
            name = vcns_const.INTERNAL_VNIC_NAME
            intf_type = 'internal'
        else:
            msg = _("Vnic %d currently not supported") % index
            raise exceptions.VcnsGeneralException(msg)

        config = self._assemble_edge_vnic(
            name, index, network, address, netmask, secondary, type=intf_type)

        userdata = {
            'edge_id': edge_id,
            'config': config,
            'jobdata': jobdata
        }
        task_name = "update-interface-%s-%d" % (edge_id, index)
        task = tasks.Task(task_name, router_id,
                          self._update_interface, userdata=userdata)
        task.add_result_monitor(self.callbacks.interface_update_result)
        self.task_manager.add(task)
        return task

    def _deploy_edge(self, task):
        userdata = task.userdata
        name = userdata['router_name']
        LOG.debug(_("VCNS: start deploying edge %s"), name)
        request = userdata['request']
        try:
            header = self.vcns.deploy_edge(request)[0]
            objuri = header['location']
            job_id = objuri[objuri.rfind("/") + 1:]
            response = self.vcns.get_edge_id(job_id)[1]
            edge_id = response['edgeId']
            LOG.debug(_("VCNS: deploying edge %s"), edge_id)
            userdata['edge_id'] = edge_id
            status = constants.TaskStatus.PENDING
        except exceptions.VcnsApiException:
            with excutils.save_and_reraise_exception():
                LOG.exception(_("VCNS: deploy edge failed for router %s."),
                              name)

        return status

    def _status_edge(self, task):
        edge_id = task.userdata['edge_id']
        try:
            response = self.vcns.get_edge_deploy_status(edge_id)[1]
            task.userdata['retries'] = 0
            system_status = response.get('systemStatus', None)
            if system_status is None:
                status = constants.TaskStatus.PENDING
            elif system_status == 'good':
                status = constants.TaskStatus.COMPLETED
            else:
                status = constants.TaskStatus.ERROR
        except exceptions.VcnsApiException:
            with excutils.save_and_reraise_exception():
                LOG.exception(_("VCNS: Edge %s status query failed."), edge_id)
        except Exception:
            retries = task.userdata.get('retries', 0) + 1
            if retries < 3:
                task.userdata['retries'] = retries
                msg = _("VCNS: Unable to retrieve edge %(edge_id)s status. "
                        "Retry %(retries)d.") % {
                            'edge_id': edge_id,
                            'retries': retries}
                LOG.exception(msg)
                status = constants.TaskStatus.PENDING
            else:
                msg = _("VCNS: Unable to retrieve edge %s status. "
                        "Abort.") % edge_id
                LOG.exception(msg)
                status = constants.TaskStatus.ERROR
        LOG.debug(_("VCNS: Edge %s status"), edge_id)
        return status

    def _result_edge(self, task):
        router_name = task.userdata['router_name']
        edge_id = task.userdata.get('edge_id')
        if task.status != constants.TaskStatus.COMPLETED:
            LOG.error(_("VCNS: Failed to deploy edge %(edge_id)s "
                        "for %(name)s, status %(status)d"), {
                            'edge_id': edge_id,
                            'name': router_name,
                            'status': task.status
                        })
        else:
            LOG.debug(_("VCNS: Edge %(edge_id)s deployed for "
                        "router %(name)s"), {
                            'edge_id': edge_id, 'name': router_name
                        })

    def _delete_edge(self, task):
        edge_id = task.userdata['edge_id']
        LOG.debug(_("VCNS: start destroying edge %s"), edge_id)
        status = constants.TaskStatus.COMPLETED
        if edge_id:
            try:
                self.vcns.delete_edge(edge_id)
            except exceptions.ResourceNotFound:
                pass
            except exceptions.VcnsApiException as e:
                msg = _("VCNS: Failed to delete %(edge_id)s:\n"
                        "%(response)s") % {
                            'edge_id': edge_id, 'response': e.response}
                LOG.exception(msg)
                status = constants.TaskStatus.ERROR
            except Exception:
                LOG.exception(_("VCNS: Failed to delete %s"), edge_id)
                status = constants.TaskStatus.ERROR

        return status

    def _get_edges(self):
        try:
            return self.vcns.get_edges()[1]
        except exceptions.VcnsApiException as e:
            with excutils.save_and_reraise_exception():
                LOG.exception(_("VCNS: Failed to get edges:\n%s"), e.response)

    def deploy_edge(self, router_id, name, internal_network, jobdata=None,
                    wait_for_exec=False, loadbalancer_enable=True):
        task_name = 'deploying-%s' % name
        edge_name = name
        edge = self._assemble_edge(
            edge_name, datacenter_moid=self.datacenter_moid,
            deployment_container_id=self.deployment_container_id,
            appliance_size='large', remote_access=True)
        appliance = self._assemble_edge_appliance(self.resource_pool_id,
                                                  self.datastore_id)
        if appliance:
            edge['appliances']['appliances'] = [appliance]

        vnic_external = self._assemble_edge_vnic(
            vcns_const.EXTERNAL_VNIC_NAME, vcns_const.EXTERNAL_VNIC_INDEX,
            self.external_network, type="uplink")
        edge['vnics']['vnics'].append(vnic_external)
        vnic_inside = self._assemble_edge_vnic(
            vcns_const.INTERNAL_VNIC_NAME, vcns_const.INTERNAL_VNIC_INDEX,
            internal_network,
            vcns_const.INTEGRATION_EDGE_IPADDRESS,
            vcns_const.INTEGRATION_SUBNET_NETMASK,
            type="internal")
        edge['vnics']['vnics'].append(vnic_inside)
        if loadbalancer_enable:
            self._enable_loadbalancer(edge)
        userdata = {
            'request': edge,
            'router_name': name,
            'jobdata': jobdata
        }
        task = tasks.Task(task_name, router_id,
                          self._deploy_edge,
                          status_callback=self._status_edge,
                          result_callback=self._result_edge,
                          userdata=userdata)
        task.add_executed_monitor(self.callbacks.edge_deploy_started)
        task.add_result_monitor(self.callbacks.edge_deploy_result)
        self.task_manager.add(task)

        if wait_for_exec:
            # wait until the deploy task is executed so edge_id is available
            task.wait(constants.TaskState.EXECUTED)

        return task

    def delete_edge(self, router_id, edge_id, jobdata=None):
        task_name = 'delete-%s' % edge_id
        userdata = {
            'router_id': router_id,
            'edge_id': edge_id,
            'jobdata': jobdata
        }
        task = tasks.Task(task_name, router_id, self._delete_edge,
                          userdata=userdata)
        task.add_result_monitor(self.callbacks.edge_delete_result)
        self.task_manager.add(task)
        return task

    def _assemble_nat_rule(self, action, original_address,
                           translated_address,
                           vnic_index=vcns_const.EXTERNAL_VNIC_INDEX,
                           enabled=True):
        nat_rule = {}
        nat_rule['action'] = action
        nat_rule['vnic'] = vnic_index
        nat_rule['originalAddress'] = original_address
        nat_rule['translatedAddress'] = translated_address
        nat_rule['enabled'] = enabled
        return nat_rule

    def get_nat_config(self, edge_id):
        try:
            return self.vcns.get_nat_config(edge_id)[1]
        except exceptions.VcnsApiException as e:
            with excutils.save_and_reraise_exception():
                LOG.exception(_("VCNS: Failed to get nat config:\n%s"),
                              e.response)

    def _create_nat_rule(self, task):
        # TODO(fank): use POST for optimization
        #             return rule_id for future reference
        rule = task.userdata['rule']
        LOG.debug(_("VCNS: start creating nat rules: %s"), rule)
        edge_id = task.userdata['edge_id']
        nat = self.get_nat_config(edge_id)
        location = task.userdata['location']

        del nat['version']

        if location is None or location == vcns_const.APPEND:
            nat['rules']['natRulesDtos'].append(rule)
        else:
            nat['rules']['natRulesDtos'].insert(location, rule)

        try:
            self.vcns.update_nat_config(edge_id, nat)
            status = constants.TaskStatus.COMPLETED
        except exceptions.VcnsApiException as e:
            LOG.exception(_("VCNS: Failed to create snat rule:\n%s"),
                          e.response)
            status = constants.TaskStatus.ERROR

        return status

    def create_snat_rule(self, router_id, edge_id, src, translated,
                         jobdata=None, location=None):
        LOG.debug(_("VCNS: create snat rule %(src)s/%(translated)s"), {
            'src': src, 'translated': translated})
        snat_rule = self._assemble_nat_rule("snat", src, translated)
        userdata = {
            'router_id': router_id,
            'edge_id': edge_id,
            'rule': snat_rule,
            'location': location,
            'jobdata': jobdata
        }
        task_name = "create-snat-%s-%s-%s" % (edge_id, src, translated)
        task = tasks.Task(task_name, router_id, self._create_nat_rule,
                          userdata=userdata)
        task.add_result_monitor(self.callbacks.snat_create_result)
        self.task_manager.add(task)
        return task

    def _delete_nat_rule(self, task):
        # TODO(fank): pass in rule_id for optimization
        #             handle routes update for optimization
        edge_id = task.userdata['edge_id']
        address = task.userdata['address']
        addrtype = task.userdata['addrtype']
        LOG.debug(_("VCNS: start deleting %(type)s rules: %(addr)s"), {
            'type': addrtype, 'addr': address})
        nat = self.get_nat_config(edge_id)
        del nat['version']
        status = constants.TaskStatus.COMPLETED
        for nat_rule in nat['rules']['natRulesDtos']:
            if nat_rule[addrtype] == address:
                rule_id = nat_rule['ruleId']
                try:
                    self.vcns.delete_nat_rule(edge_id, rule_id)
                except exceptions.VcnsApiException as e:
                    LOG.exception(_("VCNS: Failed to delete snat rule:\n"
                                    "%s"), e.response)
                    status = constants.TaskStatus.ERROR

        return status

    def delete_snat_rule(self, router_id, edge_id, src, jobdata=None):
        LOG.debug(_("VCNS: delete snat rule %s"), src)
        userdata = {
            'edge_id': edge_id,
            'address': src,
            'addrtype': 'originalAddress',
            'jobdata': jobdata
        }
        task_name = "delete-snat-%s-%s" % (edge_id, src)
        task = tasks.Task(task_name, router_id, self._delete_nat_rule,
                          userdata=userdata)
        task.add_result_monitor(self.callbacks.snat_delete_result)
        self.task_manager.add(task)
        return task

    def create_dnat_rule(self, router_id, edge_id, dst, translated,
                         jobdata=None, location=None):
        # TODO(fank): use POST for optimization
        #             return rule_id for future reference
        LOG.debug(_("VCNS: create dnat rule %(dst)s/%(translated)s"), {
            'dst': dst, 'translated': translated})
        dnat_rule = self._assemble_nat_rule(
            "dnat", dst, translated)
        userdata = {
            'router_id': router_id,
            'edge_id': edge_id,
            'rule': dnat_rule,
            'location': location,
            'jobdata': jobdata
        }
        task_name = "create-dnat-%s-%s-%s" % (edge_id, dst, translated)
        task = tasks.Task(task_name, router_id, self._create_nat_rule,
                          userdata=userdata)
        task.add_result_monitor(self.callbacks.dnat_create_result)
        self.task_manager.add(task)
        return task

    def delete_dnat_rule(self, router_id, edge_id, translated,
                         jobdata=None):
        # TODO(fank): pass in rule_id for optimization
        LOG.debug(_("VCNS: delete dnat rule %s"), translated)
        userdata = {
            'edge_id': edge_id,
            'address': translated,
            'addrtype': 'translatedAddress',
            'jobdata': jobdata
        }
        task_name = "delete-dnat-%s-%s" % (edge_id, translated)
        task = tasks.Task(task_name, router_id, self._delete_nat_rule,
                          userdata=userdata)
        task.add_result_monitor(self.callbacks.dnat_delete_result)
        self.task_manager.add(task)
        return task

    def _update_nat_rule(self, task):
        # TODO(fank): use POST for optimization
        #             return rule_id for future reference
        edge_id = task.userdata['edge_id']
        if task != self.updated_task['nat'][edge_id]:
            # this task does not have the latest config, abort now
            # for speedup
            return constants.TaskStatus.ABORT

        rules = task.userdata['rules']
        LOG.debug(_("VCNS: start updating nat rules: %s"), rules)

        nat = {
            'featureType': 'nat',
            'rules': {
                'natRulesDtos': rules
            }
        }

        try:
            self.vcns.update_nat_config(edge_id, nat)
            status = constants.TaskStatus.COMPLETED
        except exceptions.VcnsApiException as e:
            LOG.exception(_("VCNS: Failed to create snat rule:\n%s"),
                          e.response)
            status = constants.TaskStatus.ERROR

        return status

    def update_nat_rules(self, router_id, edge_id, snats, dnats,
                         jobdata=None):
        LOG.debug(_("VCNS: update nat rule\n"
                    "SNAT:%(snat)s\n"
                    "DNAT:%(dnat)s\n"), {
                        'snat': snats, 'dnat': dnats})
        nat_rules = []

        for dnat in dnats:
            nat_rules.append(self._assemble_nat_rule(
                'dnat', dnat['dst'], dnat['translated']))
            nat_rules.append(self._assemble_nat_rule(
                'snat', dnat['translated'], dnat['dst']))

        for snat in snats:
            nat_rules.append(self._assemble_nat_rule(
                'snat', snat['src'], snat['translated']))

        userdata = {
            'edge_id': edge_id,
            'rules': nat_rules,
            'jobdata': jobdata,
        }
        task_name = "update-nat-%s" % edge_id
        task = tasks.Task(task_name, router_id, self._update_nat_rule,
                          userdata=userdata)
        task.add_result_monitor(self.callbacks.nat_update_result)
        self.updated_task['nat'][edge_id] = task
        self.task_manager.add(task)
        return task

    def _update_routes(self, task):
        edge_id = task.userdata['edge_id']
        if (task != self.updated_task['route'][edge_id] and
            task.userdata.get('skippable', True)):
            # this task does not have the latest config, abort now
            # for speedup
            return constants.TaskStatus.ABORT
        gateway = task.userdata['gateway']
        routes = task.userdata['routes']
        LOG.debug(_("VCNS: start updating routes for %s"), edge_id)
        static_routes = []
        for route in routes:
            static_routes.append({
                "description": "",
                "vnic": vcns_const.INTERNAL_VNIC_INDEX,
                "network": route['cidr'],
                "nextHop": route['nexthop']
            })
        request = {
            "staticRoutes": {
                "staticRoutes": static_routes
            }
        }
        if gateway:
            request["defaultRoute"] = {
                "description": "default-gateway",
                "gatewayAddress": gateway,
                "vnic": vcns_const.EXTERNAL_VNIC_INDEX
            }
        try:
            self.vcns.update_routes(edge_id, request)
            status = constants.TaskStatus.COMPLETED
        except exceptions.VcnsApiException as e:
            LOG.exception(_("VCNS: Failed to update routes:\n%s"),
                          e.response)
            status = constants.TaskStatus.ERROR

        return status

    def update_routes(self, router_id, edge_id, gateway, routes,
                      skippable=True, jobdata=None):
        if gateway:
            gateway = gateway.split('/')[0]

        userdata = {
            'edge_id': edge_id,
            'gateway': gateway,
            'routes': routes,
            'skippable': skippable,
            'jobdata': jobdata
        }
        task_name = "update-routes-%s" % (edge_id)
        task = tasks.Task(task_name, router_id, self._update_routes,
                          userdata=userdata)
        task.add_result_monitor(self.callbacks.routes_update_result)
        self.updated_task['route'][edge_id] = task
        self.task_manager.add(task)
        return task

    def create_lswitch(self, name, tz_config, tags=None,
                       port_isolation=False, replication_mode="service"):
        lsconfig = {
            'display_name': utils.check_and_truncate(name),
            "tags": tags or [],
            "type": "LogicalSwitchConfig",
            "_schema": "/ws.v1/schema/LogicalSwitchConfig",
            "transport_zones": tz_config
        }
        if port_isolation is bool:
            lsconfig["port_isolation_enabled"] = port_isolation
        if replication_mode:
            lsconfig["replication_mode"] = replication_mode

        response = self.vcns.create_lswitch(lsconfig)[1]
        return response

    def delete_lswitch(self, lswitch_id):
        self.vcns.delete_lswitch(lswitch_id)

    def get_loadbalancer_config(self, edge_id):
        try:
            header, response = self.vcns.get_loadbalancer_config(
                edge_id)
        except exceptions.VcnsApiException:
            with excutils.save_and_reraise_exception():
                LOG.exception(_("Failed to get service config"))
        return response

    def enable_service_loadbalancer(self, edge_id):
        config = self.get_loadbalancer_config(
            edge_id)
        if not config['enabled']:
            config['enabled'] = True
        try:
            self.vcns.enable_service_loadbalancer(edge_id, config)
        except exceptions.VcnsApiException:
            with excutils.save_and_reraise_exception():
                LOG.exception(_("Failed to enable loadbalancer "
                                "service config"))


text:
package org.scalatra

import util.MultiMap
import javax.activation.MimetypesFileTypeMap
import javax.servlet.http.HttpServletRequest

/**
 * A route is a set of matchers and an action.  A route is considered to match
 * if all of its route matchers return Some.  If a route matches, its action
 * may be invoked.  The route parameters extracted by the matchers are made
 * available to the action.
 */
case class Route(
  routeMatchers: Seq[RouteMatcher] = Seq.empty,
  action: Action,
  contextPath: HttpServletRequest => String = _ => "",
  metadata: Map[Symbol, Any] = Map.empty
)
{
  /**
   * Optionally returns this route's action and the multi-map of route
   * parameters extracted from the matchers.  Each matcher's returned params
   * are merged into those of the previous.  If any matcher returns None,
   * None is returned.  If there are no route matchers, some empty map is
   * returned.
   */
  def apply(requestPath: String): Option[MatchedRoute] = {
    routeMatchers.foldLeft(Option(MultiMap())) {
      (acc: Option[MultiParams], routeMatcher: RouteMatcher) => for {
        routeParams <- acc
        matcherParams <- routeMatcher(requestPath)
      } yield routeParams ++ matcherParams
    } map { routeParams => MatchedRoute(action, routeParams) }
  }

  /**
   * The reversible matcher of a route is the first reversible matcher, if
   * any.  This matcher may be used to generate URIs.
   */
  lazy val reversibleMatcher: Option[RouteMatcher] =
    routeMatchers find (_.isInstanceOf[ReversibleRouteMatcher])

  /**
   * Determines whether this is a reversible route.
   */
  lazy val isReversible: Boolean = !reversibleMatcher.isEmpty

  override def toString: String = routeMatchers mkString " "
}

object Route {
  def apply(transformers: Seq[RouteTransformer], action: Action): Route =
    apply(transformers, action, (_: HttpServletRequest) => "")

  def apply(transformers: Seq[RouteTransformer], action: Action, contextPath: HttpServletRequest => String): Route = {
    val route = Route(action = action, contextPath = contextPath)
    transformers.foldLeft(route){ (route, transformer) => transformer(route) }
  }

  def appendMatcher(matcher: RouteMatcher): RouteTransformer = { (route: Route) =>
    route.copy(routeMatchers = route.routeMatchers :+ matcher)
  }
}

/**
 * An action and the multi-map of route parameters to invoke it with.
 */
case class MatchedRoute(action: Action, multiParams: MultiParams)


text:
from django.conf.urls import *
from .views import PortfolioWorkListView, PortfolioWorkDetailView, WorkTagListView, WorkCategoryListView

urlpatterns = patterns('',
    url(r'^$', PortfolioWorkListView.as_view(), name='portfolio_list'),
    url(r'^tag/(?P<tag>[-\w]+)/$', WorkTagListView.as_view(), name='work_tag'),
    url(r'^category/(?P<category>[-\w]+)/$', WorkCategoryListView.as_view(), name='work_category'),
    url(r'^(?P<slug>[-\w]+)/$', PortfolioWorkDetailView.as_view(), name='work_detail'),
)


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows.Forms;

namespace CCPlistEditor
{
    static class Program
    {
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        [STAThread]
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            #region 运行一次后销毁这些代码 >>> 生成多语言描述文件
            /*
            //FormMain
            Form frm = new FormMain();
            CLanguage language = new CLanguage();
            LanguageForm frmLan = new LanguageForm();
            frmLan.Name = frm.Name;
            frmLan.Controls = language.GetAllControls(frm, null);
            frmLan.Toolbars = language.GetToolStripItems(frm, "toolStrip1");
            frmLan.Menus = language.GetMenuItems((frm as FormMain).contextMenuStrip1);
            language.Forms.Add(frmLan);
            LanguageForm frmLan2 = new LanguageForm();
            //FormAbout
            frm = new AboutBox();
            frmLan2.Name = frm.Name;
            frmLan2.Controls = language.GetAllControls(frm, null);
            language.Forms.Add(frmLan2);

            language.Serialize(Application.StartupPath + "\\default_language.xml");
            */
            #endregion
            Application.Run(new FormMain());
        }
    }
}


text:
License, Credits and Other Information
======================================

Copyright and License
---------------------

.. include:: ../LICENSE.txt

Credits
-------

The authors of *unittest_expander* are: Jan Kaliszewski (zuo) and the
Contributors whose `GitHub pull requests`_ have been merged into
the code repository.

.. _GitHub pull requests: https://github.com/zuo/unittest_expander/pulls?q=is%3Apr+is%3Amerged

There were also some inspirations; see the following section to learn
about some of them...

Related Links (Historical Note)
-------------------------------

Before/when creating first versions of *unittest_expander* I (Jan)
checked out several other projects and resources related to unit test
parameterization in Python.

Some of them were mature and actively maintained projects, others were
just minor drafts; some depended (contrary to *unittest_expander*) on
external libraries or testing frameworks, others did not; some had
appealing, programmer-friendly interfaces, others felt more like
low-level building blocks...

Anyway, here are the links:

* https://nose.readthedocs.org/en/latest/writing_tests.html#test-generators
* https://github.com/wolever/nose-parameterized
* https://github.com/msabramo/python_unittest_parameterized_test_case
* https://github.com/txels/ddt
* https://code.google.com/p/parameterized-testcase/
* *https://bitbucket.org/lothiraldan/unittest-templates/* (link no longer alive)
* https://launchpad.net/testscenarios
* https://eli.thegreenplace.net/2011/08/02/python-unit-testing-parametrized-test-cases/
* https://gist.github.com/mfazekas/1710455
* plus -- of course! -- certain brilliant features of *pytest*:

  * https://pytest.org/latest/parametrize.html
  * https://pytest.org/latest/fixture.html

* ...as well as some interesting *nose2* plugins:

  * https://nose2.readthedocs.org/en/latest/plugins/generators.html
  * https://nose2.readthedocs.org/en/latest/params.html#nose2.tools.params

See also:

* https://bugs.python.org/issue7897
* https://bugs.python.org/issue12600
* https://hg.python.org/cpython/rev/e6a33938b03f/


text:
// Copyright 2016 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

package org.chromium.chrome.browser.signin;

import android.content.Context;
import android.content.Intent;
import android.provider.Settings;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.LinearLayout;
import android.widget.TextView;

import org.chromium.base.IntentUtils;
import org.chromium.chrome.R;
import org.chromium.chrome.browser.settings.SettingsLauncherImpl;
import org.chromium.chrome.browser.sync.SyncService;
import org.chromium.chrome.browser.sync.settings.ManageSyncSettings;
import org.chromium.chrome.browser.ui.signin.SyncConsentActivityLauncher.AccessPoint;
import org.chromium.components.browser_ui.settings.SettingsLauncher;
import org.chromium.components.signin.metrics.SigninAccessPoint;

/**
 * A View that shows the user the next step they must complete to start syncing their data (eg.
 * Recent Tabs or Bookmarks).
 * If inflated manually, {@link SyncPromoView#init(int)} must be called before
 * attaching this View to a ViewGroup.
 */
public class SyncPromoView extends LinearLayout implements SyncService.SyncStateChangedListener {
    private @AccessPoint int mAccessPoint;
    private boolean mInitialized;

    private TextView mTitle;
    private TextView mDescription;
    private Button mPositiveButton;

    /**
     * A convenience method to inflate and initialize a SyncPromoView.
     * @param parent A parent used to provide LayoutParams (the SyncPromoView will not be
     *         attached).
     * @param accessPoint Where the SyncPromoView is used.
     */
    public static SyncPromoView create(ViewGroup parent, @AccessPoint int accessPoint) {
        // TODO(injae): crbug.com/829548
        SyncPromoView result = (SyncPromoView) LayoutInflater.from(parent.getContext())
                                       .inflate(R.layout.sync_promo_view, parent, false);
        result.init(accessPoint);
        return result;
    }

    /**
     * Constructor for inflating from xml.
     */
    public SyncPromoView(Context context, AttributeSet attrs) {
        super(context, attrs);
        // This promo is about enabling sync, so no sense in showing it if
        // syncing isn't possible.
        assert SyncService.get() != null;
    }

    @Override
    protected void onFinishInflate() {
        super.onFinishInflate();

        mTitle = findViewById(R.id.title);
        mDescription = findViewById(R.id.description);
        mPositiveButton = findViewById(R.id.sign_in);
    }

    /**
     * Provide the information necessary for this class to function.
     * @param accessPoint Where this UI component is used.
     */
    public void init(@AccessPoint int accessPoint) {
        mAccessPoint = accessPoint;
        mInitialized = true;

        assert mAccessPoint == SigninAccessPoint.BOOKMARK_MANAGER
                || mAccessPoint == SigninAccessPoint.RECENT_TABS
                : "SyncPromoView only has strings for bookmark manager and recent tabs.";

        // The title stays the same no matter what action the user must take.
        if (mAccessPoint == SigninAccessPoint.BOOKMARK_MANAGER) {
            mTitle.setText(R.string.sync_your_bookmarks);
        } else {
            mTitle.setVisibility(View.GONE);
        }

        // We don't call update() here as it will be called in onAttachedToWindow().
    }

    private void update() {
        ViewState viewState;
        if (!SyncService.get().isSyncAllowedByPlatform()) {
            viewState = getStateForEnableAndroidSync();
        } else if (!SyncService.get().isSyncRequested()) {
            viewState = getStateForEnableChromeSync();
        } else {
            viewState = getStateForStartUsing();
        }
        viewState.apply(mDescription, mPositiveButton);
    }

    /**
     * The ViewState class represents all the UI elements that can change for each variation of
     * this View. We use this to ensure each variation (created in the getStateFor* methods)
     * explicitly touches each UI element.
     */
    private static class ViewState {
        private final int mDescriptionText;
        private final ButtonState mPositiveButtonState;

        public ViewState(int mDescriptionText, ButtonState mPositiveButtonState) {
            this.mDescriptionText = mDescriptionText;
            this.mPositiveButtonState = mPositiveButtonState;
        }

        public void apply(TextView description, Button positiveButton) {
            description.setText(mDescriptionText);
            mPositiveButtonState.apply(positiveButton);
        }
    }

    /**
     * Classes to represent the state of a button that we are interested in, used to keep ViewState
     * tidy and provide some convenience methods.
     */
    private interface ButtonState {
        void apply(Button button);
    }

    private static class ButtonAbsent implements ButtonState {
        @Override
        public void apply(Button button) {
            button.setVisibility(View.GONE);
        }
    }

    private static class ButtonPresent implements ButtonState {
        private final int mTextResource;
        private final OnClickListener mOnClickListener;

        // TODO(crbug.com/1107904): Once Chrome is decoupled from auto-sync,
        // |onClickListener| can be inlined.
        public ButtonPresent(int textResource, OnClickListener onClickListener) {
            mTextResource = textResource;
            mOnClickListener = onClickListener;
        }

        @Override
        public void apply(Button button) {
            button.setVisibility(View.VISIBLE);
            button.setText(mTextResource);
            button.setOnClickListener(mOnClickListener);
        }
    }

    private ViewState getStateForEnableAndroidSync() {
        assert mAccessPoint == SigninAccessPoint.RECENT_TABS
                : "Enable Android Sync should not be showing from bookmarks";

        int descId = R.string.recent_tabs_sync_promo_enable_android_sync;

        ButtonState positiveButton = new ButtonPresent(R.string.open_settings_button, view -> {
            IntentUtils.safeStartActivity(getContext(), new Intent(Settings.ACTION_SYNC_SETTINGS));
        });

        return new ViewState(descId, positiveButton);
    }

    private ViewState getStateForEnableChromeSync() {
        int descId = mAccessPoint == SigninAccessPoint.BOOKMARK_MANAGER
                ? R.string.bookmarks_sync_promo_enable_sync
                : R.string.recent_tabs_sync_promo_enable_chrome_sync;

        ButtonState positiveButton = new ButtonPresent(R.string.enable_sync_button, view -> {
            SettingsLauncher settingsLauncher = new SettingsLauncherImpl();
            settingsLauncher.launchSettingsActivity(getContext(), ManageSyncSettings.class,
                    ManageSyncSettings.createArguments(false));
        });

        return new ViewState(descId, positiveButton);
    }

    private ViewState getStateForStartUsing() {
        // TODO(peconn): Ensure this state is never seen when used for bookmarks.
        // State is updated before this view is removed, so this invalid state happens, but is not
        // visible. I want there to be a guarantee that this state is never seen, but to do so would
        // require some code restructuring.

        return new ViewState(R.string.ntp_recent_tabs_sync_promo_instructions, new ButtonAbsent());
    }

    @Override
    protected void onAttachedToWindow() {
        assert mInitialized : "init(...) must be called on SyncPromoView before use.";

        super.onAttachedToWindow();
        SyncService.get().addSyncStateChangedListener(this);
        update();
    }

    @Override
    protected void onDetachedFromWindow() {
        super.onDetachedFromWindow();
        SyncService.get().removeSyncStateChangedListener(this);
    }

    // SyncService.SyncStateChangedListener
    @Override
    public void syncStateChanged() {
        update();
    }
}


text:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xmlns="http://maven.apache.org/POM/4.0.0"
         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>com.github.dlenroc.TestRail</groupId>
    <artifactId>testrail</artifactId>
    <version>1.2.6</version>

</project>


text:
using System;

namespace Talkinator.UWP.Services
{
    public class OnBackgroundEnteringEventArgs : EventArgs
    {
        public SuspensionState SuspensionState { get; set; }

        public Type Target { get; private set; }

        public OnBackgroundEnteringEventArgs(SuspensionState suspensionState, Type target)
        {
            SuspensionState = suspensionState;
            Target = target;
        }
    }
}


text:
Utilities which makes home life easier.

## Prerequisites

  - OS: Archlinux
  - Module:
      - python2
      - pushbullet.py
      - yapbl
      - paho-mqtt
      - python2-systemd
  - Software:
    - motion
  - Service:
    - PushBullet API or Mosquitto


text:
/*
 * Don't change this. It's a template, so copy paste and adjust for your needs.
 */
package Servlets;

import Beans.LoggedIn;
import Models.VaDModel;
import Beans.VaDBean;

import java.io.IOException;
import java.io.PrintWriter;
import java.sql.SQLException;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.servlet.RequestDispatcher;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

/**
 *
 * @author Philipp
 */
@WebServlet(name = "VaDServlet", urlPatterns = {"/AllData"})
public class VaDServlet extends HttpServlet {

    /**
     * Processes requests for both HTTP GET and POST
     * methods.
     *
     * @param request servlet request
     * @param response servlet response
     * @throws ServletException if a servlet-specific error occurs
     * @throws IOException if an I/O error occurs
     */
    protected void processRequest(HttpServletRequest request, HttpServletResponse response)
            throws ServletException, IOException {
        response.setContentType("text/html;charset=UTF-8");
        try (PrintWriter out = response.getWriter()) {
            /* TODO output your page here. You may use following sample code. */
            out.println("<!DOCTYPE html>");
            out.println("");
            out.println("");
            out.println("<title>Servlet VaDServlet</title>");
            out.println("");
            out.println("");
            out.println("
Servlet VaDServlet at " + request.getContextPath() + "
");
            out.println("");
            out.println("");
        }
    }

    // <editor-fold defaultstate="collapsed" desc="HttpServlet methods. Click on the + sign on the left to edit the code.">
    /**
     * Handles the HTTP GET method.
     *
     * @param request servlet request
     * @param response servlet response
     * @throws ServletException if a servlet-specific error occurs
     * @throws IOException if an I/O error occurs
     */
    @Override
    protected void doGet(HttpServletRequest request, HttpServletResponse response)
            throws ServletException, IOException
    {
        System.out.println("doGet in VaDServlet.java.");

        VaDModel VaDModelObj = new VaDModel();
        try
        {
            // Retrieve the attribute that holds all data which was retrieved by the Model from the Database.
            request.setAttribute("JSONListAttribute", VaDModelObj.getJSONObjectList() );
        }
        catch (SQLException ex) { Logger.getLogger(VaDServlet.class.getName()).log(Level.SEVERE, null, ex); }

        System.out.println("after try in doPost in VaDServlet.java");
        RequestDispatcher rd = request.getRequestDispatcher("/viewalldata.jsp");
        rd.forward(request, response);
    }

    /**
     * Handles the HTTP POST method.
     *
     * @param request servlet request
     * @param response servlet response
     * @throws ServletException if a servlet-specific error occurs
     * @throws IOException if an I/O error occurs
     */
    @Override
    protected void doPost(HttpServletRequest request, HttpServletResponse response)
            throws ServletException, IOException {
        //processRequest(request, response);
        System.out.println("doPost in VaDServlet.java.");
        // None of this is done.
        HttpSession session = request.getSession();
        LoggedIn loggedin = (LoggedIn) session.getAttribute("loggedin");
        VaDModel VaDModelObj = new VaDModel();

        //if (request.getParameter("type").equals("To Philipp's Test Page")) // This is weird. "type"?? why not "value" ?
        //{
            //request.setAttribute("type", "pos");
            try
            {
                System.out.println("try in doPost in VaDServlet.java");
                //request. ?
                //session.setAttribute("VaDAttribute", VaDModelObj.getBeanList() );

                // JSONObject
                request.setAttribute("JSONListAttribute", VaDModelObj.getJSONObjectList() );
            } catch (SQLException ex) {
                Logger.getLogger(VaDServlet.class.getName()).log(Level.SEVERE, null, ex);
                System.out.println("catch in doPost in VaDServlet.java");
            }
            System.out.println("after try in doPost in VaDServlet.java");
            RequestDispatcher rd = request.getRequestDispatcher("/viewalldata.jsp");
            rd.forward(request, response);

        //}

    }

    /**
     * Returns a short description of the servlet.
     *
     * @return a String containing servlet description
     */
    @Override
    public String getServletInfo() {
        return "I like Servlets. - Sufea2k17";
    }// </editor-fold>

}


text:
{% extends "base.html" %}
{% load i18n %}

{% block content_title %}
{% trans "Page not found" %}
{% endblock %}

{% block content %}

{% trans "Page could not be found."%}

{% trans "If you think this is a bug, please contact us" %}

{% endblock %}