text:
-- MySQL dump 10.13  Distrib 5.7.17, for macos10.12 (x86_64)
--
-- Host: 127.0.0.1    Database: likemap
-- ------------------------------------------------------
-- Server version	5.6.25

/*!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 `lm_agree`
--

DROP TABLE IF EXISTS `lm_agree`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `lm_agree` (
  `ag_id` int(11) NOT NULL AUTO_INCREMENT,
  `ag_long` double NOT NULL,
  `ag_lat` double NOT NULL,
  `ag_agree` float NOT NULL,
  `ag_comment` varchar(160) COLLATE utf8_bin DEFAULT NULL,
  `ag_user` varchar(50) COLLATE utf8_bin NOT NULL,
  `ag_image_ref` varchar(50) COLLATE utf8_bin DEFAULT NULL,
  `ag_date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `ag_ip` varchar(20) COLLATE utf8_bin NOT NULL,
  `ag_like_id` int(11) DEFAULT NULL,
  `ag_hwref` varchar(50) COLLATE utf8_bin DEFAULT NULL,
  PRIMARY KEY (`ag_id`),
  KEY `li_long` (`ag_long`,`ag_lat`),
  KEY `li_long_2` (`ag_long`),
  KEY `li_lat` (`ag_lat`)
) ENGINE=InnoDB AUTO_INCREMENT=4446 DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `lm_category`
--

DROP TABLE IF EXISTS `lm_category`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `lm_category` (
  `ca_id` int(11) NOT NULL AUTO_INCREMENT,
  `ca_application` varchar(45) NOT NULL,
  PRIMARY KEY (`ca_id`),
  UNIQUE KEY `ca_id_UNIQUE` (`ca_id`)
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `lm_category_name`
--

DROP TABLE IF EXISTS `lm_category_name`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `lm_category_name` (
  `can_id` int(11) NOT NULL AUTO_INCREMENT,
  `can_language` varchar(10) NOT NULL DEFAULT 'de',
  `can_name` varchar(45) NOT NULL,
  `can_description` varchar(160) NOT NULL,
  `can_category_id` int(11) NOT NULL,
  PRIMARY KEY (`can_id`),
  UNIQUE KEY `can_id_UNIQUE` (`can_id`)
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `lm_category_value`
--

DROP TABLE IF EXISTS `lm_category_value`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `lm_category_value` (
  `cav_id` int(11) NOT NULL AUTO_INCREMENT,
  `cav_category_id` int(11) NOT NULL,
  PRIMARY KEY (`cav_id`)
) ENGINE=InnoDB AUTO_INCREMENT=41 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `lm_category_value_name`
--

DROP TABLE IF EXISTS `lm_category_value_name`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `lm_category_value_name` (
  `cavn_id` int(11) NOT NULL AUTO_INCREMENT,
  `cavn_language` varchar(10) NOT NULL,
  `cavn_name` varchar(45) NOT NULL,
  `cavn_category_value_id` int(11) NOT NULL,
  PRIMARY KEY (`cavn_id`)
) ENGINE=InnoDB AUTO_INCREMENT=59 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `lm_confirmations`
--

DROP TABLE IF EXISTS `lm_confirmations`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `lm_confirmations` (
  `co_id` int(11) NOT NULL AUTO_INCREMENT,
  `co_uid` varchar(50) COLLATE utf8_bin NOT NULL,
  `co_email` varchar(120) COLLATE utf8_bin DEFAULT NULL,
  `co_sms` varchar(30) COLLATE utf8_bin DEFAULT NULL,
  `co_key` varchar(50) COLLATE utf8_bin NOT NULL,
  `co_date_created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `co_hwref` varchar(50) COLLATE utf8_bin DEFAULT NULL,
  PRIMARY KEY (`co_id`),
  UNIQUE KEY `co_key` (`co_key`)
) ENGINE=InnoDB AUTO_INCREMENT=488 DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='confirmation codes';
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `lm_customer`
--

DROP TABLE IF EXISTS `lm_customer`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `lm_customer` (
  `cu_id` int(11) NOT NULL AUTO_INCREMENT,
  `cu_user_id` int(11) NOT NULL DEFAULT '0',
  `cu_address` varchar(300) COLLATE utf8_bin DEFAULT NULL,
  `cu_tax_id` varchar(30) COLLATE utf8_bin DEFAULT NULL,
  `cu_reference` varchar(30) COLLATE utf8_bin DEFAULT NULL,
  `cu_payment_reference` varchar(30) COLLATE utf8_bin DEFAULT NULL,
  `cu_credit` int(11) NOT NULL DEFAULT '0' COMMENT 'Current credits',
  `cu_validated` tinyint(1) NOT NULL DEFAULT '0',
  `cu_type` varchar(20) COLLATE utf8_bin NOT NULL DEFAULT 'basic',
  `cu_language` varchar(4) COLLATE utf8_bin NOT NULL DEFAULT 'de',
  `cu_country` varchar(4) COLLATE utf8_bin NOT NULL DEFAULT 'AT',
  `cu_full_name` varchar(60) COLLATE utf8_bin NOT NULL,
  `cu_default_category` varchar(128) COLLATE utf8_bin NOT NULL DEFAULT ' ',
  `cu_default_long` double NOT NULL,
  `cu_default_lat` double NOT NULL,
  `cu_default_image_ref` varchar(50) COLLATE utf8_bin NOT NULL DEFAULT 'smile',
  `cu_default_marker` varchar(50) COLLATE utf8_bin NOT NULL,
  `cu_email` varchar(1024) COLLATE utf8_bin NOT NULL,
  `cu_phone` varchar(64) COLLATE utf8_bin DEFAULT NULL,
  `cu_contact` varchar(64) COLLATE utf8_bin DEFAULT NULL,
  `cu_webpage` varchar(1024) COLLATE utf8_bin DEFAULT NULL,
  `cu_status` varchar(45) COLLATE utf8_bin DEFAULT 'new',
  `cu_created` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`cu_id`),
  KEY `cu_user_id` (`cu_user_id`)
) ENGINE=InnoDB AUTO_INCREMENT=22 DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `lm_customer_validation`
--

DROP TABLE IF EXISTS `lm_customer_validation`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `lm_customer_validation` (
  `cv_id` int(11) NOT NULL AUTO_INCREMENT,
  `cv_customer_id` int(11) NOT NULL,
  `cv_code` varchar(45) DEFAULT NULL,
  `cv_comment` varchar(160) DEFAULT NULL,
  `cv_user_id` int(11) NOT NULL,
  `cv_date` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  `cv_nickname` varchar(128) DEFAULT 'none',
  PRIMARY KEY (`cv_id`)
) ENGINE=InnoDB AUTO_INCREMENT=44 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `lm_event`
--

DROP TABLE IF EXISTS `lm_event`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `lm_event` (
  `ev_id` int(11) NOT NULL AUTO_INCREMENT,
  `ev_spot_id` int(11) NOT NULL,
  `ev_description` varchar(1024) CHARACTER SET utf8mb4 NOT NULL,
  `ev_created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `ev_image_ref` varchar(1024) COLLATE utf8_bin NOT NULL,
  `ev_url` varchar(1024) COLLATE utf8_bin NOT NULL,
  `ev_title` varchar(160) CHARACTER SET utf8mb4 NOT NULL,
  `ev_hash` varchar(50) COLLATE utf8_bin NOT NULL,
  `ev_source` varchar(50) COLLATE utf8_bin NOT NULL,
  `ev_time_description` varchar(20) COLLATE utf8_bin NOT NULL DEFAULT ' ',
  PRIMARY KEY (`ev_id`)
) ENGINE=InnoDB AUTO_INCREMENT=3450 DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `lm_feedback`
--

DROP TABLE IF EXISTS `lm_feedback`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `lm_feedback` (
  `fe_id` int(11) NOT NULL AUTO_INCREMENT,
  `fe_details` varchar(1024) DEFAULT NULL,
  `fe_use` varchar(160) DEFAULT NULL,
  `fe_how` varchar(160) DEFAULT NULL,
  `fe_ip` varchar(64) DEFAULT NULL,
  `fe_user_id` int(11) NOT NULL,
  `fe_date_created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`fe_id`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `lm_gift`
--

DROP TABLE IF EXISTS `lm_gift`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `lm_gift` (
  `gi_id` int(11) NOT NULL AUTO_INCREMENT,
  `gi_user_id` int(11) NOT NULL COMMENT 'user that gets the gift',
  `gi_promotion_id` int(11) NOT NULL COMMENT 'ref of promotion',
  `gi_image_reference` varchar(1024) COLLATE utf8_bin NOT NULL COMMENT 'optional custom image',
  `gi_end_time` timestamp NULL DEFAULT NULL COMMENT 'end of validity',
  `gi_promotion` varchar(160) CHARACTER SET utf8mb4 DEFAULT 'Grex-app sends you this gift.',
  `gi_comment` varchar(160) CHARACTER SET utf8mb4 NOT NULL DEFAULT 'Grex-app sends you this gift.',
  `gi_user_nick` varchar(30) CHARACTER SET utf8mb4 NOT NULL DEFAULT ' ',
  `gi_is_redeemed` tinyint(1) NOT NULL DEFAULT '0',
  `gi_redeem_time` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
  `gi_redeem_longitude` double DEFAULT NULL,
  `gi_redeem_latitude` double DEFAULT NULL,
  `gi_code` varchar(20) COLLATE utf8_bin NOT NULL DEFAULT 'GREX',
  `gi_longitude` double NOT NULL DEFAULT '0',
  `gi_latitude` double NOT NULL DEFAULT '0',
  `gi_promotion_instance_id` int(11) NOT NULL DEFAULT '0',
  `gi_user_comment` varchar(160) COLLATE utf8_bin DEFAULT NULL,
  `gi_hint` varchar(160) COLLATE utf8_bin DEFAULT NULL,
  `gi_count` int(11) NOT NULL DEFAULT '0',
  `gi_is_canceled` tinyint(1) NOT NULL DEFAULT '0',
  `gi_warn_time` timestamp NULL DEFAULT NULL,
  `gi_warn_message` varchar(1024) CHARACTER SET utf8mb4 DEFAULT NULL,
  `gi_warn_is_sent` tinyint(1) NOT NULL DEFAULT '0',
  `gi_warn_title` varchar(160) CHARACTER SET utf8mb4 DEFAULT NULL,
  PRIMARY KEY (`gi_id`)
) ENGINE=InnoDB AUTO_INCREMENT=1093 DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `lm_image_cache`
--

DROP TABLE IF EXISTS `lm_image_cache`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `lm_image_cache` (
  `imc_id` int(11) NOT NULL AUTO_INCREMENT,
  `imc_image_reference` varchar(50) NOT NULL DEFAULT 'smile',
  `imc_comment` varchar(160) CHARACTER SET utf8mb4 DEFAULT NULL,
  `imc_customer_id` int(11) NOT NULL DEFAULT '0',
  PRIMARY KEY (`imc_id`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `lm_like`
--

DROP TABLE IF EXISTS `lm_like`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `lm_like` (
  `li_id` int(11) NOT NULL AUTO_INCREMENT,
  `li_long` double NOT NULL,
  `li_lat` double NOT NULL,
  `li_heading` double NOT NULL DEFAULT '0',
  `li_elevation` double NOT NULL DEFAULT '0',
  `li_like` float NOT NULL,
  `li_comment` varchar(160) CHARACTER SET utf8mb4 DEFAULT NULL,
  `li_user` varchar(50) COLLATE utf8_bin NOT NULL,
  `li_image_ref` varchar(50) COLLATE utf8_bin DEFAULT NULL,
  `li_date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `li_ip` varchar(20) COLLATE utf8_bin NOT NULL,
  `li_vitality` int(11) NOT NULL DEFAULT '0',
  `li_agree` int(11) NOT NULL DEFAULT '0',
  `li_disagree` int(11) NOT NULL DEFAULT '0',
  `li_agree_short` int(11) NOT NULL DEFAULT '0',
  `li_disagree_short` int(11) NOT NULL DEFAULT '0',
  `li_date_created` timestamp NULL DEFAULT NULL,
  `li_promotion` varchar(160) CHARACTER SET utf8mb4 DEFAULT 'www.grex-app.com',
  `li_promo_id` int(11) DEFAULT NULL,
  `li_type` char(6) COLLATE utf8_bin NOT NULL DEFAULT 'LKE' COMMENT 'type of like',
  `li_view_count` int(11) NOT NULL DEFAULT '0',
  `li_category` varchar(128) CHARACTER SET utf8mb4 NOT NULL DEFAULT ' ',
  `li_event_id` int(11) NOT NULL DEFAULT '0',
  `li_marker_reference` varchar(50) COLLATE utf8_bin DEFAULT NULL,
  `li_marker_inner_reference` varchar(50) COLLATE utf8_bin DEFAULT NULL,
  `li_marker_tag_reference` varchar(50) COLLATE utf8_bin DEFAULT NULL,
  `li_kill_count` int(11) NOT NULL DEFAULT '0',
  `li_is_deactivated` tinyint(1) NOT NULL DEFAULT '0',
  `li_chat_count` int(11) NOT NULL DEFAULT '0',
  `li_strict_category` varchar(128) CHARACTER SET utf8 DEFAULT NULL,
  `li_address` varchar(1024) COLLATE utf8_bin DEFAULT NULL,
  `li_phone` varchar(64) COLLATE utf8_bin DEFAULT NULL,
  `li_contact_name` varchar(64) COLLATE utf8_bin DEFAULT NULL,
  `li_detail` varchar(1024) CHARACTER SET utf8mb4 DEFAULT NULL,
  `li_special_url` varchar(1024) COLLATE utf8_bin DEFAULT NULL,
  `li_ignore_distance` tinyint(1) NOT NULL DEFAULT '0',
  PRIMARY KEY (`li_id`),
  KEY `li_long` (`li_long`,`li_lat`),
  KEY `li_vitality` (`li_vitality`),
  FULLTEXT KEY `li_comment` (`li_comment`),
  FULLTEXT KEY `li_category` (`li_category`)
) ENGINE=MyISAM AUTO_INCREMENT=3461 DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='MyISAM for Fulltext Index';
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `lm_messaging`
--

DROP TABLE IF EXISTS `lm_messaging`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `lm_messaging` (
  `me_id` int(11) NOT NULL AUTO_INCREMENT,
  `me_type` varchar(6) CHARACTER SET utf8mb4 NOT NULL DEFAULT 'none',
  `me_title` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
  `me_message` varchar(1014) CHARACTER SET utf8mb4 DEFAULT NULL,
  `me_message_html` varchar(1014) DEFAULT NULL,
  `me_status` int(11) NOT NULL DEFAULT '0',
  `me_recipients_group_id` int(11) NOT NULL DEFAULT '0',
  `me_user_id` int(11) DEFAULT NULL,
  `me_customer_id` int(11) DEFAULT NULL,
  `me_recipients_count` int(11) DEFAULT '0',
  `me_created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `me_valid_until` timestamp NULL DEFAULT NULL,
  `me_phone_number` varchar(32) DEFAULT NULL,
  `me_promotion_instance` int(11) NOT NULL DEFAULT '0',
  `me_promotion_id` int(11) DEFAULT '0',
  `me_response_to` int(11) DEFAULT '0',
  `me_email` int(1) DEFAULT '0',
  `me_sms` int(1) DEFAULT '0',
  `me_chat` int(1) DEFAULT '0',
  `me_handled` int(1) DEFAULT '0',
  `me_read` int(1) DEFAULT '0',
  `me_sender_id` int(11) DEFAULT '0',
  PRIMARY KEY (`me_id`)
) ENGINE=InnoDB AUTO_INCREMENT=85 DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `lm_profile`
--

DROP TABLE IF EXISTS `lm_profile`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `lm_profile` (
  `pro_id` int(11) NOT NULL AUTO_INCREMENT,
  `pro_customer_id` int(11) NOT NULL,
  `pro_name` varchar(64) NOT NULL,
  `pro_description` varchar(128) NOT NULL,
  `pro_key` varchar(32) NOT NULL DEFAULT 'none',
  `pro_application` varchar(10) NOT NULL DEFAULT 'help2day',
  PRIMARY KEY (`pro_id`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `lm_profile_image_map`
--

DROP TABLE IF EXISTS `lm_profile_image_map`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `lm_profile_image_map` (
  `pim_id` int(11) NOT NULL AUTO_INCREMENT,
  `pim_profile_id` int(11) NOT NULL,
  `pim_promotion_image_reference` varchar(64) DEFAULT NULL,
  `pim_filter_image_reference` varchar(64) DEFAULT NULL,
  `pim_customer_id` int(11) NOT NULL,
  PRIMARY KEY (`pim_id`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `lm_promotion`
--

DROP TABLE IF EXISTS `lm_promotion`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `lm_promotion` (
  `pr_id` int(11) NOT NULL AUTO_INCREMENT,
  `pr_like_id` int(11) NOT NULL,
  `pr_gift_comment` varchar(160) CHARACTER SET utf8mb4 NOT NULL DEFAULT 'GREX sends you this gift.',
  `pr_user_comment` varchar(160) COLLATE utf8_bin DEFAULT NULL,
  `pr_gift_image_reference` varchar(1024) COLLATE utf8_bin NOT NULL DEFAULT 'smile',
  `pr_gift_audio_reference` varchar(128) COLLATE utf8_bin DEFAULT NULL,
  `pr_gift_count` int(11) NOT NULL DEFAULT '0' COMMENT 'max playouts',
  `pr_gift_units_per_count` int(11) NOT NULL DEFAULT '1',
  `pr_gift_age` int(11) NOT NULL DEFAULT '0' COMMENT 'age in seconds',
  `pr_gift_block` int(11) NOT NULL DEFAULT '82400' COMMENT 'blocking time in seconds',
  `pr_start_time` timestamp NULL DEFAULT NULL,
  `pr_end_time` timestamp NULL DEFAULT NULL,
  `pr_customer_id` int(11) NOT NULL,
  `pr_customer_nick` varchar(60) CHARACTER SET utf8mb4 NOT NULL DEFAULT 'ACME',
  `pr_current_count` int(11) NOT NULL DEFAULT '0' COMMENT 'already sent gifts',
  `pr_promotion` varchar(160) CHARACTER SET utf8mb4 NOT NULL DEFAULT 'www.grex-app.com',
  `pr_hint` varchar(160) COLLATE utf8_bin DEFAULT NULL,
  `pr_instance_id` int(11) NOT NULL DEFAULT '0',
  `pr_name` varchar(50) CHARACTER SET utf8mb4 NOT NULL DEFAULT 'no name',
  `pr_code` varchar(6) CHARACTER SET utf8mb4 NOT NULL DEFAULT 'PRCO',
  `pr_push` int(11) NOT NULL DEFAULT '0' COMMENT 'create push messages of higher than zero',
  `pr_duration` int(11) NOT NULL DEFAULT '7200',
  `pr_notifications` int(2) NOT NULL DEFAULT '0',
  `pr_is_helping_ticket` tinyint(1) NOT NULL DEFAULT '0',
  `pr_notification_phone` varchar(32) COLLATE utf8_bin DEFAULT NULL,
  `pr_requires_registration` tinyint(1) NOT NULL DEFAULT '0',
  `pr_allow_upcount` tinyint(1) NOT NULL DEFAULT '0',
  `pr_gift_phone` varchar(32) COLLATE utf8_bin DEFAULT NULL,
  `pr_impact` varchar(64) COLLATE utf8_bin DEFAULT NULL,
  `pr_impact_long` varchar(160) COLLATE utf8_bin DEFAULT NULL,
  `pr_impact_image_ref` varchar(1024) COLLATE utf8_bin DEFAULT NULL,
  `pr_profile_id` int(11) DEFAULT '0',
  UNIQUE KEY `pr_id` (`pr_id`)
) ENGINE=InnoDB AUTO_INCREMENT=108 DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `lm_promotion_category_value_map`
--

DROP TABLE IF EXISTS `lm_promotion_category_value_map`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `lm_promotion_category_value_map` (
  `pcam_id` int(11) NOT NULL AUTO_INCREMENT,
  `pcam_promotion_id` int(11) NOT NULL,
  `pcam_category_value_id` int(11) NOT NULL,
  PRIMARY KEY (`pcam_id`)
) ENGINE=InnoDB AUTO_INCREMENT=87 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `lm_promotion_instance`
--

DROP TABLE IF EXISTS `lm_promotion_instance`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `lm_promotion_instance` (
  `pi_id` int(11) NOT NULL AUTO_INCREMENT,
  `pi_start_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `pi_end_time` timestamp NULL DEFAULT NULL,
  `pi_promotion_id` int(11) NOT NULL,
  `pi_gift_count` int(11) NOT NULL,
  `pi_gift_image_reference` varchar(1024) COLLATE utf8_bin DEFAULT NULL,
  `pi_name` varchar(50) COLLATE utf8_bin NOT NULL,
  `pi_gift_comment` varchar(160) COLLATE utf8_bin NOT NULL,
  `pi_user_comment` varchar(160) COLLATE utf8_bin DEFAULT NULL,
  `pi_hint` varchar(160) COLLATE utf8_bin DEFAULT NULL,
  `pi_start_user_id` int(11) NOT NULL DEFAULT '0',
  `pi_end_user_id` int(11) NOT NULL DEFAULT '0',
  PRIMARY KEY (`pi_id`)
) ENGINE=InnoDB AUTO_INCREMENT=674 DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `lm_promotion_profile_map`
--

DROP TABLE IF EXISTS `lm_promotion_profile_map`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `lm_promotion_profile_map` (
  `pp_id` int(11) NOT NULL AUTO_INCREMENT,
  `pp_profile_id` int(11) NOT NULL,
  `pp_promotion_id` int(11) NOT NULL,
  PRIMARY KEY (`pp_id`)
) ENGINE=InnoDB AUTO_INCREMENT=11 DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `lm_recipients`
--

DROP TABLE IF EXISTS `lm_recipients`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `lm_recipients` (
  `re_id` int(11) NOT NULL AUTO_INCREMENT,
  `re_customer_id` int(11) NOT NULL,
  `re_user_id` int(11) DEFAULT NULL,
  `re_email` varchar(1024) DEFAULT NULL,
  `re_phone` varchar(32) DEFAULT NULL,
  `re_locale` varchar(6) NOT NULL DEFAULT 'at-at',
  `re_group_id` int(11) NOT NULL,
  `re_email_encrypted` varchar(1024) DEFAULT NULL,
  `re_phone_encrypted` varchar(64) DEFAULT NULL,
  PRIMARY KEY (`re_id`)
) ENGINE=InnoDB AUTO_INCREMENT=23 DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `lm_roles`
--

DROP TABLE IF EXISTS `lm_roles`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `lm_roles` (
  `ro_id` int(11) NOT NULL AUTO_INCREMENT,
  `ro_customer_id` int(11) NOT NULL,
  `ro_name` varchar(64) CHARACTER SET utf8 NOT NULL DEFAULT 'NONE',
  PRIMARY KEY (`ro_id`)
) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `lm_sessions`
--

DROP TABLE IF EXISTS `lm_sessions`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `lm_sessions` (
  `se_session_id` varchar(255) COLLATE utf8_bin NOT NULL,
  `se_expires` int(11) unsigned NOT NULL,
  `se_data` text COLLATE utf8_bin,
  PRIMARY KEY (`se_session_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `lm_sig_event`
--

DROP TABLE IF EXISTS `lm_sig_event`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `lm_sig_event` (
  `se_id` int(11) NOT NULL AUTO_INCREMENT,
  `se_title` varchar(45) DEFAULT NULL,
  `se_message` varchar(300) DEFAULT NULL,
  `se_image_ref` varchar(45) DEFAULT NULL,
  `se_date` datetime DEFAULT NULL,
  `se_type` varchar(16) DEFAULT NULL,
  `se_marker` varchar(45) DEFAULT NULL,
  `se_sender_id` int(11) NOT NULL DEFAULT '1',
  `se_long` float DEFAULT NULL,
  `se_lat` float DEFAULT NULL,
  `se_category` varchar(45) DEFAULT NULL,
  PRIMARY KEY (`se_id`)
) ENGINE=InnoDB AUTO_INCREMENT=92 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `lm_sig_image`
--

DROP TABLE IF EXISTS `lm_sig_image`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `lm_sig_image` (
  `si_id` int(11) NOT NULL AUTO_INCREMENT,
  `si_image_ref` varchar(45) DEFAULT NULL,
  `si_source_id` int(11) DEFAULT NULL,
  `si_key` varchar(45) DEFAULT NULL,
  `si_duration` int(11) DEFAULT NULL COMMENT 'duration in seconds',
  PRIMARY KEY (`si_id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `lm_sig_kiosk_session`
--

DROP TABLE IF EXISTS `lm_sig_kiosk_session`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `lm_sig_kiosk_session` (
  `ks_id` int(11) NOT NULL AUTO_INCREMENT,
  `ks_key` varchar(45) NOT NULL DEFAULT 'none',
  `ks_category` varchar(45) DEFAULT NULL,
  `ks_longitude` float DEFAULT NULL,
  `ks_latitude` float DEFAULT NULL,
  `ks_radius` float DEFAULT NULL,
  `ks_statistic_category` varchar(45) DEFAULT NULL,
  `ks_session_title` varchar(45) DEFAULT NULL,
  `ks_session_message` varchar(160) DEFAULT NULL,
  `ks_video_url` varchar(1024) DEFAULT NULL,
  `ks_center_image_ref` varchar(45) DEFAULT NULL,
  `ks_animation` int(11) DEFAULT '0',
  `ks_api_key` varchar(45) NOT NULL,
  PRIMARY KEY (`ks_id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `lm_sig_source`
--

DROP TABLE IF EXISTS `lm_sig_source`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `lm_sig_source` (
  `ss_id` int(11) NOT NULL AUTO_INCREMENT,
  `ss_url` varchar(1024) NOT NULL,
  `ss_user_id` int(11) DEFAULT NULL,
  `ss_date` varchar(45) DEFAULT NULL,
  `ss_year` int(11) DEFAULT NULL,
  `ss_title` varchar(45) DEFAULT NULL,
  PRIMARY KEY (`ss_id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `lm_sig_static_dataset`
--

DROP TABLE IF EXISTS `lm_sig_static_dataset`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `lm_sig_static_dataset` (
  `ssd_id` int(11) NOT NULL AUTO_INCREMENT,
  `ssd_source_id` int(11) DEFAULT NULL,
  `ssd_hours` float DEFAULT NULL,
  `ssd_year` int(11) DEFAULT NULL,
  `ssd_category` varchar(45) DEFAULT NULL,
  `ssd_long` float DEFAULT NULL,
  `ssd_lat` float DEFAULT NULL,
  `ssd_radius` float DEFAULT NULL COMMENT 'km',
  `ssd_customer_id` int(11) DEFAULT NULL,
  `ssd_user_id` int(11) DEFAULT NULL,
  `ssd_region_nation` varchar(256) DEFAULT NULL,
  `ssd_region_province` varchar(256) DEFAULT NULL,
  `ssd_region_district` varchar(256) DEFAULT NULL,
  `ssd_region_community` varchar(256) DEFAULT NULL,
  `ssd_region_location` varchar(256) DEFAULT NULL,
  `ssd_region_address` varchar(256) DEFAULT NULL,
  `ssd_date` datetime DEFAULT NULL,
  `ssd_image_ref` varchar(45) DEFAULT NULL,
  `ssd_message` varchar(64) DEFAULT NULL,
  `ssd_title` varchar(45) DEFAULT NULL,
  `ssd_key` varchar(45) DEFAULT NULL,
  PRIMARY KEY (`ssd_id`)
) ENGINE=InnoDB AUTO_INCREMENT=104 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `lm_sig_video`
--

DROP TABLE IF EXISTS `lm_sig_video`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `lm_sig_video` (
  `sv_id` int(11) NOT NULL AUTO_INCREMENT,
  `sv_url` varchar(45) DEFAULT NULL,
  `sv_key` varchar(45) DEFAULT NULL,
  PRIMARY KEY (`sv_id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `lm_timeline`
--

DROP TABLE IF EXISTS `lm_timeline`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `lm_timeline` (
  `ti_id` int(11) NOT NULL AUTO_INCREMENT,
  `ti_like_id` int(11) NOT NULL DEFAULT '0',
  `ti_user_id` int(11) NOT NULL DEFAULT '0',
  `ti_message` varchar(256) CHARACTER SET utf8mb4 NOT NULL DEFAULT 'ups',
  `ti_promotion_id` int(11) NOT NULL DEFAULT '0',
  `ti_timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `ti_type` int(2) NOT NULL DEFAULT '0' COMMENT '0 message, 1 hidden message',
  `ti_language` char(8) COLLATE utf8_bin NOT NULL DEFAULT 'de',
  `ti_parameter` varchar(32) COLLATE utf8_bin NOT NULL,
  `ti_title` varchar(64) COLLATE utf8_bin DEFAULT NULL,
  `ti_sender_id` int(11) DEFAULT NULL,
  `ti_response_to` int(11) DEFAULT NULL,
  PRIMARY KEY (`ti_id`)
) ENGINE=InnoDB AUTO_INCREMENT=5114 DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `lm_user_category_value_map`
--

DROP TABLE IF EXISTS `lm_user_category_value_map`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `lm_user_category_value_map` (
  `ucam_id` int(11) NOT NULL AUTO_INCREMENT,
  `ucam_user_id` int(11) NOT NULL,
  `ucam_category_value_id` int(11) NOT NULL,
  PRIMARY KEY (`ucam_id`)
) ENGINE=InnoDB AUTO_INCREMENT=320 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `lm_user_device`
--

DROP TABLE IF EXISTS `lm_user_device`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `lm_user_device` (
  `ud_id` int(11) NOT NULL AUTO_INCREMENT,
  `ud_uid` varchar(50) COLLATE utf8_bin NOT NULL,
  `ud_hwref` varchar(50) COLLATE utf8_bin NOT NULL,
  `ud_date_created` timestamp NULL DEFAULT NULL,
  `ud_initial_uid` varchar(50) COLLATE utf8_bin DEFAULT NULL,
  `ud_reference_id` varchar(1024) COLLATE utf8_bin DEFAULT '',
  `ud_language_code` varchar(16) COLLATE utf8_bin DEFAULT 'en',
  `ud_device_class` varchar(16) COLLATE utf8_bin DEFAULT 'android_mobile',
  `ud_system` varchar(256) COLLATE utf8_bin DEFAULT NULL,
  `ud_new_uid` varchar(50) COLLATE utf8_bin DEFAULT NULL,
  `ud_facebook_token` varchar(1024) COLLATE utf8_bin DEFAULT NULL,
  `ud_email` varchar(1024) COLLATE utf8_bin DEFAULT NULL,
  `ud_application` varchar(32) COLLATE utf8_bin DEFAULT NULL,
  `ud_version` varchar(32) COLLATE utf8_bin DEFAULT NULL,
  PRIMARY KEY (`ud_id`),
  KEY `INDEX` (`ud_hwref`)
) ENGINE=InnoDB AUTO_INCREMENT=922 DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `lm_user_profile_map`
--

DROP TABLE IF EXISTS `lm_user_profile_map`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `lm_user_profile_map` (
  `upm_id` int(11) NOT NULL AUTO_INCREMENT,
  `upm_user_id` int(11) NOT NULL,
  `upm_profile_id` int(11) NOT NULL,
  `upm_weight` float DEFAULT NULL,
  PRIMARY KEY (`upm_id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `lm_user_role_map`
--

DROP TABLE IF EXISTS `lm_user_role_map`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `lm_user_role_map` (
  `urm_id` int(11) NOT NULL AUTO_INCREMENT,
  `urm_user_id` int(11) NOT NULL,
  `urm_role_id` int(11) NOT NULL,
  PRIMARY KEY (`urm_id`)
) ENGINE=InnoDB AUTO_INCREMENT=15 DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `lm_users`
--

DROP TABLE IF EXISTS `lm_users`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `lm_users` (
  `us_id` int(20) unsigned NOT NULL AUTO_INCREMENT,
  `us_image_ref` char(40) COLLATE utf8_bin DEFAULT NULL,
  `us_email` char(254) COLLATE utf8_bin DEFAULT NULL,
  `us_nickname` varchar(64) CHARACTER SET utf8mb4 NOT NULL,
  `us_uid` varchar(50) COLLATE utf8_bin NOT NULL COMMENT 'UID of user',
  `us_uid_update` varchar(50) COLLATE utf8_bin DEFAULT NULL,
  `us_facebook_id` varchar(120) COLLATE utf8_bin DEFAULT NULL,
  `us_facebook_token_shop` text COLLATE utf8_bin,
  `us_pw` varchar(50) COLLATE utf8_bin DEFAULT NULL COMMENT 'password of user',
  `us_pw_hashed` varchar(512) COLLATE utf8_bin DEFAULT NULL,
  `us_salt` varchar(50) COLLATE utf8_bin DEFAULT NULL,
  `us_date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `us_action_control_flags` int(11) NOT NULL DEFAULT '0',
  `us_date_created` timestamp NULL DEFAULT NULL,
  `us_gift_count` int(11) NOT NULL DEFAULT '0',
  `us_like_count` int(11) NOT NULL DEFAULT '0',
  `us_agree_count` int(11) NOT NULL DEFAULT '0',
  `us_share_count` int(11) NOT NULL DEFAULT '0',
  `us_activity_rank` int(11) NOT NULL DEFAULT '0',
  `us_reset_password_token` varchar(100) COLLATE utf8_bin DEFAULT NULL,
  `us_reset_password_expires` timestamp NULL DEFAULT NULL,
  `us_phone` varchar(64) COLLATE utf8_bin DEFAULT NULL,
  `us_phone_encrypted` varchar(64) COLLATE utf8_bin DEFAULT NULL,
  `us_customer_id` int(11) DEFAULT '0',
  `us_role` varchar(64) COLLATE utf8_bin NOT NULL DEFAULT '0',
  `us_allow_email_notification` tinyint(1) NOT NULL DEFAULT '0',
  `us_allow_sms_notification` tinyint(1) NOT NULL DEFAULT '0',
  `us_long` float DEFAULT '16.37',
  `us_lat` float DEFAULT '48.2',
  `us_long_radius` float DEFAULT '0.3',
  `us_lat_radius` float DEFAULT '0.3',
  `us_email_encrypted` varchar(512) COLLATE utf8_bin DEFAULT NULL,
  `us_zoom` float DEFAULT NULL,
  `us_dont_encrypt_email` int(1) DEFAULT '0',
  `us_about_me` varchar(1024) COLLATE utf8_bin DEFAULT NULL,
  `us_sorted` int(11) DEFAULT '0',
  `us_settings_open` int(11) DEFAULT '0',
  PRIMARY KEY (`us_id`),
  KEY `us_uid` (`us_uid`),
  FULLTEXT KEY `us_nickname` (`us_nickname`)
) ENGINE=MyISAM AUTO_INCREMENT=982 DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `lm_view`
--

DROP TABLE IF EXISTS `lm_view`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `lm_view` (
  `vw_id` int(12) unsigned NOT NULL AUTO_INCREMENT,
  `vw_like_id` varchar(50) COLLATE utf8_bin NOT NULL COMMENT 'like id',
  `vw_source` varchar(50) COLLATE utf8_bin NOT NULL COMMENT 'IP of client',
  `vw_reference` varchar(50) COLLATE utf8_bin DEFAULT NULL COMMENT 'uid of referencing user',
  `vw_date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT 'timestamp of view',
  `vw_promotor` varchar(50) COLLATE utf8_bin NOT NULL DEFAULT 'likemap',
  `vw_viewer` varchar(50) COLLATE utf8_bin DEFAULT NULL COMMENT 'uid of viewer if available',
  `vw_facility` varchar(256) COLLATE utf8_bin DEFAULT NULL,
  PRIMARY KEY (`vw_id`),
  KEY `vw_like_id` (`vw_like_id`)
) ENGINE=InnoDB AUTO_INCREMENT=2616 DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
/*!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 2017-10-18 21:57:56


text:
@extends('Cpanel.template')

@section('title', 'Slider')

@section('content')

Create Slider

Sliders

                    <button class="btn btn-default btn-xs btn-filter"> Filter</button>

                        <input type="text" class="form-control" placeholder="#" disabled>
                        <input type="text" class="form-control" placeholder="Slider" disabled>
                        <input type="text" class="form-control" placeholder="Last Update" disabled>
                        <input type="text" class="form-control" placeholder="Updated By" disabled>
                    	<input type="text" class="form-control" placeholder="Options" disabled>

                <?php $i=1; ?>
                    @foreach($sliders as $slider)
                      {{$i}}
                        {{$slider->name }}
                        {{$slider->updated_at->format('d-m-Y') }}

                        {{$slider->updated_by}}

                          id}}/edit">

 |
                          id}}" data-toggle="modal">

                        <?php ++$i; ?>
                        @endforeach

   @foreach ($sliders as $slider)

id}}" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="false">

                <button type="button" class="close btn-primary" data-dismiss="modal">×</button>

Delete slider "{{$slider->name}}"

                <form class="form-horizontal" method="POST" action="/cpanel/sliders/{{$slider->id}}">
                <input name="_method" type="hidden" value="DELETE">
                {{Form::token()}}

Are you sure you want to delete this event ?

Delete "{{$slider->name}}" ?

                <button type="submit" class="btn btn-primary">Delete</button>
                </form>

                <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>

        @endforeach

  @stop

redpajama_set_name: RedPajamaGithub


text:
package org.jasig.portlet.notice.service.jpa;

import java.util.HashSet;
import java.util.List;
import java.util.Set;

import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
import javax.persistence.TypedQuery;

import org.apache.commons.lang.Validate;
import org.jasig.portlet.notice.NotificationState;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Transactional;

/**
 * This DAO class handles raw CRUD operations for the JPA-flavor notifications.
 *
 * @since 3.0
 * @author drewwills
 */
