text:
from __future__ import print_function
import os
import sys
import itertools
import traceback
import atexit
from collections import Counter

from icssploit.printer import PrinterThread, printer_queue
from icssploit.exceptions import icssploitException
from icssploit.exploits import GLOBAL_OPTS
from icssploit import utils

if sys.platform == "darwin":
    import gnureadline as readline
else:
    import readline

class BaseInterpreter(object):
    history_file = os.path.expanduser("~/.history")
    history_length = 100
    global_help = ""

    def __init__(self):
        self.setup()
        self.banner = ""

    def setup(self):
        """ Initialization of third-party libraries

        Setting interpreter history.
        Setting appropriate completer function.

        :return:
        """
        if not os.path.exists(self.history_file):
            open(self.history_file, 'a+').close()

        readline.read_history_file(self.history_file)
        readline.set_history_length(self.history_length)
        atexit.register(readline.write_history_file, self.history_file)

        readline.parse_and_bind('set enable-keypad on')

        readline.set_completer(self.complete)
        readline.set_completer_delims(' \t\n;')
        readline.parse_and_bind("tab: complete")

    def parse_line(self, line):
        """ Split line into command and argument.

        :param line: line to parse
        :return: (command, argument)
        """
        command, _, arg = line.strip().partition(" ")
        return command, arg.strip()

    @property
    def prompt(self):
        """ Returns prompt string """
        return ">>>"

    def get_command_handler(self, command):
        """ Parsing command and returning appropriate handler.

        :param command: command
        :return: command_handler
        """
        try:
            command_handler = getattr(self, "command_{}".format(command))
        except AttributeError:
            try:
                command_handler = getattr(self.current_module, "command_{}".format(command))
            except AttributeError:
                raise icssploitException("Unknown command: '{}'".format(command))
        return command_handler

    def start(self):
        """ icssploit main entry point. Starting interpreter loop. """

        utils.print_info(self.banner)
        printer_queue.join()
        while True:
            try:
                command, args = self.parse_line(raw_input(self.prompt))
                if not command:
                    continue
                command_handler = self.get_command_handler(command)
                command_handler(args)
            except icssploitException as err:
                utils.print_error(err)
            except EOFError:
                utils.print_info()
                utils.print_status("icssploit stopped")
                break
            except KeyboardInterrupt:
                utils.print_info()
            finally:
                printer_queue.join()

    def complete(self, text, state):
        """Return the next possible completion for 'text'.

        If a command has not been entered, then complete against command list.
        Otherwise try to call complete_<command> to get list of completions.
        """
        if state == 0:
            original_line = readline.get_line_buffer()
            line = original_line.lstrip()
            stripped = len(original_line) - len(line)
            start_index = readline.get_begidx() - stripped
            end_index = readline.get_endidx() - stripped

            if start_index > 0:
                cmd, args = self.parse_line(line)
                if cmd == '':
                    complete_function = self.default_completer
                else:
                    try:
                        complete_function = getattr(self, 'complete_' + cmd)
                    except AttributeError:
                        complete_function = self.default_completer
            else:
                complete_function = self.raw_command_completer

            self.completion_matches = complete_function(text, line, start_index, end_index)

        try:
            return self.completion_matches[state]
        except IndexError:
            return None

    def commands(self, *ignored):
        """ Returns full list of interpreter commands.

        :param ignored:
        :return: full list of interpreter commands
        """
        return [command.rsplit("_").pop() for command in dir(self) if command.startswith("command_")]

    def raw_command_completer(self, text, line, start_index, end_index):
        """ Complete command w/o any argument """
        return filter(lambda entry: entry.startswith(text), self.suggested_commands())

    def default_completer(self, *ignored):
        return []

    def suggested_commands(self):
        """ Entry point for intelligent tab completion.

        Overwrite this method to suggest suitable commands.

        :return: list of suitable commands
        """
        return self.commands()

class IcssploitInterpreter(BaseInterpreter):
    history_file = os.path.expanduser("~/.isf_history")
    global_help = """Global commands:
    help                        Print this help menu
    use <module>                Select a module for usage
    exec <shell command> <args> Execute a command in a shell
    search <search term>        Search for appropriate module
    exit                        Exit icssploit"""

    module_help = """Module commands:
    run                                 Run the selected module with the given options
    back                                De-select the current module
    set <option name> <option value>    Set an option for the selected module
    setg <option name> <option value>   Set an option for all of the modules
    unsetg <option name>                Unset option that was set globally
    show [info|options|devices]         Print information, options, or target devices for a module
    check                               Check if a given target is vulnerable to a selected module's exploit"""

    def __init__(self, extra_package_path=None):
        super(IcssploitInterpreter, self).__init__()
        PrinterThread().start()
        self.current_module = None
        self.raw_prompt_template = None
        self.module_prompt_template = None
        self.prompt_hostname = 'isf'
        self.show_sub_commands = ('info', 'options', 'devices', 'all', 'creds', 'exploits', 'scanners')

        self.global_commands = sorted(['use ', 'exec ', 'help', 'exit', 'show ', 'search '])
        self.module_commands = ['run', 'back', 'set ', 'setg ', 'check']
        self.module_commands.extend(self.global_commands)
        self.module_commands.sort()
        self.extra_modules_dir = None
        self.extra_modules_dirs = None
        self.extra_modules = []
        self.extra_package_path = extra_package_path
        self.import_extra_package()
        self.modules = utils.index_modules()
        self.modules += self.extra_modules
        self.modules_count = Counter()
        [self.modules_count.update(module.split('.')) for module in self.modules]
        self.main_modules_dirs = [module for module in os.listdir(utils.MODULES_DIR) if not module.startswith("__")]
        self.__parse_prompt()

        self.banner = """
  _____ _____  _____ _____ _____  _      ____ _____ _______
 |_   _/ ____|/ ____/ ____|  __ \| |    / __ \_   _|__   __|
   | || |    | (___| (___ | |__) | |   | |  | || |    | |
   | || |     \___ \\\___ \|  ___/| |   | |  | || |    | |
  _| || |____ ____) |___) | |    | |___| |__| || |_   | |
 |_____\_____|_____/_____/|_|    |______\____/_____|  |_|

				ICS Exploitation Framework

Note     : ICSSPOLIT is fork from routersploit at
           https://github.com/reverse-shell/routersploit
Dev Team : wenzhe zhu(dark-lbp)
Version  : 0.1.0

Exploits: {exploits_count} Scanners: {scanners_count} Creds: {creds_count}

ICS Exploits:
    PLC: {plc_exploit_count}          ICS Switch: {ics_switch_exploits_count}
    Software: {ics_software_exploits_count}
""".format(exploits_count=self.modules_count['exploits'] + self.modules_count['extra_exploits'],
           scanners_count=self.modules_count['scanners'] + self.modules_count['extra_scanners'],
           creds_count=self.modules_count['creds'] + self.modules_count['extra_creds'],
           plc_exploit_count=self.modules_count['plcs'],
           ics_switch_exploits_count=self.modules_count['ics_switchs'],
           ics_software_exploits_count=self.modules_count['ics_software']
           )

    def __parse_prompt(self):
        raw_prompt_default_template = "\001\033[4m\002{host}\001\033[0m\002 > "
        raw_prompt_template = os.getenv("ISF_RAW_PROMPT", raw_prompt_default_template).replace('\\033', '\033')
        self.raw_prompt_template = raw_prompt_template if '{host}' in raw_prompt_template else raw_prompt_default_template

        module_prompt_default_template = "\001\033[4m\002{host}\001\033[0m\002 (\001\033[91m\002{module}\001\033[0m\002) > "
        module_prompt_template = os.getenv("ISF_MODULE_PROMPT", module_prompt_default_template).replace('\\033', '\033')
        self.module_prompt_template = module_prompt_template if all(map(lambda x: x in module_prompt_template, ['{host}', "{module}"])) else module_prompt_default_template

    @property
    def module_metadata(self):
        return getattr(self.current_module, "_{}__info__".format(self.current_module.__class__.__name__))

    @property
    def prompt(self):
        """ Returns prompt string based on current_module attribute.

        Adding module prefix (module.name) if current_module attribute is set.

        :return: prompt string with appropriate module prefix.
        """
        if self.current_module:
            try:
                return self.module_prompt_template.format(host=self.prompt_hostname, module=self.module_metadata['name'])
            except (AttributeError, KeyError):
                return self.module_prompt_template.format(host=self.prompt_hostname, module="UnnamedModule")
        else:
            return self.raw_prompt_template.format(host=self.prompt_hostname)

    def import_extra_package(self):
        if self.extra_package_path:
            extra_modules_dir = os.path.join(self.extra_package_path, "extra_modules")
            if os.path.isdir(extra_modules_dir):
                self.extra_modules_dir = extra_modules_dir
                self.extra_modules_dirs = [module for module in os.listdir(self.extra_modules_dir) if
                                           not module.startswith("__")]
                self.extra_modules = utils.index_extra_modules(modules_directory=self.extra_modules_dir)
                print("extra_modules_dir:%s" % self.extra_modules_dir)
                sys.path.append(self.extra_package_path)
                sys.path.append(self.extra_modules_dir)
        else:
            return

    def available_modules_completion(self, text):
        """ Looking for tab completion hints using setup.py entry_points.

        May need optimization in the future!

        :param text: argument of 'use' command
        :return: list of tab completion hints
        """
        text = utils.pythonize_path(text)
        all_possible_matches = filter(lambda x: x.startswith(text), self.modules)
        matches = set()
        for match in all_possible_matches:
            head, sep, tail = match[len(text):].partition('.')
            if not tail:
                sep = ""
            matches.add("".join((text, head, sep)))
        return list(map(utils.humanize_path, matches))  # humanize output, replace dots to forward slashes

    def suggested_commands(self):
        """ Entry point for intelligent tab completion.

        Based on state of interpreter this method will return intelligent suggestions.

        :return: list of most accurate command suggestions
        """
        if self.current_module and GLOBAL_OPTS:
            return sorted(itertools.chain(self.module_commands, ('unsetg ',)))
        elif self.current_module:
            custom_commands = [command.rsplit("_").pop() for command in dir(self.current_module)
                               if command.startswith("command_")]
            self.module_commands.extend(custom_commands)
            return self.module_commands
        else:
            return self.global_commands

    def command_back(self, *args, **kwargs):
        self.current_module = None

    def command_use(self, module_path, *args, **kwargs):
        if module_path.startswith("extra_"):
            module_path = utils.pythonize_path(module_path)
        else:
            module_path = utils.pythonize_path(module_path)
            module_path = '.'.join(('icssploit', 'modules', module_path))
        try:
            self.current_module = utils.import_exploit(module_path)()
        except icssploitException as err:
            utils.print_error(err.message)

    @utils.stop_after(2)
    def complete_use(self, text, *args, **kwargs):
        if text:
            return self.available_modules_completion(text)
        else:
            if self.extra_modules_dirs:
                return self.main_modules_dirs + self.extra_modules_dirs
            else:
                return self.main_modules_dirs

    @utils.module_required
    def command_run(self, *args, **kwargs):
        utils.print_status("Running module...")
        try:
            self.current_module.run()
        except KeyboardInterrupt:
            utils.print_info()
            utils.print_error("Operation cancelled by user")
        except:
            utils.print_error(traceback.format_exc(sys.exc_info()))

    def command_exploit(self, *args, **kwargs):
        self.command_run()

    @utils.module_required
    def command_set(self, *args, **kwargs):
        key, _, value = args[0].partition(' ')
        if key in self.current_module.options:
            setattr(self.current_module, key, value)
            if kwargs.get("glob", False):
                GLOBAL_OPTS[key] = value
            utils.print_success({key: value})
        else:
            utils.print_error("You can't set option '{}'.\n"
                              "Available options: {}".format(key, self.current_module.options))

    @utils.stop_after(2)
    def complete_set(self, text, *args, **kwargs):
        if text:
            return [' '.join((attr, "")) for attr in self.current_module.options if attr.startswith(text)]
        else:
            return self.current_module.options

    @utils.module_required
    def command_setg(self, *args, **kwargs):
        kwargs['glob'] = True
        self.command_set(*args, **kwargs)

    @utils.stop_after(2)
    def complete_setg(self, text, *args, **kwargs):
        return self.complete_set(text, *args, **kwargs)

    @utils.module_required
    def command_unsetg(self, *args, **kwargs):
        key, _, value = args[0].partition(' ')
        try:
            del GLOBAL_OPTS[key]
        except KeyError:
            utils.print_error("You can't unset global option '{}'.\n"
                              "Available global options: {}".format(key, GLOBAL_OPTS.keys()))
        else:
            utils.print_success({key: value})

    @utils.stop_after(2)
    def complete_unsetg(self, text, *args, **kwargs):
        if text:
            return [' '.join((attr, "")) for attr in GLOBAL_OPTS.keys() if attr.startswith(text)]
        else:
            return GLOBAL_OPTS.keys()

    @utils.module_required
    def get_opts(self, *args):
        """ Generator returning module's Option attributes (option_name, option_value, option_description)

        :param args: Option names
        :return:
        """
        for opt_key in args:
            try:
                opt_description = self.current_module.exploit_attributes[opt_key]
                opt_value = getattr(self.current_module, opt_key)
            except (KeyError, AttributeError):
                pass
            else:
                yield opt_key, opt_value, opt_description

    @utils.module_required
    def _show_info(self, *args, **kwargs):
        utils.pprint_dict_in_order(
            self.module_metadata,
            ("name", "description", "devices", "authors", "references"),
        )
        utils.print_info()

    @utils.module_required
    def _show_options(self, *args, **kwargs):
        target_opts = ['target', 'port']
        module_opts = [opt for opt in self.current_module.options if opt not in target_opts]
        headers = ("Name", "Current settings", "Description")

        utils.print_info('\nTarget options:')
        utils.print_table(headers, *self.get_opts(*target_opts))

        if module_opts:
            utils.print_info('\nModule options:')
            utils.print_table(headers, *self.get_opts(*module_opts))

        utils.print_info()

    @utils.module_required
    def _show_devices(self, *args, **kwargs):  # TODO: cover with tests
        try:
            devices = self.current_module._Exploit__info__['devices']

            utils.print_info("\nTarget devices:")
            i = 0
            for device in devices:
                if isinstance(device, dict):
                    utils.print_info("   {} - {}".format(i, device['name']))
                else:
                    utils.print_info("   {} - {}".format(i, device))
                i += 1
            utils.print_info()
        except KeyError:
            utils.print_info("\nTarget devices are not defined")

    def __show_modules(self, root=''):
        for module in [module for module in self.modules if module.startswith(root)]:
            utils.print_info(module.replace('.', os.sep))

    def _show_all(self, *args, **kwargs):
        self.__show_modules()

    def _show_scanners(self, *args, **kwargs):
        self.__show_modules('scanners')

    def _show_exploits(self, *args, **kwargs):
        self.__show_modules('exploits')

    def _show_creds(self, *args, **kwargs):
        self.__show_modules('creds')

    def command_show(self, *args, **kwargs):
        sub_command = args[0]
        try:
            getattr(self, "_show_{}".format(sub_command))(*args, **kwargs)
        except AttributeError:
            utils.print_error("Unknown 'show' sub-command '{}'. "
                              "What do you want to show?\n"
                              "Possible choices are: {}".format(sub_command, self.show_sub_commands))

    @utils.stop_after(2)
    def complete_show(self, text, *args, **kwargs):
        if text:
            return [command for command in self.show_sub_commands if command.startswith(text)]
        else:
            return self.show_sub_commands

    @utils.module_required
    def command_check(self, *args, **kwargs):
        try:
            result = self.current_module.check()
        except Exception as error:
            utils.print_error(error)
        else:
            if result is True:
                utils.print_success("Target is vulnerable")
            elif result is False:
                utils.print_error("Target is not vulnerable")
            else:
                utils.print_status("Target could not be verified")

    def command_help(self, *args, **kwargs):
        utils.print_info(self.global_help)
        if self.current_module:
            utils.print_info("\n", self.module_help)

    def command_exec(self, *args, **kwargs):
        os.system(args[0])

    def command_search(self, *args, **kwargs):
        keyword = args[0]

        if not keyword:
            utils.print_error("Please specify search keyword. e.g. 'search plc'")
            return

        for module in self.modules:
            if keyword.lower() in module.lower():
                module = utils.humanize_path(module)
                utils.print_info(
                    "{}\033[31m{}\033[0m{}".format(*module.partition(keyword))
                )

    def command_exit(self, *args, **kwargs):
        raise EOFError


