text:
angular
    .module('HomeCtrl', [])
    .controller('HomeController', ['$scope', '$route', '$q', 'AuthenticationService', 'CourseFactory', 'SelectionFactory',
        function ($scope, $route, $q, AuthService, CourseFactory, SelectionFactory) {
            $scope.authenticated = AuthService.authenticated();

            $scope.user = AuthService.getUser();

            if ($scope.user && $scope.authenticated) {
                $q.all([
                    CourseFactory.getAll(),
                    SelectionFactory.getAll($scope.user._id)
                ]).then(function (values) {

                    var courseResp = values[0].data;
                    var selectionResp = values[1].data;

                    $scope.courses = courseResp.result.map(function (el) {
                        // to be able to search on those frields
                        el.from = el.from + "";
                        el.to = el.to + "";
                        return el;
                    });
                    $scope.selectedCourses = $scope.courses.filter(function (el) {
                        for (var i = 0; i < selectionResp.result.length; i++) {
                            if (selectionResp.result[i].courseId == el._id) {
                                return true;
                            }
                        }
                        return false;
                    });

                    var timetable = new Timetable();
                    var start = 12;
                    var end = 12;
                    timetable.addLocations(["Понеделник", "Вторник", "Сряда", "Четвъртък", "Петък", "Събота", "Неделя"]);
                    for (var i = $scope.selectedCourses.length - 1; i >= 0; i--) {
                        var course = $scope.selectedCourses[i];
                        start = Math.min(start, parseInt(course.from));
                        end = Math.max(end, parseInt(course.to));
                        timetable.addEvent(course.name, course.day, new Date(2015, 7, 17, course.from, 0), new Date(2015, 7, 17, course.to, 0));
                    };
                    timetable.setScope(start, end);
                    var renderer = new Timetable.Renderer(timetable);
                    renderer.draw('.timetable'); // any css selector

                    $scope.addCourse = function (course) {
                        for (var i = $scope.selectedCourses.length - 1; i >= 0; i--) {
                            if ($scope.selectedCourses[i]._id == course._id) {
                                alert("This course is already added.");
                                return;
                            }
                        };
                        for (var i = $scope.selectedCourses.length - 1; i >= 0; i--) {
                            if ($scope.selectedCourses[i].day == course.day) {
                                if (($scope.selectedCourses[i].from <= course.to && course.to <= $scope.selectedCourses[i].to) ||
                                    $scope.selectedCourses[i].from <= course.from && course.from <= $scope.selectedCourses[i].to) {

                                    var confirm = window.confirm("The time of the course " + course.name + " overlapse with the course " +
                                        $scope.selectedCourses[i].name + ". Are you sure you want to add it?");

                                    if (!confirm) {
                                        return;
                                    }
                                }
                            }
                        };
                        start = Math.min(start, parseInt(course.from));
                        end = Math.max(end, parseInt(course.to));

                        timetable.setScope(start, end);
                        timetable.addEvent(course.name, course.day, new Date(2015, 7, 17, course.from, 0), new Date(2015, 7, 17, course.to, 0));
                        renderer.draw('.timetable'); // any css selector

                        $scope.selectedCourses.push(course);
                        SelectionFactory.add($scope.user._id, course._id);
                    }

                    $scope.removeCourse = function (course) {
                        var index = -1;

                        timetable = new Timetable();
                        renderer = new Timetable.Renderer(timetable);
                        start = 8;
                        end = 18;
                        timetable.setScope(start, end);
                        timetable.addLocations(["Понеделник", "Вторник", "Сряда", "Четвъртък", "Петък", "Събота", "Неделя"]);
                        for (var i = $scope.selectedCourses.length - 1; i >= 0; i--) {
                            var c = $scope.selectedCourses[i];
                            if (c._id != course._id) {
                                start = Math.min(start, parseInt(c.from));
                                end = Math.max(end, parseInt(c.to));

                                timetable.addEvent(c.name, c.day, new Date(2015, 7, 17, c.from, 0), new Date(2015, 7, 17, c.to, 0));
                            } else {
                                index = i;
                            }
                        };
                        SelectionFactory.remove($scope.user._id, $scope.selectedCourses[index]._id);

                        $scope.selectedCourses.splice(index, 1);
                        timetable.setScope(start, end);

                        renderer.draw('.timetable'); // any css selector
                    }
                });
            }

            $scope.logout = function () {
                AuthService.logout();
                $route.reload();
            }
        }
    ]);