@Repository
/* package-private */ class JpaNotificationDao implements INotificationDao {

    @PersistenceContext
    private EntityManager entityManager;

    private final Logger log = LoggerFactory.getLogger(getClass());

    /**
     * Search for a JpaEntry with the specified Id. If the entry exists in the
     * persistence context, it is returned;  otherwise, null is returned.
     */
    @Override
    @Transactional(readOnly=true)
    public JpaEntry getEntry(long entryId) {
        Validate.isTrue(entryId > 0, "Invalid entryId:  " + entryId);

        JpaEntry rslt = entityManager.find(JpaEntry.class, entryId);
        return rslt;
    }

    @Override
    @Transactional
    public JpaEntry createOrUpdateEntry(JpaEntry entry) {
        Validate.notNull(entry, "Argument 'entry' cannot be null");

        JpaEntry rslt = entityManager.merge(entry);
        return rslt;
    }

    @Override
    @Transactional
    public void removeEntry(JpaEntry entry) {
        Validate.notNull(entry, "Argument 'entry' cannot be null");

        JpaEntry y = entityManager.merge(entry);  // Insures that cascades will be handled properly
        entityManager.remove(y);
    }

    @Override
    @Transactional(readOnly=true)
    public Set<JpaEntry> getEntriesByRecipient(String username) {
        Validate.notEmpty(username, "Argument 'username' cannot be empty");

        final String jpql = "SELECT DISTINCT v.entry FROM JpaEvent v "
                                    + "WHERE v.username = :username";
        TypedQuery<JpaEntry> query = entityManager.createQuery(jpql, JpaEntry.class);

        log.debug("Query getEntriesByRecipient={}", query.toString());

        query.setParameter("username", username);
        List<JpaEntry> rslt = query.getResultList();
        return new HashSet<JpaEntry>(rslt);
    }

    @Override
    @Transactional(readOnly=true)
    public Set<JpaEntry> getEntriesByRecipientByStatus(String username,
            Set<NotificationState> include, Set<NotificationState> exclude) {
        Validate.notEmpty(username, "Argument 'username' cannot be empty");

        // TODO Auto-generated method stub
        throw new UnsupportedOperationException();
    }

    @Override
    @Transactional(readOnly=true)
    public List<JpaEvent> getEvents(long entryId, String username) {
        Validate.isTrue(entryId > 0, "Argument 'entryId' must be greater than zero (0)");
        Validate.notEmpty(username, "Argument 'username' cannot be empty");

        final String jpql = "SELECT v FROM JpaEvent v WHERE v.username = :username "
                + "AND v.entry = (SELECT e FROM JpaEntry e WHERE e.id = :entryId) "
                + "ORDER BY v.timestamp";
        TypedQuery<JpaEvent> query = entityManager.createQuery(jpql, JpaEvent.class);
        query.setParameter("username", username);
        query.setParameter("entryId", entryId);
        List<JpaEvent> rslt = query.getResultList();
        return rslt;
    }

	@Override
    @Transactional
    public JpaEvent createOrUpdateEvent(JpaEvent event) {
        Validate.notNull(event, "Argument 'event' cannot be null");

        JpaEvent rslt = entityManager.merge(event);
        return rslt;
    }
}