text:
<!DOCTYPE html>

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

    <title>Whiting-Turner</title>

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

    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" integrity="sha384-1q8mTJOASx8j1Au+a5WDVnPi2lkFfwwEAa8hDDdjZlpLegxhjVME1fgjWPGmkzs7" crossorigin="anonymous">

    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap-theme.min.css" integrity="sha384-fLW2N01lMqjakBkx3l/M9EahuwpSfeNvV63J5ezn3uZzapT0u7EYsXMjQV+0En5r" crossorigin="anonymous">

    <link rel="stylesheet" type="text/css" href="css/wt_style.css">

    <link rel="stylesheet" type="text/css" href="public/styles/filedrop.css">

WHITING-TURNER

About us

Contact Us

Whiting Turner 3D view Application

                    <legend>Upload the model(revit,autocad)</legend>

                        Upload model

                                        <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>

Upload your model

JavaScript is disabled in your browser. "Drag and Drop" feature is not supported.

                                        <legend>Drag and Drop to upload your model</legend>

                                        <fieldset id="zone">

Drop a file inside…

Or click here to Browse..

                                        </fieldset>

                                            Please note that your uploaded model will be removed from the list once the page is refreshed.

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

                    Models:

                    <select name="modellist" id="inputModellist" class="form-control">
                        <option value="">-- Select One --</option>

                    </select>

                    Urn:
                    <input type="text" name="selectedUrn" id="inputSelectedUrn" class="form-control" value="" required="required" pattern="" title="">

                    View Your 3D model

© 2016 - Whiting-turner

redpajama_set_name: RedPajamaGithub


text:
![Logo Linux07](images/banniere-linux07.png "Logo Linux07")
##Qui sommes-nous ?
www.linux07.aufildudoux.fr
///
Passionés par les outils numériques et de la richesse des valeurs portées par GNU/Linux, nous désirons promouvoir et défendre le logiciel libre.
///
###But de l'association :
- promouvoir et découvrir la culture et l'utilisation des logiciels libres et des systèmes d'exploitations GNU/Linux auprès du public et des institutions
- ainsi que la mise à disposition et les aprentissages des outils numériques libres.

===

##Projets
###organiser des manifestations pour sensibiliser aux logiciels libres.
Cette journée serait ouverte
- au public,
- aux associations
- aux écoles
///
###avec la vocation de faire connaître les systèmes d'exploitation GNU/Linux
- son histoire et sa philosophie
- des activités,
- des interventions,
- des ateliers,
- de courts documentaires et des ressources.

===
##Quelques idées en vrac
===

- Jeux vidéo logiciels libres.

- Documentaires sur l'histoire du logiciel libre.

