text:
__author__ = 'ehiller@css.edu'
__author__ = 'ram8647@gmail.com'

import datetime
import logging
import random
import traceback

from models import transforms
from models.models import Student
from models.models import EventEntity
from models import utils as models_utils
from models import jobs
from models import event_transforms

from models.models import QuestionDAO
from models.models import QuestionGroupDAO
from models.models import MemcacheManager

from models.progress import UnitLessonCompletionTracker

GLOBAL_DEBUG = False

class ActivityScoreParser(jobs.MapReduceJob):
    """
        Class to parse the data returned from query of Event activities.

        An tag-assessment Event is recorded every time a student attempts
        a GCB question or Quizly exercise.  The only way to determine
        student performance on questions and exercises is to
        query the Events database, extract tag-assessment events and
        process them.
    """

    CUTOFF_DATE = datetime.datetime(2016,8,1)

    def __init__(self):
        """holds activity score info unit -> lesson -> question"""
        self.activity_scores = { }
        self.params = {}
        self.num_attempts_dict = { }

        # This is a table of all the Quizly exercises currently in the course.  It is used to provide a
        #  description in the Student Dashboard and also to validate that an instance_id is still
        #  currently valid.
        self.quizly_desc = {               # instance_id:description
            'LXgF4NO50hNM':{'desc':'Quizly, Pause the Player','name':'quiz_pause_the_player'},       # Unit 2
            'BtQ8hSoGkeml':{'desc':'Quizly, Stop the Player','name':'quiz_button_click_stop_player'},
            'Dstsv7VuDQb5':{'desc':'Quizly, Stop Player if playing','name':'quiz_stop_player_if_playing'},
            'twxBgieSEwqs':{'desc':'Quizly, If/else stop/start Player','name':'quiz_if_else_stop_start_player'},
            'a3uBZXYSOJee':{'desc':'Quizly, Set background color','name':'quiz_background_color'},   # Unit 3
            'pnhvzarYPPW1':{'desc':'Quizly, Set text color','name':'quiz_text_color'},
            'G3qzTftPYKTe':{'desc':'Quizly, Increment a variable','name':'quiz_incrementing'},
            '4kITN7u5hdsO':{'desc':'Quizly, Initialize global variable','name':'quiz_initialize_variable'},
            'pCZugPUxlHeb':{'desc':'Quizly, Initializing','name':'quiz_incrementing'},
            '8T30OkUf5r1r':{'desc':'Quizly, Simple if/else','name':'quiz_simple_if_else'},
            'KQctST8skmaC':{'desc':'Quizly, Procedure to double a variable','name':'quiz_proc_double'},
            'v2m4Ks25S1MX':{'desc':'Quizly, Procedure to add globals','name':'quiz_add_globals'},
            'rCgLbJRceEbn':{'desc':'Quizly, Procedure to reset the score','name':'quiz_reset_score'},     # Unit 4
            '7uowepixSjT4':{'desc':'Quizly, Procedure to calculate the hit rate','name':'quiz_calculate_hit_rate'},
            'w18q4UWKxvlM':{'desc':'Quizly, Fix a bug in updateScore procedure','name':'quiz_procedure_bug'},
            'rvjUJMaLZ56s':{'desc':'Quizly, If/else greater than','name':'quiz_if_x_greater_than_y'},
            'scgF2VSCjUv8':{'desc':'Quizly, Simple if/else','name':'quiz_simple_if_else'},    # Unit 5
            'JatcV7u6GOer':{'desc':'Quizly, If x greater than y','name':'quiz_if_x_greater_than_y'},
            #  No Quizly exercises beyond Unit 5 -->   we should create more!
        }

    @staticmethod
    def get_description():
        return 'activity answers parser'

    @staticmethod
    def entity_class():
        return EventEntity

    def get_num_attempts_dict():
        return _num_attempts_dict

    @classmethod
    def _get_questions_by_question_id(cls, questions_by_usage_id):
        ''' Retrieves every question in the course returning
            them in a dict:  { id:questionDAO, ... }

            @param questions_by_usage_id.values() is a dict:
             {unit, lesson, sequence, weight, quid}
        '''
        ret = {}
        ret['single'] = {}
        ret['grouped'] = {}
        for question in questions_by_usage_id.values():
            question_single = QuestionDAO.load(question['id'])
            if question_single:
                ret['single'][question['id']] = question_single
            else:
                question_group = QuestionGroupDAO.load(question['id'])
                if question_group:
                    ret['grouped'][question['id']] = {}
                    for item in question_group.items:
                        ret['grouped'][question['id']][item['question']] = QuestionDAO.load(item['question'])
        return ret

    def build_additional_mapper_params(self, app_context):
        questions_by_usage_id = event_transforms.get_questions_by_usage_id(app_context)
        return {
            'questions_by_usage_id':
                questions_by_usage_id,
            'valid_question_ids': (
                event_transforms.get_valid_question_ids()),
            'group_to_questions': (
                event_transforms.get_group_to_questions()),
            'assessment_weights':
                event_transforms.get_assessment_weights(app_context),
            'unscored_lesson_ids':
                event_transforms.get_unscored_lesson_ids(app_context),
            'questions_by_question_id':
                ActivityScoreParser._get_questions_by_question_id(questions_by_usage_id)
            }

    def parse_quizly_scores(self, data, instance_id, timestamp, student, student_answers):
         """
             Processes Quizly exercises extracted from the Events query using the
             instance_id for the quid.

             Because Quizly exercises are not officially questions -- something that
             needs to be fixed -- they don't have a quid and need to be processed in
             an ad-hoc way. There is no question_info dict that can be used to get
             information about Quizly exercises.

             Also Quizly exercises don't have a 'sequence' number within the lesson.
             To get around that we assign random numbers starting at 10. One problem
             with this approach is that it doesn't preserve the sequence of Quizly
             exercises within the lesson.
         """

         # Check that the question is still a valid question (things move around)
         if not instance_id in self.quizly_desc:
             return

         if GLOBAL_DEBUG:
             logging.debug('***RAM*** A question with instance_id = ' + str(instance_id) +
              ' and no quid and location = ' + str(data['location']))
         url = data['location']
         quizly_unit_id =  int(url[url.find('unit=') + len('unit=') : url.find('&lesson=')])
         quizly_lesson_id = int(url[ url.find('&lesson=') + len('&lesson=') : ])
         quizly_score = data['score']

         if 'answer' in data:           # Takes care of legacy events that are missing answer?
             quizly_answer = data['answer']
         else:
             quizly_answer = False

         quizly_type = 'Quizly'      # reported in data as SaQuestion
         quizly_sequence = random.randint(10,30)                  #### Make up a random sequence #

         # Create a dict for this Quizly exercise
         question_answer_dict = {}
         question_answer_dict['unit_id'] = quizly_unit_id
         question_answer_dict['lesson_id'] = quizly_lesson_id
         question_answer_dict['sequence'] = quizly_sequence       # Not given
         question_answer_dict['question_id'] = instance_id        # Use instance_id as quid
         if instance_id in self.quizly_desc:
             question_answer_dict['description'] = self.quizly_desc[instance_id]
         else:
             question_answer_dict['description'] = 'Quizly ' + instance_id
         question_answer_dict['question_type'] = quizly_type
         question_answer_dict['timestamp'] = timestamp
         question_answer_dict['answers'] = [quizly_answer]   # T or F
         question_answer_dict['score'] = quizly_score
         question_answer_dict['weighted_score'] = quizly_score
         question_answer_dict['tallied'] = False
         question_answer_dict['choices'] = [{'text':'T','score':1},{'text':'F','score': 0}]   # Quizly's are T/F

         # Use the instance_id to count the number of attempts for each Quizly exercise by a given student
         if not student.email in self.num_attempts_dict:
             self.num_attempts_dict[student.email] = {}
         if not instance_id in self.num_attempts_dict[student.email]:
             self.num_attempts_dict[student.email][instance_id] = 1
         else:
             self.num_attempts_dict[student.email][instance_id] += 1

         # Either add the dict to the lesson_answers or update an existing one
         unit_answers = student_answers.get(quizly_unit_id, {})
         lesson_answers = unit_answers.get(quizly_lesson_id, {})

         found = False
         for seq in lesson_answers:
             if lesson_answers[seq]['question_id'] == instance_id:      # Quizly already there
                 found = True
                 if GLOBAL_DEBUG:
                     logging.debug('***RAM*** Quizly found answer for seq = ' + str(seq))
                 if lesson_answers[seq]['timestamp'] < timestamp:      # Already there check time
                     question_answer_dict['sequence'] = seq
                     lesson_answers[seq] = question_answer_dict        # Replace it
         if not found:
             lesson_answers[quizly_sequence] = question_answer_dict    # Add Quizly
             if GLOBAL_DEBUG:
                 logging.debug('***RAM*** Q ' + str(quizly_unit_id) + ' ' + str(quizly_lesson_id) + ' answers after ' + str(lesson_answers))

         #  Add the Quizly exercise into the student's activity_scores
         unit_answers[quizly_lesson_id] = lesson_answers
         student_answers[quizly_unit_id] = unit_answers
         self.activity_scores[student.email] = student_answers

    def parse_question_scores(self, instance_id, questions, student_answers, answers, student, timestamp):
        """
           Processes question scores within a given lesson.

           Questions within each lesson contain a quid (question_id) and a sequence
           number.
        """
        question_info = questions[instance_id]
        unit_answers = student_answers.get(question_info['unit'], {})
        lesson_answers = unit_answers.get(question_info['lesson'], {})

        question_desc = None   # Get's filled in later

        # answers is the unpacked answers from the Event query
        for answer in answers:
            if GLOBAL_DEBUG:
                logging.debug('***RAM*** answer.question.id = ' + str(answer.question_id) + ' type= ' + str(answer.question_type) + ' s= ' + student.email)

        # Count the number of attempts for each answer by the student
            if not student.email in self.num_attempts_dict:
                self.num_attempts_dict[student.email] = {}

            if not answer.question_id in self.num_attempts_dict[student.email]:
                self.num_attempts_dict[student.email][answer.question_id] = 1
            else:
                self.num_attempts_dict[student.email][answer.question_id] += 1

            # Create a dict for this answer
            question_answer_dict = {}
            question_answer_dict['unit_id'] = answer.unit_id
            question_answer_dict['lesson_id'] = answer.lesson_id
            question_answer_dict['sequence'] = answer.sequence
            question_answer_dict['question_id'] = answer.question_id
            question_answer_dict['question_desc'] = question_desc
            question_answer_dict['question_type'] = answer.question_type
            question_answer_dict['timestamp'] = answer.timestamp
            question_answer_dict['answers'] = answer.answers
            question_answer_dict['score'] = answer.score
            question_answer_dict['weighted_score'] = answer.weighted_score
            question_answer_dict['tallied'] = answer.tallied

            if GLOBAL_DEBUG:
                logging.debug('***RAM*** Q ' + str(answer.unit_id) + ' ' + str(answer.lesson_id) + ' unit answer before ' + str(unit_answers))
                logging.debug('***RAM*** McQ ' + str(answer.unit_id) + ' ' + str(answer.lesson_id) + ' answers before ' + str(lesson_answers))

            # If the timestamp on this event is after the timestamp on a previous score do an update
            if answer.sequence in lesson_answers and lesson_answers[answer.sequence]['timestamp'] < timestamp:
                if GLOBAL_DEBUG:
                    logging.debug('***RAM*** lesson answers timestamp ' + str(lesson_answers[answer.sequence]) + ' < ' + str(timestamp))
                lesson_answers[answer.sequence] = question_answer_dict
            elif answer.sequence not in lesson_answers:
                lesson_answers[answer.sequence] = question_answer_dict
            if GLOBAL_DEBUG:
                logging.debug('***RAM*** McQ ' + str(answer.unit_id) + ' ' + str(answer.lesson_id) + ' answers after ' + str(lesson_answers))

        #  Add scores for this question into the student's activity_scores
        unit_answers[question_info['lesson']] = lesson_answers
        student_answers[question_info['unit']] = unit_answers
        self.activity_scores[student.email] = student_answers

    def parse_activity_scores(self, activity_attempt):
        '''
           Processes activity scores recieved from the mapper.

           This is called in the mapper callback function.  Each time a student attempts
           a GCB question or a Quizly exercise, a tag-assessment Event is created.
           This processes such events to extract the number of attempts the student
           made and the answers.

           Events are time-stamped and recorded by user_id. They include the instance_id
           of the Component that triggered the Event.  Both GCB questions and Quizly
           exercises have an instance_id.

           However, Quizly exercises don't have question_id and need special processing.

           Use the Dashboard to see what the data looks like for Events:
           https://console.cloud.google.com/datastore/entities/query?
               project=ram8647&ns=ns_mobileCSP&kind=EventEntity
        '''

        if activity_attempt.source == 'tag-assessment':
            data = transforms.loads(activity_attempt.data)
            instance_id = data['instanceid']
            if GLOBAL_DEBUG:
                logging.debug('***********RAM************** data[instanceid] = ' + instance_id)
            timestamp = int(
                (activity_attempt.recorded_on - datetime.datetime(1970, 1, 1)).total_seconds())

            # Get information about the course's questions (doesn't include Quizly exercises yet)
            questions = self.params['questions_by_usage_id']
            valid_question_ids = self.params['valid_question_ids']
            assessment_weights = self.params['assessment_weights']
            group_to_questions = self.params['group_to_questions']

            student = Student.get_by_user_id(activity_attempt.user_id)

            #  Get this student's answers so far
            student_answers = self.activity_scores.get(student.email, {})
            if GLOBAL_DEBUG:
                logging.debug('***RAM*** student answers = ' + str(student_answers))

            answers = event_transforms.unpack_check_answers(            # No Quizly answers in here
                data, questions, valid_question_ids, assessment_weights,
                group_to_questions, timestamp)

            # Add the score to right lesson
            # NOTE: This was throwing an exception on Quizly exercises.  Shouldn't happen now
            try:
                #  If the event is tag-assessment and has no quid, it's a Quizly exercise
                if not 'quid' in data:
                    self.parse_quizly_scores(data, instance_id, timestamp, student, student_answers)
                else:
                    self.parse_question_scores(instance_id, questions, student_answers, answers, student, timestamp)
            except Exception as e:
                logging.error('***********RAM************** bad instance_id: %s %s\n%s', str(instance_id), e, traceback.format_exc())
        if GLOBAL_DEBUG:
            logging.debug('***RAM*** activity_scores ' + str(self.activity_scores))
        return self.activity_scores

    def build_missing_score(self, question, question_info, student_id, unit_id, lesson_id, sequence=-1):
        ''' Builds a partial question_answer_dict

            This is called for each student immediately after launching the mapper query.
        '''

        if sequence == -1:
            sequence = question['sequence']

        question_answer = None

        # If (unit,lesson) already in this student's activity_scores then
        #  question_answer is the next question_answer that matches the sequence.
        if unit_id in self.activity_scores[student_id] and lesson_id in \
                self.activity_scores[student_id][unit_id]:
            question_answer = next((x for x in self.activity_scores[student_id][unit_id][lesson_id].values()
                                    if x['sequence'] == sequence), None)

        question_desc = None
        if question_info:
            question_desc = question_info.dict['description']

        possible_score = 0
        choices = None
        choices_scores_only = []
        if question_info:
            if 'choices' in question_info.dict:
                choices = question_info.dict['choices']

                if GLOBAL_DEBUG:
                    logging.debug('***RAM*** choices = ' + str(choices))

                # Calculate total possible points for questions by iterating
                # through the answer choices and summing their individual values.
                # For multiple choice questions, one choice will be 1.0 (correct)
                # and the others 0.0.  For multiple answer questions, each correct
                # is worth 1/n of the value, where n is the number of correct choices.
                # In any case, the total should typically sum to 1.0.
                # Q: Is possible score always 1?  If so why do we need this?
                i = 0
                for choice in choices:
                    if float(choice['score']) > 0:
                        possible_score += float(choice['score'])

                    # Calculating an abbreviated choices array that is passed back.
                    # We don't need the questions and answers text.
                    choices_scores_only.append( {'score': choice['score'], 'text': chr(ord('A') + i) } )
                    i = i + 1
                if GLOBAL_DEBUG:
                    logging.debug('***RAM*** scores only = ' + str(choices_scores_only))

            elif 'graders' in question_info.dict:
                choices = question_info.dict['graders']
                for grader in choices:
                    possible_score += float(grader['score'])
            if 'weight' in question and float(question['weight']) is not 0.0:
                possible_score = possible_score * float(question['weight'])
        else:
            possible_score = 1

        #  If there is no question_answer yet in activity_scores for this student
        #   construct a partial question_answer_dict with default values.  Otherwise
        #   fill in the existing dict with values from the student's question_answer.
        if not question_answer:
            if GLOBAL_DEBUG:
                logging.debug('***RAM*** Initializing dict for ' +
                     str(unit_id) + ' ' + str(lesson_id) + ' ' + str(sequence))
            question_answer_dict = {}
            question_answer_dict['unit_id'] = unit_id
            question_answer_dict['lesson_id'] = lesson_id
            question_answer_dict['sequence'] = sequence
            question_answer_dict['question_id'] = question['id']
            question_answer_dict['description'] = question_desc
            question_answer_dict['question_type'] = 'NotCompleted'
            question_answer_dict['timestamp'] = 0
            question_answer_dict['answers'] = ''
            question_answer_dict['score'] = 0
            question_answer_dict['weighted_score'] = 0
            question_answer_dict['tallied'] = False
            question_answer_dict['possible_points'] = possible_score
            question_answer_dict['choices'] = choices_scores_only