redpajama_set_name: RedPajamaGithub


text:
<?php

namespace ReputationVIP\Bundle\QueueClientBundle\Command;

use InvalidArgumentException;
use ReputationVIP\Bundle\QueueClientBundle\Configuration\QueuesConfiguration;
use ReputationVIP\QueueClient\QueueClientInterface;
use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand;
use Symfony\Component\Config\Definition\Processor;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Console\Question\ConfirmationQuestion;
use Symfony\Component\Yaml\Yaml;

class PurgeQueuesCommand extends ContainerAwareCommand
{
    /** @var QueueClientInterface */
    private $queueClient;

    public function __construct(QueueClientInterface $queueClient)
    {
        parent::__construct();

        $this->queueClient = $queueClient;
    }

    protected function configure()
    {
        $this
            ->setName('queue-client:purge-queues')
            ->setDescription('Purge queues')
            ->addOption('file', 'f', InputOption::VALUE_REQUIRED, 'File to read')
            ->addOption('force', null, InputOption::VALUE_NONE, 'If set, the task will not ask for confirm purge')
            ->addOption('priority', 'p', InputOption::VALUE_OPTIONAL, 'Get messages from specific priority')
            ->addArgument('queues', InputArgument::IS_ARRAY, 'queues to purge')
            ->setHelp(<<<HELP
This command purges queues.

Specify file in config file:
queue_client:
    queues_file: path/to/file.yml

Or specify file with file option:
    --file=path/to/file.yml

Or list queues to purge:
    queue-client:purge-queues queue1 queue2 queue3
HELP
            );
    }

    /**
     * @param OutputInterface $output
     * @param $fileName
     * @param $priority
     * @return int
     */
    private function purgeFromFile(OutputInterface $output, $fileName, $priority)
    {
        try {
            $processor = new Processor();
            $configuration = new QueuesConfiguration();
            $processedConfiguration = $processor->processConfiguration($configuration, Yaml::parse(file_get_contents($fileName)));

        } catch (\Exception $e) {
            $output->writeln($e->getMessage());

            return 1;
        }
        array_walk_recursive($processedConfiguration, 'ReputationVIP\Bundle\QueueClientBundle\QueueClientFactory::resolveParameters', $this->getContainer());
        $output->writeln('Start purge queue.');
        foreach ($processedConfiguration[QueuesConfiguration::QUEUES_NODE] as $queue) {
            $queueName = $queue[QueuesConfiguration::QUEUE_NAME_NODE];
            try {
                $this->queueClient->purgeQueue($queueName, $priority);
                $output->writeln('Queue ' . $queueName . ' purged.');
            } catch (\Exception $e) {
                $output->writeln($e->getMessage());
            }
        }
        $output->writeln('End purge queue.');

        return 0;
    }

    /**
     * @param InputInterface $input
     * @param OutputInterface $output
     * @return int
     */
    protected function execute(InputInterface $input, OutputInterface $output)
    {
        $helper = $this->getHelper('question');
        $force = $input->getOption('force') ? true : false;

        $priority = null;
        if ($input->getOption('priority')) {
            $priority = $input->getOption('priority');
            if (!in_array($priority, $this->queueClient->getPriorityHandler()->getAll())) {
                throw new \InvalidArgumentException('Priority "' . $priority . '" not found.');
            }
        }
        if ($input->getOption('file')) {
            $fileName = $input->getOption('file');
            if (!($force || $helper->ask($input, $output, new ConfirmationQuestion('Purge queues in file "' . $fileName . '"?', false)))) {

                return 0;
            }

            return $this->purgeFromFile($output, $fileName, $priority);
        } else {
            $queues = $input->getArgument('queues');
            if (count($queues)) {
                if (!($force || $helper->ask($input, $output, new ConfirmationQuestion(implode("\n", $queues) . "\nPurge queues list above?" , false)))) {

                    return 0;
                }
                foreach ($queues as $queue) {
                    try {
                        $this->queueClient->purgeQueue($queue, $priority);
                        $output->writeln('Queue ' . $queue . ' purged.');
                    } catch (\Exception $e) {
                        $output->writeln($e->getMessage());
                    }
                }

                return 0;
            }
            try {
                $fileName = $this->getContainer()->getParameter('queue_client.queues_file');
                if (!($force || $helper->ask($input, $output, new ConfirmationQuestion('Purge queues in file "' . $fileName . '"?', false)))) {

                    return 0;
                }

                return $this->purgeFromFile($output, $fileName, $priority);
            } catch (InvalidArgumentException $e) {
                $output->writeln('No queue_client.queues_file parameter found.');

                return 1;
            }
        }
    }
}