- L'installation d'une distribution libre sur son ordinateur (voir les distributions GNU/LINUX recommandées du FSF'S).

===
###Initiation à l'environnement GNU/Linux
bases et rudiments de l'utilisation des commandes du shell (bash)
///
![Terminal](images/terminal-handyrod.png "Terminal")
///
![Cours shell](images/support1.png "Cours shell")
///
![Cours shell](images/support2.png "Cours shell")
///
![Cours shell](images/support3.png "Cours shell")
///
![Cours shell](images/support4.png "Cours shell")
///
![Cours shell](images/support5.png "Cours shell")
///
![Cours shell](images/support6.png "Cours shell")
///
![Cours shell](images/support7.png "Cours shell")
///
![Cours shell](images/support8.png "Cours shell")
///
![Cours shell](images/support9.png "Cours shell")
///
![Cours shell](images/support10.png "Cours shell")
///
![Cours shell](images/support11.png "Cours shell")
///
![Cours shell](images/support12.png "Cours shell")
///
![Cours shell](images/support13.png "Cours shell")
///
![Cours shell](images/support14.png "Cours shell")
///
![Cours shell](images/support15.png "Cours shell")
///
![Cours shell](images/support16.png "Cours shell")
///
![Cours shell](images/support17.png "Cours shell")
///
![Cours shell](images/support18.png "Cours shell")
///
![Cours shell](images/support19.png "Cours shell")
///
![Cours shell](images/support20.png "Cours shell")
///
![Cours shell](images/support22.png "Cours shell")
///
![Cours shell](images/support23.png "Cours shell")
///
![Cours shell](images/support24.png "Cours shell")
///
![Cours shell](images/support25.png "Cours shell")
///
![Cours shell](images/support26.png "Cours shell")
///
![Cours shell](images/support27.png "Cours shell")
///
![Cours shell](images/support28.png "Cours shell")
///
![Cours shell](images/support29.png "Cours shell")
///
![Cours shell](images/support30.png "Cours shell")
///
![Cours shell](images/support31.png "Cours shell")
///
![Cours shell](images/support32.png "Cours shell")
///
![Cours shell](images/support33.png "Cours shell")
///
![Cours shell](images/support34.png "Cours shell")
///
![Cours shell](images/support35.png "Cours shell")
///
![Cours shell](images/support36.png "Cours shell")
///
![Cours shell](images/support37.png "Cours shell")
///
![Cours shell](images/support38.png "Cours shell")
///
![Cours shell](images/support39.png "Cours shell")
///
![Cours shell](images/support40.png "Cours shell")
///
![Cours shell](images/support41.png "Cours shell")

===
###Organisez un hackathon logiciel libre.
///
Un hackathon est un événement où des développeurs se réunissent pour faire de la programmation informatique collaborative. Le terme est un mot-valise constitué de hack et marathon.
///
C'est à l'origine un rassemblement de développeurs organisés par équipe autour de porteurs de projet avec l'objectif de produire un prototype d'application en quelques heures.
Sous forme de concours chronométré, l'équipe gagnante est généralement désignée par un jury à l'issue du temps imparti.
La référence au Marathon se justifie par le travail sans interruption des développeurs pendant deux jours, généralement lors d'un week-end.

===

###Présentation des Jerry DIT
Do It Together
///
![Jerry](images/jerrytux.jpg "Jerry")
///
Un atelier Jerry permet à tous de découvrir comment fonctionne un ordinateur de manière amusante.
Les participants prennent conscience qu'un ordinateur n'est pas qu'une boite noire. On peut récupérer ces vielles pièces et redonner vie à un ordinateur destiné à la casse !
///
![Jerry](images/futurjerry.png "Jerry")
///
Car l'idée du Jerry est de lutter contre le gaspillage accéléré de tous ces composants informatiques qui sont une tragédie pour les pays qui récupère nos déchets ainsi que l'impact sur le réchauffement climatique quand ceux-ci sont brûlés à très haute température.
///
![Jerry](images/jerryjaune.jpg "Jerry")
///
Puis la lutte contre l'obsolescence, car on arrive à obtenir un ordinateur de bureau assez performant pour faire de la bureautique et gérer quelques médias ou bien faire un serveur assez correct avec des pièces jetées.
///
![Jerry](images/emmabuntus-redone-pc-bons-casse.jpg "Jerry")
===
###Installation d'une Bibliobox
(ou Piratebox)
///
![Librarybox](images/librarybox.jpeg "Librarybox")
///
Il s'agit d'un dispositif nomade permettant d'accéder à des ressources numériques ne nécessitant pas de connexion internet.
La Bibliobox permet d'échanger des contenus librement.
///
En outre, ce projet est soucieux de la confidentialité des utilisateurs. Aucune donnée n'est collectée si un utilisateur se connecte.
La Bibliobox peut s'utiliser dans différents contextes notamment en bibliothèque.
C'est l'occasion de mettre à disposition du public des oeuvres du domaine public mais également des contenus sous Creative Commons ou encore sous licences ouvertes.
///
![Librarybox](images/biblioboxmurale.jpeg "Librarybox")
///
La Bibliobox peut accueillir des oeuvres créées ou réalisées -sous licences ouvertes – par les bibliothèques, tout comme elle a vocation à diffuser des documents à caractère professionnel pendant des journées d'étude et des stages.De manière plus interactive, elle peut également servir de lieu d'échange entre lecteurs et fréquenteurs d'une bibliothèque, au cours d'opérations de médiations numériques.
///
![Pirate Box](images/piratebox.jpeg "Piratebox")
///
Une PirateBox est un dispositif électronique souvent composé d'un routeur et d'un dispositif de stockage d'information, créant un réseau sans fil qui permet aux utilisateurs qui y sont connectés d'échanger des fichiers anonymement et de manière locale.
///
Par définition, ce dispositif qui est souvent portable, est déconnecté d'internet.Les PirateBox sont à l'origine destinées à échanger librement des données libres du domaine public ou sous licence libre. Les logiciels utilisés pour la mise en place d'une PirateBox sont majoritairement open source, voire libres.
===
###Découverte du Raspberry Pi
- pour des enfants et de logiciels educatifs de programmation
- pour les adultes aussi avec tous les champs offert par cette technologie
///
![Raspberry](images/ecranraspberry.png "Raspberry")
///
Le Raspberry Pi est un nano-ordinateur monocarte à processeur ARM conçu par le créateur de jeux vidéo David Braben, dans le cadre de sa fondation Raspberry Pi2.
///
![Raspberry](images/raspberryconnect.jpeg "Raspberry")
///
Cet ordinateur, qui a la taille d'une carte de crédit, est destiné à encourager l'apprentissage de la programmation informatique; il permet l'exécution de plusieurs variantes du système d'exploitation libre GNU/Linux et des logiciels compatibles.
///
![Raspberry](images/framboise.jpeg "Raspberry")
///
Il est fourni nu (carte mère seule, sans boîtier, alimentation, clavier, souris ni écran) dans l'objectif de diminuer les coûts et de permettre l'utilisation de matériel de récupération.
===
###RailsGirls
Atelier pour aborder comment créer une application  et découverte d'un language de programmation
///
![Rails](images/railsgirls.jpeg "Rails")
///
RailsGirls : formation introductive au langage Ruby et au framework de développement Web Ruby.
Ruby on Rails est très utilisé car ce framework apporte un gain en productivité et agilité dans la conception d'applications web.
///
![Rails](images/ruby.jpeg "Rails")
///
Il y a aussi beaucoup de startups web qui se sont construites sur Ruby on Rails comme : Scribd (plus de 70 millions de lecteurs chaque mois), Groupon ou encore Basecamp. Il est aussi utilisé dans de célèbres sociétés comme : Amazon, Apple, BBC, Cisco, CNET, IBM, NASA, Yahoo… !
///
![Rails](images/rails.png "Rails")
///
Cette formation vous permettra d'acquérir les bases du développement web avec Ruby on Rails.
===

###Guide d'Autodéfense de Courrier électronique
///
Enseigner comment utiliser le chiffrage de courrier électronique logiciel libre.
///
![Enigmail](images/infographic-button.png "Enigmail")
///
La surveillance de masse viole nos droits fondamentaux et fait planer un risque sur la liberté d'expression.
///
Apprendre les bases d'une méthode d'autodéfense contre la surveillance :
le chiffrement du courriel.
///
![Enigmail](images/step2a-01-make-keypair.png "Enigmail")
///
Une fois que vous l'aurez assimilée, vous serez en mesure d'envoyer et de recevoir des courriels codés, et ainsi faire en sorte qu'un outil de surveillance ou un voleur qui les intercepterait ne puisse pas les lire. Tout ce dont vous avez besoin, c'est d'un ordinateur doté d'une connexion à Internet, d'un compte de courriel et d'environ une demi-heure.
///
![Enigmail](images/section3-try-it-out.png "Enigmail")
===
##Besoins

Pour ces évènement, nous avons besoin d'une structure, l'idéal serait un centre multimédia, ou une bibliothèque.
///
Il nous faudrait  :
- une connexion internet (indipensable)
- des tables et des chaises
- un vidéo-projecteur
- des écrans (si possible)
///
###Merci
===
Le propos de la communauté et de la culture du logiciel libre est un enjeu majeur pour l'évolution de notre société, surtout dans le domaine public.
Je vous rappelle que le gouvernement l'utilise et le préconise.
///
###Les chiffres ne mentent pas :
le logiciel libre est partout
///
Depuis le début du siècle, le logiciel libre est à la source de toutes les révolutions technologiques, de l'avènement de l'infonuagique à l'Internet des objets, en passant par le Big Data et l'impression 3D. Il fut également un élément clé dans la réussite des grandes organisations du Web – Amazon, Google, Twitter, Ali Baba, Facebook, etc....
///
La participation en grand nombre de chefs de la direction, de responsables des technologies de l'information et de vice président(e)s au dernier sondage intitulé « The Future of Open Source » renforce mon positionnement et témoigne du fait que le logiciel libre répond aujourd'hui adéquatement à des besoins d'affaires. Autrefois ignoré, il est maintenant considéré comme un outil stratégique dans plus de 78 % des organisations.
///
Je vous propose d'analyser plus en détails les résultats du sondage afin de mieux comprendre l'état actuel de l'adoption du logiciel libre en entreprise :
///
 - Dans le cadre de projets TI, le logiciel libre est systématiquement prioritaire pour 66 % des répondants;
 - 67 % des organisations avec plus de 5 000 employés contribuent à des projets de logiciels libres;
 - 93 % des organisations ont augmenté leur implication dans des projets libres au cours des douze derniers mois;
 - 64 % des organisations contribuent à des projets de logiciels libres, une augmentation de 14 % par rapport à l'année précédente.
 - Également, 88 % planifient augmenter leur niveau de participation au cours des deux à trois prochaines années.
 ///
 Selon le sondage, les raisons principales qui justifient cet engouement sont les suivantes :
///
 - 50 % croient que le logiciel libre leur permet d'attirer les meilleures ressources techniques;
 - 65 % croient que le logiciel libre génère un avantage compétitif;
 - 58 % pensent que le logiciel libre est plus évolutif que ses alternatives propriétaires;
 - 55 % pensent que le logiciel libre est plus sécuritaire que ses alternatives propriétaires et que cette tendance va s'accentuer au cours des deux ou trois prochaines années;
 - 90 % pensent que le logiciel libre est un moteur d'innovation et qu'il permet d'accélérer les délais des déploiements;
 - 78 % pensent que le logiciel libre leur permet d'améliorer leurs marges.
///
Pour conclure, je citerai Dries Buytaert, fondateur du gestionnaire de contenu libre Drupal utilisé par la STM, la Ville de Montréal, Guardian Life, Los Angeles, Pfizer, NBC, BBC, etc... :
///
« Les chiffres ne mentent pas. Cette année a une nouvelle fois était synonyme de succès pour le logiciel libre, que ce soit au niveau de l'adoption dans les grandes entreprises comme dans les PME. Le sondage confirme ce que nous savons depuis toujours – le logiciel libre est un moteur de l'innovation[…] »

 source : http://www.directioninformatique.com/blogue/les-chiffres-ne-mentent-pas-le-logiciel-libre-est-partout/35320
 ===
 ![GNU meditate](images/meditate.jpg "GNU meditate")


text:
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ***** BEGIN LICENSE BLOCK *****
 * Version: MPL 1.1/GPL 2.0/LGPL 2.1
 *
 * The contents of this file are subject to the Mozilla Public License Version
 * 1.1 (the "License"); you may not use this file except in compliance with
 * the License. You may obtain a copy of the License at
 * http://www.mozilla.org/MPL/
 *
 * Software distributed under the License is distributed on an "AS IS" basis,
 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
 * for the specific language governing rights and limitations under the
 * License.
 *
 * The Original Code is the Netscape Portable Runtime (NSPR).
 *
 * The Initial Developer of the Original Code is
 * Netscape Communications Corporation.
 * Portions created by the Initial Developer are Copyright (C) 1998-2000
 * the Initial Developer. All Rights Reserved.
 *
 * Contributor(s):
 *
 * Alternatively, the contents of this file may be used under the terms of
 * either the GNU General Public License Version 2 or later (the "GPL"), or
 * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
 * in which case the provisions of the GPL or the LGPL are applicable instead
 * of those above. If you wish to allow use of your version of this file only
 * under the terms of either the GPL or the LGPL, and not to allow others to
 * use your version of this file under the terms of the MPL, indicate your
 * decision by deleting the provisions above and replace them with the notice
 * and other provisions required by the GPL or the LGPL. If you do not delete
 * the provisions above, a recipient may use your version of this file under
 * the terms of any one of the MPL, the GPL or the LGPL.
 *
 * ***** END LICENSE BLOCK ***** */

/*
 *----------------------------------------------------------------------
 *
 * prtime.h --
 *
 *     NSPR date and time functions
 *
 *-----------------------------------------------------------------------
 */

#ifndef prtime_h___
#define prtime_h___

#include "prlong.h"

PR_BEGIN_EXTERN_C

/**********************************************************************/
/************************* TYPES AND CONSTANTS ************************/
/**********************************************************************/

#define PR_MSEC_PER_SEC		1000UL
#define PR_USEC_PER_SEC		1000000UL
#define PR_NSEC_PER_SEC		1000000000UL
#define PR_USEC_PER_MSEC	1000UL
#define PR_NSEC_PER_MSEC	1000000UL

/*
 * PRTime --
 *
 *     NSPR represents basic time as 64-bit signed integers relative
 *     to midnight (00:00:00), January 1, 1970 Greenwich Mean Time (GMT).
 *     (GMT is also known as Coordinated Universal Time, UTC.)
 *     The units of time are in microseconds. Negative times are allowed
 *     to represent times prior to the January 1970 epoch. Such values are
 *     intended to be exported to other systems or converted to human
 *     readable form.
 *
 *     Notes on porting: PRTime corresponds to time_t in ANSI C.  NSPR 1.0
 *     simply uses PRInt64.
 */

typedef PRInt64 PRTime;

/*
 * Time zone and daylight saving time corrections applied to GMT to
 * obtain the local time of some geographic location
 */

typedef struct PRTimeParameters {
    PRInt32 tp_gmt_offset;     /* the offset from GMT in seconds */
    PRInt32 tp_dst_offset;     /* contribution of DST in seconds */
} PRTimeParameters;

/*
 * PRExplodedTime --
 *
 *     Time broken down into human-readable components such as year, month,
 *     day, hour, minute, second, and microsecond.  Time zone and daylight
 *     saving time corrections may be applied.  If they are applied, the
 *     offsets from the GMT must be saved in the 'tm_params' field so that
 *     all the information is available to reconstruct GMT.
 *
 *     Notes on porting: PRExplodedTime corrresponds to struct tm in
 *     ANSI C, with the following differences:
 *       - an additional field tm_usec;
 *       - replacing tm_isdst by tm_params;
 *       - the month field is spelled tm_month, not tm_mon;
 *       - we use absolute year, AD, not the year since 1900.
 *     The corresponding type in NSPR 1.0 is called PRTime.  Below is
 *     a table of date/time type correspondence in the three APIs:
 *         API          time since epoch          time in components
 *       ANSI C             time_t                  struct tm
 *       NSPR 1.0           PRInt64                   PRTime
 *       NSPR 2.0           PRTime                  PRExplodedTime
 */

typedef struct PRExplodedTime {
    PRInt32 tm_usec;		    /* microseconds past tm_sec (0-99999)  */
    PRInt32 tm_sec;             /* seconds past tm_min (0-61, accomodating
                                   up to two leap seconds) */
    PRInt32 tm_min;             /* minutes past tm_hour (0-59) */
    PRInt32 tm_hour;            /* hours past tm_day (0-23) */
    PRInt32 tm_mday;            /* days past tm_mon (1-31, note that it
				                starts from 1) */
    PRInt32 tm_month;           /* months past tm_year (0-11, Jan = 0) */
    PRInt16 tm_year;            /* absolute year, AD (note that we do not
				                count from 1900) */

    PRInt8 tm_wday;		        /* calculated day of the week
				                (0-6, Sun = 0) */
    PRInt16 tm_yday;            /* calculated day of the year
				                (0-365, Jan 1 = 0) */

    PRTimeParameters tm_params;  /* time parameters used by conversion */
} PRExplodedTime;

/*
 * PRTimeParamFn --
 *
 *     A function of PRTimeParamFn type returns the time zone and
 *     daylight saving time corrections for some geographic location,
 *     given the current time in GMT.  The input argument gmt should
 *     point to a PRExplodedTime that is in GMT, i.e., whose
 *     tm_params contains all 0's.
 *
 *     For any time zone other than GMT, the computation is intended to
 *     consist of two steps:
 *       - Figure out the time zone correction, tp_gmt_offset.  This number
 *         usually depends on the geographic location only.  But it may
 *         also depend on the current time.  For example, all of China
 *         is one time zone right now.  But this situation may change
 *         in the future.
 *       - Figure out the daylight saving time correction, tp_dst_offset.
 *         This number depends on both the geographic location and the
 *         current time.  Most of the DST rules are expressed in local
 *         current time.  If so, one should apply the time zone correction
 *         to GMT before applying the DST rules.
 */

typedef PRTimeParameters (PR_CALLBACK *PRTimeParamFn)(const PRExplodedTime *gmt);

/**********************************************************************/
/****************************** FUNCTIONS *****************************/
/**********************************************************************/

/*
 * The PR_Now routine returns the current time relative to the
 * epoch, midnight, January 1, 1970 UTC. The units of the returned
 * value are microseconds since the epoch.
 *
 * The values returned are not guaranteed to advance in a linear fashion
 * due to the application of time correction protocols which synchronize
 * computer clocks to some external time source. Consequently it should
 * not be depended on for interval timing.
 *
 * The implementation is machine dependent.
 * Cf. time_t time(time_t *tp) in ANSI C.
 */
#if defined(HAVE_WATCOM_BUG_2)
PRTime __pascal __export __loadds
#else
NSPR_API(PRTime)
#endif
PR_Now(void);

/*
 * Expand time binding it to time parameters provided by PRTimeParamFn.
 * The calculation is envisoned to proceed in the following steps:
 *   - From given PRTime, calculate PRExplodedTime in GMT
 *   - Apply the given PRTimeParamFn to the GMT that we just calculated
 *     to obtain PRTimeParameters.
 *   - Add the PRTimeParameters offsets to GMT to get the local time
 *     as PRExplodedTime.
 */

NSPR_API(void) PR_ExplodeTime(
    PRTime usecs, PRTimeParamFn params, PRExplodedTime *exploded);

/* Reverse operation of PR_ExplodeTime */
#if defined(HAVE_WATCOM_BUG_2)
PRTime __pascal __export __loadds
#else
NSPR_API(PRTime)
#endif
PR_ImplodeTime(const PRExplodedTime *exploded);

/*
 * Adjust exploded time to normalize field overflows after manipulation.
 * Note that the following fields of PRExplodedTime should not be
 * manipulated:
 *   - tm_month and tm_year: because the number of days in a month and
 *     number of days in a year are not constant, it is ambiguous to
 *     manipulate the month and year fields, although one may be tempted
 *     to.  For example, what does "a month from January 31st" mean?
 *   - tm_wday and tm_yday: these fields are calculated by NSPR.  Users
 *     should treat them as "read-only".
 */

NSPR_API(void) PR_NormalizeTime(
    PRExplodedTime *exploded, PRTimeParamFn params);

/**********************************************************************/
/*********************** TIME PARAMETER FUNCTIONS *********************/
/**********************************************************************/

/* Time parameters that suit current host machine */
NSPR_API(PRTimeParameters) PR_LocalTimeParameters(const PRExplodedTime *gmt);

/* Time parameters that represent Greenwich Mean Time */
NSPR_API(PRTimeParameters) PR_GMTParameters(const PRExplodedTime *gmt);

/*
 * Time parameters that represent the US Pacific Time Zone, with the
 * current daylight saving time rules (for testing only)
 */
NSPR_API(PRTimeParameters) PR_USPacificTimeParameters(const PRExplodedTime *gmt);

/*
 * This parses a time/date string into a PRTime
 * (microseconds after "1-Jan-1970 00:00:00 GMT").
 * It returns PR_SUCCESS on success, and PR_FAILURE
 * if the time/date string can't be parsed.
 *
 * Many formats are handled, including:
 *
 *   14 Apr 89 03:20:12
 *   14 Apr 89 03:20 GMT
 *   Fri, 17 Mar 89 4:01:33
 *   Fri, 17 Mar 89 4:01 GMT
 *   Mon Jan 16 16:12 PDT 1989
 *   Mon Jan 16 16:12 +0130 1989
 *   6 May 1992 16:41-JST (Wednesday)
 *   22-AUG-1993 10:59:12.82
 *   22-AUG-1993 10:59pm
 *   22-AUG-1993 12:59am
 *   22-AUG-1993 12:59 PM
 *   Friday, August 04, 1995 3:54 PM
 *   06/21/95 04:24:34 PM
 *   20/06/95 21:07
 *   95-06-08 19:32:48 EDT
 *
 * If the input string doesn't contain a description of the timezone,
 * we consult the `default_to_gmt' to decide whether the string should
 * be interpreted relative to the local time zone (PR_FALSE) or GMT (PR_TRUE).
 * The correct value for this argument depends on what standard specified
 * the time string which you are parsing.
 */

NSPR_API(PRStatus) PR_ParseTimeString (
	const char *string,
	PRBool default_to_gmt,
	PRTime *result);

/*
 * FIXME: should we also have a formatting function, such as asctime, ctime,
 * and strftime in standard C library?  But this would involve
 * internationalization issues.  Might want to provide a US English version.
 */

/**********************************************************************/
/*********************** OLD COMPATIBILITYFUNCTIONS *******************/
/**********************************************************************/
#ifndef NO_NSPR_10_SUPPORT

/* Format a time value into a buffer. Same semantics as strftime() */
NSPR_API(PRUint32) PR_FormatTime(char *buf, int buflen, const char *fmt,
                                           const PRExplodedTime *tm);

/* Format a time value into a buffer. Time is always in US English format, regardless
 * of locale setting.
 */
NSPR_API(PRUint32)
PR_FormatTimeUSEnglish( char* buf, PRUint32 bufSize,
                        const char* format, const PRExplodedTime* tm );

#endif /* NO_NSPR_10_SUPPORT */

PR_END_EXTERN_C

#endif /* prtime_h___ */


text:
"use strict";
describe('todo_service', function () {
    describe('creation', function () {
        it('should create the service correctly', function () {
            expect(true).toBe(true);
        });
    });
});
//# sourceMappingURL=todo-service_test.js.map


text:
package com.orhanobut.logger;

import android.content.Context;
import android.content.SharedPreferences;
import android.util.Log;

/**
 * Created by zhangming on 16/8/8.
 */
public class CrashUtils {
    private static final String TAG = "CrashUtils";
    private static final String ClassName = "com.orhanobut.logger.CrashHandler";

    public static void clearCrashlog(Context context) {
        if (!CrashHandler.getInstance().isInited()) {
            Log.d(TAG, "CrashHandler has not been inited!!!");
        }

        SharedPreferences sharedPreferences = context.getSharedPreferences(ClassName, Context
                .MODE_PRIVATE);
        sharedPreferences.edit().putBoolean(ClassName, false).apply();
        sharedPreferences.edit().putInt(ClassName + "_hashcode", 0).apply();
    }

    //判断本次启动是否从崩溃中恢复启动
    public static boolean isStartfromCrash(Context context) {
        if (!CrashHandler.getInstance().isInited()) {
            Log.d(TAG, "CrashHandler has not been inited!!!");
            return false;
        }

        SharedPreferences sharedPreferences = context.getSharedPreferences(ClassName, Context
                .MODE_PRIVATE);
        int hashCode = sharedPreferences.getInt(ClassName + "_hashcode", 0);
        return sharedPreferences.getBoolean(ClassName, false) && (hashCode != 0 && hashCode != context
                .getApplicationContext().hashCode());
    }
}


text:
<?php

namespace Zenstruck\Bundle\CacheBundle\DependencyInjection\Compiler;

use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Reference;

/**
 * @author Kevin Bond <kevinbond@gmail.com>
 */
class UrlProviderCompilerPass implements CompilerPassInterface
{
    /**
     * {@inheritDoc}
     */
    public function process(ContainerBuilder $container)
    {
        if (!$container->hasDefinition('zenstruck_cache.url_registry')) {
            return;
        }

        $definition = $container->getDefinition(
            'zenstruck_cache.url_registry'
        );

        $taggedServices = $container->findTaggedServiceIds(
            'zenstruck_cache.url_provider'
        );

        foreach ($taggedServices as $id => $attributes) {
            $definition->addMethodCall('addProvider', array(new Reference($id)));
        }
    }
}


text:
namespace content {

// Implementations of FileRef operations for external filesystems.
class PepperExternalFileRefBackend : public PepperFileRefBackend {
 public:
  PepperExternalFileRefBackend(ppapi::host::PpapiHost* host,
                               int render_process_id,
                               const base::FilePath& path);
  virtual ~PepperExternalFileRefBackend();

  // PepperFileRefBackend overrides.
  virtual int32_t MakeDirectory(ppapi::host::ReplyMessageContext context,
                                bool make_ancestors) OVERRIDE;
  virtual int32_t Touch(ppapi::host::ReplyMessageContext context,
                        PP_Time last_accessed_time,
                        PP_Time last_modified_time) OVERRIDE;
  virtual int32_t Delete(ppapi::host::ReplyMessageContext context) OVERRIDE;
  virtual int32_t Rename(ppapi::host::ReplyMessageContext context,
                         PepperFileRefHost* new_file_ref) OVERRIDE;
  virtual int32_t Query(ppapi::host::ReplyMessageContext context) OVERRIDE;
  virtual int32_t ReadDirectoryEntries(
      ppapi::host::ReplyMessageContext context) OVERRIDE;
  virtual int32_t GetAbsolutePath(ppapi::host::ReplyMessageContext context)
      OVERRIDE;
  virtual fileapi::FileSystemURL GetFileSystemURL() const OVERRIDE;
  virtual std::string GetFileSystemURLSpec() const OVERRIDE;
  virtual base::FilePath GetExternalPath() const OVERRIDE;

  virtual int32_t CanRead() const OVERRIDE;
  virtual int32_t CanWrite() const OVERRIDE;
  virtual int32_t CanCreate() const OVERRIDE;
  virtual int32_t CanReadWrite() const OVERRIDE;

 private:
  // Generic reply callback.
  void DidFinish(ppapi::host::ReplyMessageContext reply_context,
                 const IPC::Message& msg,
                 base::PlatformFileError error);

  // Operation specific callbacks.
  void GetMetadataComplete(
    ppapi::host::ReplyMessageContext reply_context,
    base::PlatformFileError error,
    const base::PlatformFileInfo& file_info);

  ppapi::host::PpapiHost* host_;
  base::FilePath path_;
  int render_process_id_;

  scoped_refptr<base::TaskRunner> task_runner_;

  base::WeakPtrFactory<PepperExternalFileRefBackend> weak_factory_;
};

}  // namespace content

#endif  // CONTENT_BROWSER_RENDERER_HOST_PEPPER_PEPPER_EXTERNAL_FILE_REF_BACKEND_H_


text:
 Copyright 2018 The Nakama Authors
 Licensed under the Apache License, Version 2.0 (the "License");
 you may not use this file except in compliance with the License.
 You may obtain a copy of the License at
 http://www.apache.org/licenses/LICENSE-2.0
 Unless required by applicable law or agreed to in writing, software
 distributed under the License is distributed on an "AS IS" BASIS,
 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 See the License for the specific language governing permissions and
 limitations under the License.
--]]