#            question_answer_dict['choices'] = choices

            unit = self.activity_scores[student_id].get(unit_id, {})
            lesson = unit.get(lesson_id, {})
            lesson[sequence] = question_answer_dict
        else:
            if GLOBAL_DEBUG:
                logging.debug('***RAM*** Updating dict for ' +
                    str(question_answer['unit_id']) + ' ' + str(question_answer['lesson_id']) + ' ' + str(question_answer['sequence'])
                    + ' score=' + str(question_answer['score']))
            question_answer_dict = {}
            question_answer_dict['unit_id'] = question_answer['unit_id']
            question_answer_dict['lesson_id'] = question_answer['lesson_id']
            question_answer_dict['sequence'] = question_answer['sequence']
            question_answer_dict['question_id'] = question_answer['question_id']
            question_answer_dict['description'] = question_desc
            question_answer_dict['question_type'] = question_answer['question_type']
            question_answer_dict['timestamp'] = question_answer['timestamp']
            question_answer_dict['answers'] = question_answer['answers']
            question_answer_dict['score'] = question_answer['score']
            question_answer_dict['weighted_score'] = question_answer['weighted_score']
            question_answer_dict['tallied'] = question_answer['tallied']
            question_answer_dict['possible_points'] = possible_score
            question_answer_dict['choices'] = choices_scores_only
#            question_answer_dict['choices'] = choices

            self.activity_scores[student_id][unit_id][lesson_id][sequence] = question_answer_dict

    #validate total points for lessons, need both question collections for score and weight
    def build_missing_scores(self):
        ''' This is called from get_activity_scores right after launching the query mapper.

            For each student in activity_scores, it sets up a data dict with partial
            score data that is filled in when the scores are retrieved.
        '''
        questions = self.params['questions_by_usage_id']
        questions_info = self.params['questions_by_question_id']
        for student_id in self.activity_scores:
            for question in questions.values():
                unit_id = question['unit']
                lesson_id = question['lesson']

                question_info = questions_info['single'].get(question['id'], None) #next((x for x in questions_info if x
                #  and
                # x.id == question['id']), None)
                if not question_info:
                    question_info_group = questions_info['grouped'][question['id']]
                    sequence = question['sequence']
                    for question_info in question_info_group.values():
                        self.build_missing_score(question, question_info, student_id, unit_id, lesson_id, sequence)
                        sequence += 1
                else:
                    self.build_missing_score(question, question_info, student_id, unit_id, lesson_id)

    @classmethod
    def get_student_completion_data(cls, course):
        """Retrieves student completion data for the course."""

        if GLOBAL_DEBUG:
            logging.debug('***RAM*** get_student_completion_data ' + str(course))
        completion_tracker = UnitLessonCompletionTracker(course)
        questions_dict = completion_tracker.get_id_to_questions_dict()
#         for q in questions_dict:
#             logging.debug('***RAM*** key: ' + q)
#             logging.debug('***RAM*** dict ' + str(questions_dict[q]))

    @classmethod
    def get_activity_scores(cls, student_user_ids, course, force_refresh = True):
        """Retrieve activity data for student using EventEntity.

           For each student, launch a Query of EventEntities to retrieve student
           scores.  The Query is launched as a map-reduce background process that
           will return up to 500 results, reporting back every second.  It reports
           back by calling the map_fn callback, which in turn calls parse_activity
           scores.

           As soon as the Query is launched (in the background) the foreground
           process calls build_missing_scores() to construct a student_answer.dict
           that will be updated as score data for that student is received.

           Events properties include a userid (a number) and a source (e.g.,
           tag-assessement), a  recorded-on date (timestamp) and data (a dictionary).
           Here's a typeical data dict:

           {"loc": {"city": "mililani", "language": "en-US,en;q=0.8", "locale": "en_US",
           "country": "US", "region": "hi", "long": -158.01528099999999, "lat": 21.451331,
           "page_locale": "en_US"}, "instanceid": "yOkVTqWogdaF", "quid": "5733935958982656",
           "score": 1, "location": "https://mobilecsp-201608.appspot.com/mobilecsp/unit?unit=1&lesson=45",
           "answer": [0, 1, 2, 4], "type": "McQuestion", "user_agent":
            "Mozilla/5.0 ..."}

           Note that it includes the unit_id and lesson_id as part of the Url
        """

        # Instantiate parser object
        cached_date = datetime.datetime.now()
        activityParser = ActivityScoreParser()

        if force_refresh:
            activityParser.params = activityParser.build_additional_mapper_params(course.app_context)

            #  Launch a background Query for each student's activity data.  This is expensive.
            for user_id in student_user_ids:
#                if GLOBAL_DEBUG:
#                     logging.debug('***RAM*** launching a query for student ' + str(user_id))
                mapper = models_utils.QueryMapper(
                    EventEntity.all().filter('user_id in', [user_id])       \
                                     .filter('recorded_on  >= ', cls.CUTOFF_DATE), \
                                        batch_size=1000, report_every=1000)

                # Callback function -- e.g., 45-50 callbacks per query
                def map_fn(activity_attempt):