text:
Configuring ``logging``
=======================

.. csv-table::
  :class: page-info

  "Page updated: 23rd July 2013", ""

Opbeat supports the ability to directly tie into the :mod:`logging` module.  To
use it simply add :class:`OpbeatHandler` to your logger.

First you'll need to configure a handler

.. code::
    :class: language-python

    from opbeat.handlers.logging import OpbeatHandler

    # Manually specify a client
    client = Client(...)
    handler = OpbeatHandler(client)

.. You can also automatically configure the default client with a DSN::

..     # Configure the default client
..     handler = OpbeatHandler('http://public:secret@example.com/1')

Finally, call the :func:`setup_logging` helper function

.. code::
    :class: language-python

    from opbeat.conf import setup_logging

    setup_logging(handler)

Usage
~~~~~

A recommended pattern in logging is to simply reference the modules name for
each logger, so for example, you might at the top of your module define the
following

.. code::
    :class: language-python

    import logging
    logger = logging.getLogger(__name__)

You can also use the ``exc_info`` and ``extra={'stack': True}`` arguments on
your ``log`` methods. This will store the appropriate information and allow
Opbeat to render it based on that information

.. code::
    :class: language-python

    logger.error('There was some crazy error', exc_info=True, extra={
        'culprit': 'my.view.name',
    })

You may also pass additional information to be stored as meta information with
the event. As long as the key name is not reserved and not private (_foo) it
will be displayed on the Opbeat dashboard. To do this, pass it as ``data``
within your ``extra`` clause

.. code::
    :class: language-python

    logger.error('There was some crazy error', exc_info=True, extra={
        # Optionally you can pass additional arguments to specify request info
        'culprit': 'my.view.name',

        'data': {
            # You may specify any values here and Opbeat will log and output them
            'username': request.user.username,
        }
    })

.. container:: note

    The ``url`` and ``view`` keys are used internally by Opbeat within the extra data.

.. container:: note

    Any key (in ``data``) prefixed with ``_`` will not automatically output on the Opbeat details view.

|

Opbeat will intelligently group messages if you use proper string formatting. For example, the following messages would
be seen as the same message within Opbeat

.. code::
    :class: language-python

    logger.error('There was some %s error', 'crazy')
    logger.error('There was some %s error', 'fun')
    logger.error('There was some %s error', 1)

The :mod:`logging` integration also allows easy capture of
stack frames (and their locals) as if you were logging an exception. This can
be done automatically with the ``AUTO_LOG_STACKS`` setting, as well as
by passing the ``stack`` boolean to ``extra``

.. code::
    :class: language-python

    logger.error('There was an error', extra={
        'stack': True,
    })

.. .. container:: note

..     Other languages that provide a logging package that is comparable to the
..     python :mod:`logging` package may define an Opbeat handler.  Check the
..     `Extending Opbeat
..     <http://sentry.readthedocs.org/en/latest/developer/client/index.html>`_
..     documentation.


text:
using System;
using System.Windows.Forms;
using Gorgon.UI;

namespace Gorgon.Examples
{
    /// <summary>
    /// Main application.
    /// </summary>
    static class Program
    {
        #region Methods.
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        [STAThread]
        static void Main()
        {
            try
            {
#if NET6_0_OR_GREATER
                Application.SetHighDpiMode(HighDpiMode.PerMonitorV2);
#endif
                Application.EnableVisualStyles();
                Application.SetCompatibleTextRenderingDefault(false);

                GorgonApplication.Run(new Form());
            }
            catch (Exception ex)
            {
                GorgonExample.HandleException(ex);
            }
            finally
            {
                GorgonExample.UnloadResources();
            }
        }
        #endregion
    }
}


text:
package controllers

import util.{ControllerUtils, ComponentRegister, Implicits}

/**
 * 包默认
 */
package object systemmanage extends Implicits with ComponentRegister with ControllerUtils{

}