local nk = require("nakama")

local function create(context, _)
  local match_id = nk.match_create("p2prelayer", {})
  return nk.json_encode({ match_id = match_id })
end
nk.register_rpc(create, "p2prelayer.create")

local M = {}

function M.match_init(context, params)
  local state = {}
  local tick_rate = 1
  local label = "skill=100-150"

  return state, tick_rate, label
end

function M.match_join_attempt(context, dispatcher, tick, state, presence)
  -- let anyone join.
  state.presences = state.presences or {}
  print(nk.json_encode(presence))
  state.presences[presence.user_id] = presence
  return state, true
end

function M.match_join(context, dispatcher, tick, state, presences)
  return state
end

function M.match_leave(context, dispatcher, tick, state, presence)
  return state
end

function M.match_loop(context, dispatcher, tick, state, messages)
  if (tick < 10) then
    local message = nk.json_encode({ hello = "world!" })
    dispatcher.broadcast_message(1, message)
    return state
  else
    print(nk.json_encode(state))
    return nil -- stop match.
  end
end

function M.match_terminate(context, dispatcher, tick, state, grace_seconds)
  return nil
end

return M


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

  <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  <meta http-equiv="Content-Style-Type" content="text/css">
  <title>DIScover - Model Browser WebHelp</title>
  <meta name="Generator" content="Cocoa HTML Writer">
  <meta name="CocoaVersion" content="1265.21">