#                    if GLOBAL_DEBUG:
#                     logging.debug('***RAM*** map_fn ' + str(activity_attempt))
                    activityParser.parse_activity_scores(activity_attempt)

                mapper.run(map_fn)

            #  In the foreground create the student_answer_dict, which is stored at:
            #   activity_scores[student][unit][lesson][sequence]  where sequence is
            #   the question's sequential position within the lesson.
            #  So each question in the lesson will have a question_answer_dict.
            activityParser.build_missing_scores()

            #Lets cache results for each student
            for user_id in student_user_ids:
                cached_student_data = {}
                cached_student_data['date'] = cached_date

                student = Student.get_by_user_id(user_id)

                cached_student_data['scores'] = activityParser.activity_scores.get(student.email, {})
                cached_student_data['attempts'] = activityParser.num_attempts_dict.get(student.email, {})
                MemcacheManager.set(cls._memcache_key_for_student(student.email),cached_student_data)
        else:
            uncached_students = []
            for student_id in student_user_ids:
                if student_id != '':
                    student = Student.get_by_user_id(student_id)
                    temp_email = student.email
                    temp_mem = cls._memcache_key_for_student(temp_email)
                    scores_for_student = MemcacheManager.get(temp_mem)
                    if scores_for_student:
                        cached_date = scores_for_student['date']
                        activityParser.activity_scores[student_id] = scores_for_student['scores']
                        activityParser.num_attempts_dict[student_id] = scores_for_student['scores']
                    else:
                        uncached_students.append(student_id)
            if len(uncached_students) > 0:
                if cached_date == None or datetime.datetime.now() < cached_date:
                    cached_date = datetime.datetime.now()

                activityParser.params = activityParser.build_additional_mapper_params(course.app_context)

                for user_id in uncached_students:
                    mapper = models_utils.QueryMapper(
                        EventEntity.all().filter('user_id in', [user_id])       \
                                     .filter('recorded_on  >= ', cls.CUTOFF_DATE), \
                                        batch_size=1000, report_every=1000)

                    def map_fn(activity_attempt):
                        activityParser.parse_activity_scores(activity_attempt)

                    mapper.run(map_fn)

                activityParser.build_missing_scores()

                #Lets cache results for each student
                for user_id in uncached_students:
                    cached_student_data = {}
                    cached_student_data['date'] = cached_date

                    student = Student.get_by_user_id(user_id)

                    cached_student_data['scores'] = activityParser.activity_scores.get(student.email, {})
                    MemcacheManager.set(cls._memcache_key_for_student(student.email),cached_student_data)

        score_data = {}
        score_data['date'] = cached_date
        score_data['scores'] = activityParser.activity_scores
        score_data['attempts'] = activityParser.num_attempts_dict
        if GLOBAL_DEBUG:
            logging.debug('***RAM*** get_activity_scores returning scores: ' + str(score_data['scores']))

        return score_data

    @classmethod
    def _memcache_key_for_student(cls, user_id):
        return ('activityscores:%s' % user_id)


text:
import {combineReducers} from "redux";
import app from "./app";
const rootReducer = combineReducers({
    app

})

export default rootReducer

redpajama_set_name: RedPajamaGithub


text:
<?php

namespace Common;

use Symfony\Bundle\FrameworkBundle\Test\WebTestCase as BaseWebTestCase;
use Symfony\Component\Finder\Finder;
use Symfony\Component\FileSystem\Filesystem;
use Symfony\Bundle\FrameworkBundle\Client;
use Symfony\Component\DomCrawler\Form;
use Symfony\Component\DomCrawler\Crawler;
use Backend\Core\Engine\Authentication;

/**
 * WebTestCase is the base class for functional tests.
 */
abstract class WebTestCase extends BaseWebTestCase
{
    /**
     * Attempts to guess the kernel location.
     *
     * When the Kernel is located, the file is required.
     *
     * @todo Remove this when Fork has no custom Kernel class anymore
     *
     * @throws \RuntimeException
     *
     * @return string The Kernel class name
     */
    protected static function getKernelClass()
    {
        $dir = isset($_SERVER['KERNEL_DIR']) ? $_SERVER['KERNEL_DIR'] : static::getPhpUnitXmlDir();

        $finder = new Finder();
        $finder->name('AppKernel.php')->depth(0)->in($dir);
        $results = iterator_to_array($finder);
        if (!count($results)) {
            throw new \RuntimeException(
                'Either set KERNEL_DIR in your phpunit.xml according to http://symfony.com/doc/current/book/testing.html#your-first-functional-test or override the WebTestCase::createKernel() method.'
            );
        }

        $file = current($results);
        $class = $file->getBasename('.php');

        require_once $file;

        return $class;
    }

    /**
     * Creates a Client.
     *
     * @param array $options An array of options to pass to the createKernel class
     * @param array $server  An array of server parameters
     *
     * @return Client A Client instance
     */
    protected static function createClient(array $options = array(), array $server = array())
    {
        if (null !== static::$kernel) {
            static::$kernel->shutdown();
        }

        static::$kernel = static::createKernel($options);

        $client = static::$kernel->getContainer()->get('test.client');
        $client->setServerParameters($server);

        return $client;
    }

    /**
     * Fully empties the test database
     *
     * @param \SpoonDatabase $database
     */
    protected function emptyTestDatabase($database)
    {
        foreach ($database->getTables() as $table) {
            $database->drop($table);
        }
    }

    /**
     * Executes sql in the database
     *
     * @param \SpoonDatabase $database
     * @param string $sql
     */
    protected function importSQL($database, $sql)
    {
        $database->execute(trim($sql));
    }

    /**
     * @param Client $client
     * @param array $fixtureClasses
     */
    protected function loadFixtures($client, $fixtureClasses = array())
    {
        $database = $client->getContainer()->get('database');

        // make sure our database has a clean state (freshly installed Fork)
        $this->emptyTestDatabase($database);
        $kernelDir = $client->getContainer()->getParameter('kernel.root_dir');
        $this->importSQL(
            $client->getContainer()->get('database'),
            file_get_contents($kernelDir . '/../tools/test_db.sql')
        );

        // load all the fixtures
        foreach ($fixtureClasses as $class) {
            $fixture = new $class();
            $fixture->load($database);
        }
    }

    /**
     * Copies the parameters.yml file to a backup version
     *
     * @param string $kernelDir
     */
    protected function backupParametersFile($kernelDir)
    {
        $filesystem = new Filesystem();
        if ($filesystem->exists($kernelDir . '/config/parameters.yml')) {
            $filesystem->copy(
                $kernelDir . '/config/parameters.yml',
                $kernelDir . '/config/parameters.yml~backup'
            );
        }
        if ($filesystem->exists($kernelDir . '/cache/test')) {
            $filesystem->remove($kernelDir . '/cache/test');
        }
    }

    /**
     * Puts the backed up parameters.yml file back
     *
     * @param string $kernelDir
     */
    protected function putParametersFileBack($kernelDir)
    {
        $filesystem = new Filesystem();
        if ($filesystem->exists($kernelDir . '/config/parameters.yml~backup')) {
            $filesystem->copy(
                $kernelDir . '/config/parameters.yml~backup',
                $kernelDir . '/config/parameters.yml',
                true
            );
            $filesystem->remove($kernelDir . '/config/parameters.yml~backup');
        }
        if ($filesystem->exists($kernelDir . '/cache/test')) {
            $filesystem->remove($kernelDir . '/cache/test');
        }
    }

    /**
     * @param Client $client
     */
    protected function assertIs404($client)
    {
        $client->followRedirect();
        $this->assertEquals(
            404,
            $client->getResponse()->getStatusCode()
        );
        $this->assertStringEndsWith(
            '404',
            $client->getHistory()->current()->getUri()
        );
    }

    /**
     * Submits the form and mimics the GET parameters, since they aren't added
     * by default in the functional tests
     *
     * @param  Client $client
     * @param  Form   $form
     * @param  array  $data
     */
    protected function submitForm(Client $client, Form $form, array $data = array())
    {
        // Get parameters should be set manually. Symfony uses the request object,
        // but spoon still checks the $_GET and $_POST parameters
        foreach ($data as $key => $value) {
            $_GET[$key] = $value;
            $_POST[$key] = $value;
        }

        $client->submit($form);

        foreach ($data as $key => $value) {
            unset($_GET[$key]);
            unset($_POST[$key]);
        }
    }

    /**
     * Edits the data of a form
     *
     * @param  Client $client
     * @param  Form   $form
     * @param  array  $data
     */
    protected function submitEditForm(Client $client, Form $form, array $data = array())
    {
        $originalData = array();
        foreach ($form->all() as $fieldName => $formField) {
            $originalData[$fieldName] = $formField->getValue();
        }

        $data = array_merge($originalData, $data);

        $this->submitForm($client, $form, $data);
    }

    /**
     * Do a request with the given GET parameters
     *
     * @param Client $client
     * @param string $url
     * @param array  $data
     *
     * @return Crawler
     */
    protected function requestWithGetParameters(
        Client $client,
        $url,
        $data = array()
    ) {
        $this->setGetParameters($data);
        $request = $client->request('GET', $url, $data);
        $this->unsetGetParameters($data);

        return $request;
    }

    /**
     * Set the GET parameters, as some of the old code relies on GET
     *
     * @param array $data
     */
    protected function setGetParameters($data = array())
    {
        foreach ((array) $data as $key => $value) {
            $_GET[$key] = $value;
        }
    }

    /**
     * Unset the GET parameters, as some of the old code relies on GET
     *
     * @param array $data
     */
    protected function unsetGetParameters($data = array())
    {
        if (empty($data)) {
            $_GET = array();
        } else {
            foreach ($data as $key => $value) {
                unset($_GET[$key]);
            }
        }
    }

    /**
     * Logs in a user. We do this directly in the authentication class because
     * this is a lot faster than submitting forms and following redirects
     *
     * Logging in using the forms is tested in the Authentication module
     */
    protected function login()
    {
        Authentication::tearDown();
        Authentication::loginUser('noreply@fork-cms.com', 'fork');
    }

    /**
     * Log out a user
     */
    protected function logout()
    {
        Authentication::tearDown();
    }
}


text:
package org.codehaus.mojo;

/**
 * Hello world!
 */
public class App {
	public static void main(String[] args) {
		System.out.println("Hello World!");
		test();
	}

	public static void test() {
		System.out.println("This is a test...");
	}
}


text:
/*
 * fis
 * http://fis.baidu.com/
 */

'use strict';

var UglifyJS = require('uglify-js');

module.exports = function (content, file, conf) {
    conf.fromString = true;
    var code = UglifyJS.minify(content, conf).code;
    return file.isHbsFile ? code.substring(0, code.lastIndexOf(";")) : code;
};


text:
===============
django-guardian
===============

.. image:: https://secure.travis-ci.org/lukaszb/django-guardian.png?branch=master
  :target: http://travis-ci.org/lukaszb/django-guardian

``django-guardian`` is implementation of per object permissions [1]_ as
authorization backend which is supported since Django_ 1.2. It won't
work with older Django_ releases.

Documentation
-------------

Online documentation is available at

http://packages.python.org/django-guardian/ or http://django-guardian.rtfd.org/

Installation
------------

To install ``django-guardian`` simply run::

    pip install django-guardian

Configuration
-------------

We need to hook ``django-guardian`` into our project.

1. Put ``guardian`` into your ``INSTALLED_APPS`` at settings module::

      INSTALLED_APPS = (
         ...
         'guardian',
      )

2. Add extra authorization backend::

      AUTHENTICATION_BACKENDS = (
          'django.contrib.auth.backends.ModelBackend', # default
          'guardian.backends.ObjectPermissionBackend',
      )

3. Configure anonymous user ID ::

     ANONYMOUS_USER_ID = -1

Usage
-----

After installation and project hooks we can finally use object permissions
with Django_.