text:
"""tensorflow dataset (tfds) for srn_cars."""
import imageio
import numpy as np
import tensorflow as tf
import tensorflow_datasets as tfds

_DESCRIPTION = """
Convert srn_cars dataset into a tensorflow dataset (tfds).

It should also contain any processing which has been applied (if any),
(e.g. corrupted example skipped, images cropped,...):
"""

_CITATION = """
@article{dupont2020equivariant,
  title={Equivariant Neural Rendering},
  author={Dupont, Emilien and Miguel Angel, Bautista and Colburn, Alex and Sankar, Aditya and Guestrin, Carlos and Susskind, Josh and Shan, Qi},
  journal={arXiv preprint arXiv:2006.07630},
  year={2020}
}
"""

class SrnCars(tfds.core.GeneratorBasedBuilder):
  """DatasetBuilder for srn_cars dataset."""

  VERSION = tfds.core.Version('1.0.0')
  RELEASE_NOTES = {
      '1.0.0': 'Initial release.',
  }

  def _info(self) -> tfds.core.DatasetInfo:
    """Returns the dataset metadata."""
    return tfds.core.DatasetInfo(
        builder=self,
        description=_DESCRIPTION,
        features=tfds.features.FeaturesDict({
            'images':
                tfds.features.Tensor(shape=(None, 128, 128, 3), dtype=tf.uint8),
            'poses':
                tfds.features.Tensor(shape=(None, 4, 4), dtype=tf.float32),
            'focal':
                tfds.features.Scalar(dtype=tf.float32)
        }),
        supervised_keys=None,  # Set to `None` to disable
        disable_shuffling=True,  # Fix ordering as scenes are already shuffled
        homepage='https://github.com/apple/ml-equivariant-neural-rendering',
        citation=_CITATION,
    )

  def _split_generators(self, dl_manager: tfds.download.DownloadManager):
    """Returns SplitGenerators."""
    path = dl_manager.download_and_extract(
        'https://drive.google.com/uc?export=download&confirm=9iBg'
        '&id=19yDsEJjx9zNpOKz9o6AaK-E8ED6taJWU')

    return {
        'train': self._generate_examples(path / 'cars_train'),
        'test': self._generate_examples(path / 'cars_test'),
    }

  def _generate_examples(self, path):
    """Yields examples."""
    # Coordinate transform matrix required to make SRN poses consistent
    # with other NeRF models
    coord_trans = np.diag(np.array([1., -1., -1., 1.], dtype=np.float32))

    for key, scene_path in enumerate(sorted(path.iterdir())):
      # Load intrinsics
      intrinsics_path = scene_path / 'intrinsics.txt'
      with intrinsics_path.open() as f:
        lines = f.readlines()
        # Extract focal length (required to obtain rays)
        focal = float(lines[0].split()[0])

      # Load images and their associated pose
      pose_dir = scene_path / 'pose'
      rgb_dir = scene_path / 'rgb'
      pose_paths = sorted(list(pose_dir.iterdir()))
      rgb_paths = sorted(list(rgb_dir.iterdir()))

      all_imgs = []
      all_poses = []
      for rgb_path, pose_path in zip(rgb_paths, pose_paths):
        img = imageio.imread(str(rgb_path))[..., :3]
        pose = np.loadtxt(str(pose_path), dtype=np.float32).reshape(4, 4)
        pose = pose @ coord_trans  # Fix coordinate system
        all_imgs.append(img)
        all_poses.append(pose)

      all_imgs = np.stack(all_imgs)
      all_poses = np.stack(all_poses)

      yield key, {
          'images': all_imgs,
          'poses': all_poses,
          'focal': focal,
      }


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Uses of Interface org.apache.hadoop.yarn.event.EventHandler (Apache Hadoop Main 2.7.3 API)</title>
<meta name="date" content="2016-08-18">
<link rel="stylesheet" type="text/css" href="../../../../../../stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev

Next

Frames

No Frames

All Classes

Uses of Interface
org.apache.hadoop.yarn.event.EventHandler

Packages that use EventHandler

Package
Description

org.apache.hadoop.yarn.event

Uses of EventHandler in org.apache.hadoop.yarn.event

Fields in org.apache.hadoop.yarn.event with type parameters of type EventHandler

Modifier and Type
Field and Description

protected Map<Class<? extends Enum>,EventHandler>
AsyncDispatcher.eventDispatchers