Your browser does not support JavaScript. WebHelp Context-Sensitive Help requires JavaScript support to run.


text:
namespace odb {

class _dbGroup;
class _dbNet;
template <class T>
class dbTable;

class dbGroupPowerNetItr : public dbIterator
{
  dbTable<_dbNet>* _net_tbl;

 public:
  dbGroupPowerNetItr(dbTable<_dbNet>* net_tbl) { _net_tbl = net_tbl; }

  bool reversible();
  bool orderReversed();
  void reverse(dbObject* parent);
  uint sequential();
  uint size(dbObject* parent);
  uint begin(dbObject* parent);
  uint end(dbObject* parent);
  uint next(uint id, ...);
  dbObject* getObject(uint id, ...);
};

}  // namespace odb


text:
"""Tests for stochastic graphs."""

from __future__ import absolute_import
from __future__ import division
from __future__ import print_function

import tensorflow as tf

st = tf.contrib.bayesflow.stochastic_tensor
sge = tf.contrib.bayesflow.stochastic_gradient_estimators

class StochasticGradientEstimatorsTest(tf.test.TestCase):

  def setUp(self):
    self._p = tf.constant(0.999999)
    self._final_loss = tf.constant(3.2)

  def _testScoreFunction(self, loss_fn, expected):
    x = st.BernoulliTensor(p=self._p, loss_fn=loss_fn)
    sf = x.loss(self._final_loss)
    with self.test_session() as sess:
      sess.run(tf.initialize_all_variables())
      self.assertAllClose(*sess.run([expected, sf]))

  def testScoreFunction(self):
    expected = tf.log(self._p) * self._final_loss
    self._testScoreFunction(sge.score_function, expected)

  def testScoreFunctionWithConstantBaseline(self):
    b = tf.constant(9.8)
    expected = tf.log(self._p) * (self._final_loss - b)
    self._testScoreFunction(
        sge.get_score_function_with_constant_baseline(b), expected)

  def testScoreFunctionWithBaselineFn(self):
    b = tf.constant(9.8)

    def baseline_fn(stoch_tensor, loss):
      self.assertTrue(isinstance(stoch_tensor, st.StochasticTensor))
      self.assertTrue(isinstance(loss, tf.Tensor))
      return b

    expected = tf.log(self._p) * (self._final_loss - b)
    self._testScoreFunction(
        sge.get_score_function_with_baseline(baseline_fn), expected)

  def testScoreFunctionWithMeanBaseline(self):
    ema_decay = 0.8
    num_steps = 6
    x = st.BernoulliTensor(
        p=self._p,
        loss_fn=sge.get_score_function_with_baseline(
            sge.get_mean_baseline(ema_decay)))
    sf = x.loss(self._final_loss)

    # Expected EMA value
    ema = 0.
    for _ in range(num_steps):
      ema -= (1. - ema_decay) * (ema - self._final_loss)

    # Baseline is EMA with bias correction
    bias_correction = 1. - ema_decay**num_steps
    baseline = ema / bias_correction
    expected = tf.log(self._p) * (self._final_loss - baseline)

    with self.test_session() as sess:
      sess.run(tf.initialize_all_variables())
      for _ in range(num_steps - 1):
        sess.run(sf)  # run to update EMA
      self.assertAllClose(*sess.run([expected, sf]))

  def testScoreFunctionWithAdvantageFn(self):
    b = tf.constant(9.8)

    def advantage_fn(stoch_tensor, loss):
      self.assertTrue(isinstance(stoch_tensor, st.StochasticTensor))
      self.assertTrue(isinstance(loss, tf.Tensor))
      return loss - b

    expected = tf.log(self._p) * (self._final_loss - b)
    self._testScoreFunction(
        sge.get_score_function_with_advantage(advantage_fn), expected)

  def testScoreFunctionWithMeanBaselineHasUniqueVarScope(self):
    ema_decay = 0.8
    x = st.BernoulliTensor(
        p=self._p,
        loss_fn=sge.get_score_function_with_baseline(
            sge.get_mean_baseline(ema_decay)))
    y = st.BernoulliTensor(
        p=self._p,
        loss_fn=sge.get_score_function_with_baseline(
            sge.get_mean_baseline(ema_decay)))
    sf_x = x.loss(self._final_loss)
    sf_y = y.loss(self._final_loss)
    with self.test_session() as sess:
      # Smoke test
      sess.run(tf.initialize_all_variables())
      sess.run([sf_x, sf_y])

if __name__ == "__main__":
  tf.test.main()


text:
"OrderPortal: Information pages; simplest possible CMS using Markdown."

from __future__ import print_function, absolute_import

import logging

import tornado.web

import orderportal
from orderportal import constants
from orderportal import saver
from orderportal import settings
from orderportal import utils
from orderportal.requesthandler import RequestHandler

class InfoSaver(saver.Saver):
    doctype = constants.INFO

class Info(RequestHandler):
    "Information page."

    def get(self, name):
        info = self.get_entity_view('info/name', name)
        self.render('info.html', info=info)

    @tornado.web.authenticated
    def post(self, name):
        self.check_xsrf_cookie()
        self.check_admin()
        if self.get_argument('_http_method', None) == 'delete':
            self.delete(name)
            return
        raise tornado.web.HTTPError(405, reason='POST only allowed for DELETE')

    @tornado.web.authenticated
    def delete(self, name):
        self.check_admin()
        info = self.get_entity_view('info/name', name)
        self.delete_logs(info['_id'])
        self.db.delete(info)
        self.see_other('infos')

class InfoLogs(RequestHandler):
    "Info log entries page."

    @tornado.web.authenticated
    def get(self, name):
        self.check_admin()
        info = self.get_entity_view('info/name', name)
        self.render('logs.html',
                    title=u"Logs for info '{0}'".format(name),
                    entity=info,
                    logs=self.get_logs(info['_id']))

class Infos(RequestHandler):
    "List of information pages."

    @tornado.web.authenticated
    def get(self):
        self.check_admin()
        view = self.db.view('info/menu', include_docs=True)
        menu_infos = [r.doc for r in view]
        view = self.db.view('info/name', include_docs=True)
        rest_infos = [r.doc for r in view if r.doc.get('menu') is None]
        self.render('infos.html', all_infos=menu_infos + rest_infos)

class InfoCreate(RequestHandler):
    "Create a new information page."

    @tornado.web.authenticated
    def get(self):
        self.check_admin()
        self.render('info_create.html')

    @tornado.web.authenticated
    def post(self):
        self.check_xsrf_cookie()
        self.check_admin()
        name = self.get_argument('name')
        if not constants.NAME_RX.match(name):
            raise tornado.web.HTTPError(400, reason='invalid info name')
        try:
            self.get_entity_view('info/name', name)
        except tornado.web.HTTPError:
            pass
        else:
            raise tornado.web.HTTPError(400, reason='named info already exists')
        with InfoSaver(rqh=self) as saver:
            saver['name'] = name
            saver['title'] = self.get_argument('title', None)
            try:
                saver['menu'] = int(self.get_argument('menu', None))
            except (ValueError, TypeError):
                saver['menu'] = None
            saver['text'] = self.get_argument('text', '')
        self.see_other('info', name)

class InfoEdit(RequestHandler):
    "Edit the information page."

    @tornado.web.authenticated
    def get(self, name):
        self.check_admin()
        info = self.get_entity_view('info/name', name)
        self.render('info_edit.html', info=info)

    @tornado.web.authenticated
    def post(self, name):
        self.check_xsrf_cookie()
        self.check_admin()
        info = self.get_entity_view('info/name', name)
        with InfoSaver(doc=info, rqh=self) as saver:
            saver['title'] = self.get_argument('title', None)
            try:
                saver['menu'] = int(self.get_argument('menu', None))
            except (ValueError, TypeError):
                saver['menu'] = None
            saver['text'] = self.get_argument('text', '')
        self.see_other('info', name)


text:
package au.com.mountainpass.ryvr.model;

public interface SwaggerImpl {

  boolean containsOperation(String string);

}


text:
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
    <item>
        <shape android:shape="oval">
            <stroke android:color="@color/borders"></stroke>
            <size android:height="@dimen/shortblack_add_another_height" android:width="@dimen/shortblack_add_another_width">
            </size>
            <solid android:color="@color/app_background"></solid>
            <corners android:radius="@dimen/shortblack_border_radius"></corners>
        </shape>
    </item>