Lets start really quickly::

    >>> jack = User.objects.create_user('jack', 'jack@example.com', 'topsecretagentjack')
    >>> admins = Group.objects.create(name='admins')
    >>> jack.has_perm('change_group', admins)
    False
    >>> UserObjectPermission.objects.assign_perm('change_group', user=jack, obj=admins)
    <UserObjectPermission: admins | jack | change_group>
    >>> jack.has_perm('change_group', admins)
    True

Of course our agent jack here would not be able to *change_group* globally::

    >>> jack.has_perm('change_group')
    False

Admin integration
-----------------

Replace ``admin.ModelAdmin`` with ``GuardedModelAdmin`` for those models
which should have object permissions support within admin panel.

For example::

    from django.contrib import admin
    from myapp.models import Author
    from guardian.admin import GuardedModelAdmin

    # Old way:
    #class AuthorAdmin(admin.ModelAdmin):
    #    pass

    # With object permissions support
    class AuthorAdmin(GuardedModelAdmin):
        pass

    admin.site.register(Author, AuthorAdmin)

.. [1] Great paper about this feature is available at `djangoadvent articles <https://github.com/djangoadvent/djangoadvent-articles/blob/master/1.2/06_object-permissions.rst>`_.

.. _Django: http://www.djangoproject.org/


text:
@import url(normalize.css);
/* RAIN v1.0 */
/* ==========================================================================
Table of Contents
========================================================================== */
/*

0.  Includes
1.  Icons
2.  General
3.  Utilities
4.  General
5.  Single Post
6.  Third Party Elements
7.  Pagination
8.  Footer
9.  Media Queries (Tablet)
10. Media Queries (Mobile)
 */
/* ==========================================================================
0. Includes - Ground zero
========================================================================== */
/* ==========================================================================
1. Icons - Sets up the icon font and respective classes
========================================================================== */
/* Import the font file with the icons in it */
@font-face { font-family: 'icons'; src: url("../fonts/icons.eot"); src: url("../fonts/icons.eot?#iefix") format("embedded-opentype"), url("../fonts/icons.woff") format("woff"), url("../fonts/icons.ttf") format("truetype"), url("../fonts/icons.svg#icons") format("svg"); font-weight: normal; font-style: normal; }
/* Apply these base styles to all icons */
/* line 49, ../scss/screen.scss */
.icon-ghost, .icon-feed, .icon-twitter, .icon-google-plus, .icon-facebook { font-family: 'icons'; speak: none; font-style: normal; font-weight: normal; font-variant: normal; text-transform: none; line-height: 1; -webkit-font-smoothing: antialiased; text-decoration: none; }

/* Each icon is created by inserting the corret character into the
content of the :before pseudo element. Like a boss. */
/* line 63, ../scss/screen.scss */
.icon-ghost:before { content: "\e000"; }

/* line 66, ../scss/screen.scss */
.icon-feed:before { content: "\e001"; }

/* line 69, ../scss/screen.scss */
.icon-twitter:before { content: "\e002"; font-size: 1.1em; }

/* line 73, ../scss/screen.scss */
.icon-google-plus:before { content: "\e003"; }

/* line 76, ../scss/screen.scss */
.icon-facebook:before { content: "\e004"; }

/* ==========================================================================
2. General - Setting up some base styles
========================================================================== */
/* ------------------------ */
/* CLEARING AND OTHER HACKS */
/* ------------------------ */
/* CLEAR BLOCK DIV */
/* line 91, ../scss/screen.scss */
.clear { clear: both; }

/* CLEAR INLINE SPAN */
/* line 97, ../scss/screen.scss */
span.clear { display: block; clear: both; width: 1px; height: 0.001%; font-size: 0px; line-height: 0px; }

/* CLEARFIX */
/* line 108, ../scss/screen.scss */
.clearfix:after { visibility: hidden; display: block; font-size: 0; content: " "; clear: both; height: 0; }

/* RESPONSIVE INDICATOR */
/* line 119, ../scss/screen.scss */
.jqres { width: 2000px; }

/* line 123, ../scss/screen.scss */
html { height: 100%; min-width: 320px; max-height: 100%; font-size: 62.5%; }