text:
import { AnyObject, DeepPartial, UnknownObject } from '@jovotech/common';
import {
  BaseComponent,
  ComponentConfig,
  ComponentConstructor,
  ComponentDeclaration,
} from '../BaseComponent';
import { JovoConditionFunction } from '../index';
import { ClassDecoratorMetadata } from './ClassDecoratorMetadata';
import { ComponentOptionMetadata } from './ComponentOptionMetadata';

export interface ComponentOptions<COMPONENT extends BaseComponent> extends UnknownObject {
  name?: string;
  global?: boolean;
  config?: DeepPartial<ComponentConfig<COMPONENT>>;
  components?: Array<ComponentConstructor | ComponentDeclaration>;
  models?: AnyObject;

  isAvailable?: JovoConditionFunction;
  platforms?: string[];
}

export class ComponentMetadata<
  COMPONENT extends BaseComponent = BaseComponent,
> extends ClassDecoratorMetadata<COMPONENT> {
  constructor(
    // eslint-disable-next-line @typescript-eslint/ban-types
    readonly target: ComponentConstructor<COMPONENT> | Function,
    readonly options: ComponentOptions<COMPONENT> = {},
  ) {
    super(target);
  }

  get isGlobal(): boolean {
    return !!this.options.global;
  }

  mergeWith(
    otherMetadata: ComponentMetadata<COMPONENT> | ComponentOptionMetadata<COMPONENT>,
  ): ComponentMetadata<COMPONENT> {
    for (const key in otherMetadata.options) {
      if (otherMetadata.options.hasOwnProperty(key) && otherMetadata.options[key]) {
        const valueToMergeIn = otherMetadata.options[key];
        if (Array.isArray(valueToMergeIn) && Array.isArray(this.options[key])) {
          (this.options[key] as unknown[]).push(...valueToMergeIn);
        } else if (
          typeof valueToMergeIn === 'function' &&
          typeof this.options[key] === 'function'
        ) {
          // TODO: check if this is necessary: it is experimental
          const currentFunction = this.options[key] as (
            ...args: unknown[]
          ) => unknown | Promise<unknown>;
          this.options[key] = async function (...args: unknown[]) {
            const currentResult = await currentFunction.call(this, ...args);
            const newResult = await valueToMergeIn.call(this, ...args);
            return currentResult && newResult;
          };
        } else {
          this.options[key] = valueToMergeIn;
        }
      }
    }
    return this;
  }
}