</selector>


text:
//
//  DMAdditionalActivationStepController.h
//  DevMateActivations
//
//  Copyright (c) 2014-2015 DevMate Inc. All rights reserved.
//

#import <DevMateKit/DMActivationStepController.h>

@interface DMAdditionalActivationStepController : DMActivationStepController

@property (nonatomic, assign, getter = isUserNameRequired) BOOL userNameRequired; // default is YES
@property (nonatomic, assign, getter = isUserEmailRequired) BOOL userEmailRequired; // default is YES

@property (nonatomic, assign) IBOutlet NSTextField *additionalInfoDescription;
@property (nonatomic, assign) IBOutlet NSTextField *userNameField;
@property (nonatomic, assign) IBOutlet NSTextField *userEmailField;
@property (nonatomic, assign) IBOutlet NSButton *keepUpToDateButton;

@end

/*! @brief Function that checks if email string is correct.
    @param ioEmailString Email string. Out string will be whitespace-trimmed if needs.
    @return YES in case of email string is valid. NO otherwise.
 */
FOUNDATION_EXTERN BOOL DMIsEmailValid(NSString **ioEmailString);


text:
<?xml version="1.0" encoding="UTF-8"?>
<imageIndex>
  <image>
    <originalFileName>IMG_1889 (Medium).JPG</originalFileName>
    <size>180765</size>
    <dateLastModified>Sat, 24 Jan 2015 06:07:35 GMT</dateLastModified>
    <width>768</width>
    <height>1152</height>
    <cachedImage>
      <fileName>3k1kpmui.jpeg</fileName>
      <dateCreated>Sat, 24 Jan 2015 06:18:46 GMT</dateCreated>
      <dateLastAccessed>Fri, 20 Mar 2015 13:43:36 GMT</dateLastAccessed>
      <imageFormat>jpeg</imageFormat>
      <compression>90</compression>
      <width>67</width>
      <height>100</height>
      <bgColor>#FFFFFF</bgColor>
      <transparent>True</transparent>
      <border>0</border>
      <borderColor>#000000</borderColor>
      <constrain>True</constrain>
      <pad>False</pad>
    </cachedImage>
    <cachedImage>
      <fileName>fst1mvzv.jpeg</fileName>
      <dateCreated>Sat, 24 Jan 2015 06:50:11 GMT</dateCreated>
      <dateLastAccessed>Thu, 19 Mar 2015 18:31:46 GMT</dateLastAccessed>
      <imageFormat>jpeg</imageFormat>
      <compression>90</compression>
      <width>400</width>
      <height>600</height>
      <bgColor>#FFFFFF</bgColor>
      <transparent>True</transparent>
      <border>0</border>
      <borderColor>#000000</borderColor>
      <constrain>True</constrain>
      <pad>False</pad>
    </cachedImage>
  </image>
</imageIndex>


text:
<?xml version="1.0" encoding="ISO-8859-1"?>
<?xml-stylesheet href="latest_ob.xsl" type="text/xsl"?>
<current_observation version="1.0"
	 xmlns:xsd="http://www.w3.org/2001/XMLSchema"
	 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	 xsi:noNamespaceSchemaLocation="http://www.weather.gov/view/current_observation.xsd">
	<credit>NOAA's National Weather Service</credit>
	<credit_URL>http://weather.gov/</credit_URL>
	<image>
		<url>http://weather.gov/images/xml_logo.gif</url>
		<title>NOAA's National Weather Service</title>
		<link>http://weather.gov</link>
	</image>
	<suggested_pickup>15 minutes after the hour</suggested_pickup>
	<suggested_pickup_period>60</suggested_pickup_period>
	<location>Berthoud Pass Heliport, CO</location>
	<station_id>K0CO</station_id>
	<latitude>39.7944</latitude>
	<longitude>-105.7631</longitude>
	<observation_time>Last Updated on Jan 4 2016, 7:57 pm MST</observation_time>
        <observation_time_rfc822>Mon, 04 Jan 2016 19:57:00 -0700</observation_time_rfc822>
	<weather>Overcast</weather>
	<temperature_string>19.0 F (-7.0 C)</temperature_string>
	<temp_f>19.0</temp_f>
	<temp_c>-7.0</temp_c>
	<relative_humidity>63</relative_humidity>
	<wind_string>Southeast at 11.5 MPH (10 KT)</wind_string>
	<wind_dir>Southeast</wind_dir>
	<wind_degrees>120</wind_degrees>
	<wind_mph>11.5</wind_mph>
	<wind_kt>10</wind_kt>
	<pressure_in>30.08</pressure_in>
	<dewpoint_string>8.6 F (-13.0 C)</dewpoint_string>
	<dewpoint_f>8.6</dewpoint_f>
	<dewpoint_c>-13.0</dewpoint_c>
	<windchill_string>7 F (-14 C)</windchill_string>
      	<windchill_f>7</windchill_f>
      	<windchill_c>-14</windchill_c>
	<visibility_mi>10.00</visibility_mi>
 	<icon_url_base>http://forecast.weather.gov/images/wtf/small/</icon_url_base>
	<two_day_history_url>http://www.weather.gov/data/obhistory/K0CO.html</two_day_history_url>
	<icon_url_name>novc.png</icon_url_name>
	<ob_url>http://www.weather.gov/data/METAR/K0CO.1.txt</ob_url>
	<disclaimer_url>http://weather.gov/disclaimer.html</disclaimer_url>
	<copyright_url>http://weather.gov/disclaimer.html</copyright_url>
	<privacy_policy_url>http://weather.gov/notice.html</privacy_policy_url>
</current_observation>


text:
using System;
using System.IO;
using System.Linq;
using System.Text;
using LibGit2Sharp.Tests.TestHelpers;
using Xunit;
using Xunit.Extensions;

namespace LibGit2Sharp.Tests
{
    public class StatusFixture : BaseFixture
    {
        [Fact]
        public void CanRetrieveTheStatusOfAFile()
        {
            var path = SandboxStandardTestRepoGitDir();
            using (var repo = new Repository(path))
            {
                FileStatus status = repo.RetrieveStatus("new_tracked_file.txt");
                Assert.Equal(FileStatus.NewInIndex, status);
            }
        }

        [Theory]
        [InlineData(StatusShowOption.IndexAndWorkDir, FileStatus.NewInWorkdir)]
        [InlineData(StatusShowOption.WorkDirOnly, FileStatus.NewInWorkdir)]
        [InlineData(StatusShowOption.IndexOnly, FileStatus.Nonexistent)]
        public void CanLimitStatusToWorkDirOnly(StatusShowOption show, FileStatus expected)
        {
            var clone = SandboxStandardTestRepo();

            using (var repo = new Repository(clone))
            {
                Touch(repo.Info.WorkingDirectory, "file.txt", "content");

                RepositoryStatus status = repo.RetrieveStatus(new StatusOptions() { Show = show });
                Assert.Equal(expected, status["file.txt"].State);
            }
        }

        [Theory]
        [InlineData(StatusShowOption.IndexAndWorkDir, FileStatus.NewInIndex)]
        [InlineData(StatusShowOption.WorkDirOnly, FileStatus.Nonexistent)]
        [InlineData(StatusShowOption.IndexOnly, FileStatus.NewInIndex)]
        public void CanLimitStatusToIndexOnly(StatusShowOption show, FileStatus expected)
        {
            var clone = SandboxStandardTestRepo();

            using (var repo = new Repository(clone))
            {
                Touch(repo.Info.WorkingDirectory, "file.txt", "content");
                repo.Stage("file.txt");

                RepositoryStatus status = repo.RetrieveStatus(new StatusOptions() { Show = show });
                Assert.Equal(expected, status["file.txt"].State);
            }
        }

        [Theory]
        [InlineData("file")]
        [InlineData("file.txt")]
        [InlineData("$file")]
        [InlineData("$file.txt")]
        [InlineData("$dir/file")]
        [InlineData("$dir/file.txt")]
        [InlineData("#file")]
        [InlineData("#file.txt")]
        [InlineData("#dir/file")]
        [InlineData("#dir/file.txt")]
        [InlineData("^file")]
        [InlineData("^file.txt")]
        [InlineData("^dir/file")]
        [InlineData("^dir/file.txt")]
        [InlineData("!file")]
        [InlineData("!file.txt")]
        [InlineData("!dir/file")]
        [InlineData("!dir/file.txt")]
        [InlineData("file!")]
        [InlineData("file!.txt")]
        [InlineData("dir!/file")]
        [InlineData("dir!/file.txt")]
        public void CanRetrieveTheStatusOfAnUntrackedFile(string filePath)
        {
            var clone = SandboxStandardTestRepo();

            using (var repo = new Repository(clone))
            {
                Touch(repo.Info.WorkingDirectory, filePath, "content");

                FileStatus status = repo.RetrieveStatus(filePath);
                Assert.Equal(FileStatus.NewInWorkdir, status);
            }
        }

        [Fact]
        public void RetrievingTheStatusOfADirectoryThrows()
        {
            var path = SandboxStandardTestRepoGitDir();
            using (var repo = new Repository(path))
            {
                Assert.Throws<AmbiguousSpecificationException>(() => { FileStatus status = repo.RetrieveStatus("1"); });
            }
        }

        [Theory]
        [InlineData(false, 0)]
        [InlineData(true, 5)]
        public void CanRetrieveTheStatusOfTheWholeWorkingDirectory(bool includeUnaltered, int unalteredCount)
        {
            string path = SandboxStandardTestRepo();
            using (var repo = new Repository(path))
            {
                const string file = "modified_staged_file.txt";

                RepositoryStatus status = repo.RetrieveStatus(new StatusOptions() { IncludeUnaltered = includeUnaltered });

                Assert.Equal(FileStatus.ModifiedInIndex, status[file].State);

                Assert.NotNull(status);
                Assert.Equal(6 + unalteredCount, status.Count());
                Assert.True(status.IsDirty);

                Assert.Equal("new_untracked_file.txt", status.Untracked.Select(s => s.FilePath).Single());
                Assert.Equal("modified_unstaged_file.txt", status.Modified.Select(s => s.FilePath).Single());
                Assert.Equal("deleted_unstaged_file.txt", status.Missing.Select(s => s.FilePath).Single());
                Assert.Equal("new_tracked_file.txt", status.Added.Select(s => s.FilePath).Single());
                Assert.Equal(file, status.Staged.Select(s => s.FilePath).Single());
                Assert.Equal("deleted_staged_file.txt", status.Removed.Select(s => s.FilePath).Single());

                File.AppendAllText(Path.Combine(repo.Info.WorkingDirectory, file),
                                   "Tclem's favorite commit message: boom");

                Assert.Equal(FileStatus.ModifiedInIndex | FileStatus.ModifiedInWorkdir, repo.RetrieveStatus(file));

                RepositoryStatus status2 = repo.RetrieveStatus(new StatusOptions() { IncludeUnaltered = includeUnaltered });
                Assert.Equal(FileStatus.ModifiedInIndex | FileStatus.ModifiedInWorkdir, status2[file].State);

                Assert.NotNull(status2);
                Assert.Equal(6 + unalteredCount, status2.Count());
                Assert.True(status2.IsDirty);

                Assert.Equal("new_untracked_file.txt", status2.Untracked.Select(s => s.FilePath).Single());
                Assert.Equal(new[] { file, "modified_unstaged_file.txt" }, status2.Modified.Select(s => s.FilePath));
                Assert.Equal("deleted_unstaged_file.txt", status2.Missing.Select(s => s.FilePath).Single());
                Assert.Equal("new_tracked_file.txt", status2.Added.Select(s => s.FilePath).Single());
                Assert.Equal(file, status2.Staged.Select(s => s.FilePath).Single());
                Assert.Equal("deleted_staged_file.txt", status2.Removed.Select(s => s.FilePath).Single());
            }
        }