/* line 130, ../scss/screen.scss */
body { background-color: #333; height: 100%; max-height: 100%; font-family: Droid Serif, Georgia, serif; font-size: 1.8rem; line-height: 1.5em; color: #3A4145; width: 100%; }

/* line 141, ../scss/screen.scss */
::-moz-selection { color: #ffffff; background: #222; text-shadow: none; }

/* line 147, ../scss/screen.scss */
::selection { color: #ffffff; background: #222; text-shadow: none; }

/* line 153, ../scss/screen.scss */
h1, h2, h3, h4, h5, h6 { text-rendering: optimizeLegibility; line-height: 1; margin-top: 0; font-family: 'Droid Sans', Arial, sans-serif; font-weight: 400; color: #566160; }

/* line 163, ../scss/screen.scss */
h1 { font-size: 3rem; line-height: 1.2em; letter-spacing: -2px; text-indent: -3px; }

/* line 170, ../scss/screen.scss */
h2 { font-size: 2.8rem; line-height: 1.2em; letter-spacing: -1px; text-indent: -2px; }

/* line 177, ../scss/screen.scss */
h3 { font-size: 2.4rem; }

/* line 181, ../scss/screen.scss */
h4 { font-size: 2.0rem; }

/* line 185, ../scss/screen.scss */
h5 { font-size: 1.8rem; }

/* line 189, ../scss/screen.scss */
h6 { font-size: 1.6rem; }

/* line 193, ../scss/screen.scss */
a { color: #4a4a4a; transition: color ease 0.3s, border ease 0.3s, background ease 0.3s; }

/* line 198, ../scss/screen.scss */
a:hover { color: #57A3E8; }

/* line 202, ../scss/screen.scss */
h1 a, h2 a, h3 a, h4 a, h5 a, h6 a { color: #50585D; }

/* line 208, ../scss/screen.scss */
p, ul, ol { margin: 1.6em 0; }

/* line 212, ../scss/screen.scss */
ol ol, ul ul, ul ol, ol ul { margin: 0.4em 0; }

/* line 217, ../scss/screen.scss */
hr { display: block; height: 1px; border: 0; border-top: 1px solid #efefef; margin: 3.2em 0; padding: 0; }

/* line 226, ../scss/screen.scss */
blockquote { -moz-box-sizing: border-box; box-sizing: border-box; margin: 1.6em 0 1.6em 0; padding: 0 0 0 1.6em; border-left: #4a4a4a 0.4em solid; }

/* line 234, ../scss/screen.scss */
blockquote p { margin: 0.8em 0; font-style: italic; }

/* line 239, ../scss/screen.scss */
blockquote small { display: inline-block; margin: 0.8em 0 0.8em 1.5em; font-size: 0.9em; color: #ccc; }

/* line 246, ../scss/screen.scss */
blockquote small:before { content: '\2014 \00A0'; }

/* line 248, ../scss/screen.scss */
blockquote cite { font-weight: bold; }

/* line 252, ../scss/screen.scss */
blockquote cite a { font-weight: normal; }

/* line 255, ../scss/screen.scss */
dl { margin: 1.6em 0; }

/* line 259, ../scss/screen.scss */
dl dt { float: left; width: 180px; overflow: hidden; clear: left; text-align: right; text-overflow: ellipsis; white-space: nowrap; font-weight: bold; margin-bottom: 1em; }

/* line 271, ../scss/screen.scss */
dl dd { margin-left: 200px; margin-bottom: 1em; }

/* line 276, ../scss/screen.scss */
mark { background-color: #ffc336; }

/* line 280, ../scss/screen.scss */
code, tt { padding: 1px 3px; font-family: Inconsolata, monospace, sans-serif; font-size: 0.85em; white-space: pre; border: 1px solid #E3EDF3; background: #F7FAFB; border-radius: 2px; }

/* line 290, ../scss/screen.scss */
pre code { overflow: auto; word-wrap: normal; background: #333; }

/* line 297, ../scss/screen.scss */
p code { white-space: nowrap; }

/* line 301, ../scss/screen.scss */
code .at_rule { white-space: nowrap; }

/* line 329, ../scss/screen.scss */
kbd { display: inline-block; margin-bottom: 0.4em; padding: 1px 8px; border: #ccc 1px solid; color: #666; text-shadow: #fff 0 1px 0; font-size: 0.9em; font-weight: bold; background: #f4f4f4; border-radius: 4px; box-shadow: 0 1px 0 rgba(0, 0, 0, 0.2), 0 1px 0 0 white inset; }

/* line 345, ../scss/screen.scss */
table { -moz-box-sizing: border-box; box-sizing: border-box; margin: 1.6em 0; width: 100%; max-width: 100%; background-color: transparent; }

/* line 354, ../scss/screen.scss */
table th, table td { padding: 8px; line-height: 20px; text-align: left; vertical-align: top; border-top: 1px solid #efefef; }

/* line 363, ../scss/screen.scss */
table th { color: #000; }

/* line 365, ../scss/screen.scss */
table caption + thead tr:first-child th, table caption + thead tr:first-child td, table colgroup + thead tr:first-child th, table colgroup + thead tr:first-child td, table thead:first-child tr:first-child th, table thead:first-child tr:first-child td { border-top: 0; }

/* line 374, ../scss/screen.scss */
table tbody + tbody { border-top: 2px solid #efefef; }

/* line 376, ../scss/screen.scss */
table table table { background-color: #fff; }

/* line 378, ../scss/screen.scss */
table tbody > tr:nth-child(odd) > td, table tbody > tr:nth-child(odd) > th { background-color: #f6f6f6; }

/* line 384, ../scss/screen.scss */
table.plain tbody > tr:nth-child(odd) > td, table.plain tbody > tr:nth-child(odd) > th { background: transparent; }

/* line 390, ../scss/screen.scss */
.dropcap { float: left; font-size: 5.8rem; line-height: 5.4rem; margin: 0 6px 0 0; }

/* ==========================================================================
3. Utilities - These things get used a lot
========================================================================== */
/* Hides shit */
/* line 402, ../scss/screen.scss */
.hidden { text-indent: -9999px; visibility: hidden; display: none; }

/* Creates a responsive wrapper that makes our content scale nicely */
/* line 409, ../scss/screen.scss */
.inner { position: relative; width: 80%; max-width: 700px; margin: 0 auto; }

/* Centres vertically yo. (IE8+) */
/* line 417, ../scss/screen.scss */
.vertical { display: table-cell; vertical-align: middle; width: 100%; /* hackyhack */ }

/* ==========================================================================
4. General - The main styles for the the theme
========================================================================== */
/* Big cover image on the home page */
/* line 430, ../scss/screen.scss */
#ccontainer { z-index: 0; position: fixed; left: 0; width: 100%; height: 100%; background-size: cover; }

/* line 439, ../scss/screen.scss */
#cholder { width: 100%; height: 100%; position: relative; overflow: hidden; }

/* line 446, ../scss/screen.scss */
#choverbg { background-image: url(../images/texture.png); background-size: cover; width: 100%; height: 100%; position: absolute; top: 0; right: 0; bottom: 0; left: 0; }

/* line 458, ../scss/screen.scss */
#canvas { top: 0; left: 0; position: relative; }

/* Header */
/* line 466, ../scss/screen.scss */
#site-head { position: fixed; z-index: 1; width: 100%; top: 0; font-family: 'Open Sans', sans-serif; }

/* line 474, ../scss/screen.scss */
.header-left { float: left; width: 50%; display: table; padding: 0 5.57%; background-color: #888888; background-color: rgba(0, 0, 0, 0.05); -moz-box-sizing: border-box; -webkit-box-sizing: border-box; box-sizing: border-box; }

/* line 484, ../scss/screen.scss */
.logo-wrapper { float: left; }

/* line 488, ../scss/screen.scss */
.header-right { float: left; width: 50%; max-width: 750px; display: table; padding: 0 5.57%; background-color: #f6f6f6; background-color: rgba(245, 245, 245, 0.9); color: #444444; -moz-box-sizing: border-box; -webkit-box-sizing: border-box; box-sizing: border-box; }

/* line 500, ../scss/screen.scss */
.header-left, .header-right { height: 62px; /* handmade fallback to prevent jumping when JS loads, change to fit your own logo and header height */ }

/* line 505, ../scss/screen.scss */
.nav-toggle { width: 50px; height: 50px; background: red; float: right; }

/* Equalizer - original code by http://aniketpant.com/2011/06/pure-css-soundbars/ */
/* line 514, ../scss/screen.scss */
audio.audio-rain { display: none; }

@-moz-keyframes stop { /* line 519, ../scss/screen.scss */
  0% { height: 20px; }
  /* line 520, ../scss/screen.scss */
  100% { height: 4px; } }
@-moz-keyframes hover { /* line 524, ../scss/screen.scss */
  0% { height: 5px; }
  /* line 525, ../scss/screen.scss */
  100% { height: 20px; } }
@-moz-keyframes move1 { /* line 529, ../scss/screen.scss */
  0% { height: 5px; }
  /* line 530, ../scss/screen.scss */
  25% { height: 20px; }
  /* line 531, ../scss/screen.scss */
  75% { height: 15px; }
  /* line 532, ../scss/screen.scss */
  100% { height: 5px; } }
@-moz-keyframes move2 { /* line 536, ../scss/screen.scss */
  0% { height: 2px; }
  /* line 537, ../scss/screen.scss */
  25% { height: 12px; }
  /* line 538, ../scss/screen.scss */
  75% { height: 20px; }
  /* line 539, ../scss/screen.scss */
  100% { height: 2px; } }
@-moz-keyframes move3 { /* line 543, ../scss/screen.scss */
  0% { height: 7px; }
  /* line 544, ../scss/screen.scss */
  25% { height: 2px; }
  /* line 545, ../scss/screen.scss */
  75% { height: 20px; }
  /* line 546, ../scss/screen.scss */
  100% { height: 7px; } }
@-moz-keyframes move4 { /* line 550, ../scss/screen.scss */
  0% { height: 12px; }
  /* line 551, ../scss/screen.scss */
  25% { height: 5px; }
  /* line 552, ../scss/screen.scss */
  75% { height: 22px; }
  /* line 553, ../scss/screen.scss */
  100% { height: 12px; } }
@-webkit-keyframes stop { /* line 557, ../scss/screen.scss */
  0% { height: 20px; }
  /* line 558, ../scss/screen.scss */
  100% { height: 4px; } }
@-webkit-keyframes hover { /* line 562, ../scss/screen.scss */
  0% { height: 5px; }
  /* line 563, ../scss/screen.scss */
  100% { height: 20px; } }
@-webkit-keyframes move1 { /* line 568, ../scss/screen.scss */
  0% { height: 5px; }
  /* line 569, ../scss/screen.scss */
  25% { height: 20px; }
  /* line 570, ../scss/screen.scss */
  75% { height: 15px; }
  /* line 571, ../scss/screen.scss */
  100% { height: 5px; } }
@-webkit-keyframes move2 { /* line 575, ../scss/screen.scss */
  0% { height: 2px; }
  /* line 576, ../scss/screen.scss */
  25% { height: 12px; }
  /* line 577, ../scss/screen.scss */
  75% { height: 20px; }
  /* line 578, ../scss/screen.scss */
  100% { height: 2px; } }
@-webkit-keyframes move3 { /* line 582, ../scss/screen.scss */
  0% { height: 7px; }
  /* line 583, ../scss/screen.scss */
  25% { height: 2px; }
  /* line 584, ../scss/screen.scss */
  75% { height: 20px; }
  /* line 585, ../scss/screen.scss */
  100% { height: 7px; } }
@-webkit-keyframes move4 { /* line 589, ../scss/screen.scss */
  0% { height: 12px; }
  /* line 590, ../scss/screen.scss */
  25% { height: 5px; }
  /* line 591, ../scss/screen.scss */
  75% { height: 22px; }
  /* line 592, ../scss/screen.scss */
  100% { height: 12px; } }
/* line 595, ../scss/screen.scss */
.music-toggle { display: none; /* showing up is controlled via jQuery */ cursor: pointer; float: right; }

/* line 601, ../scss/screen.scss */
.bars { list-style: none; margin: 0; padding: 0; width: 19px; height: 20px; /* true is 22 */ position: relative; }

/* line 610, ../scss/screen.scss */
.bars li { position: absolute; bottom: 0; display: block; float: left; width: 4px; background-color: #ffffff; -webkit-border-radius: 1px 1px 0px 0px; -moz-border-radius: 1px 1px 0px 0px; border-radius: 1px 1px 0px 0px; -moz-transition: height 0.4s linear; -o-transition: height 0.4s linear; -webkit-transition: height 0.4s linear; transition: height 0.4s linear; }

/* line 623, ../scss/screen.scss */
.bars:first-child { margin-left: 0; }

/* line 627, ../scss/screen.scss */
.bars:last-child { margin-right: 0; }

/* line 631, ../scss/screen.scss */
.bar1 { left: 0px; height: 16px; -moz-animation: move1 infinite 2s linear; -webkit-animation: move1 infinite 2s linear; }

/* line 638, ../scss/screen.scss */
.bar2 { left: 5px; height: 12px; -moz-animation: move2 infinite 4s linear; -webkit-animation: move2 infinite 4s linear; }

/* line 645, ../scss/screen.scss */
.bar3 { left: 10px; height: 18px; -moz-animation: move3 infinite 2s linear; -webkit-animation: move3 infinite 2s linear; }

/* line 652, ../scss/screen.scss */
.bar4 { left: 15px; height: 9px; -moz-animation: move4 infinite 0.8s linear; -webkit-animation: move4 infinite 0.8s linear; }

/* line 659, ../scss/screen.scss */
.hidden { height: 300px; box-shadow: none !important; }

/* line 664, ../scss/screen.scss */
.music-toggle.music-stopped .bars li { height: 4px; -moz-animation: stop 0.8s linear; -webkit-animation: stop 0.8s linear; }

/* line 670, ../scss/screen.scss */
#mobile-logo { display: none; position: relative; text-align: center; padding: 200px 0; }

/* Category Navigation */
/* line 679, ../scss/screen.scss */
#cat-nav { position: fixed; z-index: 0; width: 50%; bottom: 0; font-family: 'Open Sans', sans-serif; color: #ffffff; }

/* line 688, ../scss/screen.scss */
.cat-nav-left { float: left; width: 100%; height: 62px; /* handmade fallback to prevent jumping when JS loads, change to fit your own logo and header height */ display: table; padding: 0 11.14%; position: relative; background-color: #000000; background-color: rgba(0, 0, 0, 0.3); -moz-box-sizing: border-box; -webkit-box-sizing: border-box; box-sizing: border-box; }

/* line 700, ../scss/screen.scss */
.cat-nav-posts { text-align: center; font-family: Montserrat, Arial, sans-serif; text-transform: uppercase; font-size: 1.2rem; height: 44px; overflow: hidden; position: relative; }

/* line 710, ../scss/screen.scss */
.cat-nav-post { position: absolute; top: 1px; right: 0; bottom: 0; left: 0; height: 44px; line-height: 44px; opacity: 0; -moz-transition: -moz-transform 0s ease-in-out opacity 0s ease-in-out; -o-transition: -o-transform 0s ease-in-out opacity 0s ease-in-out; -webkit-transition: -webkit-transform 0s ease-in-out opacity 0s ease-in-out; transition: transform 0s ease-in-out opacity 0s ease-in-out; -moz-transform: translateY(0); -ms-transform: translateY(0); -o-transform: translateY(0); -webkit-transform: translateY(0); transform: translateY(0); }

/* line 723, ../scss/screen.scss */
.cat-nav-post.come-from-top { opacity: 1; left: 30px; right: auto; text-align: left; padding-left: 13px; -moz-transform: translateX(-30px); -ms-transform: translateX(-30px); -o-transform: translateX(-30px); -webkit-transform: translateX(-30px); transform: translateX(-30px); -moz-transition: -moz-transform 0.381s ease-in-out opacity 0.381s ease-in-out; -o-transition: -o-transform 0.381s ease-in-out opacity 0.381s ease-in-out; -webkit-transition: -webkit-transform 0.381s ease-in-out opacity 0.381s ease-in-out; transition: transform 0.381s ease-in-out opacity 0.381s ease-in-out; }

/* line 733, ../scss/screen.scss */
.cat-nav-post.come-from-bottom { opacity: 1; right: 30px; left: auto; text-align: right; padding-right: 13px; -moz-transform: translateX(30px); -ms-transform: translateX(30px); -o-transform: translateX(30px); -webkit-transform: translateX(30px); transform: translateX(30px); -moz-transition: -moz-transform 0.381s ease-in-out opacity 0.381s ease-in-out; -o-transition: -o-transform 0.381s ease-in-out opacity 0.381s ease-in-out; -webkit-transition: -webkit-transform 0.381s ease-in-out opacity 0.381s ease-in-out; transition: transform 0.381s ease-in-out opacity 0.381s ease-in-out; }

/* line 743, ../scss/screen.scss */
.prev-post, .next-post { cursor: pointer; font-size: 3.4rem; vertical-align: middle; height: 44px !important; line-height: 44px !important; display: block; opacity: 0.5; overflow: hidden; width: 44px; text-align: center; }

/* line 757, ../scss/screen.scss */
.prev-post { float: left; margin-left: -11px; }

/* line 762, ../scss/screen.scss */
.next-post { float: right; margin-right: -13px; }

/* line 767, ../scss/screen.scss */
.prev-post:hover, .next-post:hover { opacity: 1; }

/* Breadcrumbs */
/* line 774, ../scss/screen.scss */
.breadcrumbs { padding: 0; margin: 0; text-transform: uppercase; font-size: 1.2rem; }

/* line 781, ../scss/screen.scss */
.breadcrumbs li { float: left; list-style: none; }

/* line 786, ../scss/screen.scss */
.breadcrumbs li:after { content: "/"; padding: 0 6px; }

/* line 791, ../scss/screen.scss */
.breadcrumbs li:last-child:after { content: ""; }

/* Yo-logo. Yolo-go. Upload one in ghost/settings/ */
/* line 797, ../scss/screen.scss */
#blog-logo { float: left; margin: 20px 0; }

/* line 802, ../scss/screen.scss */
#blog-logo img { display: block; max-height: 100px; width: auto; line-height: 0; }

/* line 809, ../scss/screen.scss */
#back { color: rgba(0, 0, 0, 0.2); position: fixed; top: 8px; left: 8px; padding: 6px; font-size: 16px; }

/* Navigation Menu */
/* line 820, ../scss/screen.scss */
.menu { position: fixed; z-index: 1; font-size: 18px; line-height: 48px; top: 0px; bottom: 0; left: 0; width: 50%; opacity: 0; background-color: #222; color: #ffffff; text-align: center; overflow: auto; -webkit-transform-origin: 100% 50% 0; -moz-transform-origin: 100% 50% 0; -ms-transform-origin: 100% 50% 0; -o-transform-origin: 100% 50% 0; transform-origin: 100% 50% 0; -moz-box-sizing: border-box; -webkit-box-sizing: border-box; box-sizing: border-box; -moz-transform: perspective(1600px) rotateY(-90deg) rotateX(0deg); -ms-transform: perspective(1600px) rotateY(-90deg) rotateX(0deg); -o-transform: perspective(1600px) rotateY(-90deg) rotateX(0deg); -webkit-transform: perspective(1600px) rotateY(-90deg) rotateX(0deg); transform: perspective(1600px) rotateY(-90deg) rotateX(0deg); -moz-transition: all 0.381s ease-out; -o-transition: all 0.381s ease-out; -webkit-transition: all 0.381s ease-out; transition: all 0.381s ease-out; }

/* line 844, ../scss/screen.scss */
.menu.active { opacity: 1; -moz-transform: perspective(1600px) rotateY(0deg) rotateX(0deg); -ms-transform: perspective(1600px) rotateY(0deg) rotateX(0deg); -o-transform: perspective(1600px) rotateY(0deg) rotateX(0deg); -webkit-transform: perspective(1600px) rotateY(0deg) rotateX(0deg); transform: perspective(1600px) rotateY(0deg) rotateX(0deg); }

/* line 861, ../scss/screen.scss */
.menu-title { font-size: 6.2rem; margin: 120px 11.4% 0 11.4%; padding: 0 10%; color: #ffffff; }

/* line 868, ../scss/screen.scss */
.menu ul { display: block; list-style: none; padding: 46px 11.4%; margin: 30px 0 30px 0; -moz-box-sizing: border-box; -webkit-box-sizing: border-box; box-sizing: border-box; }

/* line 876, ../scss/screen.scss */
.menu li { float: left; width: 100%; border-bottom: 1px solid #555555; border-bottom: 1px solid rgba(255, 255, 255, 0.1); padding: 20px 0; }

/* line 884, ../scss/screen.scss */
.menu li:last-child { border-bottom: none; }

/* line 888, ../scss/screen.scss */
.menu li:before { color: #404040; width: 48px; display: inline-block; display: none; }

/* line 895, ../scss/screen.scss */
.menu li:nth-child(1):before { content: "01. "; }

/* line 898, ../scss/screen.scss */
.menu li:nth-child(2):before { content: "02. "; }

/* line 901, ../scss/screen.scss */
.menu li:nth-child(3):before { content: "03. "; }

/* line 904, ../scss/screen.scss */
.menu li:nth-child(4):before { content: "04. "; }

/* line 907, ../scss/screen.scss */
.menu li:nth-child(5):before { content: "05. "; }

/* line 910, ../scss/screen.scss */
.menu li:nth-child(6):before { content: "06. "; }

/* line 913, ../scss/screen.scss */
.menu li:nth-child(7):before { content: "07. "; }

/* line 916, ../scss/screen.scss */
.menu li:nth-child(8):before { content: "08. "; }

/* line 919, ../scss/screen.scss */
.menu li:nth-child(9):before { content: "09. "; }

/* line 922, ../scss/screen.scss */
.menu li:nth-child(10):before { content: "10. "; }

/* line 925, ../scss/screen.scss */
.menu li:nth-child(11):before { content: "11. "; }

/* line 928, ../scss/screen.scss */
.menu li:nth-child(12):before { content: "12. "; }

/* line 931, ../scss/screen.scss */
.menu li:nth-child(13):before { content: "13. "; }

/* line 934, ../scss/screen.scss */
.menu li:nth-child(14):before { content: "14. "; }

/* line 937, ../scss/screen.scss */
.menu li:nth-child(15):before { content: "15. "; }

/* line 940, ../scss/screen.scss */
.menu li:nth-child(16):before { content: "16. "; }

/* line 943, ../scss/screen.scss */
.menu li:nth-child(17):before { content: "17. "; }

/* line 946, ../scss/screen.scss */
.menu li:nth-child(18):before { content: "18. "; }

/* line 949, ../scss/screen.scss */
.menu li:nth-child(19):before { content: "19. "; }

/* line 952, ../scss/screen.scss */
.menu li:nth-child(20):before { content: "20. "; }

/* line 956, ../scss/screen.scss */
.menu { color: #666666; }

/* line 960, ../scss/screen.scss */
.menu a { color: #666666; text-decoration: none; }

/* line 965, ../scss/screen.scss */
.menu a:hover { color: #ffffff; text-decoration: none; }

/* line 970, ../scss/screen.scss */
.menu h2, .menu h3, .menu h4 { font-family: Montserrat, Arial, sans-serif; text-transform: uppercase; font-weight: 700; letter-spacing: -2px; }

/* line 979, ../scss/screen.scss */
.menu li.active-item { color: #666666; }

/* line 983, ../scss/screen.scss */
.menu li.active-item a { color: #ffffff; }

/* line 987, ../scss/screen.scss */
.menu li h3 { margin: 0; padding: 0; font-size: 2.9rem; }

/* line 993, ../scss/screen.scss */
.menu li .post-meta-date { font-size: 1.6rem; line-height: 2.6rem; }

/* line 998, ../scss/screen.scss */
.menu_button { color: #aaaaaa; float: left; cursor: pointer; -moz-border-radius: 3px; -webkit-border-radius: 3px; border-radius: 3px; }

/* line 1005, ../scss/screen.scss */
.menu_button:hover { color: #444444; }

/* line 1009, ../scss/screen.scss */
.menu_button i { font-size: 26px; vertical-align: middle; padding: 0; }

/* line 1015, ../scss/screen.scss */
.menu .menu-author-image { margin: 48px auto 40px auto; width: 240px; height: 240px; border: 10px solid #ffffff; background-size: cover; background-position: center center; -moz-border-radius: 999px; -webkit-border-radius: 999px; border-radius: 999px; }

/* line 1025, ../scss/screen.scss */
.menu .written-by { margin-top: 53px; }

/* line 1029, ../scss/screen.scss */
.menu .about-the-author { margin-top: 20px; }

/* line 1033, ../scss/screen.scss */
.menu .menu-author-bio { line-height: 2.7rem; margin: 0 11.4% 0 11.4%; }

/* line 1038, ../scss/screen.scss */
.menu .menu-author-web { margin: 26px 0 0 0; }

/* line 1042, ../scss/screen.scss */
.menu .menu-author-web, .menu .menu-author-mail { display: inline-block; text-align: center; color: #ffffff; line-height: 1.8rem; font-size: 1.6rem; }

/* line 1051, ../scss/screen.scss */
.menu .menu-author-web:hover, .menu .menu-author-mail:hover { text-decoration: underline; }

/* line 1056, ../scss/screen.scss */
.menu .menu-author-web i, .menu .menu-author-mail i { margin: 0 9px 0 0; color: #666666; font-size: 1.6rem; }

/* Content Wrapper */
/* line 1065, ../scss/screen.scss */
.content { width: 50%; position: relative; padding: 0; /*box-shadow: 0 10px 10px rgba(0,0,0,0.5);*/ margin: 0 0 0 50%; float: left; max-width: 750px; -moz-box-sizing: border-box; -webkit-box-sizing: border-box; box-sizing: border-box; }

/* The details of your blog. Defined in ghost/settings/ */
/* line 1077, ../scss/screen.scss */
.blog-title { margin: 10px 0 10px 0; font-size: 5rem; letter-spacing: -1px; }

/* line 1083, ../scss/screen.scss */
.blog-description { margin: 0; font-size: 1.8rem; line-height: 1.5em; font-weight: 300; font-family: 'Droid Serif', Georgia, serif; letter-spacing: 0; }

/* Every post, on every page, gets this style on its <article> tag */
/* line 1094, ../scss/screen.scss */
.article_container { background: rgba(220, 220, 220, 0.3); }

/* line 1098, ../scss/screen.scss */
.post { position: relative; margin: 0 0 12px 0; padding: 40px 11.14% 80px 11.14%; word-break: break-word; hyphens: auto; background-color: #ffffff; background-color: white; -moz-border-radius: 2px 0 0 2px; -webkit-border-radius: 2px; border-radius: 2px 0 0 2px; }

/* line 1109, ../scss/screen.scss */
.post:first-of-type { padding-top: 80px; }

/* line 1113, ../scss/screen.scss */
.post:last-of-type { padding-bottom: 80px; }

/* line 1117, ../scss/screen.scss */
.article_container:last-of-type .post { margin-bottom: 0; -moz-border-radius: 2px 0 0 0; -webkit-border-radius: 2px; border-radius: 2px 0 0 0; }

/* line 1122, ../scss/screen.scss */
.article_container:first-of-type .post .post-inner { /*padding-top: 62px;*/ /* handmade fallback to prevent jumping when JS loads, change to fit your own logo and header height */ }

/* line 1126, ../scss/screen.scss */
.article_container:last-of-type .post .post-inner { padding-bottom: 0px; /* handmade fallback to prevent jumping when JS loads, change to fit your own logo and header height */ }

/* line 1130, ../scss/screen.scss */
.post-template .article_container:last-of-type .post .post-inner { padding-bottom: 0; /* handmade fallback to prevent jumping when JS loads, change to fit your own logo and header height */ }

/* line 1134, ../scss/screen.scss */
.post-title-wrapper { /*height: 0;
position: absolute;
right: 100%;
width: 100%;*/ position: fixed; top: 38%; bottom: auto; left: 0; right: 50%; }

/* line 1146, ../scss/screen.scss */
.post-title { font-size: 7.4rem; line-height: 7.4rem; margin: 0; font-weight: 700; text-transform: uppercase; font-family: Montserrat, Arial, sans-serif; text-align: center; letter-spacing: -4px; opacity: 0.95; padding: 0 11.4%; font-style: normal; -moz-box-sizing: border-box; -webkit-box-sizing: border-box; box-sizing: border-box; }

/* line 1161, ../scss/screen.scss */
.post-title, .post-title a { color: #ffffff; }

/* line 1166, ../scss/screen.scss */
.post-title a { text-decoration: none; }

/* line 1170, ../scss/screen.scss */
.post-excerpt p { margin: 1.6rem 0 0 0; font-size: 0.9em; line-height: 1.6em; }

/* line 1176, ../scss/screen.scss */
.post-end { color: #BBC7CC; font-size: 14px; }

/* line 1181, ../scss/screen.scss */
.post-end i { margin: 0 4px 0 0; }

/* line 1185, ../scss/screen.scss */
.post-end-date { float: left; }

/* line 1189, ../scss/screen.scss */
.post-end-author { float: right; font-style: italic; }

/* line 1194, ../scss/screen.scss */
.post-end-author a { text-decoration: none; }

/* line 1201, ../scss/screen.scss */
.post-meta { margin: 0 0 5px 0; font-size: 1.5rem; color: #566160; text-align: center; }

/* line 1208, ../scss/screen.scss */
.post-meta a { color: #566160; text-decoration: none; }

/* line 1213, ../scss/screen.scss */
.post-meta a:hover { text-decoration: underline; }

/* line 1217, ../scss/screen.scss */
.user-meta { position: relative; padding: 0.3rem 40px 0 100px; min-height: 77px; }

/* line 1223, ../scss/screen.scss */
.user-image { position: absolute; top: 0; left: 0; }

/* line 1229, ../scss/screen.scss */
.user-name { display: block; font-weight: bold; }

/* line 1234, ../scss/screen.scss */
.user-bio { display: block; max-width: 440px; font-size: 1.4rem; line-height: 1.5em; }

/* line 1241, ../scss/screen.scss */
.publish-meta { position: absolute; top: 0; right: 0; padding: 4.3rem 0 4rem 0; text-align: right; }

/* line 1249, ../scss/screen.scss */
.publish-heading { display: block; font-weight: bold; }

/* line 1254, ../scss/screen.scss */
.publish-date { display: block; font-size: 1.4rem; line-height: 1.5em; }

/* ==========================================================================
5. Single Post - When you click on an individual post
========================================================================== */
/* Tweak the .post wrapper style */
/* line 1265, ../scss/screen.scss */
.post-template .post { border-bottom: none; }

/* Kill that stylish little circle that was on the border, too */
/* line 1270, ../scss/screen.scss */
.post-template .post:after { display: none; }

/* Insert some mad padding up in the header for better spacing */
/* line 1275, ../scss/screen.scss */
.post-template .post-header { padding: 60px 0; }

/* Keep large images within the bounds of the post-width */
/* line 1280, ../scss/screen.scss */
.post-content img { display: block; max-width: 100%; margin: 0 auto; }

/* line 1286, ../scss/screen.scss */
.post-template .table-of-contents { display: none; }

/* The author credit area after the post */
/* line 1291, ../scss/screen.scss */
.post-footer { position: relative; margin: 5.6rem 0 0 0; }

/* line 1296, ../scss/screen.scss */
.post-footer, .post-footer a { color: #3A4145; }

/* line 1301, ../scss/screen.scss */
.post-footer h4 { font-size: 1.8rem; margin: 0; }

/* line 1306, ../scss/screen.scss */
.post-footer p { margin: 1rem 0; font-size: 1.1rem; line-height: 1.1rem; text-align: center; }

/* Create some space to the right for the share links */
/* line 1314, ../scss/screen.scss */
.post-footer .author { margin-right: 180px; }

/* Drop the share links in the space to the right.
Doing it like this means it's easier for the author bio
to be flexible at smaller screen sizes while the share
links remain at a fixed width the whole time */
/* line 1322, ../scss/screen.scss */
.post-footer .share { float: right; }

/* line 1326, ../scss/screen.scss */
.post-footer .share a { text-decoration: none; font-size: 1.1rem; margin: 0 2px; display: inline-block; text-align: center; vertical-align: middle; }

/* line 1335, ../scss/screen.scss */
.post-footer .share a:hover { color: #57A3E8; }

/* line 1339, ../scss/screen.scss */
.post-footer .tags { text-align: left; border-top: #3A4145 1px solid; padding: 0.8rem 0.1rem; margin-bottom: 0; }

/* line 1346, ../scss/screen.scss */
.post-footer-share-title { text-align: center; padding: 0 0 0.2rem 0; }

/* line 1351, ../scss/screen.scss */
.post-footer .post-footer-share { text-align: center; margin: 1rem 0 5rem 0; }

/* line 1356, ../scss/screen.scss */
.post-footer-share a { text-decoration: none; font-size: 3rem; margin: 0 2px; display: inline-block; text-align: center; vertical-align: middle; width: 50px; height: 50px; line-height: 50px; border: 2px solid #4A4A4A; -moz-border-radius: 9999px; -webkit-border-radius: 9999px; border-radius: 9999px; }

/* line 1371, ../scss/screen.scss */
.post-footer-share a:hover { color: #569cdc; border-color: #569cdc; }

/* ==========================================================================
6. Third Party Elements - Embeds from other services
========================================================================== */
/* Github */
/* line 1382, ../scss/screen.scss */
.gist table { margin: 0; font-size: 1.4rem; }

/* line 1387, ../scss/screen.scss */
.gist .line-number { min-width: 25px; font-size: 1.1rem; }

/* line 1392, ../scss/screen.scss */
.reading-time { color: #777; font-size: 12px; text-align: center; }

/* ==========================================================================
7. Pagination - Tools to let you flick between pages
========================================================================== */
/* The main wrapper for our pagination links */
/* line 1404, ../scss/screen.scss */
.pagination { position: relative; font-family: Montserrat, Arial, sans-serif; font-size: 1.2rem; font-size: 1.2rem; text-transform: uppercase; line-height: 2.7rem; color: #ffffff; text-align: center; background-color: #000000; background-color: rgba(0, 0, 0, 0.3); padding: 0 11.14% 0 11.14%; }

/* line 1418, ../scss/screen.scss */
.pagination a { color: #ffffff; }

/* line 1422, ../scss/screen.scss */
.menu .pagination { background-color: transparent; margin-bottom: 120px; }

/* Push the previous/next links out to the left/right */
/* line 1428, ../scss/screen.scss */
.older-posts, .newer-posts { position: absolute; display: inline-block; text-decoration: none; cursor: pointer; display: block; font-size: 3.4rem; width: 44px; height: 44px !important; line-height: 44px !important; opacity: 0.5; overflow: hidden; text-align: center; vertical-align: middle; margin: 9px 0 0 0; }

/* line 1446, ../scss/screen.scss */
.older-posts:hover, .newer-posts:hover { opacity: 1; text-decoration: none !important; }

/* line 1452, ../scss/screen.scss */
.older-posts { right: 11.14%; margin-right: -13px; }

/* line 1457, ../scss/screen.scss */
.page-number { display: inline-block; padding: 17px 0 18px 0; opacity: 0.5; }

/* line 1463, ../scss/screen.scss */
.newer-posts { left: 11.14%; margin-left: -11px; }

/* line 1468, ../scss/screen.scss */
.older-posts:hover, .newer-posts:hover { border-color: #9EABB3; }

/* ==========================================================================
8. Footer - The bottom of every page
========================================================================== */
/* line 1478, ../scss/screen.scss */
.site-footer { position: relative; margin: 8rem 0 0 0; padding: 4rem 0; border-top: #EBF2F6 1px solid; font-family: 'Open Sans', sans-serif; font-size: 1.3rem; line-height: 1.7em; color: #BBC7CC; text-align: center; background: #F7FAFB; }

/* line 1491, ../scss/screen.scss */
.site-footer a { color: #BBC7CC; text-decoration: underline; }

/* line 1496, ../scss/screen.scss */
.site-footer a:hover { color: #50585D; }

/* line 1500, ../scss/screen.scss */
.poweredby .icon-ghost { font-weight: 700; text-decoration: none; }

/* line 1505, ../scss/screen.scss */
.poweredby .icon-ghost:hover { text-decoration: none; }

/* line 1509, ../scss/screen.scss */
.poweredby .icon-ghost:before { font-size: 1rem; margin-right: 0.2em; }

/* The subscribe icon on the footer */
/* line 1515, ../scss/screen.scss */
.subscribe { width: 28px; height: 28px; position: absolute; top: -14px; left: 50%; margin-left: -15px; border: #EBF2F6 1px solid; text-align: center; line-height: 2.4rem; border-radius: 50px; background: #fff; transition: box-shadow 0.5s; }

/* The RSS icon, inserted via icon font */
/* line 1531, ../scss/screen.scss */
.subscribe:before { color: #D2DEE3; font-size: 10px; position: absolute; top: 2px; left: 9px; font-weight: bold; transition: color 0.5s ease; }

/* Add a box shadow to on hover */
/* line 1542, ../scss/screen.scss */
.subscribe:hover { box-shadow: rgba(0, 0, 0, 0.05) 0 0 0 3px; transition: box-shadow 0.25s; }

/* line 1547, ../scss/screen.scss */
.subscribe:hover:before { color: #50585D; }

/* CSS tooltip saying "Subscribe!" - initially hidden */
/* line 1552, ../scss/screen.scss */
.tooltip { opacity: 0; display: inline-block; padding: 4px 8px 5px 8px; position: absolute; top: -23px; left: -23px; color: rgba(255, 255, 255, 0.9); font-size: 1.1rem; font-weight: bold; line-height: 1em; text-align: center; background: #50585D; border-radius: 20px; box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1); transition: opacity 0.3s ease, top 0.3s ease; }

/* The little chiclet arrow under the tooltip, pointing down */
/* line 1571, ../scss/screen.scss */
.tooltip:after { content: ""; border-width: 5px 5px 0 5px; border-style: solid; border-color: #50585D transparent; display: block; position: absolute; bottom: -4px; left: 50%; margin-left: -5px; z-index: 220; width: 0; }

/* On hover, show the tooltip! */
/* line 1586, ../scss/screen.scss */
.subscribe:hover .tooltip { opacity: 1; top: -33px; }

/* ==========================================================================
9. Media Queries - Smaller than 900px
========================================================================== */
@media only screen and (max-width: 900px) { /* RESPONSIVE INDICATOR */
  /* line 1600, ../scss/screen.scss */
  .jqres { width: 900px; }
  /* line 1604, ../scss/screen.scss */
  #site-head { display: none; }
  /* line 1608, ../scss/screen.scss */
  .menu { display: none; }
  /* line 1612, ../scss/screen.scss */
  #cat-nav { display: none; }
  /* line 1616, ../scss/screen.scss */
  blockquote { margin-left: 0; }
  /* line 1621, ../scss/screen.scss */
  #mobile-logo { display: block; }
  /* line 1625, ../scss/screen.scss */
  .dropcap { font-size: 5.2rem; line-height: 5rem; margin: 0 4px 0 0; }
  /* line 1631, ../scss/screen.scss */
  .content { width: 80%; max-width: none; margin: 0 10% 0 10%; }
  /* line 1637, ../scss/screen.scss */
  .article_container:last-of-type .post .post-inner { padding-bottom: 0px; }
  /* line 1641, ../scss/screen.scss */
  .post:first-of-type { padding-top: 60px; }
  /* line 1645, ../scss/screen.scss */
  .post { margin-bottom: 30px; padding-right: 8%; padding-left: 8%; }
  /* line 1651, ../scss/screen.scss */
  .post:last-of-type { padding-bottom: 40px; }
  /* line 1655, ../scss/screen.scss */
  .post-title-wrapper { position: static; margin-bottom: 4rem; }
  /* line 1660, ../scss/screen.scss */
  .post-title, .post-title a { color: #333638; }
  /* line 1665, ../scss/screen.scss */
  .post-title { font-size: 4.2rem; line-height: 4.6rem; padding: 0; }
  /* line 1671, ../scss/screen.scss */
  .blog-title { font-size: 4rem; letter-spacing: -1px; }
  /* line 1676, ../scss/screen.scss */
  .blog-description { font-size: 1.7rem; line-height: 1.5em; }
  /* line 1681, ../scss/screen.scss */
  .post { font-size: 0.9em; line-height: 1.6em; }
  /* line 1686, ../scss/screen.scss */
  .post-template .post { padding-bottom: 1rem; }
  /* line 1690, ../scss/screen.scss */
  .post-template .post-header { padding: 40px 0; }
  /* line 1694, ../scss/screen.scss */
  .pagination { margin-top: 30px; margin-bottom: 30px; -moz-border-radius: 2px; -webkit-border-radius: 2px; border-radius: 2px; }
  /* line 1700, ../scss/screen.scss */
  h1, h2 { font-size: 2.4rem; line-height: 1.1em; letter-spacing: 0; }
  /* line 1706, ../scss/screen.scss */
  h3 { font-size: 2.0rem; line-height: 2.2rem; }
  /* line 1711, ../scss/screen.scss */
  h4 { font-size: 1.8rem; line-height: 2.0rem; }
  /* line 1716, ../scss/screen.scss */
  h5, h6 { font-size: 1.5rem; line-height: 1.7rem; } }
/* ==========================================================================
10. Media Queries - Smaller than 500px
========================================================================== */
@media only screen and (max-width: 500px) { /* RESPONSIVE INDICATOR */
  /* line 1732, ../scss/screen.scss */
  .jqres { width: 500px; }
  /* line 1736, ../scss/screen.scss */
  #blog-logo img { max-height: 80px; }
  /* line 1740, ../scss/screen.scss */
  .post { width: auto; font-size: 0.8em; line-height: 1.6em; }
  /* line 1749, ../scss/screen.scss */
  .blog-title { font-size: 3rem; }
  /* line 1753, ../scss/screen.scss */
  .blog-description { font-size: 1.5rem; }
  /* line 1757, ../scss/screen.scss */
  .dropcap { font-size: 4.4rem; line-height: 4.6rem; margin: 0 4px 0 0; }
  /* line 1763, ../scss/screen.scss */
  .post-footer { margin-top: 0rem; }
  /* line 1767, ../scss/screen.scss */
  h1, h2 { font-size: 2.4rem; line-height: 1.1em; letter-spacing: 0; }
  /* line 1773, ../scss/screen.scss */
  h3 { font-size: 2.0rem; line-height: 2.2rem; }
  /* line 1778, ../scss/screen.scss */
  h4 { font-size: 1.8rem; line-height: 2.0rem; }
  /* line 1783, ../scss/screen.scss */
  h5, h6 { font-size: 1.5rem; line-height: 1.7rem; }
  /* line 1788, ../scss/screen.scss */
  .post-template .post { padding-bottom: 0; }
  /* line 1792, ../scss/screen.scss */
  .post-template .post-header { padding: 30px 0; }
  /* line 1796, ../scss/screen.scss */
  .post:first-of-type { padding-top: 40px; }
  /* line 1800, ../scss/screen.scss */
  .post-title { font-size: 2.5rem; line-height: 2.9rem; letter-spacing: -1px; padding: 0; text-align: left; }
  /* line 1808, ../scss/screen.scss */
  .post-meta { font-size: 1.3rem; }
  /* line 1812, ../scss/screen.scss */
  .post-footer { padding: 4rem 0; text-align: center; }
  /* line 1817, ../scss/screen.scss */
  .post-footer .author { margin: 0 0 2rem 0; padding: 0 0 1.6rem 0; border-bottom: #EBF2F6 1px dashed; }
  /* line 1823, ../scss/screen.scss */
  .post-footer .share { position: static; width: auto; }
  /* line 1828, ../scss/screen.scss */
  .post-footer .share a { margin: 1.4rem 0.8rem 0 0.8rem; }
  /* line 1832, ../scss/screen.scss */
  .site-footer { margin-top: 6rem; font-size: 1.1rem; } }
/* ==========================================================================
End of file. Media queries should be the last thing here. Do not add stuff
below this point, or it will probably fuck everything up.
========================================================================== */
/* ==========================================================================
Post specific styles
========================================================================== */
/* line 1853, ../scss/screen.scss */
.post.tag-padding-saves-the-day img { border: 1px solid gray; }


text:
<?php

session_start();
if (isset($_SESSION['miSesion'])){
      $arreglo=$_SESSION['miSesion'];
      }else{
        header("Location: ./login.php");

}
 ?>
<!DOCTYPE html>

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

  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1">

  <title>Control Presupuestal </title>

  <link href="../vendors/bootstrap/dist/css/bootstrap.min.css" rel="stylesheet">

  <link href="../vendors/font-awesome/css/font-awesome.min.css" rel="stylesheet">

  <link href="../vendors/nprogress/nprogress.css" rel="stylesheet">

  <link href="../build/css/custom.min.css" rel="stylesheet">

  <link href="../vendors/bootstrap-daterangepicker/daterangepicker.css" rel="stylesheet">

  <link href="../vendors/bootstrap-datetimepicker/build/css/bootstrap-datetimepicker.css" rel="stylesheet">

         <?php include './navar.php'; ?>

         <?php  include "./menuusuario.php";?>

         <?php  include "./barramenu.php";?>

     <?php  include "./topnavigation.php";?>

Registrar un nuevo departamento

Departamento

                <form class="form-horizontal form-label-left" action="./codigos/departamentos.php" method="post" id="formdepa">

Registro del nuevo departamento

                  Información

Has excedido el presupuesto
                                   <button type="button" class="close" data-dismiss="alert" aria-label="Close">
                            ×
                          </button>

                      Nombre *

                      <input class="form-control col-md-7 col-xs-12"
                      name="nombre" id="nombre"
                      placeholder="Nombre del departamento"  type="text"
                      required="required">

                    Presupuesto  *

                    <input class="form-control col-md-7 col-xs-12"
                    name="presupuesto" id="presupuesto"
                    min="0"
                    placeholder="Presupuesto otorgado" type="number"
                     required="required">

                   <button type="submit" class="btn btn-primary">Cancelar</button>
                    <button id="send" type="submit" class="btn btn-success">Guardar</button>

            </form>

     Instituto Tecnológico Superior de Nuevo Casas Grandes


text:
package org.esupportail.smsuapi.dao.beans;

import java.io.Serializable;

/**
 * The class that represents institutions.
 */
public class Institution  implements Serializable {

	/**
	 * Hibernate reference for institution.
	 */
	public static final String REF = "Institution";

	/**
	 * Hibernate property for the label.
	 */
	public static final String PROP_LABEL = "Label";

	/**
	 * Hibernate property for the identifier.
	 */
	public static final String PROP_ID = "Id";

	/**
	 * The serialization id.
	 */
	private static final long serialVersionUID = 5548416143260535777L;

	/**
	 * Institution identifier.
	 */
	private java.lang.Integer id;

	/**
	 * Institution label.
	 */
	private java.lang.String label;

	/**
//	 * Collection of applications associated to the institution.
	 */
	private java.util.Set<Application> applications;

	/**
	 * Bean constructor.
	 */
	public Institution() {
		super();
	}

	/**
	 * Constructor for required fields.
	 */
	public Institution(
			final java.lang.Integer id,
			final java.lang.String label) {

		this.setId(id);
		this.setLabel(label);
	}

	/**
	 * Return the unique identifier of this class.
     * @hibernate.id
     *  generator-class="native"
     *  column="INS_ID"
     */
	public java.lang.Integer getId() {
		return id;
	}

	/**
	 * Set the unique identifier of this class.
	 * @param id the new ID
	 */
	public void setId(final java.lang.Integer id) {
		this.id = id;
	}

	/**
	 * Return the value associated with the column: INS_LABEL.
	 */
	public java.lang.String getLabel() {
		return label;
	}

	/**
	 * Set the value related to the column: INS_LABEL.
	 * @param label the INS_LABEL value
	 */
	public void setLabel(final java.lang.String label) {
		this.label = label;
	}

	/**
	 * Return the value associated with the column: Applications.
	 */
	public java.util.Set<Application> getApplications() {
		return applications;
	}

	/**
	 * Set the value related to the column: Applications.
	 * @param applications the Applications value
	 */
	public void setApplications(final java.util.Set<Application> applications) {
		this.applications = applications;
	}

	/**
	 * Add the application to the collection associated to the institution.
	 * @param application
	 */
	public void addToApplications(final Application application) {
		if (null == getApplications()) {
			setApplications(new java.util.TreeSet<Application>());
		}
		getApplications().add(application);
	}

	/**
	 * @see java.lang.Object#hashCode()
	 */
	@Override
	public boolean equals(final Object obj) {
		if (null == obj) {
			return false;
		}
		if (!(obj instanceof Institution)) {
			return false;
		} else {
			Institution institution = (Institution) obj;
			if (null == this.getId() || null == institution.getId()) {
				return false;
			} else {
				return this.getId().equals(institution.getId());
			}
		}
	}

	/**
	 * @see java.lang.Object#hashCode()
	 */
	@Override
	public int hashCode() {
		return super.hashCode();
	}

	/**
	 * @see java.lang.Object#toString()
	 */
	@Override
	public String toString() {
		return "Account#" + hashCode() + "[id=[" + id + "], label=[" + label
		+  "]]";
	}

}


text:
class NameAndNumberKeyFactory < Toy::Identity::AbstractKeyFactory
  def next_key(object)
    "#{object.name}-#{object.number}" unless object.name.nil? || object.number.nil?
  end
end


text:
namespace atom {

// Singleton to remember the original "argc" and "argv".
class AtomCommandLine {
 public:
  static void Init(int argc, const char* const* argv);
  static std::vector<std::string> argv() { return argv_; }

#if defined(OS_LINUX)
  // On Linux the command line has to be read from base::CommandLine since
  // it is using zygote.
  static void InitializeFromCommandLine();
#endif

 private:
  static std::vector<std::string> argv_;

  DISALLOW_IMPLICIT_CONSTRUCTORS(AtomCommandLine);
};

}  // namespace atom

#endif  // ATOM_COMMON_ATOM_COMMAND_LINE_H_


text:
'use strict';

module.exports = function (message) {
    Error.captureStackTrace(this, this.constructor);
    this.name = this.constructor.name;
    this.message = message || 'AccessKeyId or Secret Key  is missing';
};

require('util').inherits(module.exports, Error);


text:
<?php

namespace CultureKings\Afterpay\Model\Merchant;

use DateTime;

/**
 * Class ShippingCourier
 *
 * @package CultureKings\Afterpay\Model\Merchant
 */
class ShippingCourier
{
    /**
     * @var DateTime
     */
    protected $shippedAt;
    /**
     * @var string
     */
    protected $name;
    /**
     * @var string
     */
    protected $tracking;
    /**
     * @var string
     */
    protected $priority;

    /**
     * @return DateTime
     */
    public function getShippedAt()
    {
        return $this->shippedAt;
    }

    /**
     * @return string
     */
    public function getName()
    {
        return $this->name;
    }

    /**
     * @return string
     */
    public function getTracking()
    {
        return $this->tracking;
    }

    /**
     * @return string
     */
    public function getPriority()
    {
        return $this->priority;
    }

    /**
     * @param DateTime $shippedAt
     * @return $this
     */
    public function setShippedAt(DateTime $shippedAt)
    {
        $this->shippedAt = $shippedAt;

        return $this;
    }

    /**
     * @param string $name
     * @return $this
     */
    public function setName($name)
    {
        $this->name = $name;

        return $this;
    }

    /**
     * @param string $tracking
     * @return $this
     */
    public function setTracking($tracking)
    {
        $this->tracking = $tracking;

        return $this;
    }

    /**
     * @param string $priority
     * @return $this
     */
    public function setPriority($priority)
    {
        $this->priority = $priority;

        return $this;
    }
}


text:
import React from 'react';
import { storiesOf, action, linkTo } from '@kadira/storybook';
import Button from './Button';
import Welcome from './Welcome';
import Scrap from '../scrappyr/static/js/scraps/components/scrap.js'

import '../scrappyr/static/sass/main.scss'

storiesOf('Welcome', module)
  .add('to Storybook', () => (
    <Welcome showApp={linkTo('Button')}/>
  ));

storiesOf('Button', module)
  .add('with text', () => (
    <Button onClick={action('clicked')}>Hello Button</Button>
  ))
  .add('with some emoji', () => (
    <Button onClick={action('clicked')}>😀 😎 👍 💯</Button>
  ));

const scrap_list = [
    { raw_title: "hi", html_title: "
hi
" },
];

storiesOf('Scrap', module)
  .add('to Storybook', () => (
      <Scrap scrap={scrap_list[0]}/>
  ));


text:
package com.demo.app.configuration.cache;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

@Target({ ElementType.TYPE })
@Retention(RetentionPolicy.RUNTIME)
public @interface Cacheable {

}