text:
/**
 * Shows meta data of selected photo
 */
qx.Class.define("flicky.view.Meta",
{
  extend : unify.view.ServiceView,
  type : "singleton",

  properties :
  {
    // overridden
    modal :
    {
      refine : true,
      init : true
    }
  },

  members :
  {
    __content : null,
    __template : null,

    // overridden
    getTitle : function(type) {
      return "Meta Data";
    },

    // overridden
    _createView : function()
    {
      var layer = new unify.ui.Layer(this);
      var navigationBar = new unify.ui.NavigationBar(this);
      navigationBar.setRightItems([{label:"Done", rel:"close", kind:"button"}]);
      layer.add(navigationBar);

      var content = this.__content = new unify.ui.ScrollView;
      content.setEnableScrollX(false);
      layer.add(content);

      return layer;
    },

    // overridden
    _getBusinessObject : function() {
      return flicky.business.Flickr.getInstance();
    },

    // overridden
    _getServiceName : function() {
      return "info";
    },

    // overridden
    _getRenderVariant : function() {
      return flicky.view.Photo.getInstance().getParam();
    },

    // overridden
    _getServiceParams : function()
    {
      return {
        "photo" : flicky.view.Photo.getInstance().getParam()
      };
    },

    // overridden
    _renderData : function(data)
    {
      if(!data){
        this.__content.clear();
        return;
      }
      var template = this.__template;
      if (!template)
      {
        var html = "
";
        html += "
Title{title}
";
        html += "
ID{id}
";
        html += "
Owner

";
        html += "
Location

";
        html += "
Description{description}
";
        html += "
Comments{comments}
";
        html += "
";

        template = this.__template = new qx.util.Template(html);
      }

      var photo = data.query.results.photo;
      this.__content.replace(template.run(photo));
    }
  }
});


text:
@interface ViewController : UIViewController
@property (weak, nonatomic) IBOutlet SFVerificationCodeView *codeView;

@end


text:
package de.iritgo.aktario.jdbc;

import de.iritgo.aktario.core.Engine;
import de.iritgo.aktario.core.command.Command;
import de.iritgo.aktario.core.iobject.IObjectList;
import de.iritgo.aktario.core.logger.Log;
import de.iritgo.aktario.framework.base.DataObject;
import org.apache.commons.dbutils.DbUtils;
import javax.sql.DataSource;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.SQLException;
import java.util.Iterator;
import java.util.Map;

/**
 * This command stores the specified user to the database.
 *
 *

 *
Parameter	Type	Description

 *
dataobject	DataObject	The object to store in the database.

 *
owner	DataObject	The owner object to create the relations.

 *
listAttribute	String	The name of the IObjectList for the relation.

 *

 */
public class StoreObject extends Command
{
	/**
	 * Create a new StoreUser command.
	 */
	public StoreObject()
	{
		super("persist.StoreObject");
	}

	/**
	 * Perform the command.
	 */
	public void perform()
	{
		insert((DataObject) properties.get("dataobject"), (DataObject) properties.get("owner"), (String) properties
						.get("listattribute"));
	}

	/**
	 * Insert a new data object into the database.
	 *
	 * @param object The data object to create.
	 * @param owner The data object owning this one.
	 * @param listAttribute The name of the list attribute to which the new
	 *   object belongs.
	 */
	private void insert(DataObject object, DataObject owner, String listAttribute)
	{
		Connection connection = null;
		PreparedStatement stmt = null;

		try
		{
			JDBCManager jdbcManager = (JDBCManager) Engine.instance().getManager("persist.JDBCManager");
			DataSource dataSource = jdbcManager.getDefaultDataSource();

			connection = dataSource.getConnection();

			StringBuffer sqlFields = new StringBuffer("id");
			StringBuffer sqlValues = new StringBuffer("?");

			for (Iterator i = object.getAttributes().entrySet().iterator(); i.hasNext();)
			{
				Map.Entry attribute = (Map.Entry) i.next();

				if (attribute.getValue() instanceof IObjectList)
				{
					continue;
				}

				sqlFields.append(", " + (String) attribute.getKey());
				sqlValues.append(", ?");
			}

			String sql = "insert into " + object.getTypeId() + " (" + sqlFields.toString() + ") values ("
							+ sqlValues.toString() + ")";

			stmt = connection.prepareStatement(sql);
			putAttributesToStatement(object, stmt);
			stmt.execute();

			Log.logVerbose("persist", "JDBCManager", "CREATED " + object.getTypeId() + ":" + object.getUniqueId()
							+ " |" + sql + "|");

			stmt.close();

			if (owner != null)
			{
				sql = "insert into IritgoObjectList (type, id, attribute, elemType, elemId) values (?, ?, ?, ?, ?)";

				stmt = connection.prepareStatement(sql);
				stmt.setString(1, owner.getTypeId());
				stmt.setLong(2, owner.getUniqueId());
				stmt.setString(3, listAttribute);
				stmt.setString(4, object.getTypeId());
				stmt.setLong(5, object.getUniqueId());
				stmt.execute();

				Log.logVerbose("persist", "StoreObject", "CREATED REFRENCE " + owner.getTypeId() + ":"
								+ owner.getUniqueId() + " => " + object.getTypeId() + ":" + object.getUniqueId() + " |"
								+ sql + "|");
			}
		}
		catch (Exception x)
		{
			Log.logDebug("persist", "StoreObject", "Error while creating new database record: " + x);
		}
		finally
		{
			DbUtils.closeQuietly(stmt);
			DbUtils.closeQuietly(connection);
		}
	}

