text:
CREATE DATABASE  IF NOT EXISTS `noark5` /*!40100 DEFAULT CHARACTER SET latin1 */;
USE `noark5`;
-- MySQL dump 10.13  Distrib 5.6.17, for Win32 (x86)
--
-- Host: 10.20.5.46    Database: noark5
-- ------------------------------------------------------
-- Server version	5.5.41-0ubuntu0.14.04.1

/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
/*!40103 SET TIME_ZONE='+00:00' */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;

--
-- Table structure for table `author`
--

DROP TABLE IF EXISTS `author`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `author` (
  `pk_author_id` bigint(20) NOT NULL AUTO_INCREMENT,
  `author` varchar(255) DEFAULT NULL,
  `system_id` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`pk_author_id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `basic_record`
--

DROP TABLE IF EXISTS `basic_record`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `basic_record` (
  `description` varchar(255) DEFAULT NULL,
  `document_medium` varchar(255) DEFAULT NULL,
  `official_title` varchar(255) DEFAULT NULL,
  `record_id` varchar(255) DEFAULT NULL,
  `title` varchar(255) DEFAULT NULL,
  `pk_record_id` bigint(20) NOT NULL,
  `basic_record_storage_location_id` bigint(20) DEFAULT NULL,
  PRIMARY KEY (`pk_record_id`),
  KEY `FK_g96oqw59su7166i6g08cnmwji` (`basic_record_storage_location_id`),
  CONSTRAINT `FK_9nt606ggdatigd6bg90jolb47` FOREIGN KEY (`pk_record_id`) REFERENCES `record` (`pk_record_id`),
  CONSTRAINT `FK_g96oqw59su7166i6g08cnmwji` FOREIGN KEY (`basic_record_storage_location_id`) REFERENCES `storage_location` (`pk_storage_location_id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `basic_record_author`
--

DROP TABLE IF EXISTS `basic_record_author`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `basic_record_author` (
  `f_pk_record_id` bigint(20) NOT NULL,
  `f_pk_author_id` bigint(20) NOT NULL,
  PRIMARY KEY (`f_pk_record_id`,`f_pk_author_id`),
  KEY `FK_835hb1s246lu5wc5xm9qbyd1a` (`f_pk_author_id`),
  CONSTRAINT `FK_835hb1s246lu5wc5xm9qbyd1a` FOREIGN KEY (`f_pk_author_id`) REFERENCES `author` (`pk_author_id`),
  CONSTRAINT `FK_bdw33670xtc6wm739fk265hrl` FOREIGN KEY (`f_pk_record_id`) REFERENCES `basic_record` (`pk_record_id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `basic_record_keyword`
--

DROP TABLE IF EXISTS `basic_record_keyword`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `basic_record_keyword` (
  `f_pk_record_id` bigint(20) NOT NULL,
  `f_pk_keyword_id` bigint(20) NOT NULL,
  PRIMARY KEY (`f_pk_record_id`,`f_pk_keyword_id`),
  KEY `FK_67fayx2bwyhpa4twfxwayrork` (`f_pk_keyword_id`),
  CONSTRAINT `FK_67fayx2bwyhpa4twfxwayrork` FOREIGN KEY (`f_pk_keyword_id`) REFERENCES `keyword` (`pk_keyword_id`),
  CONSTRAINT `FK_f67pekutp3xvgph6kca4jsi3l` FOREIGN KEY (`f_pk_record_id`) REFERENCES `basic_record` (`pk_record_id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `case_file`
--

DROP TABLE IF EXISTS `case_file`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `case_file` (
  `administrative_unit` varchar(255) DEFAULT NULL,
  `case_date` date DEFAULT NULL,
  `case_responsible` varchar(255) DEFAULT NULL,
  `case_sequence_number` int(11) DEFAULT NULL,
  `case_status` varchar(255) DEFAULT NULL,
  `case_year` int(11) DEFAULT NULL,
  `loaned_date` date DEFAULT NULL,
  `loaned_to` varchar(255) DEFAULT NULL,
  `records_management_unit` varchar(255) DEFAULT NULL,
  `pk_file_id` bigint(20) NOT NULL,
  PRIMARY KEY (`pk_file_id`),
  CONSTRAINT `FK_g47wtxorxl7j6m1mrogttdfrm` FOREIGN KEY (`pk_file_id`) REFERENCES `file` (`pk_file_id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `class`
--

DROP TABLE IF EXISTS `class`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `class` (
  `pk_class_id` bigint(20) NOT NULL AUTO_INCREMENT,
  `class_id` varchar(255) DEFAULT NULL,
  `created_by` varchar(255) DEFAULT NULL,
  `created_date` datetime DEFAULT NULL,
  `description` varchar(255) DEFAULT NULL,
  `finalised_by` varchar(255) DEFAULT NULL,
  `finalised_date` datetime DEFAULT NULL,
  `system_id` varchar(255) DEFAULT NULL,
  `title` varchar(255) DEFAULT NULL,
  `class_classification_system_id` bigint(20) DEFAULT NULL,
  `referenceParentClass_pk_class_id` bigint(20) DEFAULT NULL,
  PRIMARY KEY (`pk_class_id`),
  KEY `FK_ioj5qccl0jo845h0uhrm5qcd` (`class_classification_system_id`),
  KEY `FK_egwgq8bcju5flcydew3418wpt` (`referenceParentClass_pk_class_id`),
  CONSTRAINT `FK_egwgq8bcju5flcydew3418wpt` FOREIGN KEY (`referenceParentClass_pk_class_id`) REFERENCES `class` (`pk_class_id`),
  CONSTRAINT `FK_ioj5qccl0jo845h0uhrm5qcd` FOREIGN KEY (`class_classification_system_id`) REFERENCES `classification_system` (`pk_classification_system_id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `class_keyword`
--

DROP TABLE IF EXISTS `class_keyword`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `class_keyword` (
  `f_pk_class_id` bigint(20) NOT NULL,
  `f_pk_keyword_id` bigint(20) NOT NULL,
  PRIMARY KEY (`f_pk_class_id`,`f_pk_keyword_id`),
  KEY `FK_44ctxyw8vb14tj21c0gli7owb` (`f_pk_keyword_id`),
  CONSTRAINT `FK_44ctxyw8vb14tj21c0gli7owb` FOREIGN KEY (`f_pk_keyword_id`) REFERENCES `keyword` (`pk_keyword_id`),
  CONSTRAINT `FK_fs5h14d1bnjtdnu05hu13dyhb` FOREIGN KEY (`f_pk_class_id`) REFERENCES `class` (`pk_class_id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `classification_system`
--

DROP TABLE IF EXISTS `classification_system`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `classification_system` (
  `pk_classification_system_id` bigint(20) NOT NULL AUTO_INCREMENT,
  `classification_type` varchar(255) DEFAULT NULL,
  `created_by` varchar(255) DEFAULT NULL,
  `created_date` datetime DEFAULT NULL,
  `description` varchar(255) DEFAULT NULL,
  `finalised_by` varchar(255) DEFAULT NULL,
  `finalised_date` datetime DEFAULT NULL,
  `system_id` varchar(255) DEFAULT NULL,
  `title` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`pk_classification_system_id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `document_description`
--

DROP TABLE IF EXISTS `document_description`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `document_description` (
  `pk_document_description_id` bigint(20) NOT NULL AUTO_INCREMENT,
  `associated_by` varchar(255) DEFAULT NULL,
  `associated_with_record_as` varchar(255) DEFAULT NULL,
  `association_date` date DEFAULT NULL,
  `created_by` varchar(255) DEFAULT NULL,
  `created_date` datetime DEFAULT NULL,
  `description` varchar(255) DEFAULT NULL,
  `document_medium` varchar(255) DEFAULT NULL,
  `document_number` int(11) DEFAULT NULL,
  `document_status` varchar(255) DEFAULT NULL,
  `document_type` varchar(255) DEFAULT NULL,
  `system_id` varchar(255) DEFAULT NULL,
  `title` varchar(255) DEFAULT NULL,
  `document_description_record_id` bigint(20) DEFAULT NULL,
  PRIMARY KEY (`pk_document_description_id`),
  KEY `fk_name` (`document_description_record_id`),
  CONSTRAINT `document_description_ibfk_1` FOREIGN KEY (`document_description_record_id`) REFERENCES `record` (`pk_record_id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=51 DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `document_object`
--

DROP TABLE IF EXISTS `document_object`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `document_object` (
  `pk_document_object_id` bigint(20) NOT NULL AUTO_INCREMENT,
  `checksum` varchar(255) DEFAULT NULL,
  `checksum_algorithm` varchar(255) DEFAULT NULL,
  `created_by` varchar(255) DEFAULT NULL,
  `created_date` datetime DEFAULT NULL,
  `file_size` bigint(20) DEFAULT NULL,
  `format` varchar(255) DEFAULT NULL,
  `format_details` varchar(255) DEFAULT NULL,
  `reference_document_file` varchar(255) DEFAULT NULL,
  `system_id` varchar(255) DEFAULT NULL,
  `variant_format` varchar(255) DEFAULT NULL,
  `version_number` int(11) DEFAULT NULL,
  `document_object_document_description_id` bigint(20) DEFAULT NULL,
  `document_object_record_id` bigint(20) DEFAULT NULL,
  PRIMARY KEY (`pk_document_object_id`),
  KEY `FK_aba1hp827by6kyok9n414d3mc` (`document_object_document_description_id`),
  KEY `FK_5kuiyhjyuk258f5worsunftd` (`document_object_record_id`),
  CONSTRAINT `FK_5kuiyhjyuk258f5worsunftd` FOREIGN KEY (`document_object_record_id`) REFERENCES `record` (`pk_record_id`),
  CONSTRAINT `FK_aba1hp827by6kyok9n414d3mc` FOREIGN KEY (`document_object_document_description_id`) REFERENCES `document_description` (`pk_document_description_id`)
) ENGINE=InnoDB AUTO_INCREMENT=51 DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `file`
--

DROP TABLE IF EXISTS `file`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `file` (
  `pk_file_id` bigint(20) NOT NULL AUTO_INCREMENT,
  `created_by` varchar(255) DEFAULT NULL,
  `created_date` datetime DEFAULT NULL,
  `description` varchar(255) DEFAULT NULL,
  `document_medium` varchar(255) DEFAULT NULL,
  `file_id` varchar(255) DEFAULT NULL,
  `finalised_by` varchar(255) DEFAULT NULL,
  `finalised_date` datetime DEFAULT NULL,
  `official_title` varchar(255) DEFAULT NULL,
  `system_id` varchar(255) DEFAULT NULL,
  `title` varchar(255) DEFAULT NULL,
  `file_class_id` bigint(20) DEFAULT NULL,
  `referenceParentFile_pk_file_id` bigint(20) DEFAULT NULL,
  `file_series_id` bigint(20) DEFAULT NULL,
  `file_storage_location_id` bigint(20) DEFAULT NULL,
  PRIMARY KEY (`pk_file_id`),
  KEY `FK_jg3towfj6hogo0phh7xcsmmnw` (`file_class_id`),
  KEY `FK_ds17k3tpeeumv6b2vyhvkq84j` (`referenceParentFile_pk_file_id`),
  KEY `FK_mev6nbnjb625v0mtgm6y3ovfs` (`file_series_id`),
  KEY `FK_f8j4tulnfbkb54aw7kun0lac3` (`file_storage_location_id`),
  CONSTRAINT `FK_ds17k3tpeeumv6b2vyhvkq84j` FOREIGN KEY (`referenceParentFile_pk_file_id`) REFERENCES `file` (`pk_file_id`),
  CONSTRAINT `FK_f8j4tulnfbkb54aw7kun0lac3` FOREIGN KEY (`file_storage_location_id`) REFERENCES `storage_location` (`pk_storage_location_id`),
  CONSTRAINT `FK_jg3towfj6hogo0phh7xcsmmnw` FOREIGN KEY (`file_class_id`) REFERENCES `class` (`pk_class_id`),
  CONSTRAINT `FK_mev6nbnjb625v0mtgm6y3ovfs` FOREIGN KEY (`file_series_id`) REFERENCES `series` (`pk_series_id`)
) ENGINE=InnoDB AUTO_INCREMENT=13 DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `file_keyword`
--

DROP TABLE IF EXISTS `file_keyword`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `file_keyword` (
  `f_pk_file_id` bigint(20) NOT NULL,
  `f_pk_keyword_id` bigint(20) NOT NULL,
  PRIMARY KEY (`f_pk_file_id`,`f_pk_keyword_id`),
  KEY `FK_hepfbx70j9a7xujqoghy9pky0` (`f_pk_keyword_id`),
  CONSTRAINT `FK_djsmi2iqhsk1ttm36805u3jd4` FOREIGN KEY (`f_pk_file_id`) REFERENCES `file` (`pk_file_id`),
  CONSTRAINT `FK_hepfbx70j9a7xujqoghy9pky0` FOREIGN KEY (`f_pk_keyword_id`) REFERENCES `keyword` (`pk_keyword_id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `fonds`
--

DROP TABLE IF EXISTS `fonds`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `fonds` (
  `pk_fonds_id` bigint(20) NOT NULL AUTO_INCREMENT,
  `created_by` varchar(255) DEFAULT NULL,
  `created_date` datetime DEFAULT NULL,
  `description` varchar(255) DEFAULT NULL,
  `document_medium` varchar(255) DEFAULT NULL,
  `finalised_by` varchar(255) DEFAULT NULL,
  `finalised_date` datetime DEFAULT NULL,
  `fonds_status` varchar(255) DEFAULT NULL,
  `system_id` varchar(255) DEFAULT NULL,
  `title` varchar(255) DEFAULT NULL,
  `referenceParentFonds_pk_fonds_id` bigint(20) DEFAULT NULL,
  PRIMARY KEY (`pk_fonds_id`),
  KEY `FK_69j163vt6680of6dbgvs2pi5k` (`referenceParentFonds_pk_fonds_id`),
  CONSTRAINT `FK_69j163vt6680of6dbgvs2pi5k` FOREIGN KEY (`referenceParentFonds_pk_fonds_id`) REFERENCES `fonds` (`pk_fonds_id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `fonds_creator`
--

DROP TABLE IF EXISTS `fonds_creator`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `fonds_creator` (
  `pk_fonds_creator_id` bigint(20) NOT NULL AUTO_INCREMENT,
  `description` varchar(255) DEFAULT NULL,
  `fonds_creator_id` varchar(255) DEFAULT NULL,
  `fonds_creator_name` varchar(255) DEFAULT NULL,
  `system_id` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`pk_fonds_creator_id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `fonds_fonds_creator`
--

DROP TABLE IF EXISTS `fonds_fonds_creator`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `fonds_fonds_creator` (
  `f_pk_fonds_id` bigint(20) NOT NULL,
  `f_pk_fonds_creator_id` bigint(20) NOT NULL,
  PRIMARY KEY (`f_pk_fonds_id`,`f_pk_fonds_creator_id`),
  KEY `FK_ndv4f8bwhnedu2lmjx8sd2r6a` (`f_pk_fonds_creator_id`),
  CONSTRAINT `FK_dtllhm65kwg374alxrclrmowt` FOREIGN KEY (`f_pk_fonds_id`) REFERENCES `fonds` (`pk_fonds_id`),
  CONSTRAINT `FK_ndv4f8bwhnedu2lmjx8sd2r6a` FOREIGN KEY (`f_pk_fonds_creator_id`) REFERENCES `fonds_creator` (`pk_fonds_creator_id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `fonds_storage_location`
--

DROP TABLE IF EXISTS `fonds_storage_location`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `fonds_storage_location` (
  `f_pk_fonds_id` bigint(20) NOT NULL,
  `f_pk_storage_location_id` bigint(20) NOT NULL,
  PRIMARY KEY (`f_pk_fonds_id`,`f_pk_storage_location_id`),
  KEY `FK_b8lamxy5eknhgom6xac41o2jj` (`f_pk_storage_location_id`),
  CONSTRAINT `FK_3aiibmj3n5v1n05fu28vvn9i8` FOREIGN KEY (`f_pk_fonds_id`) REFERENCES `fonds` (`pk_fonds_id`),
  CONSTRAINT `FK_b8lamxy5eknhgom6xac41o2jj` FOREIGN KEY (`f_pk_storage_location_id`) REFERENCES `storage_location` (`pk_storage_location_id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `keyword`
--

DROP TABLE IF EXISTS `keyword`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `keyword` (
  `pk_keyword_id` bigint(20) NOT NULL AUTO_INCREMENT,
  `keyword` varchar(255) DEFAULT NULL,
  `system_id` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`pk_keyword_id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `record`
--

DROP TABLE IF EXISTS `record`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `record` (
  `pk_record_id` bigint(20) NOT NULL AUTO_INCREMENT,
  `archived_by` varchar(255) DEFAULT NULL,
  `archived_date` datetime DEFAULT NULL,
  `created_by` varchar(255) DEFAULT NULL,
  `created_date` datetime DEFAULT NULL,
  `system_id` varchar(255) DEFAULT NULL,
  `record_class_id` bigint(20) DEFAULT NULL,
  `record_file_id` bigint(20) DEFAULT NULL,
  `record_series_id` bigint(20) DEFAULT NULL,
  PRIMARY KEY (`pk_record_id`),
  KEY `FK_odsb9ljaukssypinqx83w83o7` (`record_class_id`),
  KEY `FK_kdme5gs8menoxnfpohba1ql7c` (`record_file_id`),
  KEY `FK_n2qfgleytsst1qa75pajmxwfc` (`record_series_id`),
  CONSTRAINT `FK_kdme5gs8menoxnfpohba1ql7c` FOREIGN KEY (`record_file_id`) REFERENCES `file` (`pk_file_id`),
  CONSTRAINT `FK_n2qfgleytsst1qa75pajmxwfc` FOREIGN KEY (`record_series_id`) REFERENCES `series` (`pk_series_id`),
  CONSTRAINT `FK_odsb9ljaukssypinqx83w83o7` FOREIGN KEY (`record_class_id`) REFERENCES `class` (`pk_class_id`)
) ENGINE=InnoDB AUTO_INCREMENT=51 DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `record_document_description`
--

DROP TABLE IF EXISTS `record_document_description`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `record_document_description` (
  `f_pk_record_id` bigint(20) NOT NULL,
  `f_pk_document_description_id` bigint(20) NOT NULL,
  PRIMARY KEY (`f_pk_record_id`,`f_pk_document_description_id`),
  KEY `FK_r0hy921ma48snafsxnetwb9e9` (`f_pk_document_description_id`),
  CONSTRAINT `FK_6v3m892ounp8wmy05c5k1fdc6` FOREIGN KEY (`f_pk_record_id`) REFERENCES `record` (`pk_record_id`),
  CONSTRAINT `FK_r0hy921ma48snafsxnetwb9e9` FOREIGN KEY (`f_pk_document_description_id`) REFERENCES `document_description` (`pk_document_description_id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `registry_entry`
--

DROP TABLE IF EXISTS `registry_entry`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `registry_entry` (
  `document_date` date DEFAULT NULL,
  `due_date` date DEFAULT NULL,
  `freedom_assessment_date` date DEFAULT NULL,
  `loaned_date` date DEFAULT NULL,
  `loaned_to` datetime DEFAULT NULL,
  `number_of_attachments` int(11) DEFAULT NULL,
  `received_date` datetime DEFAULT NULL,
  `record_date` date DEFAULT NULL,
  `record_sequence_number` int(11) DEFAULT NULL,
  `record_status` varchar(255) DEFAULT NULL,
  `record_year` int(11) DEFAULT NULL,
  `records_management_unit` varchar(255) DEFAULT NULL,
  `registry_entry_number` int(11) DEFAULT NULL,
  `registry_entry_type` varchar(255) DEFAULT NULL,
  `sent_date` datetime DEFAULT NULL,
  `pk_record_id` bigint(20) NOT NULL,
  PRIMARY KEY (`pk_record_id`),
  CONSTRAINT `FK_kwxomo0c0yos5mbe81lfd86ua` FOREIGN KEY (`pk_record_id`) REFERENCES `basic_record` (`pk_record_id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `series`
--

DROP TABLE IF EXISTS `series`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `series` (
  `pk_series_id` bigint(20) NOT NULL AUTO_INCREMENT,
  `created_by` varchar(255) DEFAULT NULL,
  `created_date` datetime DEFAULT NULL,
  `description` varchar(255) DEFAULT NULL,
  `document_medium` varchar(255) DEFAULT NULL,
  `finalised_by` varchar(255) DEFAULT NULL,
  `finalised_date` datetime DEFAULT NULL,
  `series_end_date` date DEFAULT NULL,
  `series_start_date` date DEFAULT NULL,
  `series_status` varchar(255) DEFAULT NULL,
  `system_id` varchar(255) DEFAULT NULL,
  `title` varchar(255) DEFAULT NULL,
  `series_classification_system_id` bigint(20) DEFAULT NULL,
  `series_fonds_id` bigint(20) DEFAULT NULL,
  `referencePrecursor_pk_series_id` bigint(20) DEFAULT NULL,
  PRIMARY KEY (`pk_series_id`),
  KEY `FK_qhmw1aeoq6mq0wobtm5d3aecv` (`series_classification_system_id`),
  KEY `FK_v5nro1qnoc347s71g7nb377d` (`series_fonds_id`),
  KEY `FK_aumb1f1ai9kogu04uk9rtb1tc` (`referencePrecursor_pk_series_id`),
  CONSTRAINT `FK_aumb1f1ai9kogu04uk9rtb1tc` FOREIGN KEY (`referencePrecursor_pk_series_id`) REFERENCES `series` (`pk_series_id`),
  CONSTRAINT `FK_qhmw1aeoq6mq0wobtm5d3aecv` FOREIGN KEY (`series_classification_system_id`) REFERENCES `classification_system` (`pk_classification_system_id`),
  CONSTRAINT `FK_v5nro1qnoc347s71g7nb377d` FOREIGN KEY (`series_fonds_id`) REFERENCES `fonds` (`pk_fonds_id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `series_storage_location`
--

DROP TABLE IF EXISTS `series_storage_location`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `series_storage_location` (
  `f_pk_series_id` bigint(20) NOT NULL,
  `f_pk_storage_location_id` bigint(20) NOT NULL,
  PRIMARY KEY (`f_pk_series_id`,`f_pk_storage_location_id`),
  KEY `FK_1cxgpinao62w6hmu6xelftib4` (`f_pk_storage_location_id`),
  CONSTRAINT `FK_1cxgpinao62w6hmu6xelftib4` FOREIGN KEY (`f_pk_storage_location_id`) REFERENCES `storage_location` (`pk_storage_location_id`),
  CONSTRAINT `FK_e6y1df2n7dk4fy21yp72jk483` FOREIGN KEY (`f_pk_series_id`) REFERENCES `series` (`pk_series_id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `storage_location`
--

DROP TABLE IF EXISTS `storage_location`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `storage_location` (
  `pk_storage_location_id` bigint(20) NOT NULL AUTO_INCREMENT,
  `storage_location` varchar(255) DEFAULT NULL,
  `system_id` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`pk_storage_location_id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;

/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;

-- Dump completed on 2015-03-25 16:12:40


text:
CREATE OR REPLACE FUNCTION ti.getelementtaxagroupstable()
 RETURNS TABLE(elementtaxagroupid integer, taxagroupid character varying, elementtypeid integer)
 LANGUAGE sql
AS $function$
SELECT elementtaxagroupid, taxagroupid, elementtypeid
FROM ndb.elementtaxagroups
$function$

redpajama_set_name: RedPajamaGithub


text:
package org.spongepowered.mod.mixin.entityactivation;

import net.minecraft.entity.EntityAgeable;
import net.minecraft.entity.EntityCreature;
import net.minecraft.world.World;
import org.spongepowered.api.entity.living.Ageable;
import org.spongepowered.api.util.annotation.NonnullByDefault;
import org.spongepowered.asm.mixin.Implements;
import org.spongepowered.asm.mixin.Interface;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow;
import org.spongepowered.asm.mixin.SoftOverride;

@NonnullByDefault
@Mixin(EntityAgeable.class)
@Implements(@Interface(iface = Ageable.class, prefix = "ageable$"))
public abstract class MixinEntityAgeable extends EntityCreature {

    private MixinEntityAgeable super$;

    public MixinEntityAgeable(World worldIn) {
        super(worldIn);
    }

    @Shadow
    public abstract int getGrowingAge();

    @Shadow
    public abstract void setGrowingAge(int age);

    @Shadow
    public abstract void setScaleForAge(boolean baby);

    @SoftOverride
    public void inactiveTick() {
        this.super$.inactiveTick();

        if (this.worldObj.isRemote) {
            this.setScaleForAge(this.isChild());
        } else {
            int i = this.getGrowingAge();

            if (i < 0) {
                ++i;
                this.setGrowingAge(i);
            } else if (i > 0) {
                --i;
                this.setGrowingAge(i);
            }
        }
    }

}


text:
// Code generated by client-gen. DO NOT EDIT.

package fake

import (
	v1beta1 "k8s.io/client-go/deprecated/typed/node/v1beta1"
	rest "k8s.io/client-go/rest"
	testing "k8s.io/client-go/testing"
)

type FakeNodeV1beta1 struct {
	*testing.Fake
}

func (c *FakeNodeV1beta1) RuntimeClasses() v1beta1.RuntimeClassInterface {
	return &FakeRuntimeClasses{c}
}

// RESTClient returns a RESTClient that is used to communicate
// with API server by this client implementation.
func (c *FakeNodeV1beta1) RESTClient() rest.Interface {
	var ret *rest.RESTClient
	return ret
}


text:
package hu.kazocsaba.imageviewer;

import java.awt.Graphics2D;
import java.awt.geom.AffineTransform;
import java.awt.image.BufferedImage;
import java.util.ArrayList;
import java.util.List;

/**
 * An overlay is a layer on top of an image. It can be used to add annotations, arbitrary
 * shapes to an image. Drawing is implemented in the paint method.
 *

 * The following is an implementation of a simple example overlay that draws a cross over
 * the image:
 *

 *
 * class XPainter extends Overlay {
 *   public void paint(Graphics2D g, BufferedImage image, AffineTransform transform) {
 *     g.setColor(Color.RED);
 *     double[] bounds={
 *       0, 0,
 *       image.getWidth(), 0,
 *       image.getWidth(), image.getHeight(),
 *       0, image.getHeight()};
 *     transform.transform(bounds, 0, bounds, 0, 4);
 *     g.drawLine((int)bounds[0], (int)bounds[1], (int)bounds[4], (int)bounds[5]);
 *     g.drawLine((int)bounds[2], (int)bounds[3], (int)bounds[6], (int)bounds[7]);
 *   }
 * }
 *

 * It can be added to a viewer by calling viewer.addOverlay(new XPainter(), 10).
 * @author Kazó Csaba
 */
public abstract class Overlay {
	List<OverlayComponent> overlayComponents=new ArrayList<OverlayComponent>(1);
	final void addOverlayComponent(OverlayComponent c) {
		overlayComponents.add(c);
	}
	final void removeOverlayComponent(OverlayComponent c) {
		overlayComponents.remove(c);
	}
	/**
	 * Causes the overlay to be repainted.
	 */
	public void repaint() {
		for (OverlayComponent overlayComponent: overlayComponents)
			overlayComponent.repaint();
	}
	/**
	 * Called to paint the contents of this overlay. The graphics context to paint on is a copy
	 * for this overlay and can be freely modified.
	 *

	 * The method receives the currently displayed image. The image is never null -
	 * if there is currently no image being displayed in the image viewer, then the
	 * paint method is not called.
	 *

	 * This method also receives the transformation that is applied to the image before it
	 * is displayed. This transformation is most commonly the concatenation of a uniform scale
	 * and a translation. The original image bounds (0, 0)
	 * - (image.getWidth(), image.getHeight()) are mapped using this transformation to get the
	 * final display bounds. The overlay should not rely on whether painting outside these
	 * final bounds will be visible or not.
	 * @param g the graphics context to draw onto
	 * @param image the current image
	 * @param transform the transformation applied to the image before displaying
	 */
	public abstract void paint(Graphics2D g, BufferedImage image, AffineTransform transform);
}


text:
import { CommonModule } from '@angular/common';
import { NgModule } from '@angular/core';
import { NgxOverStyleModule } from './directives';
import { NgxSideBarModule } from './components';

@NgModule({
  imports: [
    CommonModule,
    NgxOverStyleModule,
    NgxSideBarModule
  ],
  providers: [
  ],
  declarations: [
  ],
  exports: [
    NgxSideBarModule
  ]
})
export class NgxDualityModule {
}


text:
import Pointer from "../../input/Pointer.js";
import Matrix4 from "../../math/Matrix4.js";
import Vector2 from "../../math/Vector2.js";
import Vector3 from "../../math/Vector3.js";
import Quaternion from "../../math/Quaternion.js";

export default class TrackballController {
  constructor({
    matrix = new Matrix4(),
    domElement = document.body,
    distance = 0,
    invertRotation = true,
    rotationEaseRatio = .04,
    zoomSpeed = .1,
    zoomEaseRatio = .1,
    minDistance = 0,
    maxDistance = Infinity,
    enabled = true
  } = {}) {
    this.matrix = matrix;

    this._distance = distance;
    this.invertRotation = invertRotation;
    this.rotationEaseRatio = rotationEaseRatio;
    this.maxDistance = maxDistance;
    this.minDistance = minDistance;
    this.zoomSpeed = zoomSpeed;
    this.zoomEaseRatio = zoomEaseRatio;

    this._pointer = Pointer.get(domElement);
    this._nextDistance = this._distance;

    this._cachedQuaternion = new Quaternion();
    this._cachedMatrix = new Matrix4();
    this._cachedVector3 = new Vector3();

    this._velocity = new Vector2();
    this._velocityOrigin = new Vector2();

    this._position = new Vector3([this.matrix.x, this.matrix.y, this.matrix.z]);
    this._positionPrevious = this._position.clone();
    this._positionOffset = new Vector3();

    domElement.addEventListener("wheel", this.onWheel.bind(this));

    this.enabled = true;
    this.update();
    this.enabled = enabled;
  }

  set distance(value) {
    this._distance = this._nextDistance = value;
  }

  get distance() {
    return this._distance;
  }

  onWheel(e) {
    if(!this.enabled) {
      return;
    }
    const scrollOffsetRatio = 1 + Math.abs(e.deltaY * this.zoomSpeed * .01);
    this._nextDistance = this._nextDistance || 1;
    this._nextDistance = e.deltaY > 0 ? this._nextDistance * scrollOffsetRatio : this._nextDistance / scrollOffsetRatio;
    this._nextDistance = Math.max(Math.min(this._nextDistance, this.maxDistance), this.minDistance);
  }

  update() {
    if(!this.enabled) {
      return;
    }

    this._cachedMatrix.identity();
    this._cachedQuaternion.identity();

    this._distance += (this._nextDistance - this._distance) * this.zoomEaseRatio;

    this._position.set(this.matrix.x, this.matrix.y, this.matrix.z).subtract(this._positionOffset);

    this.matrix.x = 0;
    this.matrix.y = 0;
    this.matrix.z = 0;

    if(this._pointer.downed) {
      this._velocity.copy(this._pointer.velocity).scale(.003);
    }

    this._velocity.lerp(this._velocityOrigin, this.rotationEaseRatio);

    this._cachedQuaternion.rotateY(this.invertRotation ? -this._velocity.x : this._velocity.x);
    this._cachedQuaternion.rotateX(this.invertRotation ? -this._velocity.y : this._velocity.y);

    this._cachedMatrix.fromQuaternion(this._cachedQuaternion);

    this.matrix.multiply(this._cachedMatrix);

    this._positionOffset.set(0, 0, 1);
    this._positionOffset.applyMatrix4(this.matrix);
    this._positionOffset.scale(this._distance);

    this._cachedVector3.copy(this._position).add(this._positionOffset);

    this.matrix.x = this._cachedVector3.x;
    this.matrix.y = this._cachedVector3.y;
    this.matrix.z = this._cachedVector3.z;
  }
}


text:
__all__ = ['BioCCollection']

from meta import _MetaInfons, _MetaIter
from compat import _Py2Next

class BioCCollection(_Py2Next, _MetaInfons, _MetaIter):

    def __init__(self, collection=None):

        self.infons = dict()
        self.source = ''
        self.date = ''
        self.key = ''
        self.documents = list()

        if collection is not None:
            self.infons = collection.infons
            self.source = collection.source
            self.date = collection.date
            self.key = collection.key
            self.documents = collection.documents

    def __str__(self):
        s = 'source: ' + self.source + '\n'
        s += 'date: ' + self.date + '\n'
        s += 'key: ' + self.key + '\n'
        s += str(self.infons) + '\n'
        s += str(self.documents) + '\n'

        return s

    def _iterdata(self):
        return self.documents

    def clear_documents(self):
        self.documents = list()

    def get_document(self, doc_idx):
        return self.documents[doc_idx]

    def add_document(self, document):
        self.documents.append(document)

    def remove_document(self, document):
        if type(document) is int:
            self.dcouments.remove(self.documents[document])
        else:
            self.documents.remove(document)  # TBC


text:
// Copyright 2020 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.

#include "chrome/browser/performance_hints/performance_hints_observer.h"

#include <string>

#include "base/metrics/histogram_functions.h"
#include "base/metrics/histogram_macros.h"
#include "base/strings/strcat.h"
#include "build/build_config.h"
#include "chrome/browser/optimization_guide/optimization_guide_keyed_service.h"
#include "chrome/browser/optimization_guide/optimization_guide_keyed_service_factory.h"
#include "chrome/browser/performance_hints/performance_hints_features.h"
#include "chrome/browser/profiles/profile.h"
#include "components/optimization_guide/core/optimization_guide_permissions_util.h"
#include "components/optimization_guide/core/url_pattern_with_wildcards.h"
#include "components/optimization_guide/proto/performance_hints_metadata.pb.h"
#include "content/public/browser/navigation_handle.h"
#include "content/public/browser/web_contents.h"
#include "url/gurl.h"

#if defined(OS_ANDROID)
#include "base/android/jni_string.h"
#include "chrome/browser/performance_hints/android/jni_headers/PerformanceHintsObserver_jni.h"
#include "url/android/gurl_android.h"
#endif  // OS_ANDROID

using optimization_guide::OptimizationGuideDecision;
using optimization_guide::URLPatternWithWildcards;
using optimization_guide::proto::LinkPerformanceMetadata;
using optimization_guide::proto::PerformanceClass;
using optimization_guide::proto::PerformanceHint;

namespace performance_hints {
namespace {

// These values are logged to UMA. Entries should not be renumbered and numeric
// values should never be reused. Please keep in sync with:
//  - "PerformanceHintsPerformanceClass" in
//    src/tools/metrics/histograms/enums.xml
//  - "PerformanceClass" in
//    src/components/optimization_guide/proto/performance_hints_metadata.proto
enum class UmaPerformanceClass {
  kUnknown = 0,
  kSlow = 1,
  kFast = 2,
  kNormal = 3,
  kMaxValue = kNormal,
};

UmaPerformanceClass ToUmaPerformanceClass(PerformanceClass performance_class) {
  if (static_cast<int>(performance_class) < 0) {
    NOTREACHED();
    return UmaPerformanceClass::kUnknown;
  } else if (static_cast<int>(performance_class) >
             static_cast<int>(UmaPerformanceClass::kMaxValue)) {
    NOTREACHED();
    return UmaPerformanceClass::kUnknown;
  } else {
    return static_cast<UmaPerformanceClass>(performance_class);
  }
}

// New values should be added to the PerformanceHintsSource histogram_suffix.
enum class HintLookupSource {
  kLinkHint = 0,
  kPageHint = 1,
  kFastHostHint = 2,
  kMaxValue = kFastHostHint,
};

const char* ToString(HintLookupSource source) {
  switch (source) {
    case HintLookupSource::kLinkHint:
      return "LinkHint";
    case HintLookupSource::kPageHint:
      return "PageHint";
    case HintLookupSource::kFastHostHint:
      return "FastHostHint";
  }
}
}  // namespace

#if defined(OS_ANDROID)
static jint JNI_PerformanceHintsObserver_GetPerformanceClassForURL(
    JNIEnv* env,
    const base::android::JavaParamRef<jobject>& java_web_contents,
    const base::android::JavaParamRef<jobject>& url) {
  content::WebContents* web_contents =
      content::WebContents::FromJavaWebContents(java_web_contents);
  return PerformanceHintsObserver::PerformanceClassForURL(
      web_contents, *url::GURLAndroid::ToNativeGURL(env, url),
      /*record_metrics=*/false);
}

static jboolean
JNI_PerformanceHintsObserver_IsContextMenuPerformanceInfoEnabled(JNIEnv* env) {
  return features::IsContextMenuPerformanceInfoEnabled();
}
#endif  // OS_ANDROID

PerformanceHintsObserver::PerformanceHintsObserver(
    content::WebContents* web_contents)
    : content::WebContentsObserver(web_contents),
      content::WebContentsUserData<PerformanceHintsObserver>(*web_contents) {
  Profile* profile =
      Profile::FromBrowserContext(web_contents->GetBrowserContext());

  // Given that we throw things away if the user is unable to fetch from
  // the remote Optimization Guide, do not instantiate anything else since
  // we will throw everything away anyway. Although FAST_HOST_HINTS and some
  // hints that were fetched for the original profile are available in
  // incognito, these do not provide sufficient coverage.
  if (profile->IsOffTheRecord())
    return;

  optimization_guide_decider_ =
      OptimizationGuideKeyedServiceFactory::GetForProfile(profile);
  std::vector<optimization_guide::proto::OptimizationType> opts;
  opts.push_back(optimization_guide::proto::PERFORMANCE_HINTS);
  if (features::AreFastHostHintsEnabled()) {
    opts.push_back(optimization_guide::proto::FAST_HOST_HINTS);
  }
  if (features::AreLinkPerformanceHintsEnabled()) {
    opts.push_back(optimization_guide::proto::LINK_PERFORMANCE);
  }
  if (optimization_guide_decider_) {
    optimization_guide_decider_->RegisterOptimizationTypes(opts);
  }

  rewrite_handler_ =
      RewriteHandler::FromConfigString(features::GetRewriteConfigString());
}

PerformanceHintsObserver::~PerformanceHintsObserver() {
  DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
}

// static
PerformanceClass PerformanceHintsObserver::PerformanceClassForURL(
    content::WebContents* web_contents,
    const GURL& url,
    bool record_metrics) {
  if (web_contents == nullptr) {
    return PerformanceClass::PERFORMANCE_UNKNOWN;
  }

  Profile* profile =
      Profile::FromBrowserContext(web_contents->GetBrowserContext());
  if (!profile ||
      !optimization_guide::IsUserPermittedToFetchFromRemoteOptimizationGuide(
          profile->IsOffTheRecord(), profile->GetPrefs())) {
    // We can't get performance hints if OptimizationGuide can't fetch them.
    return PerformanceClass::PERFORMANCE_UNKNOWN;
  }

  PerformanceHintsObserver* performance_hints_observer =
      PerformanceHintsObserver::FromWebContents(web_contents);
  if (performance_hints_observer == nullptr ||
      !performance_hints_observer->DoesPageSupportHints()) {
    return PerformanceClass::PERFORMANCE_UNKNOWN;
  }

  HintForURLResult result =
      performance_hints_observer->HintForURL(url, record_metrics);
  if (record_metrics) {
    if (result.rewritten) {
      UMA_HISTOGRAM_ENUMERATION(
          "PerformanceHints.Observer.HintForURLResult.Rewritten",
          result.status);
    }
    UMA_HISTOGRAM_ENUMERATION("PerformanceHints.Observer.HintForURLResult",
                              result.status);
  }

  PerformanceClass performance_class;
  switch (result.status) {
    case HintForURLStatus::kHintFound:
      performance_class = result.hint ? result.hint->performance_class()
                                      : PerformanceClass::PERFORMANCE_UNKNOWN;
      break;
    case HintForURLStatus::kHintNotFound:
    case HintForURLStatus::kHintNotReady:
      performance_class = PerformanceClass::PERFORMANCE_UNKNOWN;
      break;
    case HintForURLStatus::kInvalidURL:
      // Error case. Don't allow the override.
      return PerformanceClass::PERFORMANCE_UNKNOWN;
  }

  if (record_metrics) {
    // Log to UMA before the override logic so we can determine how often the
    // override is happening.
    UMA_HISTOGRAM_ENUMERATION(
        "PerformanceHints.Observer.PerformanceClassForURL",
        ToUmaPerformanceClass(performance_class));
  }

  if (performance_class == PerformanceClass::PERFORMANCE_UNKNOWN &&
      features::ShouldTreatUnknownAsFast()) {
    // If we couldn't get the hint or we didn't expect it on this page, give it
    // the benefit of the doubt.
    return PerformanceClass::PERFORMANCE_FAST;
  }

  return performance_class;
}

// static
void PerformanceHintsObserver::RecordPerformanceUMAForURL(
    content::WebContents* web_contents,
    const GURL& url) {
  PerformanceClassForURL(web_contents, url, /*record_metrics=*/true);
}

PerformanceHintsObserver::HintForURLResult::HintForURLResult() = default;
PerformanceHintsObserver::HintForURLResult::HintForURLResult(
    const HintForURLResult&) = default;
PerformanceHintsObserver::HintForURLResult::~HintForURLResult() = default;

PerformanceHintsObserver::HintForURLResult PerformanceHintsObserver::HintForURL(
    const GURL& url,
    bool record_metrics) {
  DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);

  HintForURLResult result;

  if (!url.is_valid() || !url.SchemeIsHTTPOrHTTPS()) {
    result.status = HintForURLStatus::kInvalidURL;
    return result;
  }

  absl::optional<GURL> maybe_rewritten;
  if (features::ShouldHandleRewrites()) {
    maybe_rewritten = rewrite_handler_.HandleRewriteIfNecessary(url);
    result.rewritten = maybe_rewritten.has_value();
    if (maybe_rewritten && (!maybe_rewritten->is_valid() ||
                            !maybe_rewritten->SchemeIsHTTPOrHTTPS())) {
      result.status = HintForURLStatus::kInvalidURL;
      return result;
    }
  }

  GURL hint_url = maybe_rewritten.value_or(url);

  // At this point we know the URL is valid. Individual source lookups will
  // override this if they have more detailed status (found or not ready).
  result.status = HintForURLStatus::kHintNotFound;

  using LookupFn = base::OnceCallback<std::tuple<
      SourceLookupStatus,
      absl::optional<optimization_guide::proto::PerformanceHint>>(const GURL&)>;

  std::vector<std::tuple<HintLookupSource, LookupFn>> sources;
  sources.emplace_back(HintLookupSource::kLinkHint,
                       base::BindOnce(&PerformanceHintsObserver::LinkHintForURL,
                                      base::Unretained(this)));
  sources.emplace_back(HintLookupSource::kPageHint,
                       base::BindOnce(&PerformanceHintsObserver::PageHintForURL,
                                      base::Unretained(this)));
  if (features::AreFastHostHintsEnabled()) {
    sources.emplace_back(
        HintLookupSource::kFastHostHint,
        base::BindOnce(&PerformanceHintsObserver::FastHostHintForURL,
                       base::Unretained(this)));
  }

  for (std::tuple<HintLookupSource, LookupFn>& source : sources) {
    SourceLookupStatus lookup_status = SourceLookupStatus::kNotQueried;
    // Only query sources until a hint has been found.
    if (!result.hint.has_value()) {
      std::tie(lookup_status, result.hint) =
          std::move(std::get<LookupFn>(source)).Run(hint_url);
    }
    if (record_metrics) {
      // UMA is recorded for each source, even if it wasn't queried. This is
      // done so all source histograms have the same total.
      base::UmaHistogramEnumeration(
          base::StrCat({"PerformanceHints.Observer.SourceLookupStatus.",
                        ToString(std::get<HintLookupSource>(source))}),
          lookup_status);
    }
    switch (lookup_status) {
      case SourceLookupStatus::kNotReady:
        // If no hints are found and any of the sources returned kNotReady, we
        // should also return kNotReady.
        result.status = HintForURLStatus::kHintNotReady;
        break;
      case SourceLookupStatus::kHintFound:
        DCHECK(result.hint.has_value());
        result.status = HintForURLStatus::kHintFound;
        break;
      case SourceLookupStatus::kNotQueried:
      case SourceLookupStatus::kNoMatch:
        break;
    }
  }

  return result;
}

bool PerformanceHintsObserver::DoesPageSupportHints() {
  // page_url_ is not set for error pages.
  return page_url_.has_value() && page_url_->is_valid() &&
         page_url_->SchemeIsHTTPOrHTTPS();
}

void PerformanceHintsObserver::PopulateLinkHints() {
  DCHECK(page_url_);
  if (!page_url_)
    return;

  const google::protobuf::RepeatedPtrField<PerformanceHint>* link_hints =
      nullptr;
  // Metadata variables are scoped here to share the same scope as link_hints.
  optimization_guide::OptimizationMetadata metadata;
  absl::optional<LinkPerformanceMetadata> link_metadata;
  if (features::AreLinkPerformanceHintsEnabled()) {
    link_hints_decision_ = optimization_guide_decider_->CanApplyOptimization(
        page_url_.value(), optimization_guide::proto::LINK_PERFORMANCE,
        &metadata);
    link_metadata = metadata.ParsedMetadata<LinkPerformanceMetadata>();
    if (!link_metadata)
      return;
    link_hints = &link_metadata->link_hints();
  } else {
    link_hints_decision_ = optimization_guide_decider_->CanApplyOptimization(
        page_url_.value(), optimization_guide::proto::PERFORMANCE_HINTS,
        &metadata);
    if (!metadata.performance_hints_metadata())
      return;
    link_hints =
        &metadata.performance_hints_metadata().value().performance_hints();
  }

  DCHECK(link_hints);
  if (link_hints_decision_ == OptimizationGuideDecision::kTrue) {
    for (const PerformanceHint& link_hint : *link_hints) {
      link_hints_.emplace_back(
          URLPatternWithWildcards(link_hint.wildcard_pattern()), link_hint);
    }
  }
}

std::tuple<PerformanceHintsObserver::SourceLookupStatus,
           absl::optional<optimization_guide::proto::PerformanceHint>>
PerformanceHintsObserver::LinkHintForURL(const GURL& url) {
  if (!optimization_guide_decider_) {
    return {SourceLookupStatus::kNoMatch, absl::nullopt};
  }

  if (link_hints_decision_ == OptimizationGuideDecision::kUnknown) {
    PopulateLinkHints();
  }
  switch (link_hints_decision_) {
    case OptimizationGuideDecision::kUnknown:
      return {SourceLookupStatus::kNotReady, absl::nullopt};
    case OptimizationGuideDecision::kFalse:
      return {SourceLookupStatus::kNoMatch, absl::nullopt};
    case OptimizationGuideDecision::kTrue: {
      // Link hints only contain scheme, host, and path, so remove other
      // components.
      url::Replacements<char> replacements;
      replacements.ClearUsername();
      replacements.ClearPassword();
      replacements.ClearQuery();
      replacements.ClearPort();
      replacements.ClearRef();
      GURL scheme_host_path = url.ReplaceComponents(replacements);

      for (const auto& pattern_hint : link_hints_) {
        if (pattern_hint.first.Matches(scheme_host_path.spec())) {
          return {SourceLookupStatus::kHintFound, pattern_hint.second};
        }
      }
      return {SourceLookupStatus::kNoMatch, absl::nullopt};
    }
  }
}

std::tuple<PerformanceHintsObserver::SourceLookupStatus,
           absl::optional<optimization_guide::proto::PerformanceHint>>
PerformanceHintsObserver::PageHintForURL(const GURL& url) const {
  if (!optimization_guide_decider_) {
    return {SourceLookupStatus::kNoMatch, absl::nullopt};
  }

  // Check to see if there happens to be a cached hint for the site that this
  // URL belongs to. This should be the case for links on the SRP since the
  // OptimizationGuideService proactively fetches hints for them.
  optimization_guide::OptimizationMetadata metadata;
  OptimizationGuideDecision decision =
      optimization_guide_decider_->CanApplyOptimization(
          url, optimization_guide::proto::PERFORMANCE_HINTS, &metadata);
  if (decision == OptimizationGuideDecision::kUnknown) {
    return {SourceLookupStatus::kNotReady, absl::nullopt};
  } else if (decision == OptimizationGuideDecision::kTrue &&
             metadata.performance_hints_metadata() &&
             metadata.performance_hints_metadata()->has_page_hint()) {
    return {SourceLookupStatus::kHintFound,
            metadata.performance_hints_metadata()->page_hint()};
  }

  return {SourceLookupStatus::kNoMatch, absl::nullopt};
}

std::tuple<PerformanceHintsObserver::SourceLookupStatus,
           absl::optional<optimization_guide::proto::PerformanceHint>>
PerformanceHintsObserver::FastHostHintForURL(const GURL& url) const {
  if (!optimization_guide_decider_) {
    return {SourceLookupStatus::kNoMatch, absl::nullopt};
  }

  OptimizationGuideDecision decision =
      optimization_guide_decider_->CanApplyOptimization(
          url, optimization_guide::proto::FAST_HOST_HINTS, nullptr);
  switch (decision) {
    case OptimizationGuideDecision::kTrue: {
      optimization_guide::proto::PerformanceHint hint;
      hint.set_performance_class(optimization_guide::proto::PERFORMANCE_FAST);
      return {SourceLookupStatus::kHintFound, hint};
    }
    case OptimizationGuideDecision::kFalse:
      return {SourceLookupStatus::kNoMatch, absl::nullopt};
    case OptimizationGuideDecision::kUnknown:
      return {SourceLookupStatus::kNotReady, absl::nullopt};
  }
}

void PerformanceHintsObserver::DidFinishNavigation(
    content::NavigationHandle* navigation_handle) {
  DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
  DCHECK(navigation_handle);
  // TODO(https://crbug.com/1218946): With MPArch there may be multiple main
  // frames. This caller was converted automatically to the primary main frame
  // to preserve its semantics. Follow up to confirm correctness.
  if (!navigation_handle->IsInPrimaryMainFrame() ||
      navigation_handle->IsSameDocument() ||
      !navigation_handle->HasCommitted()) {
    // Use the same hints if the main frame hasn't changed.
    return;
  }

  // We've navigated to a new page, so clear out any existing cached hints.
  link_hints_.clear();
  link_hints_decision_ = OptimizationGuideDecision::kUnknown;
  page_url_.reset();

  if (!optimization_guide_decider_) {
    return;
  }
  if (navigation_handle->IsErrorPage()) {
    // Don't provide hints on Chrome error pages.
    return;
  }

  page_url_ = navigation_handle->GetURL();
}

WEB_CONTENTS_USER_DATA_KEY_IMPL(PerformanceHintsObserver);

}  // namespace performance_hints


text:
'use strict';

process.title = 'npmvsyarn';

let prettyMs = require('pretty-ms'),
    clc = require('cli-color'),
    sh = require('shelljs'),
    Table = require('cli-table3');

let packageName = process.argv[2];

// Move existing node_modules (if any) to temp
console.log('🛀 Saving node_modules (if any) to temp');
if (sh.test('-d', 'node_modules')) {
    sh.mv('node_modules', 'temp_npmvsyarn_node_modules');
}

// Check if yarn exists, if not install it.
console.log('🕵 Checking if ' + clc.blue('yarn') + ' is installed...');

if (!sh.which('yarn')) {
    console.log('🤕 ' + clc.blue('yarn') + ' command not found in a global scope.');
    console.log('😴 Installing ' + clc.blue('yarn') + '...');
    sh.exec('npm install -g yarn', { silent: true });
} else {
    console.log('👯 ' + clc.blue('yarn') + ' exists in a global scope');
}

// Declare common variables
let timeStamp,
    yarnAddTime,
    npmAddTime,
    yarnRemoveTime,
    npmRemoveTime;

// Check if package name is provided
if (!packageName) {

    console.log('🛀 Running benchmark for current project');

    // Check if package.json exists
    if (!sh.test('-f', 'package.json')) {
        console.log('🤕 package.json does not exist');
        console.log('🚫 Exit');
        process.exit(1);
    }

    // Install module using yarn add.
    console.log('🛀 Installing with ' + clc.blue('yarn'));
    timeStamp = Date.now();
    sh.exec('yarn ', { silent: true });
    yarnAddTime = Date.now() - timeStamp;
    console.log('🚀 Time taken by yarn to add ' + clc.green(prettyMs(yarnAddTime)) + '');

    // Clear node_modules
    sh.rm('-rf', 'node_modules');

    // Install module using npm install.
    timeStamp = Date.now();
    console.log('🛀 Installing with ' + clc.blue('npm'));
    sh.exec('npm install ', { silent: true });
    npmAddTime = Date.now() - timeStamp;
    console.log('🚀 Time taken by npm to install ' + clc.green(prettyMs(npmAddTime)) + '');

} else {

    // Install module using yarn add.
    console.log('🛀 Adding ' + clc.magenta(packageName) + ' with ' + clc.blue('yarn'));
    timeStamp = Date.now();
    sh.exec('yarn add ' + packageName, { silent: true });
    yarnAddTime = Date.now() - timeStamp;
    console.log('🚀 Time taken by yarn to add ' + clc.green(prettyMs(yarnAddTime)) + '');

    // Uninstall module using yarn remove.
    console.log('🛀 Removing ' + clc.magenta(packageName) + ' with ' + clc.blue('yarn'));
    timeStamp = Date.now();
    sh.exec('yarn remove ' + packageName, { silent: true });
    yarnRemoveTime = Date.now() - timeStamp;
    console.log('🚀 Time taken by yarn to remove ' + clc.red(prettyMs(yarnRemoveTime)) + '');
    sh.rm('-rf', 'node_modules');

    // Install module using npm install.
    timeStamp = Date.now();
    console.log('🛀 Installing ' + clc.magenta(packageName) + ' with ' + clc.blue('npm'));
    sh.exec('npm install ' + packageName, { silent: true });
    npmAddTime = Date.now() - timeStamp;
    console.log('🚀 Time taken by npm to install ' + clc.green(prettyMs(npmAddTime)) + '');

    // Uninstall module using npm uninstall.
    console.log('🛀 Removing ' + clc.magenta(packageName) + ' with ' + clc.blue('npm'));
    timeStamp = Date.now();
    sh.exec('npm uninstall ' + packageName, { silent: true });
    npmRemoveTime = Date.now() - timeStamp;
    console.log('🚀 Time taken by npm to uninstall ' + clc.red(prettyMs(npmRemoveTime)) + '');
}

// Display results in a table.
var table = new Table({
    head: ['Package Manager', 'npm', 'yarn'],
    colWidths: [20, 10, 10],
    style: {
        head: ['yellow']
    }
});

console.log('🛀 Cleaning up');
sh.rm('-rf', 'node_modules');
if (sh.test('-d', 'temp_npmvsyarn_node_modules')) {
    sh.mv('temp_npmvsyarn_node_modules', 'node_modules');
}

table.push(
    ['Install', prettyMs(npmAddTime), prettyMs(yarnAddTime)]
);

if (npmRemoveTime) {
    table.push(
        ['Uninstall', prettyMs(npmRemoveTime), prettyMs(yarnRemoveTime)]
    );
}

console.log(table.toString());


text:
%% ==============================================
%%  Alg: srba_process_new_kf
%% ==============================================
\begin{algorithm}
\BeginAlgSize
\caption{\texttt{srba\_define\_new\_keyframe}   \hfill
 \textcolor{white}{.}
$\text{Worst case: }\Or( (\gamma N_R)^3+ N_o ( D_{max} + \log N_R)  )$  }
\label{alg:srba}
\begin{algorithmic}[1]
\Statex{C++: \texttt{RBA\_Problem::define\_new\_keyframe()}}
\Statex
  %\medskip
\Require{ $\left( \mathbf{z}_n,\mathbf{\alpha}_n \right) =
\left\{ \left( \mathbf{z}^1_n,\A^1_n \right),...,
   \left( \mathbf{z}^{N_o}_n,\A^{N_o}_n \right) \right\}$
\Comment{Set of $N_o$ new observations
$\mathbf{z}^i_n$ and their data association $\A^i_n$ }}
\Require{ $run\_local\_optimization$ \Comment{Whether to also run optimizations}}
\Ensure { The updated, locally consistent map }
\Statex
%-----------
\Statex{\underline{// Update keyframes (KFs) data structures}}
\State{$n \gets $number of KFs in the map} \Comment{Assign a free ID to the new KF -- $\Or(1)$}
\State{$KF[n] \gets $empty KF data structure} \Comment{Insert at the end of \texttt{std::map} --
$\Or(1)$}
%-----------
\Statex
\Statex{\underline{// Apply edge-creation policy to decide how to handle loop closures, etc.}}
%% \State{$\mathbf{new\_edges} = \varnothing $}
\While{$ \varnothing \neq \left[ (i_k \leftrightarrow n) = \text{\texttt{decide\_edge\_to\_create}()}\right]$ }
  \Comment{\begin{tiny}$\Or(N_o \log N_R)$\end{tiny}}
	\State{\texttt{add\_kf2kf\_edge}$( i_k \leftrightarrow n )$ }
	\Comment{Update KF-to-KF edge structures -- $\Or(1)$ }
\State{\texttt{update\_sym\_spanning\_trees}$( i_k \leftrightarrow n )$ }
\Comment{$\Or(N_R^2\log N_R)$}
\EndWhile \Comment{Typ. iterations: $\Or(\gamma)$}

%% ---
%-----------
\Statex
\Statex{\underline{// Update symbolic Jacobian structures}}
 \Comment{$\Or\left(N_o (D_{max}+ \log N_R) \right)$}
\ForEach{$ \left( \mathbf{z}_n^i,\mathbf{\alpha}_n^i \right) \in \left(
\mathbf{z}_n,\mathbf{\alpha}_n \right)$}
\Comment{For each of the $N_o$ new observations}
	\State{\texttt{add\_observation}$(
 \underbrace{\mathbf{z}_n^i}_{\text{obs. data}},
 \underbrace{n}_{\text{observing KF}},
 \underbrace{\mathbf{\alpha}_n^i}_{\text{\text{landmark ID}}}
)$ }
\Comment{\begin{tiny}$\Or(D_{max}+ \log N_R)$\end{tiny}}
\EndFor
%-----------
\Statex
\If{$run\_local\_optimization$}
\If{$optimize\_new\_edges\_alone$}
\Statex{~~~~~~~~\underline{// Initialize new edges}}
\ForEach{$ (i_k \leftrightarrow n) $} \Comment{For each new kf2kf edge created above}
\State{\texttt{non\_linear\_optimizer}$\left( i_k \leftrightarrow n \right)$} \Comment{$\Or(N_o)$}
\EndFor
\EndIf
%-----------
\Statex
\Statex{~~~~\underline{// Update SLAM estimation}}
\State{$\mathbf{edges\_to\_optimize} \gets$ all within a $D_{max}$ distance from $n$}
\Comment{$\Or(N_R)$}
\State{\texttt{non\_linear\_optimizer}$\left( \mathbf{edges\_to\_optimize}
\right)$} \Comment{$\Or( (\gamma N_R)^3)$}
\EndIf
\end{algorithmic}
\EndAlgSize
\end{algorithm}


text:
class FixedAbilityLimit {
    constructor(max) {
        this.max = max;
        this.useCount = 0;
    }

    isRepeatable() {
        return false;
    }

    isAtMax() {
        return this.useCount >= this.max;
    }

    increment() {
        this.useCount += 1;
    }

    reset() {
        this.useCount = 0;
    }

    registerEvents() {
        // No event handling
    }

    unregisterEvents() {
        // No event handling
    }
}

class RepeatableAbilityLimit extends FixedAbilityLimit {
    constructor(max, eventName) {
        super(max);

        this.eventName = eventName;
        this.resetHandler = () => this.reset();
    }

    isRepeatable() {
        return true;
    }

    registerEvents(eventEmitter) {
        eventEmitter.on(this.eventName, this.resetHandler);
    }

    unregisterEvents(eventEmitter) {
        eventEmitter.removeListener(this.eventName, this.resetHandler);
        this.reset();
    }
}

var AbilityLimit = {};

AbilityLimit.fixed = function(max) {
    return new FixedAbilityLimit(max);
};

AbilityLimit.repeatable = function(max, eventName) {
    return new RepeatableAbilityLimit(max, eventName);
};

AbilityLimit.perChallenge = function(max) {
    return new RepeatableAbilityLimit(max, 'onChallengeFinished');
};

AbilityLimit.perPhase = function(max) {
    return new RepeatableAbilityLimit(max, 'onPhaseEnded');
};

AbilityLimit.perRound = function(max) {
    return new RepeatableAbilityLimit(max, 'onRoundEnded');
};

module.exports = AbilityLimit;


text:
/* Dependencies. */
const xtend = require('xtend')
const definitions = require('mdast-util-definitions')
const one = require('./one')
const preprocess = require('./preprocessors')

/* Expose. */
module.exports = stringify
module.exports.toLaTeX = toLaTeX

function toLaTeX (tree, options = {}) {
  /* Stringify the given MDAST node. */
  preprocess(options, tree)
  // resolve definition after preprocess because this step can create new identifiers
  options.definitions = definitions(tree, options)
  return one(options, tree, undefined, undefined)
}

/* Compile MDAST tree using toLaTeX */
function stringify (config) {
  const settings = xtend(config, this.data('settings'))

  this.Compiler = compiler

  function compiler (tree) {
    return toLaTeX(tree, settings, tree)
  }
}


text:
usage() { echo "Usage: worker|proxy" 1>&2; exit 1; }
if [ "$1" = 'worker' ]; then
    worker -config-file=/worker.toml
elif [ "$1" = 'proxy' ]; then
    proxy -proxy-file=/proxy.toml
else
	usage
fi


text:
@class IDEScheme, NSDictionary, NSString;

@interface IDEExecutionAction : NSObject <DVTXMLUnarchiving>
{
    NSString *_title;
    IDEScheme *_runContext;
}

+ (id)actionType;
@property(retain) IDEScheme *runContext; // @synthesize runContext=_runContext;
@property(copy, nonatomic) NSString *title; // @synthesize title=_title;
- (void).cxx_destruct;
- (void)schemeObjectGraphSetupComplete;
@property(readonly) BOOL needsCurrentArchiveVersion;
- (void)setTitleFromUTF8String:(char *)arg1 fromXMLUnarchiver:(id)arg2;
- (void)dvt_encodeAttributesWithXMLArchiver:(id)arg1 version:(id)arg2;
- (id)initFromXMLUnarchiver:(id)arg1 archiveVersion:(float)arg2;
- (id)operationForExecutionWithBuildParameters:(id)arg1 error:(id *)arg2;
@property(readonly) NSDictionary *actionEnvironmentVariables;

// Remaining properties
@property(readonly, copy) NSString *debugDescription;
@property(readonly, copy) NSString *description;
@property(readonly) unsigned long long hash;
@property(readonly) Class superclass;

@end


text:
<?xml version="1.0" encoding="utf-8"?>
<openerp>

<template id="layout" name="Editor layout"><!DOCTYPE html>

            <meta charset="utf-8" />
            <title>Odoo Editor layout</title>
            <meta name="viewport" content="initial-scale=1"/>

            <link t-if="enable_editor and inline_mode" rel="stylesheet" href="/web_editor/static/src/css/inline.css" type="text/css"/>
            <t t-if="not dont_load_assets">
                <t t-call-assets="web_editor.assets_editor"/>

            </t>

            <t t-raw="head or ''"/>

                    <t t-raw="0"/>

            <t t-raw="add_html or ''"/>

</template>

<template id="FieldTextHtml" name="Editor HTML">
    <t t-call="web_editor.layout">

    </t>
</template>

</openerp>


text:
package io.gravitee.repository.mongodb.management.internal.ticket;

import io.gravitee.repository.mongodb.management.internal.model.TicketMongo;
import org.springframework.data.mongodb.repository.MongoRepository;
import org.springframework.stereotype.Repository;

/**
 * @author Yann TAVERNIER (yann.tavernier at graviteesource.com)
 * @author GraviteeSource Team
 */
@Repository
public interface TicketMongoRepository extends MongoRepository<TicketMongo, String>, TicketMongoRepositoryCustom {

}


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

using System;
using System.IO;

namespace RipcordSoftware.HttpWebClient
{
    internal sealed class HttpWebClientRequestStream : Stream
    {
        #region Private fields
        private readonly HttpWebClientHeaders _headers;

        private Stream _stream;
        #endregion

        #region Types
        internal sealed class RequestStream : Stream
        {
            #region Private fields
            private readonly IHttpWebClientSocket _socket;

            private readonly byte[] _streamBuffer;
            private int _streamBufferPosition = 0;
            private long _position = 0;
            #endregion

            #region Constructor
            public RequestStream(IHttpWebClientSocket socket)
            {
                _socket = socket;
                _streamBuffer = new byte[7 * 1024];
            }
            #endregion

            #region implemented abstract members of Stream
            public override void Flush()
            {
                _socket.Flush();
            }

            public override int Read(byte[] buffer, int offset, int count) { throw new NotImplementedException(); }

            public override long Seek(long offset, System.IO.SeekOrigin origin) { throw new NotImplementedException(); }

            public override void SetLength(long value) { throw new NotImplementedException(); }

            public override void Write(byte[] buffer, int offset, int count)
            {
                try
                {
                    if ((_streamBufferPosition + count) >= _streamBuffer.Length)
                    {
                        SendBuffer(_socket, _streamBuffer, 0, _streamBufferPosition);
                        SendBuffer(_socket, buffer, offset, count);
                        _streamBufferPosition = 0;
                    }
                    else
                    {
                        Array.Copy(buffer, offset, _streamBuffer, _streamBufferPosition, count);
                        _streamBufferPosition += count;
                    }

                    _position += count;
                }
                catch (HttpWebClientRequestException)
                {
                    throw;
                }
                catch (Exception ex)
                {
                    throw new HttpWebClientRequestException("Error sending request", ex);
                }
            }
            public override bool CanRead { get { return false; } }

            public override bool CanSeek { get { return false; } }

            public override bool CanWrite { get { return true; } }

            public override bool CanTimeout { get { return _socket.Timeout > 0; } }

            public override long Length { get { return _position; } }

            public override long Position { get { return _position; } set { throw new NotImplementedException(); } }
            #endregion

            #region Public methods
            public override void Close()
            {
                if (_streamBufferPosition > 0)
                {
                    SendBuffer(_socket, _streamBuffer, 0, _streamBufferPosition);
                    _position += _streamBufferPosition;
                    _streamBufferPosition = 0;
                }

                Flush();
            }
            #endregion

            #region Private methods
            private static void SendBuffer(IHttpWebClientSocket socket, byte[] buffer, int offset, int count)
            {
                var sent = 0;
                while (sent < count)
                {
                    var bytes = socket.Send(buffer, offset + sent, count - sent);
                    if (bytes == 0)
                    {
                        throw new HttpWebClientRequestException("Failed to send buffer to remote, the socket returned 0 bytes sent");
                    }

                    sent += bytes;
                }
            }
            #endregion
        }
        #endregion

        #region Constructor
        public HttpWebClientRequestStream(IHttpWebClientSocket socket, HttpWebClientHeaders headers) : this(new RequestStream(socket), headers)
        {
        }

        internal HttpWebClientRequestStream(Stream stream, HttpWebClientHeaders headers)
        {
            _stream = stream;
            _headers = headers;
        }
        #endregion

        #region Implemented abstract members of Stream
        public override void Flush()
        {
            _stream.Flush();
        }

        public override int Read(byte[] buffer, int offset, int count) { throw new NotImplementedException(); }

        public override long Seek(long offset, SeekOrigin origin) { throw new NotImplementedException(); }

        public override void SetLength(long value) { throw new NotImplementedException(); }

        public override void Write(byte[] buffer, int offset, int count)
        {
            if (_stream.Position == 0)
            {
                if (!_headers.ContentLength.HasValue)
                {
                    _headers["Transfer-Encoding"] = "chunked";
                    SendHeaders();

                    _stream = new HttpWebClientChunkedRequestStream(_stream);
                }
                else
                {
                    SendHeaders();
                }
            }

            _stream.Write(buffer, offset, count);
        }

        public override bool CanTimeout { get { return _stream.CanTimeout; } }

        public override bool CanRead { get { return false; } }

        public override bool CanSeek { get { return false;  } }

        public override bool CanWrite { get { return true; } }

        public override long Length { get { return _stream.Length; } }

        public override long Position
        {
            get
            {
                return _stream.Position;
            }
            set
            {
                throw new NotImplementedException();
            }
        }

        public override void Close()
        {
            try
            {
                if (_stream.Position == 0)
                {
                    _headers["Transfer-Encoding"] = null;

                    if (_headers.Method == "PUT" || _headers.Method == "POST")
                    {
                        _headers.ContentLength = 0;
                    }

                    SendHeaders();
                }
            }
            finally
            {
                try
                {
                    _stream.Close();
                }
                catch (HttpWebClientException)
                {
                    throw;
                }
                catch (Exception ex)
                {
                    var msg = string.Format("Failed to close socket to remote host {0}:{1}", _headers.Hostname, _headers.Port);
                    throw new HttpWebClientRequestException(msg, ex);
                }
            }
        }
        #endregion

        #region Private and protected methods
        private void SendHeaders()
        {
            try
            {
                var bytes = _headers.GetHeaderBytes();
                _stream.Write(bytes, 0, bytes.Length);
            }
            catch (Exception ex)
            {
                var msg = string.Format("Unable to send headers to the remote host {0}:{1}", _headers.Hostname, _headers.Port);
                throw new HttpWebClientRequestException(msg, ex);
            }
        }
        #endregion
    }
}


text:
package com.jeve.config;

import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.cloud.config.server.EnableConfigServer;

@EnableConfigServer
@SpringBootApplication
public class ConfigApplication {

	public static void main(String[] args) {
		new SpringApplicationBuilder(ConfigApplication.class).web(true).run(args);
	}

}


text:
New indicator fields:
- **Is Processed**


text:
MJworks
=======

an MJ collaboration


text:
package com.querydsl.core.support;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Objects;

import com.querydsl.core.*;
import com.querydsl.core.types.*;
import com.querydsl.core.types.dsl.Expressions;
import com.querydsl.core.util.CollectionUtils;

/**
 * {@code ReplaceVisitor} is a deep visitor that can be customized to replace segments of
 * expression trees
 *
 * @param <C> context type
 */
public class ReplaceVisitor<C> implements Visitor<Expression<?>, C> {

    @Override
    public Expression<?> visit(Constant<?> expr, C context) {
        return expr;
    }

    @Override
    public Expression<?> visit(FactoryExpression<?> expr, C context) {
        List<Expression<?>> args = visit(expr.getArgs(), context);
        if (args.equals(expr.getArgs())) {
            return expr;
        } else {
            return FactoryExpressionUtils.wrap(expr, args);
        }
    }

    @Override
    public Expression<?> visit(Operation<?> expr, C context) {
        List<Expression<?>> args = visit(expr.getArgs(), context);
        if (args.equals(expr.getArgs())) {
            return expr;
        } else if (expr instanceof Predicate) {
            return ExpressionUtils.predicate(expr.getOperator(), args);
        } else {
            return ExpressionUtils.operation(expr.getType(), expr.getOperator(), args);
        }
    }

    @Override
    public Expression<?> visit(ParamExpression<?> expr, C context) {
        return expr;
    }

    @Override
    public Expression<?> visit(Path<?> expr, C context) {
        if (expr.getMetadata().isRoot()) {
            return expr;
        } else {
            PathMetadata metadata = expr.getMetadata();
            Path<?> parent = (Path) metadata.getParent().accept(this, context);
            Object element = metadata.getElement();
            if (element instanceof Expression<?>) {
                element = ((Expression<?>) element).accept(this, context);
            }
            if (parent.equals(metadata.getParent()) && Objects.equals(element, metadata.getElement())) {
                return expr;
            } else {
                metadata = new PathMetadata(parent, element, metadata.getPathType());
                return ExpressionUtils.path(expr.getType(), metadata);
            }
        }
    }

    @SuppressWarnings("unchecked")
    @Override
    public Expression<?> visit(SubQueryExpression<?> expr, C context) {
        QueryMetadata md = new DefaultQueryMetadata();
        md.setValidate(false);
        md.setDistinct(expr.getMetadata().isDistinct());
        md.setModifiers(expr.getMetadata().getModifiers());
        md.setUnique(expr.getMetadata().isUnique());
        for (QueryFlag flag : expr.getMetadata().getFlags()) {
            md.addFlag(new QueryFlag(flag.getPosition(), flag.getFlag().accept(this, context)));
        }
        for (Expression<?> e : expr.getMetadata().getGroupBy()) {
            md.addGroupBy(e.accept(this, context));
        }
        Predicate having = expr.getMetadata().getHaving();
        if (having != null) {
            md.addHaving((Predicate) having.accept(this, context));
        }
        for (JoinExpression je : expr.getMetadata().getJoins()) {
            md.addJoin(je.getType(), je.getTarget().accept(this, context));
            if (je.getCondition() != null) {
                md.addJoinCondition((Predicate) je.getCondition().accept(this, context));
            }
            for (JoinFlag jf : je.getFlags()) {
                md.addJoinFlag(new JoinFlag(jf.getFlag().accept(this, context), jf.getPosition()));
            }
        }
        for (OrderSpecifier<?> os : expr.getMetadata().getOrderBy()) {
            OrderSpecifier<?> os2 = new OrderSpecifier(os.getOrder(), os.getTarget().accept(this,
                    context), os.getNullHandling());
            md.addOrderBy(os2);
        }
        for (Map.Entry<ParamExpression<?>, Object> entry : expr.getMetadata().getParams()
                .entrySet()) {
            md.setParam((ParamExpression) entry.getKey().accept(this, context), entry.getValue());
        }
        if (expr.getMetadata().getProjection() != null) {
            md.setProjection(expr.getMetadata().getProjection().accept(this, context));
        }
        Predicate where = expr.getMetadata().getWhere();
        if (where != null) {
           md.addWhere((Predicate) where.accept(this, context));
        }
        if (expr.getMetadata().equals(md)) {
            return expr;
        } else {
            return new SubQueryExpressionImpl(expr.getType(), md);
        }
    }

    @SuppressWarnings("unchecked")
    @Override
    public Expression<?> visit(TemplateExpression<?> expr, C context) {
        ArrayList args = new ArrayList<>();
        for (Object arg : expr.getArgs()) {
            if (arg instanceof Expression) {
                args.add(((Expression<?>) arg).accept(this, context));
            } else {
                args.add(arg);
            }
        }
        if (args.equals(expr.getArgs())) {
            return expr;
        } else {
            if (expr instanceof Predicate) {
                return Expressions.booleanTemplate(expr.getTemplate(), args);
            } else {
                return ExpressionUtils.template(expr.getType(), expr.getTemplate(), args);
            }
        }
    }

    private List<Expression<?>> visit(List<Expression<?>> args, C context) {
        List<Expression<?>> result = new ArrayList<>();
        for (Expression<?> arg : args) {
            result.add(arg.accept(this, context));
        }
        return CollectionUtils.unmodifiableList(result);
    }
}


text:
		<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />

Home /

Adaptermonitoring

Adaptermonitoring

Description

Shows Adapter activities. setup:

	    	<form><textarea id="code" name="code">
PojoDependencyInjector dependyInjector = new PojoDependencyInjector();
MonitoringDependencyInjector monitoringDependencyInjector= new MonitoringDependencyInjector(dependyInjector, monitoringDataCollector);
			</textarea></form>

Example

Screenshot


text:
<?php
defined('BASEPATH') OR exit('No direct script access allowed');

/*
 * Klasa Mainpage;
 * odpowiada za wyświetlanie strony głównej
 *
 * @category pages
 * @author Jakub Brzegowski
 */
class Mainpage extends CI_Controller {

    /*
     * Wyświetla stronę główną;
     * różną w zależności od tego, czy użytkownik jest zalogowany
     */
    public function index(){
        $data['title'] = 'Strona główna';

        $this->load->view('templates/header', $data);

        if ($this->user_model->session_is_logged()) {
	    // Jeśli użytkownik jest zalogowany:
            $this->load->view('mainpage/mainpage_logged');
        } else {
	    // Jeśli użytkownik nie jest zalogowany
            $this->load->view('mainpage/mainpage_unlogged', $data);
        }

        $this->load->view('templates/foot');
    }
}


text:
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models

class Migration(SchemaMigration):

    def forwards(self, orm):
        # Adding field 'Cookie.owner_name'
        db.add_column('cookies_cookie', 'owner_name',
                      self.gf('django.db.models.fields.CharField')(default='', max_length=50),
                      keep_default=False)

        # Adding field 'Cookie.backend'
        db.add_column('cookies_cookie', 'backend',
                      self.gf('django.db.models.fields.CharField')(default='', max_length=25),
                      keep_default=False)

        # Adding unique constraint on 'Cookie', fields ['name', 'owner_name']
        db.create_unique('cookies_cookie', ['name', 'owner_name'])

    def backwards(self, orm):
        # Removing unique constraint on 'Cookie', fields ['name', 'owner_name']
        db.delete_unique('cookies_cookie', ['name', 'owner_name'])

        # Deleting field 'Cookie.owner_name'
        db.delete_column('cookies_cookie', 'owner_name')

        # Deleting field 'Cookie.backend'
        db.delete_column('cookies_cookie', 'backend')

    models = {
        'auth.bakeryuser': {
            'Meta': {'object_name': 'BakeryUser'},
            'email': ('django.db.models.fields.EmailField', [], {'blank': 'True', 'max_length': '254', 'unique': 'True', 'null': 'True'}),
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),
            'is_organization': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
            'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
            'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
            'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
            'name': ('django.db.models.fields.CharField', [], {'blank': 'True', 'max_length': '100', 'null': 'True'}),
            'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}),
            'profile_url': ('django.db.models.fields.URLField', [], {'blank': 'True', 'max_length': '200', 'null': 'True'}),
            'username': ('django.db.models.fields.CharField', [], {'max_length': '50', 'unique': 'True'})
        },
        'cookies.cookie': {
            'Meta': {'object_name': 'Cookie', 'unique_together': "(('name', 'owner_name'),)"},
            'backend': ('django.db.models.fields.CharField', [], {'max_length': '25'}),
            'description': ('django.db.models.fields.TextField', [], {'default': "''"}),
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'last_change': ('django.db.models.fields.DateTimeField', [], {'null': 'True'}),
            'last_poll': ('django.db.models.fields.DateTimeField', [], {'null': 'True'}),
            'license': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '50'}),
            'mapping': ('jsonfield.fields.JSONField', [], {'default': '{}'}),
            'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}),
            'owner': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.BakeryUser']"}),
            'owner_name': ('django.db.models.fields.CharField', [], {'max_length': '50'}),
            'url': ('django.db.models.fields.URLField', [], {'max_length': '200', 'unique': 'True'})
        }
    }

    complete_apps = ['cookies']


text:
<meta charset="UTF-8">
<title>Glyph.verticalLineBold - </title>
<link rel="stylesheet" href="../../style.css">

io.sureshg.extn / Glyph / verticalLineBold

verticalLineBold

val verticalLineBold: String

A bold vertical line that can be used to draw a box.


text:
function [ m ] = cell2matnn( c )
%CELL2MATNN Summary of this function goes here
%   Detailed explanation goes here

    function x = t(x)
        if isempty(x)
            x = NaN;
        end
    end

c = cellfun(@t,c,'Uniformoutput',false);
m = cell2mat(c);
end


text:
module Azure::MariaDB::Mgmt::V2018_06_01_preview
  #
  # MariaDB Client
  #
  class LocationBasedPerformanceTier
    include MsRestAzure

    #
    # Creates and initializes a new instance of the LocationBasedPerformanceTier class.
    # @param client service class for accessing basic functionality.
    #
    def initialize(client)
      @client = client
    end

    # @return [MariaDBManagementClient] reference to the MariaDBManagementClient
    attr_reader :client

    #
    # List all the performance tiers at specified location in a given subscription.
    #
    # @param location_name [String] The name of the location.
    # @param custom_headers [Hash{String => String}] A hash of custom headers that
    # will be added to the HTTP request.
    #
    # @return [PerformanceTierListResult] operation results.
    #
    def list(location_name, custom_headers:nil)
      response = list_async(location_name, custom_headers:custom_headers).value!
      response.body unless response.nil?
    end

    #
    # List all the performance tiers at specified location in a given subscription.
    #
    # @param location_name [String] The name of the location.
    # @param custom_headers [Hash{String => String}] A hash of custom headers that
    # will be added to the HTTP request.
    #
    # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
    #
    def list_with_http_info(location_name, custom_headers:nil)
      list_async(location_name, custom_headers:custom_headers).value!
    end

    #
    # List all the performance tiers at specified location in a given subscription.
    #
    # @param location_name [String] The name of the location.
    # @param [Hash{String => String}] A hash of custom headers that will be added
    # to the HTTP request.
    #
    # @return [Concurrent::Promise] Promise object which holds the HTTP response.
    #
    def list_async(location_name, custom_headers:nil)
      fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
      fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
      fail ArgumentError, 'location_name is nil' if location_name.nil?

      request_headers = {}
      request_headers['Content-Type'] = 'application/json; charset=utf-8'

      # Set Headers
      request_headers['x-ms-client-request-id'] = SecureRandom.uuid
      request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
      path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.DBforMariaDB/locations/{locationName}/performanceTiers'

      request_url = @base_url || @client.base_url

      options = {
          middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
          path_params: {'subscriptionId' => @client.subscription_id,'locationName' => location_name},
          query_params: {'api-version' => @client.api_version},
          headers: request_headers.merge(custom_headers || {}),
          base_url: request_url
      }
      promise = @client.make_request_async(:get, path_template, options)

      promise = promise.then do |result|
        http_response = result.response
        status_code = http_response.status
        response_content = http_response.body
        unless status_code == 200
          error_model = JSON.load(response_content)
          fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
        end

        result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
        result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
        result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
        # Deserialize Response
        if status_code == 200
          begin
            parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
            result_mapper = Azure::MariaDB::Mgmt::V2018_06_01_preview::Models::PerformanceTierListResult.mapper()
            result.body = @client.deserialize(result_mapper, parsed_response)
          rescue Exception => e
            fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
          end
        end

        result
      end

      promise.execute
    end

  end
end


text:
const os = require('os');
// eslint-disable-next-line import/extensions
const _each = require('../../../_each.js');

function computeStartMicros() {
    let startTimeMs = Date.now();
    let startHrTime = process.hrtime();
    let baseHrMicros = (startHrTime[0] * 1000000.0 + startHrTime[1] / 1000.0);

    let startTimeMicros = (startTimeMs * 1000.0) - baseHrMicros;
    return startTimeMicros;
}

let startTimeMicros = computeStartMicros();

// Local storage for Node is just memory
let gLocalStorage = {};

export default class PlatformNode {
    constructor(imp) {
        this._mustMatchVersion();
    }

    // An explicit runtime version check. The package.json cannot enforce the
    // runtime version requirement in all circumstances.  See:
    // http://www.marcusoft.net/2015/03/packagejson-and-engines-and-enginestrict.html
    //
    // Note: consider using the semver package if the logic in this function
    // gets any more complex.
    _mustMatchVersion() {
        let actualMatch = /^v(\d+)\.(\d+)\.(\d+)$/.exec(process.version);
        if (!actualMatch || actualMatch.length !== 4) {
            // The version string did not match the expected pattern;
            // optimistically assume this is fine.
            return;
        }

        let packageObject = require('../../../../package.json');
        let requiredVersionString = packageObject.engines.node;
        let requiredMatch = /^>=(\d+)\.(\d+)\.(\d+)$/.exec(requiredVersionString);
        if (!requiredMatch || requiredMatch.length !== 4) {
            throw new Error('Internal error: package.json node requirement malformed');
        }

        let err = `Fatal Error: insufficient node version. Requires node ${requiredVersionString}`;
        try {
            let actual = [
                parseInt(actualMatch[0], 10),
                parseInt(actualMatch[1], 10),
                parseInt(actualMatch[2], 10),
            ];
            let required = [
                parseInt(requiredMatch[0], 10),
                parseInt(requiredMatch[1], 10),
                parseInt(requiredMatch[2], 10),
            ];
            if (actual[0] > required[0]) {
                // eslint-disable-next-line no-empty
            } else if (actual[0] < required[0]) {
                this.fatal(err);
            } else if (actual[1] > required[1]) {
                // eslint-disable-next-line no-empty
            } else if (actual[1] < required[1]) {
                this.fatal(err);
            } else if (actual[2] < required[2]) {
                this.fatal(err);
            }
        } catch (e) {
            // Optimistically ignore the unexpected version format and keep
            // going.
        }
    }

    name() {
        return 'node';
    }

    /* eslint-disable no-empty */
    static initLibrary(lib) {}
    /* eslint-enable no-empty */

    nowMicros() {
        let hrTime = process.hrtime();
        return Math.floor(startTimeMicros + hrTime[0] * 1000000.0 + hrTime[1] / 1000.0);
    }

    runtimeGUID(groupName) {
        return this.generateUUID();
    }

    generateUUID() {
        /* eslint-disable no-bitwise */
        let p0 = `00000000${Math.abs((Math.random() * 0xFFFFFFFF) | 0).toString(16)}`.substr(-8);
        let p1 = `00000000${Math.abs((Math.random() * 0xFFFFFFFF) | 0).toString(16)}`.substr(-8);
        return `${p0}${p1}`;
        /* eslint-enable no-bitwise */
    }

    onBeforeExit(...args) {
        process.on('beforeExit', ...args);
    }

    plugins() {
        return [
            require('../../../plugins/instrument_nodejs'),
        ];
    }

    options() {
        if (!(process && process.argv)) {
            return;
        }
        let opts = {};
        _each(process.argv, (value, key) => {
            // Keep the argument "parsing" simple.  These are primarily debug
            // options regardless.
            switch (value.toLowerCase()) {
            case '--lightstep-log_to_console':
            case '--lightstep-log_to_console=true':
            case '--lightstep-log_to_console=1':
                opts.log_to_console = true;
                break;
            case '--lightstep-verbosity=5':
                opts.verbosity = 5;
                break;
            case '--lightstep-verbosity=4':
                opts.verbosity = 4;
                break;
            case '--lightstep-verbosity=3':
                opts.verbosity = 3;
                break;
            case '--lightstep-verbosity=2':
                opts.verbosity = 2;
                break;
            case '--lightstep-verbosity=1':
                opts.verbosity = 1;
                break;
            default:
                // Ignore
                break;
            }
        });
        return opts;
    }

    tracerTags() {
        let tags = {
            'lightstep.tracer_platform'         : 'node',
            'lightstep.tracer_platform_version' : process.version,
            'lightstep.node_platform'           : process.platform,
            'lightstep.node_arch'               : process.arch,
            'lightstep.hostname'                : os.hostname(),
        };
        if (process.argv) {
            tags['lightstep.command_line'] = process.argv.join(' ');
        }
        if (process.execArgv && process.execArgv.length > 0) {
            tags['lightstep.node_arguments'] = process.execArgv.join(' ');
        }

        return tags;
    }

    fatal(message) {
        console.error(message); // eslint-disable-line no-console
        process.exit(1);
    }

    localStoreGet(key) {
        return gLocalStorage[key];
    }

    localStoreSet(key, value) {
        gLocalStorage[key] = value;
    }
}


text:
package nz.ac.waikato.its.irr.altmetrics.providers;

import nz.ac.waikato.its.irr.altmetrics.providers.ProviderLookup;

import java.util.HashMap;
import java.util.Map;

/**
 * @author Andrea Schweer schweer@waikato.ac.nz for the LCoNZ Institutional Research Repositories
 */
public abstract class AbstractProviderLookup implements ProviderLookup {
	private Map<String, String> parameters = new HashMap<>();

	@Override
	public void addParam(String name, String value) {
		parameters.put(name, value);
	}

	protected Map<String, String> getParams() {
		return parameters;
	}

}


text:
class AddAttachmentPictureToQuestions < ActiveRecord::Migration
  def self.up
    change_table :questions do |t|
      t.attachment :picture
    end
  end

  def self.down
    remove_attachment :questions, :picture
  end
end


text:
ITEM.Name = 'Kleiner'
ITEM.Price = 250
ITEM.Model = 'models/player/kleiner.mdl'

function ITEM:OnEquip(ply, modifications)
	if not ply._OldModel then
		ply._OldModel = ply:GetModel()
	end

	timer.Simple(1, function() ply:SetModel(self.Model) end)
end

function ITEM:OnHolster(ply)
	if ply._OldModel then
		ply:SetModel(ply._OldModel)
	end
end

function ITEM:PlayerSetModel(ply)
	ply:SetModel(self.Model)
end


text:
'use strict';
module.exports = function valueComparator(prev, next, direction) {
    return direction === 1 ? prev > next : prev < next;
};


text:
const path = require('path');
const webpack = require('webpack');
const CopyWebpackPlugin = require('copy-webpack-plugin');

// Phaser webpack config
const phaserModule = path.join(__dirname, '/node_modules/phaser-ce/');
const phaser = path.join(phaserModule, 'build/custom/phaser-split.js');
const pixi = path.join(phaserModule, 'build/custom/pixi.js');
const p2 = path.join(phaserModule, 'build/custom/p2.js');

const definePlugin = new webpack.DefinePlugin({
    __DEV__: JSON.stringify(JSON.parse(process.env.BUILD_DEV || 'false')),
});

module.exports = {
    entry: {
        app: [
            'babel-polyfill',
            path.resolve(__dirname, 'src/main.js'),
        ],
        vendor: ['pixi', 'p2', 'phaser', 'webfontloader'],

    },
    output: {
        path: path.resolve(__dirname, 'dist'),
        publicPath: './dist/',
        filename: 'bundle.js',
    },
    plugins: [
        definePlugin,
        new webpack.IgnorePlugin(/^\.\/locale$/, /moment$/),
        new webpack.optimize.UglifyJsPlugin({
            drop_console: true,
            minimize: true,
            output: {
                comments: false,
            },
        }),
        new CopyWebpackPlugin([
            {from: 'assets', to: 'assets'},
            {from: 'favicons'},
            {from: 'index.html'}
        ]),
        new webpack.optimize.CommonsChunkPlugin({ name: 'vendor'/* chunkName= */, filename: 'vendor.bundle.js'/* filename= */ }),
    ],
    module: {
        rules: [
      { test: /\.js$/, use: ['babel-loader'], include: path.join(__dirname, 'src') },
      { test: /pixi\.js/, use: ['expose-loader?PIXI'] },
      { test: /phaser-split\.js$/, use: ['expose-loader?Phaser'] },
      { test: /p2\.js/, use: ['expose-loader?p2'] },
        ],
    },
    node: {
        fs: 'empty',
        net: 'empty',
        tls: 'empty',
    },
    resolve: {
        alias: {
            phaser,
            pixi,
            p2,
        },
    },
};