Methods in org.apache.hadoop.yarn.event that return EventHandler

Modifier and Type
Method and Description

EventHandler
AsyncDispatcher.getEventHandler()

EventHandler
Dispatcher.getEventHandler()

Methods in org.apache.hadoop.yarn.event with parameters of type EventHandler

Modifier and Type
Method and Description

void
AsyncDispatcher.register(Class<? extends Enum> eventType,
                EventHandler handler)

void
Dispatcher.register(Class<? extends Enum> eventType,
                EventHandler handler)

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev

Next

Frames

No Frames

All Classes

Copyright © 2016 Apache Software Foundation. All rights reserved.


text:
document.getElementsByTagName('body')[0].appendChild(document.createElement('script')).setAttribute('src','https://www.mendeley.com/minified/bookmarklet.js');

//for the current bookmarklet.js sourcecode refer to mendeleysource.txt
//'https://www.mendeley.com/minified/bookmarklet.js' is the url the bookmark fetches


text:
var nano = require("nano"),
    Promise = require("bluebird");

// Returns a Promise that resolves with a handle to a blank testing DB.
module.exports = function resetTestDB() {
    var DB_NAME = "test",
        n = null;

    return Promise.try(() => {
        if (!process.env.DB) {
            throw new Error("DB envvar is undefined");
        }

        n = nano(process.env.DB);
        return Promise.promisify(n.db.destroy)("test");
    })
        .catch(NanoNotFoundError, () => {})
        .then(() => {
            return Promise.promisify(n.db.create)("test");
        })
        .then(() => {
            return n.use(DB_NAME);
        });
};

// Returns true iff the provided error is a Nano "Not Found" error.
function NanoNotFoundError(e) {
    return e && e.error == "not_found";
}


text:
package com.amazonaws.services.resourceexplorer2.model.transform;

import javax.annotation.Generated;

import com.amazonaws.SdkClientException;
import com.amazonaws.services.resourceexplorer2.model.*;

import com.amazonaws.protocol.*;
import com.amazonaws.annotation.SdkInternalApi;

/**
 * SupportedResourceTypeMarshaller
 */
@Generated("com.amazonaws:aws-java-sdk-code-generator")
@SdkInternalApi
public class SupportedResourceTypeMarshaller {

    private static final MarshallingInfo<String> RESOURCETYPE_BINDING = MarshallingInfo.builder(MarshallingType.STRING)
            .marshallLocation(MarshallLocation.PAYLOAD).marshallLocationName("ResourceType").build();
    private static final MarshallingInfo<String> SERVICE_BINDING = MarshallingInfo.builder(MarshallingType.STRING).marshallLocation(MarshallLocation.PAYLOAD)
            .marshallLocationName("Service").build();

    private static final SupportedResourceTypeMarshaller instance = new SupportedResourceTypeMarshaller();

    public static SupportedResourceTypeMarshaller getInstance() {
        return instance;
    }

    /**
     * Marshall the given parameter object.
     */
    public void marshall(SupportedResourceType supportedResourceType, ProtocolMarshaller protocolMarshaller) {

        if (supportedResourceType == null) {
            throw new SdkClientException("Invalid argument passed to marshall(...)");
        }

        try {
            protocolMarshaller.marshall(supportedResourceType.getResourceType(), RESOURCETYPE_BINDING);
            protocolMarshaller.marshall(supportedResourceType.getService(), SERVICE_BINDING);
        } catch (Exception e) {
            throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);
        }
    }

}


text:
Previously available binaries distributed via Maven have been removed as they
redistributed Category-X binaries in violation of Apache Software Foundation
(ASF) policies.

At this point in time, no third-party binary Java packages are available. Please
follow the build from source instructions linked above.