	/**
	 * Transfer all attribute values of a data object to the specified
	 * prepared statement.
	 *
	 * @param object The data object to transfer.
	 * @param stmt The prepared statement.
	 * @throws SQLException If an attribute could not be set.
	 */
	private void putAttributesToStatement(DataObject object, PreparedStatement stmt) throws SQLException
	{
		stmt.setLong(1, object.getUniqueId());

		int pos = 2;

		for (Iterator i = object.getAttributes().entrySet().iterator(); i.hasNext();)
		{
			Map.Entry attribute = (Map.Entry) i.next();

			if (attribute.getValue() instanceof IObjectList)
			{
				continue;
			}

			stmt.setObject(pos++, attribute.getValue());
		}
	}
}


text:
(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);throw new Error("Cannot find module '"+o+"'")}var f=n[o]={exports:{}};t[o][0].call(f.exports,function(e){var n=t[o][1][e];return s(n?n:e)},f,f.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
// Generated by CoffeeScript 1.7.1
var DEFAULT_ACTIONS, buildCachedResourceClass, readArrayCache, readCache, writeCache;

DEFAULT_ACTIONS = {
  get: {
    method: 'GET'
  },
  query: {
    method: 'GET',
    isArray: true
  },
  save: {
    method: 'POST'
  },
  remove: {
    method: 'DELETE'
  },
  "delete": {
    method: 'DELETE'
  }
};

readArrayCache = require('./read_array_cache');

readCache = require('./read_cache');

writeCache = require('./write_cache');

module.exports = buildCachedResourceClass = function($resource, $timeout, $q, log, args) {
  var $key, Cache, CachedResource, Resource, ResourceCacheArrayEntry, ResourceCacheEntry, ResourceWriteQueue, actions, arg, boundParams, handler, isPermissibleBoundValue, method, name, param, paramDefault, paramDefaults, params, url;
  ResourceCacheEntry = require('./resource_cache_entry')(log);
  ResourceCacheArrayEntry = require('./resource_cache_array_entry')(log);
  ResourceWriteQueue = require('./resource_write_queue')(log, $q);
  Cache = require('./cache')(log);
  $key = args.shift();
  url = args.shift();
  while (args.length) {
    arg = args.pop();
    if (angular.isObject(arg[Object.keys(arg)[0]])) {
      actions = arg;
    } else {
      paramDefaults = arg;
    }
  }
  actions = angular.extend({}, DEFAULT_ACTIONS, actions);
  if (paramDefaults == null) {
    paramDefaults = {};
  }
  boundParams = {};
  for (param in paramDefaults) {
    paramDefault = paramDefaults[param];
    if (paramDefault[0] === '@') {
      boundParams[paramDefault.substr(1)] = param;
    }
  }
  Resource = $resource.call(null, url, paramDefaults, actions);
  isPermissibleBoundValue = function(value) {
    return angular.isDate(value) || angular.isNumber(value) || angular.isString(value);
  };
  CachedResource = (function() {
    CachedResource.prototype.$cache = true;

    function CachedResource(attrs) {
      angular.extend(this, attrs);
    }

    CachedResource.prototype.$params = function() {
      var attribute, params;
      params = {};
      for (attribute in boundParams) {
        param = boundParams[attribute];
        if (isPermissibleBoundValue(this[attribute])) {
          params[param] = this[attribute];
        }
      }
      return params;
    };

    CachedResource.prototype.$$addToCache = function(dirty) {
      var entry;
      if (dirty == null) {
        dirty = false;
      }
      entry = new ResourceCacheEntry($key, this.$params());
      entry.set(this, dirty);
      return this;
    };

    CachedResource.$clearAll = function(_arg) {
      var cacheArrayEntry, clearPendingWrites, exceptFor, exceptForKeys, key, params, queue, resourceParams, _i, _j, _len, _len1, _ref, _ref1;
      _ref = _arg != null ? _arg : {}, exceptFor = _ref.exceptFor, clearPendingWrites = _ref.clearPendingWrites;
      exceptForKeys = [];
      if (angular.isArray(exceptFor)) {
        exceptFor = exceptFor.map(function(entry) {
          return new CachedResource(entry).$params();
        });
      } else if (angular.isObject(exceptFor)) {
        cacheArrayEntry = new ResourceCacheArrayEntry($key, exceptFor).load();
        exceptForKeys.push(cacheArrayEntry.fullCacheKey());
        if (cacheArrayEntry.value) {
          exceptFor = (function() {
            var _i, _len, _ref1, _results;
            _ref1 = cacheArrayEntry.value;
            _results = [];
            for (_i = 0, _len = _ref1.length; _i < _len; _i++) {
              params = _ref1[_i];
              _results.push(params);
            }
            return _results;
          })();
        }
      }
      if (exceptFor == null) {
        exceptFor = [];
      }
      if (!clearPendingWrites) {
        _ref1 = CachedResource.$writes, queue = _ref1.queue, key = _ref1.key;
        exceptForKeys.push(key);
        for (_i = 0, _len = queue.length; _i < _len; _i++) {
          resourceParams = queue[_i].resourceParams;
          exceptFor.push(resourceParams);
        }
      }
      for (_j = 0, _len1 = exceptFor.length; _j < _len1; _j++) {
        params = exceptFor[_j];
        exceptForKeys.push(new ResourceCacheEntry($key, params).fullCacheKey());
      }
      return Cache.clear({
        key: $key,
        exceptFor: exceptForKeys
      });
    };

    CachedResource.$addToCache = function(attrs, dirty) {
      return new CachedResource(attrs).$$addToCache(dirty);
    };

    CachedResource.$addArrayToCache = function(attrs, instances, dirty) {
      if (dirty == null) {
        dirty = false;
      }
      instances = instances.map(function(instance) {
        return new CachedResource(instance);
      });
      return new ResourceCacheArrayEntry($key, attrs).addInstances(instances, dirty);
    };

    CachedResource.$resource = Resource;

    CachedResource.$key = $key;

    return CachedResource;

  })();
  CachedResource.$writes = new ResourceWriteQueue(CachedResource, $timeout);
  for (name in actions) {
    params = actions[name];
    method = params.method.toUpperCase();
    if (params.cache !== false) {
      handler = method === 'GET' && params.isArray ? readArrayCache($q, log, name, CachedResource) : method === 'GET' ? readCache($q, log, name, CachedResource) : method === 'POST' || method === 'PUT' || method === 'DELETE' || method === 'PATCH' ? writeCache($q, log, name, CachedResource) : void 0;
      CachedResource[name] = handler;
      if (method !== 'GET') {
        CachedResource.prototype["$" + name] = handler;
      }
    } else {
      CachedResource[name] = Resource[name];
      CachedResource.prototype["$" + name] = Resource.prototype["$" + name];
    }
  }
  return CachedResource;
};

},{"./cache":2,"./read_array_cache":7,"./read_cache":8,"./resource_cache_array_entry":9,"./resource_cache_entry":10,"./resource_write_queue":11,"./write_cache":12}],2:[function(require,module,exports){
// Generated by CoffeeScript 1.7.1
var LOCAL_STORAGE_PREFIX, buildKey, cacheKeyHasPrefix, localStorage, memoryCache;

LOCAL_STORAGE_PREFIX = 'cachedResource://';

localStorage = window.localStorage;

memoryCache = {};

buildKey = function(key) {
  return "" + LOCAL_STORAGE_PREFIX + key;
};

cacheKeyHasPrefix = function(cacheKey, prefix) {
  var index, nextChar;
  if (prefix == null) {
    return cacheKey.indexOf(LOCAL_STORAGE_PREFIX) === 0;
  }
  prefix = buildKey(prefix);
  index = cacheKey.indexOf(prefix);
  nextChar = cacheKey[prefix.length];
  return index === 0 && ((nextChar == null) || (nextChar === '?' || nextChar === '/'));
};

module.exports = function(log) {
  return {
    getItem: function(key, fallbackValue) {
      var item, out;
      key = buildKey(key);
      item = memoryCache[key];
      if (item == null) {
        item = localStorage.getItem(key);
      }
      out = item != null ? angular.fromJson(item) : fallbackValue;
      log.debug("CACHE GET: " + key, out);
      return out;
    },
    setItem: function(key, value) {
      var stringValue;
      key = buildKey(key);
      stringValue = angular.toJson(value);
      try {
        localStorage.setItem(key, stringValue);
        if (memoryCache[key] != null) {
          delete memoryCache[key];
        }
      } catch (_error) {
        memoryCache[key] = stringValue;
      }
      log.debug("CACHE PUT: " + key, angular.fromJson(angular.toJson(value)));
      return value;
    },
    clear: function(_arg) {
      var cacheKey, cacheKeys, exceptFor, exception, i, key, skipKey, _i, _j, _k, _len, _len1, _ref, _ref1, _results;
      _ref = _arg != null ? _arg : {}, key = _ref.key, exceptFor = _ref.exceptFor;
      if (exceptFor == null) {
        exceptFor = [];
      }
      cacheKeys = [];
      for (i = _i = 0, _ref1 = localStorage.length; 0 <= _ref1 ? _i < _ref1 : _i > _ref1; i = 0 <= _ref1 ? ++_i : --_i) {
        cacheKey = localStorage.key(i);
        if (!cacheKeyHasPrefix(cacheKey, key)) {
          continue;
        }
        skipKey = false;
        for (_j = 0, _len = exceptFor.length; _j < _len; _j++) {
          exception = exceptFor[_j];
          if (!(cacheKeyHasPrefix(cacheKey, exception))) {
            continue;
          }
          skipKey = true;
          break;
        }
        if (skipKey) {
          continue;
        }
        cacheKeys.push(cacheKey);
      }
      _results = [];
      for (_k = 0, _len1 = cacheKeys.length; _k < _len1; _k++) {
        cacheKey = cacheKeys[_k];
        _results.push(localStorage.removeItem(cacheKey));
      }
      return _results;
    }
  };
};

},{}],3:[function(require,module,exports){
// Generated by CoffeeScript 1.7.1
var __indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; };

module.exports = function(log) {
  var Cache, CachedResourceManager, buildCachedResourceClass;
  buildCachedResourceClass = require('./build_cached_resource_class');
  Cache = require('./cache')(log);
  return CachedResourceManager = (function() {
    function CachedResourceManager($resource, $timeout, $q) {
      this.byKey = {};
      this.build = angular.bind(this, buildCachedResourceClass, $resource, $timeout, $q, log);
    }

    CachedResourceManager.prototype.keys = function() {
      return Object.keys(this.byKey);
    };

    CachedResourceManager.prototype.add = function() {
      var CachedResource, args;
      args = Array.prototype.slice.call(arguments);
      CachedResource = this.build(args);
      this.byKey[CachedResource.$key] = CachedResource;
      CachedResource.$writes.flush();
      return CachedResource;
    };

    CachedResourceManager.prototype.flushQueues = function() {
      var CachedResource, key, _ref, _results;
      _ref = this.byKey;
      _results = [];
      for (key in _ref) {
        CachedResource = _ref[key];
        _results.push(CachedResource.$writes.flush());
      }
      return _results;
    };

    CachedResourceManager.prototype.clearAll = function(_arg) {
      var CachedResource, clearPendingWrites, exceptFor, key, _ref, _ref1, _results;
      _ref = _arg != null ? _arg : {}, exceptFor = _ref.exceptFor, clearPendingWrites = _ref.clearPendingWrites;
      if (exceptFor == null) {
        exceptFor = [];
      }
      _ref1 = this.byKey;
      _results = [];
      for (key in _ref1) {
        CachedResource = _ref1[key];
        if (__indexOf.call(exceptFor, key) < 0) {
          _results.push(CachedResource.$clearAll({
            clearPendingWrites: clearPendingWrites
          }));
        }
      }
      return _results;
    };

    CachedResourceManager.prototype.clearUndefined = function() {
      return Cache.clear({
        exceptFor: this.keys()
      });
    };

    return CachedResourceManager;

  })();
};

},{"./build_cached_resource_class":1,"./cache":2}],4:[function(require,module,exports){
// Generated by CoffeeScript 1.7.1
var $cachedResourceFactory, $cachedResourceProvider, app, debugMode, resourceManagerListener,
  __slice = [].slice;

resourceManagerListener = null;

debugMode = false;

if (typeof module !== "undefined" && module !== null) {
  module.exports = app = angular.module('ngCachedResource', ['ngResource']);
}

app.provider('$cachedResource', $cachedResourceProvider = (function() {
  function $cachedResourceProvider() {
    this.$get = $cachedResourceFactory;
  }

  $cachedResourceProvider.prototype.setDebugMode = function(newSetting) {
    if (newSetting == null) {
      newSetting = true;
    }
    return debugMode = newSetting;
  };

  return $cachedResourceProvider;

})());

$cachedResourceFactory = [
  '$resource', '$timeout', '$q', '$log', function($resource, $timeout, $q, $log) {
    var $cachedResource, CachedResourceManager, bindLogFunction, fn, log, resourceManager, _i, _len, _ref;
    bindLogFunction = function(logFunction) {
      return function() {
        var message;
        message = 1 <= arguments.length ? __slice.call(arguments, 0) : [];
        message.unshift('ngCachedResource');
        return $log[logFunction].apply($log, message);
      };
    };
    log = {
      debug: debugMode ? bindLogFunction('debug') : (function() {}),
      error: bindLogFunction('error')
    };
    CachedResourceManager = require('./cached_resource_manager')(log);
    resourceManager = new CachedResourceManager($resource, $timeout, $q);
    if (resourceManagerListener) {
      document.removeEventListener('online', resourceManagerListener);
    }
    resourceManagerListener = function(event) {
      return resourceManager.flushQueues();
    };
    document.addEventListener('online', resourceManagerListener);
    $cachedResource = function() {
      return resourceManager.add.apply(resourceManager, arguments);
    };
    _ref = ['clearAll', 'clearUndefined'];
    for (_i = 0, _len = _ref.length; _i < _len; _i++) {
      fn = _ref[_i];
      $cachedResource[fn] = angular.bind(resourceManager, resourceManager[fn]);
    }
    return $cachedResource;
  }
];

},{"./cached_resource_manager":3}],5:[function(require,module,exports){
// Generated by CoffeeScript 1.7.1
var modifyObjectInPlace;

module.exports = modifyObjectInPlace = function(oldObject, newObject, cachedObject) {
  var key, localChange, localChanges, _i, _j, _len, _len1, _ref, _ref1, _results;
  _ref = Object.keys(oldObject);
  for (_i = 0, _len = _ref.length; _i < _len; _i++) {
    key = _ref[_i];
    if (!(key[0] !== '$')) {
      continue;
    }
    localChange = cachedObject && (cachedObject[key] == null);
    if (!((newObject[key] != null) || localChange)) {
      delete oldObject[key];
    }
  }
  _ref1 = Object.keys(newObject);
  _results = [];
  for (_j = 0, _len1 = _ref1.length; _j < _len1; _j++) {
    key = _ref1[_j];
    if (key[0] !== '$') {
      if (angular.isObject(oldObject[key]) && angular.isObject(newObject[key])) {
        _results.push(modifyObjectInPlace(oldObject[key], newObject[key], cachedObject != null ? cachedObject[key] : void 0));
      } else {
        localChanges = cachedObject && !angular.equals(oldObject[key], cachedObject[key]);
        if (!(angular.equals(oldObject[key], newObject[key]) || localChanges)) {
          _results.push(oldObject[key] = newObject[key]);
        } else {
          _results.push(void 0);
        }
      }
    }
  }
  return _results;
};

},{}],6:[function(require,module,exports){
// Generated by CoffeeScript 1.7.1
var processReadArgs;

module.exports = processReadArgs = function($q, args) {
  var deferred, error, params, success;
  args = Array.prototype.slice.call(args);
  params = angular.isObject(args[0]) ? args.shift() : {};
  success = args[0], error = args[1];
  deferred = $q.defer();
  if (angular.isFunction(success)) {
    deferred.promise.then(success);
  }
  if (angular.isFunction(error)) {
    deferred.promise["catch"](error);
  }
  return {
    params: params,
    deferred: deferred
  };
};

},{}],7:[function(require,module,exports){
// Generated by CoffeeScript 1.7.1
var modifyObjectInPlace, processReadArgs, readArrayCache,
  __slice = [].slice;

processReadArgs = require('./process_read_args');

modifyObjectInPlace = require('./modify_object_in_place');

module.exports = readArrayCache = function($q, log, name, CachedResource) {
  var ResourceCacheArrayEntry, ResourceCacheEntry, first;
  ResourceCacheEntry = require('./resource_cache_entry')(log);
  ResourceCacheArrayEntry = require('./resource_cache_array_entry')(log);
  first = function(array, params) {
    var found, item, itemParams, _i, _len;
    found = null;
    for (_i = 0, _len = array.length; _i < _len; _i++) {
      item = array[_i];
      itemParams = item.$params();
      if (Object.keys(params).every(function(key) {
        return itemParams[key] === params[key];
      })) {
        found = item;
        break;
      }
    }
    return found;
  };
  return function() {
    var arrayInstance, cacheArrayEntry, cacheDeferred, cacheInstanceEntry, cacheInstanceParams, httpDeferred, params, readHttp, _i, _len, _ref, _ref1;
    _ref = processReadArgs($q, arguments), params = _ref.params, cacheDeferred = _ref.deferred;
    httpDeferred = $q.defer();
    arrayInstance = new Array();
    arrayInstance.$promise = cacheDeferred.promise;
    arrayInstance.$httpPromise = httpDeferred.promise;
    cacheArrayEntry = new ResourceCacheArrayEntry(CachedResource.$key, params).load();
    arrayInstance.$httpPromise.then(function(instances) {
      return cacheArrayEntry.addInstances(instances, false);
    });
    readHttp = function() {
      var resource;
      resource = CachedResource.$resource[name](params);
      resource.$promise.then(function(response) {
        var newArrayInstance;
        newArrayInstance = new Array();
        response.map(function(resourceInstance) {
          var existingInstance;
          resourceInstance = new CachedResource(resourceInstance);
          existingInstance = first(arrayInstance, resourceInstance.$params());
          if (existingInstance) {
            modifyObjectInPlace(existingInstance, resourceInstance);
            return newArrayInstance.push(existingInstance);
          } else {
            return newArrayInstance.push(resourceInstance);
          }
        });
        arrayInstance.splice.apply(arrayInstance, [0, arrayInstance.length].concat(__slice.call(newArrayInstance)));
        if (!cacheArrayEntry.value) {
          cacheDeferred.resolve(arrayInstance);
        }
        return httpDeferred.resolve(arrayInstance);
      });
      return resource.$promise["catch"](function(error) {
        if (!cacheArrayEntry.value) {
          cacheDeferred.reject(error);
        }
        return httpDeferred.reject(error);
      });
    };
    CachedResource.$writes.flush(readHttp);
    if (cacheArrayEntry.value) {
      _ref1 = cacheArrayEntry.value;
      for (_i = 0, _len = _ref1.length; _i < _len; _i++) {
        cacheInstanceParams = _ref1[_i];
        cacheInstanceEntry = new ResourceCacheEntry(CachedResource.$key, cacheInstanceParams).load();
        arrayInstance.push(new CachedResource(cacheInstanceEntry.value));
      }
      cacheDeferred.resolve(arrayInstance);
    }
    return arrayInstance;
  };
};

},{"./modify_object_in_place":5,"./process_read_args":6,"./resource_cache_array_entry":9,"./resource_cache_entry":10}],8:[function(require,module,exports){
// Generated by CoffeeScript 1.7.1
var modifyObjectInPlace, processReadArgs, readCache;

processReadArgs = require('./process_read_args');

modifyObjectInPlace = require('./modify_object_in_place');

module.exports = readCache = function($q, log, name, CachedResource) {
  var ResourceCacheEntry;
  ResourceCacheEntry = require('./resource_cache_entry')(log);
  return function() {
    var cacheDeferred, cacheEntry, httpDeferred, instance, params, readHttp, _ref;
    _ref = processReadArgs($q, arguments), params = _ref.params, cacheDeferred = _ref.deferred;
    httpDeferred = $q.defer();
    instance = new CachedResource({
      $promise: cacheDeferred.promise,
      $httpPromise: httpDeferred.promise
    });
    cacheEntry = new ResourceCacheEntry(CachedResource.$key, params).load();
    readHttp = function() {
      var resource;
      resource = CachedResource.$resource[name].call(CachedResource.$resource, params);
      resource.$promise.then(function(httpResponse) {
        modifyObjectInPlace(instance, httpResponse);
        if (!cacheEntry.value) {
          cacheDeferred.resolve(instance);
        }
        httpDeferred.resolve(instance);
        return cacheEntry.set(httpResponse, false);
      });
      return resource.$promise["catch"](function(error) {
        if (!cacheEntry.value) {
          cacheDeferred.reject(error);
        }
        return httpDeferred.reject(error);
      });
    };
    if (cacheEntry.dirty) {
      CachedResource.$writes.processResource(params, readHttp);
    } else {
      readHttp();
    }
    if (cacheEntry.value) {
      angular.extend(instance, cacheEntry.value);
      cacheDeferred.resolve(instance);
    }
    return instance;
  };
};

},{"./modify_object_in_place":5,"./process_read_args":6,"./resource_cache_entry":10}],9:[function(require,module,exports){
// Generated by CoffeeScript 1.7.1
var __hasProp = {}.hasOwnProperty,
  __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };

module.exports = function(log) {
  var ResourceCacheArrayEntry, ResourceCacheEntry;
  ResourceCacheEntry = require('./resource_cache_entry')(log);
  return ResourceCacheArrayEntry = (function(_super) {
    __extends(ResourceCacheArrayEntry, _super);

    function ResourceCacheArrayEntry() {
      return ResourceCacheArrayEntry.__super__.constructor.apply(this, arguments);
    }

    ResourceCacheArrayEntry.prototype.defaultValue = [];

    ResourceCacheArrayEntry.prototype.cacheKeyPrefix = function() {
      return "" + this.key + "/array";
    };

    ResourceCacheArrayEntry.prototype.addInstances = function(instances, dirty) {
      var cacheArrayReferences, cacheInstanceEntry, cacheInstanceParams, instance, _i, _len;
      cacheArrayReferences = [];
      for (_i = 0, _len = instances.length; _i < _len; _i++) {
        instance = instances[_i];
        cacheInstanceParams = instance.$params();
        if (Object.keys(cacheInstanceParams).length === 0) {
          log.error("instance " + instance + " doesn't have any boundParams. Please, make sure you specified them in your resource's initialization, f.e. `{id: \"@id\"}`, or it won't be cached.");
        } else {
          cacheArrayReferences.push(cacheInstanceParams);
          cacheInstanceEntry = new ResourceCacheEntry(this.key, cacheInstanceParams).load();
          cacheInstanceEntry.set(instance, dirty);
        }
      }
      return this.set(cacheArrayReferences, dirty);
    };

    return ResourceCacheArrayEntry;

  })(ResourceCacheEntry);
};

},{"./resource_cache_entry":10}],10:[function(require,module,exports){
// Generated by CoffeeScript 1.7.1
module.exports = function(log) {
  var Cache, ResourceCacheEntry;
  Cache = require('./cache')(log);
  return ResourceCacheEntry = (function() {
    ResourceCacheEntry.prototype.defaultValue = {};

    ResourceCacheEntry.prototype.cacheKeyPrefix = function() {
      return this.key;
    };

    ResourceCacheEntry.prototype.fullCacheKey = function() {
      return this.cacheKeyPrefix() + this.cacheKeyParams;
    };

    function ResourceCacheEntry(key, params) {
      var param, paramKeys;
      this.key = key;
      paramKeys = angular.isObject(params) ? Object.keys(params).sort() : [];
      if (paramKeys.length) {
        this.cacheKeyParams = '?' + ((function() {
          var _i, _len, _results;
          _results = [];
          for (_i = 0, _len = paramKeys.length; _i < _len; _i++) {
            param = paramKeys[_i];
            _results.push("" + param + "=" + params[param]);
          }
          return _results;
        })()).join('&');
      } else {
        this.cacheKeyParams = '';
      }
    }

    ResourceCacheEntry.prototype.load = function() {
      var _ref;
      _ref = Cache.getItem(this.fullCacheKey(), this.defaultValue), this.value = _ref.value, this.dirty = _ref.dirty;
      return this;
    };

    ResourceCacheEntry.prototype.set = function(value, dirty) {
      this.value = value;
      if (this.dirty && !dirty) {
        log.error("unexpectedly setting a clean entry (load) over a dirty entry (pending write)");
      }
      this.dirty = dirty;
      return this._update();
    };

    ResourceCacheEntry.prototype.setClean = function() {
      this.dirty = false;
      return this._update();
    };

    ResourceCacheEntry.prototype._update = function() {
      return Cache.setItem(this.fullCacheKey(), {
        value: this.value,
        dirty: this.dirty
      });
    };

    return ResourceCacheEntry;

  })();
};

},{"./cache":2}],11:[function(require,module,exports){
// Generated by CoffeeScript 1.7.1
var CACHE_RETRY_TIMEOUT;

CACHE_RETRY_TIMEOUT = 60000;

module.exports = function(log, $q) {
  var Cache, ResourceCacheEntry, ResourceWriteQueue, flushQueueDeferreds, resetDeferred, resolveDeferred;
  ResourceCacheEntry = require('./resource_cache_entry')(log);
  Cache = require('./cache')(log);
  flushQueueDeferreds = {};
  resetDeferred = function(queue) {
    var deferred;
    deferred = $q.defer();
    flushQueueDeferreds[queue.key] = deferred;
    queue.promise = deferred.promise;
    return deferred;
  };
  resolveDeferred = function(queue) {
    return flushQueueDeferreds[queue.key].resolve();
  };
  return ResourceWriteQueue = (function() {
    ResourceWriteQueue.prototype.logStatusOfRequest = function(status, action, params, data) {
      return log.debug("" + action + " for " + this.key + " " + (angular.toJson(params)) + " " + status + " (queue length: " + this.queue.length + ")", data);
    };

    function ResourceWriteQueue(CachedResource, $timeout) {
      this.CachedResource = CachedResource;
      this.$timeout = $timeout;
      this.key = "" + this.CachedResource.$key + "/write";
      this.queue = Cache.getItem(this.key, []);
      resetDeferred(this);
      if (this.queue.length === 0) {
        resolveDeferred(this);
      }
    }

    ResourceWriteQueue.prototype.enqueue = function(params, resourceData, action, deferred) {
      var resourceParams, write, _ref, _ref1;
      if (this.queue.length === 0) {
        resetDeferred(this);
      }
      resourceParams = angular.isArray(resourceData) ? resourceData.map(function(resource) {
        return resource.$params();
      }) : resourceData.$params();
      write = this.findWrite({
        params: params,
        action: action
      });
      if (write == null) {
        this.queue.push({
          params: params,
          resourceParams: resourceParams,
          action: action,
          deferred: deferred
        });
        this._update();
      } else {
        if ((_ref = write.deferred) != null) {
          _ref.promise.then(function(response) {
            return deferred.resolve(response);
          });
        }
        if ((_ref1 = write.deferred) != null) {
          _ref1.promise["catch"](function(error) {
            return deferred.reject(error);
          });
        }
      }
      return this.logStatusOfRequest('enqueued', action, params, resourceData);
    };

    ResourceWriteQueue.prototype.findWrite = function(_arg) {
      var action, params, write, _i, _len, _ref;
      action = _arg.action, params = _arg.params;
      _ref = this.queue;
      for (_i = 0, _len = _ref.length; _i < _len; _i++) {
        write = _ref[_i];
        if (action === write.action && angular.equals(params, write.params)) {
          return write;
        }
      }
    };

    ResourceWriteQueue.prototype.removeWrite = function(_arg) {
      var action, entry, newQueue, params, _i, _len, _ref;
      action = _arg.action, params = _arg.params;
      newQueue = [];
      _ref = this.queue;
      for (_i = 0, _len = _ref.length; _i < _len; _i++) {
        entry = _ref[_i];
        if (!(action === entry.action && angular.equals(params, entry.params))) {
          newQueue.push(entry);
        }
      }
      this.queue = newQueue;
      if (this.queue.length === 0 && this.timeoutPromise) {
        this.$timeout.cancel(this.timeoutPromise);
        delete this.timeoutPromise;
      }
      this._update();
      if (this.queue.length === 0) {
        return resolveDeferred(this);
      }
    };

    ResourceWriteQueue.prototype.flush = function(done) {
      var write, _i, _len, _ref, _results;
      if (angular.isFunction(done)) {
        this.promise.then(done);
      }
      this._setFlushTimeout();
      _ref = this.queue;
      _results = [];
      for (_i = 0, _len = _ref.length; _i < _len; _i++) {
        write = _ref[_i];
        _results.push(this._processWrite(write));
      }
      return _results;
    };

    ResourceWriteQueue.prototype.processResource = function(params, done) {
      var notDone, write, _i, _len, _ref, _results;
      notDone = true;
      _ref = this._writesForResource(params);
      _results = [];
      for (_i = 0, _len = _ref.length; _i < _len; _i++) {
        write = _ref[_i];
        _results.push(this._processWrite(write, (function(_this) {
          return function() {
            if (notDone && _this._writesForResource(params).length === 0) {
              notDone = false;
              return done();
            }
          };
        })(this)));
      }
      return _results;
    };

    ResourceWriteQueue.prototype._writesForResource = function(params) {
      var write, _i, _len, _ref, _results;
      _ref = this.queue;
      _results = [];
      for (_i = 0, _len = _ref.length; _i < _len; _i++) {
        write = _ref[_i];
        if (angular.equals(params, write.params)) {
          _results.push(write);
        }
      }
      return _results;
    };

    ResourceWriteQueue.prototype._processWrite = function(write, done) {
      var cacheEntries, onFailure, onSuccess, writeData;
      if (angular.isArray(write.resourceParams)) {
        cacheEntries = write.resourceParams.map((function(_this) {
          return function(resourceParams) {
            return new ResourceCacheEntry(_this.CachedResource.$key, resourceParams).load();
          };
        })(this));
        writeData = cacheEntries.map(function(cacheEntry) {
          return cacheEntry.value;
        });
      } else {
        cacheEntries = [new ResourceCacheEntry(this.CachedResource.$key, write.resourceParams).load()];
        writeData = cacheEntries[0].value;
      }
      onSuccess = (function(_this) {
        return function(value) {
          var cacheEntry, _i, _len, _ref;
          _this.removeWrite(write);
          for (_i = 0, _len = cacheEntries.length; _i < _len; _i++) {
            cacheEntry = cacheEntries[_i];
            cacheEntry.setClean();
          }
          if ((_ref = write.deferred) != null) {
            _ref.resolve(value);
          }
          _this.logStatusOfRequest('succeeded', write.action, write.resourceParams, writeData);
          if (angular.isFunction(done)) {
            return done();
          }
        };
      })(this);
      onFailure = (function(_this) {
        return function(error) {
          var _ref;
          if (error && error.status >= 400 && error.status < 500) {
            _this.removeWrite(write);
            _this.logStatusOfRequest("failed with error " + (angular.toJson(error)) + "; removed from queue", write.action, write.resourceParams, writeData);
          } else {
            _this.logStatusOfRequest("failed with error " + (angular.toJson(error)) + "; still in queue", write.action, write.resourceParams, writeData);
          }
          return (_ref = write.deferred) != null ? _ref.reject(error) : void 0;
        };
      })(this);
      this.CachedResource.$resource[write.action](write.params, writeData, onSuccess, onFailure);
      return this.logStatusOfRequest('processed', write.action, write.resourceParams, writeData);
    };

    ResourceWriteQueue.prototype._setFlushTimeout = function() {
      if (this.queue.length > 0 && !this.timeoutPromise) {
        this.timeoutPromise = this.$timeout(angular.bind(this, this.flush), CACHE_RETRY_TIMEOUT);
        return this.timeoutPromise.then((function(_this) {
          return function() {
            delete _this.timeoutPromise;
            return _this._setFlushTimeout();
          };
        })(this));
      }
    };

    ResourceWriteQueue.prototype._update = function() {
      var savableQueue;
      savableQueue = this.queue.map(function(write) {
        return {
          params: write.params,
          resourceParams: write.resourceParams,
          action: write.action
        };
      });
      return Cache.setItem(this.key, savableQueue);
    };

    return ResourceWriteQueue;

  })();
};

},{"./cache":2,"./resource_cache_entry":10}],12:[function(require,module,exports){
// Generated by CoffeeScript 1.7.1
var modifyObjectInPlace, writeCache;

modifyObjectInPlace = require('./modify_object_in_place');

module.exports = writeCache = function($q, log, action, CachedResource) {
  var ResourceCacheEntry;
  ResourceCacheEntry = require('./resource_cache_entry')(log);
  return function() {
    var args, cacheEntry, data, deferred, error, instanceMethod, isArray, param, params, queueDeferred, resource, success, value, wrapInCachedResource, _i, _len, _ref;
    instanceMethod = this instanceof CachedResource;
    args = Array.prototype.slice.call(arguments);
    params = !instanceMethod && angular.isObject(args[1]) ? args.shift() : instanceMethod && angular.isObject(args[0]) ? args.shift() : {};
    data = instanceMethod ? this : args.shift();
    success = args[0], error = args[1];
    isArray = angular.isArray(data);
    wrapInCachedResource = function(object) {
      if (object instanceof CachedResource) {
        return object;
      } else {
        return new CachedResource(object);
      }
    };
    if (isArray) {
      data = data.map(function(o) {
        return wrapInCachedResource(o);
      });
      for (_i = 0, _len = data.length; _i < _len; _i++) {
        resource = data[_i];
        cacheEntry = new ResourceCacheEntry(CachedResource.$key, resource.$params()).load();
        if (!angular.equals(cacheEntry.data, resource)) {
          cacheEntry.set(resource, true);
        }
      }
    } else {
      data = wrapInCachedResource(data);
      _ref = data.$params();
      for (param in _ref) {
        value = _ref[param];
        params[param] = value;
      }
      cacheEntry = new ResourceCacheEntry(CachedResource.$key, data.$params()).load();
      if (!angular.equals(cacheEntry.data, data)) {
        cacheEntry.set(data, true);
      }
    }
    data.$resolved = false;
    deferred = $q.defer();
    data.$promise = deferred.promise;
    if (angular.isFunction(success)) {
      deferred.promise.then(success);
    }
    if (angular.isFunction(error)) {
      deferred.promise["catch"](error);
    }
    queueDeferred = $q.defer();
    queueDeferred.promise.then(function(httpResource) {
      cacheEntry.load();
      modifyObjectInPlace(data, httpResource, cacheEntry.value);
      data.$resolved = true;
      return deferred.resolve(data);
    });
    queueDeferred.promise["catch"](deferred.reject);
    CachedResource.$writes.enqueue(params, data, action, queueDeferred);
    CachedResource.$writes.flush();
    return data;
  };
};

},{"./modify_object_in_place":5,"./resource_cache_entry":10}]},{},[4])