        [Fact]
        public void CanRetrieveTheStatusOfRenamedFilesInWorkDir()
        {
            string path = SandboxStandardTestRepo();
            using (var repo = new Repository(path))
            {
                Touch(repo.Info.WorkingDirectory, "old_name.txt",
                    "This is a file with enough data to trigger similarity matching.\r\n" +
                    "This is a file with enough data to trigger similarity matching.\r\n" +
                    "This is a file with enough data to trigger similarity matching.\r\n" +
                    "This is a file with enough data to trigger similarity matching.\r\n");

                repo.Stage("old_name.txt");

                File.Move(Path.Combine(repo.Info.WorkingDirectory, "old_name.txt"),
                    Path.Combine(repo.Info.WorkingDirectory, "rename_target.txt"));

                RepositoryStatus status = repo.RetrieveStatus(
                    new StatusOptions()
                    {
                        DetectRenamesInIndex = true,
                        DetectRenamesInWorkDir = true
                    });

                Assert.Equal(FileStatus.NewInIndex | FileStatus.RenamedInWorkdir, status["rename_target.txt"].State);
                Assert.Equal(100, status["rename_target.txt"].IndexToWorkDirRenameDetails.Similarity);
            }
        }

        [Fact]
        public void CanRetrieveTheStatusOfRenamedFilesInIndex()
        {
            string path = SandboxStandardTestRepo();
            using (var repo = new Repository(path))
            {
                File.Move(
                    Path.Combine(repo.Info.WorkingDirectory, "1.txt"),
                    Path.Combine(repo.Info.WorkingDirectory, "rename_target.txt"));

                repo.Stage("1.txt");
                repo.Stage("rename_target.txt");

                RepositoryStatus status = repo.RetrieveStatus();

                Assert.Equal(FileStatus.RenamedInIndex, status["rename_target.txt"].State);
                Assert.Equal(100, status["rename_target.txt"].HeadToIndexRenameDetails.Similarity);
            }
        }

        [Fact]
        public void CanDetectedVariousKindsOfRenaming()
        {
            string path = InitNewRepository();
            using (var repo = new Repository(path))
            {
                Touch(repo.Info.WorkingDirectory, "file.txt",
                    "This is a file with enough data to trigger similarity matching.\r\n" +
                    "This is a file with enough data to trigger similarity matching.\r\n" +
                    "This is a file with enough data to trigger similarity matching.\r\n" +
                    "This is a file with enough data to trigger similarity matching.\r\n");

                repo.Stage("file.txt");
                repo.Commit("Initial commit", Constants.Signature, Constants.Signature);

                File.Move(Path.Combine(repo.Info.WorkingDirectory, "file.txt"),
                    Path.Combine(repo.Info.WorkingDirectory, "renamed.txt"));

                var opts = new StatusOptions
                {
                    DetectRenamesInIndex = true,
                    DetectRenamesInWorkDir = true
                };

                RepositoryStatus status = repo.RetrieveStatus(opts);

                // This passes as expected
                Assert.Equal(FileStatus.RenamedInWorkdir, status.Single().State);

                repo.Stage("file.txt");
                repo.Stage("renamed.txt");

                status = repo.RetrieveStatus(opts);

                Assert.Equal(FileStatus.RenamedInIndex, status.Single().State);

                File.Move(Path.Combine(repo.Info.WorkingDirectory, "renamed.txt"),
                    Path.Combine(repo.Info.WorkingDirectory, "renamed_again.txt"));

                status = repo.RetrieveStatus(opts);

                Assert.Equal(FileStatus.RenamedInWorkdir | FileStatus.RenamedInIndex,
                    status.Single().State);
            }
        }

        [Theory]
        [InlineData(true)]
        [InlineData(false)]
        public void CanRetrieveTheStatusOfANewRepository(bool includeUnaltered)
        {
            string repoPath = InitNewRepository();

            using (var repo = new Repository(repoPath))
            {
                RepositoryStatus status = repo.RetrieveStatus(new StatusOptions() { IncludeUnaltered = includeUnaltered });
                Assert.NotNull(status);
                Assert.Equal(0, status.Count());
                Assert.False(status.IsDirty);

                Assert.Equal(0, status.Untracked.Count());
                Assert.Equal(0, status.Modified.Count());
                Assert.Equal(0, status.Missing.Count());
                Assert.Equal(0, status.Added.Count());
                Assert.Equal(0, status.Staged.Count());
                Assert.Equal(0, status.Removed.Count());
            }
        }

        [Fact]
        public void RetrievingTheStatusOfARepositoryReturnNativeFilePaths()
        {
            // Build relative path
            string relFilePath = Path.Combine("directory", "Testfile.txt");

            // Open the repository
            string repoPath = InitNewRepository();

            using (var repo = new Repository(repoPath))
            {
                Touch(repo.Info.WorkingDirectory, relFilePath, "Anybody out there?");

                // Add the file to the index
                repo.Stage(relFilePath);

                // Get the repository status
                RepositoryStatus repoStatus = repo.RetrieveStatus();

                Assert.Equal(1, repoStatus.Count());
                StatusEntry statusEntry = repoStatus.Single();

                Assert.Equal(relFilePath, statusEntry.FilePath);

                Assert.Equal(statusEntry.FilePath, repoStatus.Added.Select(s => s.FilePath).Single());
            }
        }

        [Fact]
        public void RetrievingTheStatusOfAnEmptyRepositoryHonorsTheGitIgnoreDirectives()
        {
            string repoPath = InitNewRepository();

            using (var repo = new Repository(repoPath))
            {
                const string relativePath = "look-ma.txt";
                Touch(repo.Info.WorkingDirectory, relativePath, "I'm going to be ignored!");

                RepositoryStatus status = repo.RetrieveStatus();
                Assert.Equal(new[] { relativePath }, status.Untracked.Select(s => s.FilePath));

                Touch(repo.Info.WorkingDirectory, ".gitignore", "*.txt" + Environment.NewLine);

                RepositoryStatus newStatus = repo.RetrieveStatus();
                Assert.Equal(".gitignore", newStatus.Untracked.Select(s => s.FilePath).Single());

                Assert.Equal(FileStatus.Ignored, repo.RetrieveStatus(relativePath));
                Assert.Equal(new[] { relativePath }, newStatus.Ignored.Select(s => s.FilePath));
            }
        }

        [Fact]
        public void RetrievingTheStatusOfTheRepositoryHonorsTheGitIgnoreDirectives()
        {
            string path = SandboxStandardTestRepo();
            using (var repo = new Repository(path))
            {
                string relativePath = Path.Combine("1", "look-ma.txt");
                Touch(repo.Info.WorkingDirectory, relativePath, "I'm going to be ignored!");

                /*
                 * $ git status --ignored
                 * # On branch master
                 * # Your branch and 'origin/master' have diverged,
                 * # and have 2 and 2 different commit(s) each, respectively.
                 * #
                 * # Changes to be committed:
                 * #   (use "git reset HEAD <file>..." to unstage)
                 * #
                 * #       deleted:    deleted_staged_file.txt
                 * #       modified:   modified_staged_file.txt
                 * #       new file:   new_tracked_file.txt
                 * #
                 * # Changes not staged for commit:
                 * #   (use "git add/rm <file>..." to update what will be committed)
                 * #   (use "git checkout -- <file>..." to discard changes in working directory)
                 * #
                 * #       modified:   1/branch_file.txt
                 * #       modified:   README
                 * #       modified:   branch_file.txt
                 * #       deleted:    deleted_unstaged_file.txt
                 * #       modified:   modified_unstaged_file.txt
                 * #       modified:   new.txt
                 * #
                 * # Untracked files:
                 * #   (use "git add <file>..." to include in what will be committed)
                 * #
                 * #       1/look-ma.txt
                 * #       new_untracked_file.txt
                 */

                RepositoryStatus status = repo.RetrieveStatus();

                Assert.Equal(new[] { relativePath, "new_untracked_file.txt" }, status.Untracked.Select(s => s.FilePath));

                Touch(repo.Info.WorkingDirectory, ".gitignore", "*.txt" + Environment.NewLine);

                /*
                 * $ git status --ignored
                 * # On branch master
                 * # Your branch and 'origin/master' have diverged,
                 * # and have 2 and 2 different commit(s) each, respectively.
                 * #
                 * # Changes to be committed:
                 * #   (use "git reset HEAD <file>..." to unstage)
                 * #
                 * #       deleted:    deleted_staged_file.txt
                 * #       modified:   modified_staged_file.txt
                 * #       new file:   new_tracked_file.txt
                 * #
                 * # Changes not staged for commit:
                 * #   (use "git add/rm <file>..." to update what will be committed)
                 * #   (use "git checkout -- <file>..." to discard changes in working directory)
                 * #
                 * #       modified:   1/branch_file.txt
                 * #       modified:   README
                 * #       modified:   branch_file.txt
                 * #       deleted:    deleted_unstaged_file.txt
                 * #       modified:   modified_unstaged_file.txt
                 * #       modified:   new.txt
                 * #
                 * # Untracked files:
                 * #   (use "git add <file>..." to include in what will be committed)
                 * #
                 * #       .gitignore
                 * # Ignored files:
                 * #   (use "git add -f <file>..." to include in what will be committed)
                 * #
                 * #       1/look-ma.txt
                 * #       new_untracked_file.txt
                 */

                RepositoryStatus newStatus = repo.RetrieveStatus();
                Assert.Equal(".gitignore", newStatus.Untracked.Select(s => s.FilePath).Single());

                Assert.Equal(FileStatus.Ignored, repo.RetrieveStatus(relativePath));
                Assert.Equal(new[] { relativePath, "new_untracked_file.txt" }, newStatus.Ignored.Select(s => s.FilePath));
            }
        }

        [Theory]
        [InlineData(true, FileStatus.Unaltered, FileStatus.Unaltered)]
        [InlineData(false, FileStatus.DeletedFromWorkdir, FileStatus.NewInWorkdir)]
        public void RetrievingTheStatusOfAFilePathHonorsTheIgnoreCaseConfigurationSetting(
            bool shouldIgnoreCase,
            FileStatus expectedlowerCasedFileStatus,
            FileStatus expectedCamelCasedFileStatus
            )
        {
            string lowerCasedPath;
            const string lowercasedFilename = "plop";

            string repoPath = InitNewRepository();

            using (var repo = new Repository(repoPath))
            {
                repo.Config.Set("core.ignorecase", shouldIgnoreCase);

                lowerCasedPath = Touch(repo.Info.WorkingDirectory, lowercasedFilename);

                repo.Stage(lowercasedFilename);
                repo.Commit("initial", Constants.Signature, Constants.Signature);
            }

            using (var repo = new Repository(repoPath))
            {
                const string upercasedFilename = "Plop";

                string camelCasedPath = Path.Combine(repo.Info.WorkingDirectory, upercasedFilename);
                File.Move(lowerCasedPath, camelCasedPath);

                Assert.Equal(expectedlowerCasedFileStatus, repo.RetrieveStatus(lowercasedFilename));
                Assert.Equal(expectedCamelCasedFileStatus, repo.RetrieveStatus(upercasedFilename));

                AssertStatus(shouldIgnoreCase, expectedlowerCasedFileStatus, repo, camelCasedPath.ToLowerInvariant());
                AssertStatus(shouldIgnoreCase, expectedCamelCasedFileStatus, repo, camelCasedPath.ToUpperInvariant());
            }
        }