text:
<def-group>
  <definition class="compliance" id="file_groupowner_etc_gshadow" version="1">
    <metadata>
      <title>Verify group who owns 'gshadow' file</title>
      <affected family="unix">
        <platform>Red Hat Enterprise Linux 6</platform>
        <platform>Red Hat Enterprise Linux 7</platform>
      </affected>
      <description>The /etc/gshadow file should be owned by the appropriate
      group.</description>
      <reference source="swells" ref_id="20130918" ref_url="test_attestation" />
    </metadata>
    <criteria>
      <criterion test_ref="test_file_groupowner_etc_gshadow" />
    </criteria>
  </definition>
  <unix:file_test check="all" check_existence="all_exist"
  comment="Testing gshadow ownership" id="test_file_groupowner_etc_gshadow"
  version="1">
    <unix:object object_ref="object_file_groupowner_etc_gshadow" />
    <unix:state state_ref="state_file_groupowner_etc_gshadow" />
  </unix:file_test>
  <unix:file_state id="state_file_groupowner_etc_gshadow" version="1">
    <unix:group_id datatype="int">0</unix:group_id>
  </unix:file_state>
  <unix:file_object comment="/etc/gshadow"
  id="object_file_groupowner_etc_gshadow" version="1">
    <unix:filepath>/etc/gshadow</unix:filepath>
  </unix:file_object>
</def-group>


text:
id: 6145f3a5cd9be60b9459cdd6
title: Step 37
challengeType: 0
dashedName: step-37
---

# --description--

Link the first `label` element to the `select` element, and give the `select` element a `name` attribute.

# --hints--

You should give the `label` element a `for` attribute.

```js
assert.notEmpty(document.querySelector('.question-block > label')?.htmlFor);
```

You should give the `select` element an `id` attribute.

```js
assert.notEmpty(document.querySelector('.answer > select')?.id);
```

You should give the `select` element an `id` matching the `for` attribute of the `label` element.

```js
assert.equal(document.querySelector('.answer > select')?.id, document.querySelector('.question-block > label')?.htmlFor);
```

You should give the `select` element a `name` attribute.

```js
assert.notEmpty(document.querySelector('.answer > select')?.name);
```

# --seed--

## --seed-contents--

```html
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <meta name="description" content="freeCodeCamp Accessibility Quiz practice project" />
    <title>freeCodeCamp: Accessibility Quiz</title>
    <link rel="stylesheet" href="styles.css" />
  </head>
  <body>
    <header>
      <img id="logo" src="https://cdn.freecodecamp.org/platform/universal/fcc_primary.svg">
      <h1>HTML/CSS Quiz</h1>
      <nav>
        <ul>
          <li><a href="#student-info">INFO</a></li>
          <li><a href="#html-questions">HTML</a></li>
          <li><a href="#css-questions">CSS</a></li>
			  </ul>
      </nav>
    </header>
    <main>
      <form method="post" action="https://freecodecamp.org/practice-project/accessibility-quiz">
        <section role="region" aria-labelledby="student-info">
          <h2 id="student-info">Student Info</h2>
          <div class="info">
            <label for="student-name">Name:</label>
            <input type="text" name="student-name" id="student-name" />
          </div>
          <div class="info">
            <label for="student-email">Email:</label>
            <input type="email" name="student-email" id="student-email" />
          </div>
          <div class="info">
            <label for="birth-date">D.O.B.<span class="sr-only">(Date of Birth)</span></label>
            <input type="date" name="birth-date" id="birth-date" />
          </div>
        </section>
        <section role="region" aria-labelledby="html-questions">
          <h2 id="html-questions">HTML</h2>
          <div class="question-block">
            <p>1</p>
            <fieldset class="question" name="html-question-one">
              <legend>
                The legend element represents a caption for the content of its
                parent fieldset element
              </legend>
              <ul class="answers-list">
                <li>
                  <label for="q1-a1">
                    <input type="radio" id="q1-a1" name="q1" value="true" />
                    True
                  </label>
                </li>
                <li>
                  <label for="q1-a2">
                    <input type="radio" id="q1-a2" name="q1" value="false" />
                    False
                  </label>
                </li>
              </ul>
            </fieldset>
          </div>
          <div class="question-block">
            <p>2</p>
            <fieldset class="question" name="html-question-two">
              <legend>
                A label element nesting an input element is required to have a
                for attribute with the same value as the input's id
              </legend>
              <ul class="answers-list">
                <li>
                  <label for="q2-a1">
                    <input type="radio" id="q2-a1" name="q2" value="true" />
                    True
                  </label>
                </li>
                <li>
                  <label for="q2-a2">
                    <input type="radio" id="q2-a2" name="q2" value="false" />
                    False
                  </label>
                </li>
              </ul>
            </fieldset>
          </div>
        </section>
        <section role="region" aria-labelledby="css-questions">
          <h2 id="css-questions">CSS</h2>
          <div class="formrow">
--fcc-editable-region--
            <div class="question-block">
              <label>Are you a frontend developer?</label>
            </div>
            <div class="answer">
              <select required>
                <option value="">Select an option</option>
                <option value="yes">Yes</option>
                <option value="no">No</option>
              </select>
            </div>
--fcc-editable-region--
            <div class="question-block">
              <label>Do you have any questions:</label>
            </div>
            <div class="answer">
            </div>
          </div>
        </section>
      </form>
    </main>
  </body>
</html>

```