text:
    "Una expresión regular, a menudo llamada también regex, es una secuencia de caracteres que forma un patrón de búsqueda, principalmente utilizada para la búsqueda de patrones de cadenas de caracteres u operaciones de sustituciones."

Resumen: Las expresiones regulares son formas de representar patrones de caracteres.

[slide-sep]

## ¿Para qué sirven las RegExp?

* Contrastar si un texto contiene un patrón.
* Sustituir partes del texto utilizando un patrón.
* Extraer grupos de información de un texto.

[vertical-sep]

## Ejemplo en Open Refine

[slide-sep]

## ¿Dónde puedo usar las RegExp?

* Editores de texto:
    * Windows: Notepad++, ...
    * UNIX/Mac: Sublime Text, Mate, ...

* OpenRefine, Google spreadsheets, ...

También podremos usar las expresiones regulares
en cualquier lenguaje de programación

[vertical-sep]

## Editores de texto

![Sublime example][sublime_img]

[sublime_img]: images/sublime.jpg

[vertical-sep]

## Open Refine

![OpenRefine example][refine_img]

[refine_img]: images/refine.jpg

[vertical-sep]

## Google spreadsheets

![OpenRefine example][spreadsheet_img]

[spreadsheet_img]: images/spreadsheet.jpg


text:
var fs = require('fs');