        private static void AssertStatus(bool shouldIgnoreCase, FileStatus expectedFileStatus, IRepository repo, string path)
        {
            try
            {
                Assert.Equal(expectedFileStatus, repo.RetrieveStatus(path));
            }
            catch (ArgumentException)
            {
                Assert.False(shouldIgnoreCase);
            }
        }

        [Fact]
        public void RetrievingTheStatusOfTheRepositoryHonorsTheGitIgnoreDirectivesThroughoutDirectories()
        {
            char dirSep = Path.DirectorySeparatorChar;

            string path = SandboxStandardTestRepo();
            using (var repo = new Repository(path))
            {
                Touch(repo.Info.WorkingDirectory, "bin/look-ma.txt", "I'm going to be ignored!");
                Touch(repo.Info.WorkingDirectory, "bin/what-about-me.txt", "Huh?");

                const string gitIgnore = ".gitignore";
                Touch(repo.Info.WorkingDirectory, gitIgnore, "bin");

                Assert.Equal(FileStatus.Ignored, repo.RetrieveStatus("bin/look-ma.txt"));
                Assert.Equal(FileStatus.Ignored, repo.RetrieveStatus("bin/what-about-me.txt"));

                RepositoryStatus newStatus = repo.RetrieveStatus();
                Assert.Equal(new[] { "bin" + dirSep }, newStatus.Ignored.Select(s => s.FilePath));

                var sb = new StringBuilder();
                sb.AppendLine("bin/*");
                sb.AppendLine("!bin/w*");
                Touch(repo.Info.WorkingDirectory, gitIgnore, sb.ToString());

                Assert.Equal(FileStatus.Ignored, repo.RetrieveStatus("bin/look-ma.txt"));
                Assert.Equal(FileStatus.NewInWorkdir, repo.RetrieveStatus("bin/what-about-me.txt"));

                newStatus = repo.RetrieveStatus();

                Assert.Equal(new[] { "bin" + dirSep + "look-ma.txt" }, newStatus.Ignored.Select(s => s.FilePath));
                Assert.True(newStatus.Untracked.Select(s => s.FilePath).Contains("bin" + dirSep + "what-about-me.txt"));
            }
        }

        [Fact]
        public void CanRetrieveStatusOfFilesInSubmodule()
        {
            var path = SandboxSubmoduleTestRepo();
            using (var repo = new Repository(path))
            {
                string[] expected = new string[] {
                    ".gitmodules",
                    "sm_changed_file",
                    "sm_changed_head",
                    "sm_changed_index",
                    "sm_changed_untracked_file",
                    "sm_missing_commits"
                };

                RepositoryStatus status = repo.RetrieveStatus();
                Assert.Equal(expected, status.Modified.Select(x => x.FilePath).ToArray());
            }
        }

        [Fact]
        public void CanExcludeStatusOfFilesInSubmodule()
        {
            var path = SandboxSubmoduleTestRepo();
            using (var repo = new Repository(path))
            {
                string[] expected = new string[] {
                    ".gitmodules",
                };

                RepositoryStatus status = repo.RetrieveStatus(new StatusOptions() { ExcludeSubmodules = true });
                Assert.Equal(expected, status.Modified.Select(x => x.FilePath).ToArray());
            }
        }

        [Fact]
        public void CanRetrieveTheStatusOfARelativeWorkingDirectory()
        {
            string path = SandboxStandardTestRepo();
            using (var repo = new Repository(path))
            {
                const string file = "just_a_dir/other.txt";
                const string otherFile = "just_a_dir/another_dir/other.txt";

                Touch(repo.Info.WorkingDirectory, file);
                Touch(repo.Info.WorkingDirectory, otherFile);

                RepositoryStatus status = repo.RetrieveStatus(new StatusOptions() { PathSpec = new[] { "just_a_dir" } });
                Assert.Equal(2, status.Count());
                Assert.Equal(2, status.Untracked.Count());

                status = repo.RetrieveStatus(new StatusOptions() { PathSpec = new[] { "just_a_dir/another_dir" } });
                Assert.Equal(1, status.Count());
                Assert.Equal(1, status.Untracked.Count());
            }
        }

        [Fact]
        public void CanRetrieveTheStatusOfMultiplePathSpec()
        {
            string path = SandboxStandardTestRepo();
            using (var repo = new Repository(path))
            {
                const string file = "just_a_dir/other.txt";
                const string otherFile = "just_a_file.txt";

                Touch(repo.Info.WorkingDirectory, file);
                Touch(repo.Info.WorkingDirectory, otherFile);

                RepositoryStatus status = repo.RetrieveStatus(new StatusOptions() { PathSpec = new[] { "just_a_file.txt", "just_a_dir" } });
                Assert.Equal(2, status.Count());
                Assert.Equal(2, status.Untracked.Count());
            }
        }

        [Fact]
        public void CanRetrieveTheStatusOfAGlobSpec()
        {
            string path = SandboxStandardTestRepo();
            using (var repo = new Repository(path))
            {
                const string file = "just_a_dir/other.txt";
                const string otherFile = "just_a_file.txt";

                Touch(repo.Info.WorkingDirectory, file);
                Touch(repo.Info.WorkingDirectory, otherFile);

                RepositoryStatus status = repo.RetrieveStatus(new StatusOptions() { PathSpec = new[] { "just_a_*" } });
                Assert.Equal(2, status.Count());
                Assert.Equal(2, status.Untracked.Count());
            }
        }

        [Fact]
        public void RetrievingTheStatusHonorsAssumedUnchangedMarkedIndexEntries()
        {
            var path = SandboxAssumeUnchangedTestRepo();
            using (var repo = new Repository(path))
            {
                var status = repo.RetrieveStatus();
                Assert.Equal("hello.txt", status.Modified.Single().FilePath);
            }
        }

        [Fact]
        public void CanIncludeStatusOfUnalteredFiles()
        {
            var path = SandboxStandardTestRepo();
            string[] unalteredPaths = {
                "1.txt",
                "1" + Path.DirectorySeparatorChar + "branch_file.txt",
                "branch_file.txt",
                "new.txt",
                "README",
            };

            using (var repo = new Repository(path))
            {
                RepositoryStatus status = repo.RetrieveStatus(new StatusOptions() { IncludeUnaltered = true });

                Assert.Equal(unalteredPaths.Length, status.Unaltered.Count());
                Assert.Equal(unalteredPaths, status.Unaltered.OrderBy(s => s.FilePath).Select(s => s.FilePath).ToArray());
            }
        }

        [Fact]
        public void UnalteredFilesDontMarkIndexAsDirty()
        {
            var path = SandboxStandardTestRepo();

            using (var repo = new Repository(path))
            {
                repo.Reset(ResetMode.Hard);
                repo.RemoveUntrackedFiles();

                RepositoryStatus status = repo.RetrieveStatus(new StatusOptions() { IncludeUnaltered = true });

                Assert.Equal(false, status.IsDirty);
                Assert.Equal(9, status.Count());
            }
        }
    }
}


text:
angular.module( 'services.config', ['lodash'])

.service('config', function(lodash) {

	// private vars here if needed

	return {
		siteName: 'Sailng',
		// no trailing slash!
		siteUrl: '/',
		apiUrl: '/api',

		currentUser: false
	};

});


text:
<?php declare(strict_types=1);

namespace PMG\Queue\Handler\Pcntl;

use PMG\Queue\Exception\AbnormalExit;

/**
 * A very thin wrapper around the the `pcntl_*` functions and `exit` to deal
 * with forking processes. This exists simply so we can mock it and validate that
 * `PcntlForkingHandler` works.
 *
 * @since 3.1
 * @internal
 */
class Pcntl
{
    public function __construct()
    {
        // @codeCoverageIgnoreStart
        if (!function_exists('pcntl_fork')) {
            throw new \RuntimeException(sprintf('%s can only be used if the pcntl extension is loaded', __CLASS__));
        }
        // @codeCoverageIgnoreEnd
    }

    /**
     * Fork a new process and return the current processes ID. In the parent thead
     * this will be the child process' ID and the child thread will see a `0`.
     *
     * @return int
     */
    public function fork() : int
    {
        return @pcntl_fork();
    }

    /**
     * Wait for the child process to finish and report wether its exit status
     * was successful or not. If the child process exits normally this is
     * will return a bool. If there was a non-normal exit (like a segfault)
     * this will throw.
     *
     * @return bool True if the child existed successfully.
     */
    public function wait($child) : WaitResult
    {
        pcntl_waitpid($child, $status, WUNTRACED);

        if (pcntl_wifexited($status)) {
            return new WaitResult(pcntl_wexitstatus($status));
        }

        throw AbnormalExit::fromWaitStatus($status);
    }

    /**
     * Quit the current process by calling `exit`. The exit code is defined by
     * whather the $succesful value is true.
     *
     * @param bool $successful If true `exit(0)` otherwise `exit(1)`
     * @return void
     */
    public function quit($successful)
    {
        exit($successful ? 0 : 1);
    }

    /**
     * Deliver a signal to a process.
     *
     * @param $child The process to signal
     * @param $sig The signal to send.
     * @return void
     */
    public function signal(int $child, int $sig)
    {
        posix_kill($child, $sig);
    }
}


text:
#include <aws/medialive/model/HlsIncompleteSegmentBehavior.h>
#include <aws/core/utils/HashingUtils.h>
#include <aws/core/Globals.h>
#include <aws/core/utils/EnumParseOverflowContainer.h>

using namespace Aws::Utils;

namespace Aws
{
  namespace MediaLive
  {
    namespace Model
    {
      namespace HlsIncompleteSegmentBehaviorMapper
      {

        static const int AUTO_HASH = HashingUtils::HashString("AUTO");
        static const int SUPPRESS_HASH = HashingUtils::HashString("SUPPRESS");

        HlsIncompleteSegmentBehavior GetHlsIncompleteSegmentBehaviorForName(const Aws::String& name)
        {
          int hashCode = HashingUtils::HashString(name.c_str());
          if (hashCode == AUTO_HASH)
          {
            return HlsIncompleteSegmentBehavior::AUTO;
          }
          else if (hashCode == SUPPRESS_HASH)
          {
            return HlsIncompleteSegmentBehavior::SUPPRESS;
          }
          EnumParseOverflowContainer* overflowContainer = Aws::GetEnumOverflowContainer();
          if(overflowContainer)
          {
            overflowContainer->StoreOverflow(hashCode, name);
            return static_cast<HlsIncompleteSegmentBehavior>(hashCode);
          }

          return HlsIncompleteSegmentBehavior::NOT_SET;
        }

        Aws::String GetNameForHlsIncompleteSegmentBehavior(HlsIncompleteSegmentBehavior enumValue)
        {
          switch(enumValue)
          {
          case HlsIncompleteSegmentBehavior::AUTO:
            return "AUTO";
          case HlsIncompleteSegmentBehavior::SUPPRESS:
            return "SUPPRESS";
          default:
            EnumParseOverflowContainer* overflowContainer = Aws::GetEnumOverflowContainer();
            if(overflowContainer)
            {
              return overflowContainer->RetrieveOverflow(static_cast<int>(enumValue));
            }

            return {};
          }
        }

      } // namespace HlsIncompleteSegmentBehaviorMapper
    } // namespace Model
  } // namespace MediaLive
} // namespace Aws