```css
body {
  background: #f5f6f7;
	color: #1b1b32;
	font-family: Helvetica;
	margin: 0;
}

header {
  width: 100%;
	height: 50px;
	background-color: #1b1b32;
	display: flex;
}

#logo {
  width: max(100px, 18vw);
	background-color: #0a0a23;
  aspect-ratio: 35 / 4;
	padding: 0.4rem;
}

h1 {
  color: #f1be32;
	font-size: min(5vw, 1.2em);
}

nav {
  width: 50%;
	max-width: 300px;
	height: 50px;
}

nav > ul {
  display: flex;
	justify-content: space-evenly;
}

h1,
h2 {
  font-family: Verdana, Tahoma;
}

h2 {
  border-bottom: 4px solid #dfdfe2;
}

p::before {
  content: "Question #";
}

.sr-only {
  position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

```


text:
<?php

namespace Tecnokey\ShopBundle\Entity\Shop;

use Tecnokey\ShopBundle\Entity\Shop\Image;

use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Validator\Constraints as Assert;

/**
 * Tecnokey\ShopBundle\Entity\Shop\Category
 *
 * @ORM\Table(name="shop_category")
 * @ORM\Entity(repositoryClass="Tecnokey\ShopBundle\Repository\CategoryRepository")
 * @ORM\HasLifecycleCallbacks
 */
class Category
{
    /**
     * @var integer $id
     *
     * @ORM\Column(name="id", type="integer")
     * @ORM\Id
     * @ORM\GeneratedValue(strategy="AUTO")
     */
    private $id;

    /**
     * @var string $name
     *
     * @ORM\Column(name="name", type="string", length=255, nullable=true)
     */
    private $name;

    /**
     * @var text $description
     *
     * @ORM\Column(name="description", type="text", nullable=true)
     */
    private $description;

    /**
     * @var datetime $createdAt
     *
     * @ORM\Column(name="createdAt", type="datetime", nullable=true)
     */
    private $createdAt;

    /**
     * @var datetime $modifiedAt
     *
     * @ORM\Column(name="modifiedAt", type="datetime", nullable=true)
     */
    private $modifiedAt;

    /**
     * @Assert\Type(type="Tecnokey\ShopBundle\Entity\Shop\Image")
     *
     *
     * @ORM\ManyToOne(targetEntity="Image", cascade={"persist", "remove"})
     * @ORM\JoinColumn(name="imageId", referencedColumnName="id", nullable=true)
     *
     * @var Image $image
     */
    private $image;

    /**
     * @ORM\ManyToOne(targetEntity="Category", inversedBy="categories", cascade={"persist"})
     * @ORM\JoinColumn(name="parentCategoryId", referencedColumnName="id")
     *
     * @var Category $parentCategory
     */
    private $parentCategory;

    /**
     * //added cascade persist on 02/12/2011 as another way to save the parentCategory when only changing the array of categories directly but it's not tested that this way works (without setting the parentCategory manually)
     * @ORM\OneToMany(targetEntity="Category", mappedBy="parentCategory", cascade={"persist"})
     * @var ArrayCollection $categories
     */
    private $categories;

    /**
     *
     * @ORM\OneToMany(targetEntity="Product", mappedBy="category")
     * @var ArrayCollection $products
     */
    private $products;

    /**
     *
     * @ORM\ManyToOne(targetEntity="TimeOffer", cascade={"persist", "remove", "detached"})
     * @ORM\JoinColumn(name="offerId", referencedColumnName="id", nullable=true)
     *
     * @var TimeOffer $offer
     */
    private $offer;

    public function __construct(){
        $this->createdAt = new \DateTime();
    }

    public function getOffer() {
        return $this->offer;
    }

    public function setOffer($offer) {
        $this->offer = $offer;
    }

    /**
     * @return the $products
     */
    public function getProducts() {
            return $this->products;
    }