// 3rd party
var xml2js = require('xml2js');

// load resource file
var data = fs.readFileSync(__dirname + '/../resources/FIX42.xml');

var parser = new xml2js.Parser();
parser.parseString(data, function (err, result) {
    result.fields.field.forEach(function(field) {
        var number = field['@'].number;
        var name = field['@'].name;

        module.exports[name] = {
            tag: number,
        };
    });
});


text:
"""
Views for managing Nova instance snapshots.
"""

import logging
import re

from django import http
from django import shortcuts
from django import template
from django.contrib import messages
from django.utils.translation import ugettext as _
from glance.common import exception as glance_exception
from openstackx.api import exceptions as api_exceptions

from horizon import api
from horizon import forms
from horizon.dashboards.nova.images_and_snapshots.snapshots.forms import \
                                                                CreateSnapshot

LOG = logging.getLogger(__name__)

def index(request):
    images = []

    try:
        images = api.snapshot_list_detailed(request)
    except glance_exception.ClientConnectionError, e:
        msg = _('Error connecting to glance: %s') % str(e)
        LOG.exception(msg)
        messages.error(request, msg)
    except glance_exception.GlanceException, e:
        msg = _('Error retrieving image list: %s') % str(e)
        LOG.exception(msg)
        messages.error(request, msg)

    return shortcuts.render(request,
                            'nova/images_and_snapshots/snapshots/index.html',
                            {'images': images})