    /**
     * @param ArrayCollection $products
     */
    public function setProducts($products) {
            $this->products = $products;
    }

    /**
     * @return Category $parentCategory
     */
    public function getParentCategory() {
            return $this->parentCategory;
    }

    /**
     *
     * @param Category $category
     */
    protected function addCategory(Category $category){
        if($this->categories == null){
            $this->categories = new ArrayCollection();
        }
        $this->categories [] = $category;

        $category->setParentCategory($this); //IMPORTANT FOR THE SQL MAPPING AS THE PARENT CATEGORY IS WHAT KEEP THE HIERARCHY/DEPENDENCY INFO IN THE DATABASE BETWEEN CATEGORIES
    }

    /**
     * @return ArrayCollection $categories
     */
    public function getCategories() {
            return $this->categories;
    }

    /**
     * @param ArrayCollection $categories
     */
    protected function setCategories($categories) {
            $this->categories = $categories;
    }

    /**
     * @param Category $parentCategory
     */
    public function setParentCategory($parentCategory) {
            $this->parentCategory = $parentCategory;
    }

    /**
     * Get id
     *
     * @return integer
     */
    public function getId()
    {
        return $this->id;
    }

    /**
     * Set id
     *
     * @param integer $id
     */
    public function setId($id) {
        $this->id = $id;
    }

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

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

    /**
     * Set description
     *
     * @param text $description
     */
    public function setDescription($description)
    {
        $this->description = $description;
    }

    /**
     * Get description
     *
     * @return text
     */
    public function getDescription()
    {
        return $this->description;
    }

    /**
     * Set createdAt
     *
     * @param datetime $createdAt
     */
    public function setCreatedAt($createdAt)
    {
        $this->createdAt = $createdAt;
    }

    /**
     * Get createdAt
     *
     * @return datetime
     */
    public function getCreatedAt()
    {
        return $this->createdAt;
    }

    /**
     * Set modifiedAt
     *
     * @param datetime $modifiedAt
     */
    public function setModifiedAt($modifiedAt)
    {
        $this->modifiedAt = $modifiedAt;
    }

    /**
     * Get modifiedAt
     *
     * @return datetime
     */
    public function getModifiedAt()
    {
        return $this->modifiedAt;
    }

    /**
     *
     * Get image
     *
     * @return Image
     */
    public function getImage(){
    	return $this->image;
    }

    /**
     *
     * Set image
     *
     * @param Image $image
     */
    public function setImage($image){
        $this->image = $image;
    }

    public function getRootCategory(){
        $parentCategory = $this->getParentCategory();
        if($parentCategory== NULL){
            return $this;
        }
        else{
            return $parentCategory->getRootCategory();
        }
    }

    public function getHierarchyDepth(){
        $parentCategory = $this->getParentCategory();
        if($parentCategory== NULL){
            return 1;
        }

        else{
            return 1 + $parentCategory->getHierarchyDepth();
        }
    }

    public function __toString() {
       $depth = $this->getHierarchyDepth();

       $contentStart = "";
       $contentEnd = "";
       $name = $this->getName();

       if($depth == 1){
           $contentStart = "";
           $contentEnd = "";
           $name = strtoupper($name);
       }
       else{

           //capitalize first character
           $name = strtolower($name);
           $name = ucfirst($name);
           //end capitalizing first character

           $depth = 2 * ($depth -1);
           for ($index = 0; $index < $depth; $index++) {
               $contentStart .='-';
           }
       }
       return $contentStart . "  " . $name . "  " . $contentEnd;
    }

    /**
     *
     * @param array $ancestors
     * @return array
     */
    public function getAncestors(){
        if($this->getParentCategory() == NULL){
            return array();
        }
        else{
            $ancestors = $this->getParentCategory()->getAncestors();
            $ancestor = $this->getParentCategory();
            $ancestors[] = $ancestor;

            return $ancestors;
        }

        //return array($this, $this, $this);
    }

    function __clone(){
        // If the entity has an identity, proceed as normal.
        if ($this->id) {

        }
        // otherwise do nothing, do NOT throw an exception!

        //reset images
        if($this->image){
            $this->image = NULL;
        }
        //end reseting the images
    }

    /**
     * Invoked before the entity is updated.
     *
     * @ORM\PreUpdate
     */
    public function preUpdate()
    {
        $this->updatedAt = new \DateTime();
    }

}