def create(request, instance_id):
    tenant_id = request.user.tenant_id
    form, handled = CreateSnapshot.maybe_handle(request,
                        initial={'tenant_id': tenant_id,
                                 'instance_id': instance_id})
    if handled:
        return handled

    try:
        instance = api.server_get(request, instance_id)
    except api_exceptions.ApiException, e:
        msg = _("Unable to retrieve instance: %s") % e
        LOG.exception(msg)
        messages.error(request, msg)
        return shortcuts.redirect(
                        'horizon:nova:instances_and_volumes:index')

    valid_states = ['ACTIVE']
    if instance.status not in valid_states:
        messages.error(request, _("To snapshot, instance state must be\
                                  one of the following: %s") %
                                  ', '.join(valid_states))
        return shortcuts.redirect(
                        'horizon:nova:instances_and_volumes:index')

    return shortcuts.render(request,
                            'nova/images_and_snapshots/snapshots/create.html',
                            {'instance': instance,
                             'create_form': form})


text:
You can get manager your issues by this app.

Get start:

1. Install `mongodb` before useing this app.
2. Clone this repo to local.
3. Copy the env.json to the root directory.
4. cd `./client` and run `npm run dev`
5. cd `./server` and run `npm start`
6. Open browser with https://localhost:3333

The structure of env.json:

```{
	"DB_HOST": "mongodb://127.0.0.1/issue_processing",
	"API_HOST": "api.github.com",
	"HOST": "github.com",
	"API_PREFIX": "/api/v3",
	"APP_HOST": "localhost",
	"APP_PORT": "3333",
	"SERVER_PORT": "3000",
	"PER_PAGE": 100,
	"ISSUES_SORT": "created",
	"ISSUES_DIRECTION": "desc",
	"CLIENT_ID": "You client id",
	"CLIENT_SECRET": "your client secret",
	"PRIVATE_DOMIN": false
}
```


text:
package org.elasticsearch.script;

import java.util.Map;

/**
 * A script used in bucket aggregations that returns a {@code double} value.
 */
public abstract class BucketAggregationScript {

    public static final String[] PARAMETERS = {};

    public static final ScriptContext<Factory> CONTEXT = new ScriptContext<>("bucket_aggregation", Factory.class);

    /**
     * The generic runtime parameters for the script.
     */
    private final Map<String, Object> params;

    public BucketAggregationScript(Map<String, Object> params) {
        this.params = params;
    }

    /**
     * Return the parameters for this script.
     */
    public Map<String, Object> getParams() {
        return params;
    }

    public abstract Number execute();

    public interface Factory {
        BucketAggregationScript newInstance(Map<String, Object> params);
    }
}


text:
require "shellwords"

require "vagrant/util/retryable"

module VagrantPlugins
  module GuestLinux
    module Cap
      class MountVirtualBoxSharedFolder
        extend Vagrant::Util::Retryable

        def self.mount_virtualbox_shared_folder(machine, name, guestpath, options)
          guest_path = Shellwords.escape(guestpath)

          mount_commands = ["set -e"]

          if options[:owner].is_a? Integer
            mount_uid = options[:owner]
          else
            mount_uid = "`id -u #{options[:owner]}`"
          end

          if options[:group].is_a? Integer
            mount_gid = options[:group]
            mount_gid_old = options[:group]
          else
            mount_gid = "`getent group #{options[:group]} | cut -d: -f3`"
            mount_gid_old = "`id -g #{options[:group]}`"
          end

          # First mount command uses getent to get the group
          mount_options = "-o uid=#{mount_uid},gid=#{mount_gid}"
          mount_options += ",#{options[:mount_options].join(",")}" if options[:mount_options]
          mount_commands << "mount -t vboxsf #{mount_options} #{name} #{guest_path}"

          # Second mount command uses the old style `id -g`
          mount_options = "-o uid=#{mount_uid},gid=#{mount_gid_old}"
          mount_options += ",#{options[:mount_options].join(",")}" if options[:mount_options]
          mount_commands << "mount -t vboxsf #{mount_options} #{name} #{guest_path}"

          # Create the guest path if it doesn't exist
          machine.communicate.sudo("mkdir -p #{guest_path}")

          # Attempt to mount the folder. We retry here a few times because
          # it can fail early on.
          command = mount_commands.join("\n")
          stderr = ""
          retryable(on: Vagrant::Errors::VirtualBoxMountFailed, tries: 3, sleep: 5) do
            machine.communicate.sudo(command,
              error_class: Vagrant::Errors::VirtualBoxMountFailed,
              error_key: :virtualbox_mount_failed,
              command: command,
              output: stderr,
            ) { |type, data| stderr = data if type == :stderr }
          end

          # Chown the directory to the proper user. We skip this if the
          # mount options contained a readonly flag, because it won't work.
          if !options[:mount_options] || !options[:mount_options].include?("ro")
            chown_commands = []
            chown_commands << "chown #{mount_uid}:#{mount_gid} #{guest_path}"
            chown_commands << "chown #{mount_uid}:#{mount_gid_old} #{guest_path}"

            exit_status = machine.communicate.sudo(chown_commands[0], error_check: false)
            machine.communicate.sudo(chown_commands[1]) if exit_status != 0
          end

          # Emit an upstart event if we can
          machine.communicate.sudo <<-EOH.gsub(/^ {12}/, "")
            if command -v /sbin/init && /sbin/init --version | grep upstart; then
              /sbin/initctl emit --no-wait vagrant-mounted MOUNTPOINT=#{guest_path}
            fi
          EOH
        end

        def self.unmount_virtualbox_shared_folder(machine, guestpath, options)
          guest_path = Shellwords.escape(guestpath)

          result = machine.communicate.sudo("umount #{guest_path}", error_check: false)
          if result == 0
            machine.communicate.sudo("rmdir #{guest_path}", error_check: false)
          end
        end
      end
    end
  end
end


text:
"""Classes and functions for generating minibatches of examples for
training.
"""
import numpy as np;

__all__ = ['Dataset'];

_METHODS = set(['sequential',
                'random_slices',
                ]);

class Dataset(object):
    """Iterator over minibatches of examples.

    Parameters
    ----------
    feats : ndarray, shape (n_examples, ...)
        Features.

    targets : ndarray, shape (n_examples,)
        Targets.

    n_classes : int, optional
        Number of classes in the classifications problem, which is used
        to code the label ``targets[i]`` with a 1-of-k code. If None,
        ``targets`` is treated as numeric.
        (Default: None)

    mbsz : int, optional
        Number of examples per minibatch.
        (Default: 128)

    method : str, optional
        Method used for iterating over dataset. If ``method=sequential``
        contiguous non-overlapping minibatches are generated
        sequentially. If ``method=random_slices``, contiguous slices
        with random start indices are generated.
        (Default: 'random_slices')

    shuffle : bool, optional
        If True, examples are shuffled in place before the first
        iteration.
        (Default: True)

    seed : int, optional
        Seed for random number generator. If None, then ``seed`` is
        generated by reading /dev/urandom (or Windows equivalent) if
        available or from clock otherwise.
        (Default: None)

    Attributes
    ----------
    n_examples : int
        Number of examples.

    rng : np.random.RandomState
        Random number generator.

    mb_gen: generator
        Actual generator that yields the minibatches.
    """
    def __init__(self, feats, targets, n_classes=None, mbsz=128,
                 method='random_slices', shuffle=True, seed=None):
        self.__dict__.update(locals());
        del self.self;

        # Convert features/targets to desired float type.
        self.feats = feats;
        if not n_classes is None:
            # If target is a 1-D array of integer labels AND we know the
            # number of classes, convert to 1-of-k coding.
            targets = np.column_stack([targets==ii
                                       for ii in xrange(n_classes)]);
        if not targets is feats:
            targets = targets.astype(self.feats.dtype, copy=False);
        self.targets = targets;
        self.n_examples = self.feats.shape[0];

        # Initialize RNG and perform initial shuffle of examples.
        self.rng = np.random.RandomState(seed);
        if shuffle:
            self.shuffle_data();

        # Initialize actual minibatch generator.
        assert(method in _METHODS);
        if method == 'sequential':
            def gen():
                slices = [];
                for ii in xrange(0, self.n_examples, self.mbsz):
                    slices.append(slice(ii, ii + self.mbsz));
                while True:
                    for slice_ in slices:
                        yield feats[slice_], targets[slice_];
        elif method == 'random_slices':
            def gen():
                max_bi = self.n_examples - self.mbsz;
                while True:
                    bi = self.rng.randint(max_bi);
                    ei = bi + mbsz;
                    yield self.feats[bi:ei, ], self.targets[bi:ei, ];
        self.mb_gen = gen();

    def shuffle_data(self):
        """
        """
        orig_state = self.rng.get_state();
        self.rng.shuffle(self.feats);
        self.rng.set_state(orig_state);
        self.rng.shuffle(self.targets);

    def next(self):
        """
        """
        return self.mb_gen.next();


text:
@implementation TestSuite
- (void)setUp
{
	HTTPRequest = [[LFHTTPRequest alloc] init];
	HTTPRequest.delegate = self;
	HTTPRequest.shouldWaitUntilDone = YES;
}

- (void)tearDown
{
	[HTTPRequest release];
	HTTPRequest = nil;
}

- (void)testFetchData
{
	[HTTPRequest performMethod:LFHTTPRequestGETMethod onURL:[NSURL URLWithString:@"http://google.com"] withData:nil];
	NSLog(@"received data: %s", [[HTTPRequest receivedData] bytes]);
}

- (void)httpRequestDidComplete:(LFHTTPRequest *)request
{
	NSLog(@"%s %@", __PRETTY_FUNCTION__, [request receivedData]);
}

- (void)httpRequest:(LFHTTPRequest *)request didFailWithError:(NSString *)error
{
	NSLog(@"%@ %@", __PRETTY_FUNCTION__, error);
}

@end