text:
"""Analyse disk content to extract File System event timelines."""

import ntpath
import logging
from datetime import timedelta
from functools import lru_cache
from itertools import chain, groupby
from tempfile import NamedTemporaryFile
from collections import defaultdict, namedtuple

from vminspect.filesystem import FileSystem
from vminspect.usnjrnl import CorruptedUsnRecord, usn_journal

class FSTimeline:
    def __init__(self, disk):
        self._disk = disk
        self._filesystem = None
        self._filetype_cache = {}
        self._checksum_cache = {}
        self.logger = logging.getLogger(
            "%s.%s" % (self.__module__, self.__class__.__name__))

    def __enter__(self):
        self._filesystem = FileSystem(self._disk)
        self._filesystem.mount()

        return self

    def __exit__(self, *_):
        self._filesystem.umount()

    def __getattr__(self, attr):
        return getattr(self._filesystem, attr)

    def timeline(self):
        self.logger.debug("Extracting File System timeline events.")
        events = tuple(Event(d.inode, d.path, d.size, d.allocated, t, r)
                       for d in self._visit_filesystem()
                       for t, r in ((d.atime, 'access'),
                                    (d.mtime, 'change'),
                                    (d.ctime, 'attribute_change'),
                                    (d.crtime, 'creation'))
                       if t > 0)

        self.logger.debug("Sorting File System timeline events.")
        return sorted(events, key=lambda e: e.timestamp)

    @lru_cache(maxsize=None)
    def file(self, path):
        """Identifies the file type.

        Caches the result to reduce overhead on duplicated events.

        """
        return self._filesystem.file(path)

    @lru_cache(maxsize=None)
    def checksum(self, path):
        """Identifies the file type.

        Caches the result to reduce overhead on duplicated events.

        """
        return self._filesystem.checksum(path)

    def _visit_filesystem(self):
        """Walks through the filesystem content."""
        self.logger.debug("Parsing File System content.")

        root_partition = self._filesystem.inspect_get_roots()[0]

        yield from self._root_dirent()

        for entry in self._filesystem.filesystem_walk(root_partition):
            yield Dirent(
                entry['tsk_inode'],
                self._filesystem.path('/' + entry['tsk_name']),
                entry['tsk_size'], entry['tsk_type'],
                True if entry['tsk_flags'] & TSK_ALLOC else False,
                timestamp(entry['tsk_atime_sec'], entry['tsk_atime_nsec']),
                timestamp(entry['tsk_mtime_sec'], entry['tsk_mtime_nsec']),
                timestamp(entry['tsk_ctime_sec'], entry['tsk_ctime_nsec']),
                timestamp(entry['tsk_crtime_sec'], entry['tsk_crtime_nsec']))

    def _root_dirent(self):
        """Returns the root folder dirent as filesystem_walk API doesn't."""
        fstat = self._filesystem.stat('/')

        yield Dirent(fstat['ino'], self._filesystem.path('/'),
                     fstat['size'], 'd', True,
                     timestamp(fstat['atime'], 0),
                     timestamp(fstat['mtime'], 0),
                     timestamp(fstat['ctime'], 0),
                     0)

class NTFSTimeline(FSTimeline):
    """Inspect NTFS filesystem in order to extract a timeline of events
    containing the information related to files/directories changes.

    This feature depends on a special build of Libguestfs available at:
      https://github.com/noxdafox/libguestfs/tree/forensics

    """
    def __init__(self, disk):
        super().__init__(disk)

    def __enter__(self):
        super().__enter__()

        if self._filesystem.osname != 'windows':
            self._filesystem.umount()

            raise RuntimeError("Filesystem is not NTFS.")

        return self

    def usnjrnl_timeline(self):
        """Iterates over the changes occurred within the filesystem.

        Yields UsnJrnlEvent namedtuples containing:

            file_reference_number: known in Unix FS as inode.
            path: full path of the file.
            size: size of the file in bytes if recoverable.
            allocated: whether the file exists or it has been deleted.
            timestamp: timespamp of the change.
            changes: list of changes applied to the file.
            attributes: list of file attributes.

        """
        filesystem_content = defaultdict(list)

        self.logger.debug("Extracting Update Sequence Number journal.")

        journal = self._read_journal()

        for dirent in self._visit_filesystem():
            filesystem_content[dirent.inode].append(dirent)

        self.logger.debug("Generating timeline.")
        yield from generate_timeline(journal, filesystem_content)

    def _read_journal(self):
        """Extracts the USN journal from the disk and parses its content."""
        root = self._filesystem.inspect_get_roots()[0]
        inode = self._filesystem.stat('C:\\$Extend\\$UsnJrnl')['ino']

        with NamedTemporaryFile(buffering=0) as tempfile:
            self._filesystem.download_inode(root, inode, tempfile.name)

            journal = usn_journal(tempfile.name)

            return parse_journal(journal)

def parse_journal(journal):
    """Parses the USN Journal content removing duplicates
    and corrupted records.

    """
    events = [e for e in journal if not isinstance(e, CorruptedUsnRecord)]
    keyfunc = lambda e: str(e.file_reference_number) + e.file_name + e.timestamp
    event_groups = (tuple(g) for k, g in groupby(events, key=keyfunc))

    if len(events) < len(list(journal)):
        LOGGER.debug(
            "Corrupted records in UsnJrnl, some events might be missing.")

    return [journal_event(g) for g in event_groups]

def journal_event(events):
    """Group multiple events into a single one."""
    reasons = set(chain.from_iterable(e.reasons for e in events))
    attributes = set(chain.from_iterable(e.file_attributes for e in events))

    return JrnlEvent(events[0].file_reference_number,
                     events[0].parent_file_reference_number,
                     events[0].file_name,
                     events[0].timestamp,
                     list(reasons), list(attributes))

def generate_timeline(usnjrnl, filesystem_content):
    """Aggregates the data collected from the USN journal
    and the filesystem content.

    """
    journal_content = defaultdict(list)
    for event in usnjrnl:
        journal_content[event.inode].append(event)

    for event in usnjrnl:
        try:
            dirent = lookup_dirent(event, filesystem_content, journal_content)

            yield UsnJrnlEvent(
                dirent.inode, dirent.path, dirent.size, dirent.allocated,
                event.timestamp, event.changes, event.attributes)
        except LookupError as error:
            LOGGER.debug(error)

def lookup_dirent(event, filesystem_content, journal_content):
    """Lookup the dirent given a journal event."""
    for dirent in filesystem_content[event.inode]:
        if dirent.path.endswith(event.name):
            return dirent

    path = lookup_folder(event, filesystem_content)
    if path is not None:
        return Dirent(event.inode, path, -1, None, False, 0, 0, 0, 0)

    path = lookup_deleted_folder(event, filesystem_content, journal_content)
    if path is not None:
        return Dirent(event.inode, path, -1, None, False, 0, 0, 0, 0)

    raise LookupError("File %s not found" % event.name)

def lookup_folder(event, filesystem):
    """Lookup the parent folder in the filesystem content."""
    for dirent in filesystem[event.parent_inode]:
        if dirent.type == 'd' and dirent.allocated:
            return ntpath.join(dirent.path, event.name)

def lookup_deleted_folder(event, filesystem, journal):
    """Lookup the parent folder in the journal content."""
    folder_events = (e for e in journal[event.parent_inode]
                     if 'DIRECTORY' in e.attributes
                     and 'FILE_DELETE' in e.changes)

    for folder_event in folder_events:
        path = lookup_deleted_folder(folder_event, filesystem, journal)

        return ntpath.join(path, event.name)

    return lookup_folder(event, filesystem)

def timestamp(secs, nsecs):
    delta = timedelta(seconds=secs) + timedelta(microseconds=(nsecs / 1000))

    return delta.total_seconds()

TSK_ALLOC = 0x01

Event = namedtuple('Event',
                   ('inode', 'path', 'size',
                    'allocated', 'timestamp', 'reason'))
UsnJrnlEvent = namedtuple('Event', ('file_reference_number', 'path', 'size',
                                    'allocated', 'timestamp', 'changes',
                                    'attributes'))

Dirent = namedtuple('Dirent', ('inode', 'path', 'size', 'type', 'allocated',
                               'atime', 'mtime', 'ctime', 'crtime'))
JrnlEvent = namedtuple('JrnlEvent', ('inode', 'parent_inode', 'name',
                                     'timestamp', 'changes', 'attributes'))

LOGGER = logging.getLogger("%s" % (__name__))


text:
var _and = require('./and');

var _and2 = _interopRequireDefault(_and);

var _between = require('./between');

var _between2 = _interopRequireDefault(_between);

var _childrenHavePropXorChildren = require('./childrenHavePropXorChildren');

var _childrenHavePropXorChildren2 = _interopRequireDefault(_childrenHavePropXorChildren);

var _childrenOf = require('./childrenOf');

var _childrenOf2 = _interopRequireDefault(_childrenOf);

var _childrenOfType = require('./childrenOfType');

var _childrenOfType2 = _interopRequireDefault(_childrenOfType);

var _childrenSequenceOf = require('./childrenSequenceOf');

var _childrenSequenceOf2 = _interopRequireDefault(_childrenSequenceOf);

var _componentWithName = require('./componentWithName');

var _componentWithName2 = _interopRequireDefault(_componentWithName);

var _elementType = require('./elementType');

var _elementType2 = _interopRequireDefault(_elementType);

var _explicitNull = require('./explicitNull');

var _explicitNull2 = _interopRequireDefault(_explicitNull);

var _forbidExtraProps = require('./forbidExtraProps');

var _forbidExtraProps2 = _interopRequireDefault(_forbidExtraProps);

var _integer = require('./integer');

var _integer2 = _interopRequireDefault(_integer);

var _keysOf = require('./keysOf');

var _keysOf2 = _interopRequireDefault(_keysOf);

var _mutuallyExclusiveProps = require('./mutuallyExclusiveProps');

var _mutuallyExclusiveProps2 = _interopRequireDefault(_mutuallyExclusiveProps);

var _mutuallyExclusiveTrueProps = require('./mutuallyExclusiveTrueProps');

var _mutuallyExclusiveTrueProps2 = _interopRequireDefault(_mutuallyExclusiveTrueProps);

var _nChildren = require('./nChildren');

var _nChildren2 = _interopRequireDefault(_nChildren);

var _nonNegativeInteger = require('./nonNegativeInteger');

var _nonNegativeInteger2 = _interopRequireDefault(_nonNegativeInteger);

var _nonNegativeNumber = require('./nonNegativeNumber');

var _nonNegativeNumber2 = _interopRequireDefault(_nonNegativeNumber);

var _numericString = require('./numericString');

var _numericString2 = _interopRequireDefault(_numericString);

var _object = require('./object');

var _object2 = _interopRequireDefault(_object);

var _or = require('./or');

var _or2 = _interopRequireDefault(_or);

var _range = require('./range');

var _range2 = _interopRequireDefault(_range);

var _restrictedProp = require('./restrictedProp');

var _restrictedProp2 = _interopRequireDefault(_restrictedProp);

var _sequenceOf = require('./sequenceOf');

var _sequenceOf2 = _interopRequireDefault(_sequenceOf);

var _shape = require('./shape');

var _shape2 = _interopRequireDefault(_shape);

var _uniqueArray = require('./uniqueArray');

var _uniqueArray2 = _interopRequireDefault(_uniqueArray);

var _uniqueArrayOf = require('./uniqueArrayOf');

var _uniqueArrayOf2 = _interopRequireDefault(_uniqueArrayOf);

var _valuesOf = require('./valuesOf');

var _valuesOf2 = _interopRequireDefault(_valuesOf);

var _withShape = require('./withShape');

var _withShape2 = _interopRequireDefault(_withShape);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }

module.exports = {
  and: _and2['default'],
  between: _between2['default'],
  childrenHavePropXorChildren: _childrenHavePropXorChildren2['default'],
  childrenOf: _childrenOf2['default'],
  childrenOfType: _childrenOfType2['default'],
  childrenSequenceOf: _childrenSequenceOf2['default'],
  componentWithName: _componentWithName2['default'],
  elementType: _elementType2['default'],
  explicitNull: _explicitNull2['default'],
  forbidExtraProps: _forbidExtraProps2['default'],
  integer: _integer2['default'],
  keysOf: _keysOf2['default'],
  mutuallyExclusiveProps: _mutuallyExclusiveProps2['default'],
  mutuallyExclusiveTrueProps: _mutuallyExclusiveTrueProps2['default'],
  nChildren: _nChildren2['default'],
  nonNegativeInteger: _nonNegativeInteger2['default'],
  nonNegativeNumber: _nonNegativeNumber2['default'],
  numericString: _numericString2['default'],
  object: _object2['default'],
  or: _or2['default'],
  range: _range2['default'],
  restrictedProp: _restrictedProp2['default'],
  sequenceOf: _sequenceOf2['default'],
  shape: _shape2['default'],
  uniqueArray: _uniqueArray2['default'],
  uniqueArrayOf: _uniqueArrayOf2['default'],
  valuesOf: _valuesOf2['default'],
  withShape: _withShape2['default']
};
//# sourceMappingURL=index.js.map

redpajama_set_name: RedPajamaGithub


text:
(function () {
  var DOMAINS = ['foo.com', 'bar.com', 'baz.com'];

  var CUTOF = 20;

  var DEL = 46;
  var BACK = 8;

  var INVALID = ['', 'test', 'test@', 'test@@', 'test@foo.comz'];
  var VALID = ['test@f', 'test@foo.co', /* test@foo.com, */ 'test@ba'];
  var EXPECTED = [
    ['test@foo.com'],
    ['test@foo.com'],
    ['test@bar.com', 'test@baz.com']
  ];
  var input;

  function setup() {
    $('#main').append($('<form id="form"><input id="input" /></form>'));
    input = $('#input').emailcomplete(DOMAINS, CUTOF);
  }

  function teardown() {
    $('#main').empty();
    input = null;
  }

  function placeholder() {
    return $('.ec-suggest').val();
  }

  function suggestions() {
    var result = [];
    $('.ec-item').each(function() {
      result.push($(this).text());
    });
    return result;
  }

  function backspace(text) {
    var event = {altKey: false, metaKey: false, shiftKey: false, ctrlKey: false};
    var keydownevent = $.extend($.Event(), event, {type:'keydown', keyCode: BACK, charCode: 0});
    var keyupevent = $.extend($.Event(), event, {type:'keyup', keyCode: BACK, charCode: 0});

    input.trigger(keydownevent);
    input.val(text);
    input.trigger(keyupevent);
  }

  function carret(pos) {
    var i = input.get(0);
    if (i.setSelectionRange) {
      i.setSelectionRange(pos, pos);
    } else {
      var range = i.createTextRange();
      range.collapse(true);
      range.moveEnd('character', pos);
      range.moveStart('character', pos);
      range.select();
    }
  }

  $(document).ready(function() {
    module('emailcomplete', {setup: setup, teardown: teardown});

    test("when I type a string that does not match the suggestion list is not shown", function() {
      for (var i in INVALID) {
        input.val('').autotype(INVALID[i]);
        ok($('.ec-list').is(':hidden'), 'suggestion list is hidden after typing: "' + INVALID[i] + '"');
      }
    });

    test("when I type a string that does not match the suggestion list is empty", function() {
      for (var i in INVALID) {
        input.val('').autotype(INVALID[i]);
        same(suggestions(), [], 'suggestion list is empty after typing: "' + INVALID[i] + '"');
      }
    });

    test("when I type a string that matches, a suggestion list should be shown", function() {
      for (var i in VALID) {
        input.val('').autotype(VALID[i]);
        ok($('.ec-list').is(':visible'), 'suggestion list is visible after typing: "' + VALID[i] + '"');
      }
    });

    test("when I type a string that matches, the suggestion list should contain the matches", function() {
      for (var i in VALID) {
        input.val('').autotype(VALID[i]);
        same(suggestions(), EXPECTED[i], 'when ' + VALID[i] + ' is typed, the matching suggestions should be shown');
      }
    });

    test("when I type a string that matches the first match should be shown as placeholder", function() {
      for (var i in VALID) {
        input.val('').autotype(VALID[i]);
        equals(placeholder(), EXPECTED[i][0], 'typed ' + VALID[i]);
      }
    });

    test("when I click a suggestion its value is set", function() {
      for (var i in VALID) {
        input.val('').autotype(VALID[i]);
        var suggestion = $('.ec-item:first-child');
        suggestion.mousedown();
        equals(suggestion.text(), input.val(), 'clicking sets text');
      }
    });

    test("when I click a suggestion the suggestion list is hidden", function() {
      for (var i in VALID) {
        input.val('').autotype(VALID[i]);
        var suggestion = $('.ec-item:first-child');
        suggestion.mousedown();
        ok($('.ec-list').is(':hidden'), 'suggestion list is visable');
      }
    });

    test("when I click a suggestion the placeholder is cleared", function() {
      for (var i in VALID) {
        input.val('').autotype(VALID[i]);
        var suggestion = $('.ec-item:first-child');
        suggestion.mousedown();
        equal(placeholder(), '', 'placeholder should be empty');
      }
    });

    test("when a suggestion list is present the first suggestion is selected", function() {
      for (var i in VALID) {
        input.val('').autotype(VALID[i]);
        var suggestion = $('.ec-item:first-child');
        ok(suggestion.is('.ec-selected'), 'first suggestion should be selected when ' + VALID[i] + ' is typed')
      }
    });

    test("when a suggestion list is present only one item should be selected", function() {
      for (var i in VALID) {
        input.val('').autotype(VALID[i]);
        equal($('.ec-selected').length, 1, 'only one item should be selected');
      }
    });

    test("when a suggestion list is present and I press down the next suggestion is highlighted", function() {
      input.autotype('test@b');
      var selected = $('.ec-selected');
      input.autotype('{{down}}');
      equal($('.ec-selected').text(), selected.next().text());
    });

    test("when a suggestion list is present and I press down the next suggestion is used as a placeholder", function() {
      input.autotype('test@b');
      input.autotype('{{down}}');
      equal(placeholder(), $('.ec-selected').text());
    });

    test("when a suggestion list is present and I press down while at the last suggestion nothing happens", function() {
      input.autotype('test@b');
      $('.ec-item').removeClass('ec-selected');
      var selected = $('.ec-item:last-child').addClass('ec-selected');
      input.autotype('{{down}}');
      equal($('.ec-selected').text(), selected.text());
    });

    test("when a suggestion list is present and I press up the previous suggestion is highlighted", function() {
      input.autotype('test@b');
      $('.ec-item').removeClass('ec-selected');
      var selected = $('.ec-item:last-child').addClass('ec-selected');
      input.autotype('{{up}}');
      equal($('.ec-selected').text(), selected.prev().text());
    });

    test("when a suggestion list is present and I press up the previous suggestion is is used as a placeholder", function() {
      input.autotype('test@b');
      $('.ec-item').removeClass('ec-selected');
      var selected = $('.ec-item:last-child').addClass('ec-selected');
      input.autotype('{{up}}');
      equal($('.ec-selected').text(), selected.prev().text());
    });

    test("when a suggestion list is present and I press up while at the first suggestion nothing happens", function() {
      input.autotype('test@b');
      var selected = $('.ec-selected');
      input.autotype('{{up}}');
      equal($('.ec-selected').text(), selected.text());
    });

    test("when a placeholder is present and I blur the placeholder is cleared", function() {
      input.autotype('test@b');
      input.blur();
      equal(placeholder(), '');
    });

    test("when a placeholder is present and I blur the input the suggestion list is hidden", function() {
      input.autotype('test@b');
      input.blur();
      ok($('.ec-list').is(':hidden'));
    });

    test("when a selected value is present and I press enter its value is transfered to the input", function() {
      input.autotype('test@b');
      input.autotype('{{enter}}');
      equal(input.val(), 'test@bar.com');
    });

    test("when a placeholder is present and I press enter placeholder is cleared", function() {
      input.autotype('test@b');
      input.autotype('{{enter}}');
      equal(placeholder(), '');
    });

    test("when a selected value is present and I press tab its value is transfered to the input", function() {
      input.autotype('test@b');
      input.autotype('{{tab}}');
      equal(input.val(), 'test@bar.com');
    });

    test("when a placeholder is present and I press tab placeholder is cleared", function() {
      input.autotype('test@b');
      input.autotype('{{tab}}');
      equal(placeholder(), '');
    });

    test("when I change the string the suggestion is updated", function() {
      input.autotype('test@ba');
      same(suggestions(), ['test@bar.com', 'test@baz.com'], input.val());
      input.autotype('z');
      same(suggestions(), ['test@baz.com'], input.val());
      input.autotype('{{back}}');
      same(suggestions(), ['test@bar.com', 'test@baz.com'], input.val());
    });

    test("when I change the string the placeholder is updated", function() {
      input.autotype('test@ba');
      equal(placeholder(), 'test@bar.com');
      input.autotype('z');
      equal(placeholder(), 'test@baz.com');
      input.autotype('{{back}}');
      equal(placeholder(), 'test@bar.com');
    });

    test("when I change the string so that it no longer matches the suggestions are hidden", function() {
      input.autotype('test@b');
      input.autotype('{{back}}');
      ok($('.ec-list').is(':hidden'));
    });

    test("when I change the string so that it no longer matches the placeholder is cleared", function() {
      input.autotype('test@b');
      input.autotype('{{back}}');
      equal(placeholder(), '');
    });

    test("when the suggestion list is present it should be the at least the same width as the input", function() {
      input.autotype('test@b');
      var list = $('.ec-list').width();
      ok(list >= input.width(), list + ' >= ' + input.width());
    });

    test("when we are focused the suggestion list should become visible again", function() {
      input.autotype('test@b');
      input.blur();
      input.focus();
      ok($('.ec-list').is(':visible'));
    });

    test("when we are focused the placeholder be set again", function() {
      input.autotype('test@b');
      input.blur();
      input.focus();
      equal(placeholder(), 'test@bar.com');
    });

    test("when the localpart is updated the placeholder is updated to match", function() {
      input.autotype('test@ba');
      backspace('tes@ba');
      equal(placeholder(), 'tes@bar.com');
    });

    test("when the localpart is updated the suggestion list is updated to match", function() {
      input.autotype('test@ba');
      backspace('tes@ba');
      same(suggestions(), ['tes@bar.com', 'tes@baz.com']);
    });

    test("when the keydown event for delete is fired the suggestion is cleared", function() {
        input.autotype('test@b');

        var event = {altKey: false, metaKey: false, shiftKey: false, ctrlKey: false};
        var keydownevent = $.extend($.Event(), event, {type:'keydown', keyCode: DEL, charCode: 0});

        input.trigger(keydownevent);
        equal(placeholder(), '');
    });

    test("when the keydown event for backspace is fired the suggestion is cleared", function() {
        input.autotype('test@b');
        carret(0);

        var event = {altKey: false, metaKey: false, shiftKey: false, ctrlKey: false};
        var keydownevent = $.extend($.Event(), event, {type:'keydown', keyCode: BACK, charCode: 0});

        input.trigger(keydownevent);
        equal(placeholder(), '');
    });

    test("when the keydownevent for backspace is fired and the carret is at the end the text is not cleared", function() {
        var text = 'test@ba';
        input.autotype(text);
        carret(text.length);

        var event = {altKey: false, metaKey: false, shiftKey: false, ctrlKey: false};
        var keydownevent = $.extend($.Event(), event, {type:'keydown', keyCode: BACK, charCode: 0});

        input.trigger(keydownevent);
        equal(placeholder(), 'test@bar.com');
    });

    test("when cutof is passed placeholder is not set", function() {
      input.autotype('12345678901234567890@f')
      same(placeholder(), '');
    });

    test("when the suggestion list is present it should be below the input", function() {
      // FIXME
    });

    test("when the suggestion list is present it should have a solid background", function() {
      // FIXME
    });

    test("when the placeholder is present it should be aligned with the input", function() {
      // FIXME
    });

    test("when the tab key is pressed the the suggestion input is not focused", function() {
      // FIXME
    });

    test("when the shift+tab key is pressed the the suggestion input is not focused", function() {
      // FIXME
    });

    test("when the text is earsed the placeholder is updated", function() {
    });

    test("when the text is changed the selected item is presserved", function() {
    });

    test("when a placeholder is present and I press enter the form is not submited", function() {
    });

    test("when no placeholder is present and I press enter the form is submited", function() {
    });

    // FIXME enter triggers submit on opera
    // ... keydown vs. keypress issue it would seem
    // FIXME enter never trigger submit on ie
    // FIXME text scrolling breaks placeholder hack
    // ... solved with cutof perhaps?
    // FIXME clearing placeholder for keydown back and del not tested
    // FIXME clearing placeholder when at end of string looks ugly...
    // FIXME test-foo@ba -> testi@ba should be tested with keypress i
    // FIXME updating localpart should not trigger animation

    // FIXME test suggest is not modified between events...

    // FIXME test that arrows keys to sides don't "kill" suggestion

    // FIXME right arrow should "type" next char

    // Backspace at end does nothing
    // Backspace internal clears suggest
    // del allways clears suggestion
  });
})();


text:
set -e
set -x

cd $(dirname ${BASH_SOURCE[0]})

# Recipes that should fail and give some error

for recipe in metadata/*/; do
    if [[ $(ls -A $recipe) ]]; then
        if [[ $recipe =~ .*osx_is_app.* && $(uname) != "Darwin" ]]; then
            continue
        fi
        conda build --no-binstar-upload $recipe
    fi
done

# We use 2>&1 as the error is printed to stderr. We could do >/dev/null to
# ensure it is printed to stderr, but then we would hide the output of the
# command from the test output.  The ! ensures that the command fails.
! OUTPUT=$(conda build fail/symlinks/ 2>&1)
echo "$OUTPUT" | grep "Error" | wc -l | grep 6


text:
package boofcv.alg.filter.convolve.noborder;

import boofcv.alg.filter.convolve.CompareToStandardConvolution;
import boofcv.struct.convolve.Kernel1D_I32;
import boofcv.struct.convolve.Kernel2D_I32;
import boofcv.struct.image.ImageInt8;
import boofcv.struct.image.ImageUInt8;
import org.junit.Test;

import java.lang.reflect.Method;

/**
 * @author Peter Abeles
 */
public class TestConvolveImageUnrolled_U8_I8_Div {
	CompareToStandardConvolution compareToStandard = new CompareToStandardConvolution(ConvolveImageUnrolled_U8_I8_Div.class);

	@Test
	public void convolve() throws NoSuchMethodException {
		for (int i = 0; i < GenerateConvolvedUnrolled.numUnrolled; i++) {
			Method m = ConvolveImageUnrolled_U8_I8_Div.class.getMethod("convolve",
					Kernel2D_I32.class, ImageUInt8.class, ImageInt8.class , int.class);

			compareToStandard.compareMethod(m, "convolve", i + 1);
		}
	}

	@Test
	public void horizontal_divide() throws NoSuchMethodException {

		for (int i = 0; i < GenerateConvolvedUnrolled.numUnrolled; i++) {
			Method m = ConvolveImageUnrolled_U8_I8_Div.class.getMethod("horizontal",
					Kernel1D_I32.class, ImageUInt8.class, ImageInt8.class, int.class, boolean.class);

			compareToStandard.compareMethod(m, "horizontal", i + 1);
		}
	}

	@Test
	public void vertical_divide() throws NoSuchMethodException {

		for (int i = 0; i < GenerateConvolvedUnrolled.numUnrolled; i++) {
			Method m = ConvolveImageUnrolled_U8_I8_Div.class.getMethod("vertical",
					Kernel1D_I32.class, ImageUInt8.class, ImageInt8.class, int.class, boolean.class);

			compareToStandard.compareMethod(m, "vertical", i + 1);
		}
	}
}


text:
/* jshint node: true */
'use strict';

module.exports = {
  name: 'ember-ted-gear',

  included: function(app) {
    app.import('vendor/ember-ted-gear/style.css');
  }
};


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

class Migration(SchemaMigration):

    def forwards(self, orm):
        # Adding model 'PpfaTest'
        db.create_table(u'selenium_tests_ppfatest', (
            (u'id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
            ('name', self.gf('django.db.models.fields.CharField')(max_length=100)),
            ('location', self.gf('django.db.models.fields.CharField')(max_length=100)),
            ('date_created', self.gf('django.db.models.fields.DateTimeField')(null=True, blank=True)),
            ('last_run', self.gf('django.db.models.fields.DateTimeField')(null=True, blank=True)),
            ('status', self.gf('django.db.models.fields.BooleanField')(default=False)),
        ))
        db.send_create_signal(u'selenium_tests', ['PpfaTest'])

        # Adding model 'PpfaTestRun'
        db.create_table(u'selenium_tests_ppfatestrun', (
            (u'id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
            ('ppfa_test', self.gf('django.db.models.fields.related.ForeignKey')(related_name='ppfa_test_runs', to=orm['selenium_tests.PpfaTest'])),
            ('date_created', self.gf('django.db.models.fields.DateTimeField')(null=True, blank=True)),
            ('status', self.gf('django.db.models.fields.BooleanField')(default=False)),
        ))
        db.send_create_signal(u'selenium_tests', ['PpfaTestRun'])

        # Adding model 'PpfaTestAssertion'
        db.create_table(u'selenium_tests_ppfatestassertion', (
            (u'id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
            ('subject', self.gf('django.db.models.fields.CharField')(max_length=100)),
            ('verb', self.gf('django.db.models.fields.CharField')(max_length=100)),
            ('object', self.gf('django.db.models.fields.CharField')(max_length=100)),
            ('status', self.gf('django.db.models.fields.BooleanField')(default=False)),
            ('ppfa_test_run', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['selenium_tests.PpfaTestRun'])),
            ('ppfa_test', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['selenium_tests.PpfaTest'])),
        ))
        db.send_create_signal(u'selenium_tests', ['PpfaTestAssertion'])

    def backwards(self, orm):
        # Deleting model 'PpfaTest'
        db.delete_table(u'selenium_tests_ppfatest')

        # Deleting model 'PpfaTestRun'
        db.delete_table(u'selenium_tests_ppfatestrun')

        # Deleting model 'PpfaTestAssertion'
        db.delete_table(u'selenium_tests_ppfatestassertion')

    models = {
        u'selenium_tests.ppfatest': {
            'Meta': {'object_name': 'PpfaTest'},
            'date_created': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}),
            u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'last_run': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}),
            'location': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
            'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
            'status': ('django.db.models.fields.BooleanField', [], {'default': 'False'})
        },
        u'selenium_tests.ppfatestassertion': {
            'Meta': {'object_name': 'PpfaTestAssertion'},
            u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'object': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
            'ppfa_test': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['selenium_tests.PpfaTest']"}),
            'ppfa_test_run': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['selenium_tests.PpfaTestRun']"}),
            'status': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
            'subject': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
            'verb': ('django.db.models.fields.CharField', [], {'max_length': '100'})
        },
        u'selenium_tests.ppfatestrun': {
            'Meta': {'object_name': 'PpfaTestRun'},
            'date_created': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}),
            u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'ppfa_test': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'ppfa_test_runs'", 'to': u"orm['selenium_tests.PpfaTest']"}),
            'status': ('django.db.models.fields.BooleanField', [], {'default': 'False'})
        }
    }

    complete_apps = ['selenium_tests']


text:
const DrawCard = require('../../../drawcard.js');

class MoonBrothers extends DrawCard {
    setupCardAbilities(ability) {
        this.action({
            title: 'Add as an attacker',
            location: 'hand',
            condition: () => (
                this.game.currentChallenge &&
                this.game.currentChallenge.attackingPlayer === this.controller &&
                this.hasAttackingClansman()
            ),
            cost: ability.costs.kneelFactionCard(),
            handler: () => {
                this.controller.putIntoPlay(this);
                this.game.currentChallenge.addAttacker(this);
                this.kneeled = false;
                this.game.addMessage('{0} kneels their faction card to put {1} into play participating  as an attacker',
                                      this.controller, this);
            }
        });
    }

    hasAttackingClansman() {
        var cards = this.controller.filterCardsInPlay(card => {
            return card.hasTrait('Clansman') && card.getType() === 'character' && this.game.currentChallenge.isAttacking(card);
        });

        return cards.length > 0;
    }
}

MoonBrothers.code = '05011';

module.exports = MoonBrothers;


text:
import {Component} from '@angular/core';

@Component({
  selector: 'tooltip-demo',
  templateUrl: 'tooltip-demo.html',
})
export class TooltipDemo {}


text:
package support

import javax.net.ssl._
import play.core.ApplicationProvider
import play.server.api._

/*
 * This custom SSL engine creates an instance of the default SSL Engine and
 * enables client authentication.  For this class to be instantiated the
 * following command line argument must be used when starting the application:
 *
 *     -Dplay.http.sslengineprovider=support.CustomSSLEngineProvider
 */
class CustomSSLEngineProvider(appProvider: ApplicationProvider) extends SSLEngineProvider {
  override def createSSLEngine(): SSLEngine = {
    val sslEngine = SSLContext.getDefault.createSSLEngine
    sslEngine.setNeedClientAuth(true)
    sslEngine
  }
}


text:
package com.tectonica.jonix.onix2;

import com.tectonica.jonix.common.JPU;
import com.tectonica.jonix.common.OnixElement;
import com.tectonica.jonix.common.codelist.Languages;
import com.tectonica.jonix.common.codelist.RecordSourceTypes;
import com.tectonica.jonix.common.codelist.TextCaseFlags;
import com.tectonica.jonix.common.codelist.TextFormats;
import com.tectonica.jonix.common.codelist.TransliterationSchemes;
import com.tectonica.jonix.common.codelist.UnpricedItemTypes;

import java.io.Serializable;

/*
 * NOTE: THIS IS AN AUTO-GENERATED FILE, DO NOT EDIT MANUALLY
 */

/**
 *
Unpriced item type

 *

 * An ONIX code which specifies a reason why a price amount is not sent. If code value 02 is used to send
 * advance information without giving a price, the price must be confirmed as soon as possible. Optional and
 * non-repeating, but required if the <SupplyDetail> composite does not carry a price.
 *

 *

 *

 * Format
 * Fixed-length, two numeric digits.
 *

 *

 * Codelist
 * List 57
 *

 *

 * Reference name
 * <tt><UnpricedItemType></tt>
 *

 *

 * Short tag
 * <tt><j192></tt>
 *

 *

 * Example
 * <tt><UnpricedItemType>01</UnpricedItemType></tt> Free of charge
 *

 *

 *

 * This tag may be included in the following composites:
 *

 *
<{@link SupplyDetail}>

 *

 *

 * Possible placements within ONIX message:
 *

 *
{@link ONIXMessage} ⯈ {@link Product} ⯈ {@link SupplyDetail} ⯈ {@link UnpricedItemType}

 *

 */
public class UnpricedItemType implements OnixElement<UnpricedItemTypes>, Serializable {
    private static final long serialVersionUID = 1L;

    public static final String refname = "UnpricedItemType";
    public static final String shortname = "j192";

    /////////////////////////////////////////////////////////////////////////////////
    // ATTRIBUTES
    /////////////////////////////////////////////////////////////////////////////////

    public TextFormats textformat;

    public TextCaseFlags textcase;

    public Languages language;

    public TransliterationSchemes transliteration;

    /**
     * (type: DateOrDateTime)
     */
    public String datestamp;

    public RecordSourceTypes sourcetype;

    public String sourcename;

    /////////////////////////////////////////////////////////////////////////////////
    // VALUE MEMBER
    /////////////////////////////////////////////////////////////////////////////////

    public UnpricedItemTypes value;

    /**
     * Internal API, use the {@link #value()} method or the {@link #value} field instead
     */
    @Override
    public UnpricedItemTypes _value() {
        return value;
    }

    /////////////////////////////////////////////////////////////////////////////////
    // SERVICES
    /////////////////////////////////////////////////////////////////////////////////

    private final boolean exists;
    public static final UnpricedItemType EMPTY = new UnpricedItemType();

    public UnpricedItemType() {
        exists = false;
    }

    public UnpricedItemType(org.w3c.dom.Element element) {
        exists = true;
        textformat = TextFormats.byCode(JPU.getAttribute(element, "textformat"));
        textcase = TextCaseFlags.byCode(JPU.getAttribute(element, "textcase"));
        language = Languages.byCode(JPU.getAttribute(element, "language"));
        transliteration = TransliterationSchemes.byCode(JPU.getAttribute(element, "transliteration"));
        datestamp = JPU.getAttribute(element, "datestamp");
        sourcetype = RecordSourceTypes.byCode(JPU.getAttribute(element, "sourcetype"));
        sourcename = JPU.getAttribute(element, "sourcename");

        value = UnpricedItemTypes.byCode(JPU.getContentAsString(element));
    }

    /**
     * @return whether this tag (<UnpricedItemType> or <j192>) is explicitly provided in the ONIX XML
     */
    @Override
    public boolean exists() {
        return exists;
    }
}


text:
package btools.mapcreator;

/**
 * Callbacklistener for Relations
 *
 * @author ab
 */
public interface RelationListener {
  void nextRelation(RelationData data) throws Exception;

  void nextRestriction(RelationData data, long fromWid, long toWid, long viaNid) throws Exception;
}


text:
require 'sidekiq/testing'

Sidekiq::Testing.fake!
Sidekiq.configure_client do |config|
  config.client_middleware do |chain|
    chain.remove SidekiqUniqueJobs::Client::Middleware
  end
end


text:
require "fast_spec_helper"
require "formatters/abstract_document_publication_alert_formatter"

RSpec.describe MedicalSafetyAlertPublicationAlertFormatter do
  let(:url_maker) {
    double(:url_maker,
      published_specialist_document_path: "http://www.example.com"
    )
  }
  let(:document) {
    double(:document,
      alert_type: "drugs",
      title: "Some title",
    )
  }
  subject(:formatter) {
    MedicalSafetyAlertPublicationAlertFormatter.new(
      document: document,
      url_maker: url_maker,
    )
  }
  it "has a subject containing the document title" do
    expect(formatter.subject).to eq("Drug alert: Some title")
  end
end


text:
__all__ = ('lights', 'light', 'item_for_light', 'toggle_item_for_light',
           'group', 'item_for_group', 'scenes_item_for_group',
           'scenes', 'scene', 'item_for_scene_name',
           'connected')

HUE_PRODUCTS = dict(
    LLC014='aura',
    HBL001='beyond_ceiling_pendant_table',
    HBL002='beyond_ceiling_pendant_table',
    HBL003='beyond_ceiling_pendant_table',
    LLC005='bloom',
    LLC011='bloom',
    LLC012='bloom',
    LLC007='bloom',
    LCT002='br30',
    LCT011='br30',
    LTW011='br30',
    LWB005='br30',
    LWB011='br30',
    HEL001='entity',
    HEL002='entity',
    LLC020='go',
    LCT003='gu10_par16',
    HIL001='impulse',
    HIL002='impulse',
    LLC006='iris',
    LLC010='iris',
    LST001='lightstrip',
    LST002='lightstrip',
    HML001='phoenix_ceiling_pendant_table_wall',
    HML002='phoenix_ceiling_pendant_table_wall',
    HML003='phoenix_ceiling_pendant_table_wall',
    HML004='phoenix_ceiling_pendant_table_wall',
    HML005='phoenix_ceiling_pendant_table_wall',
    HML006='phoenix_ceiling_pendant_table_wall',
    HML007='phoenix_recessed_spot',
    LLC013='storylight',
    LCT001='white_and_color_e27_b22',
    LCT007='white_and_color_e27_b22',
    LCT010='white_and_color_e27_b22',
    LWT010='white_and_color_e27_b22',
    LWB004='white_and_color_e27_b22',
    LWB006='white_and_color_e27_b22',
    LWB010='white_e27_b22',
    LWB014='white_e27_b22')

HUE_ROOMS=['bathroom', 'bedroom', 'carport', 'dining', 'driveway', 'frontdoor',
           'garage', 'garden', 'gym', 'hallway', 'kids_bedroom', 'kitchen',
           'living', 'nursery', 'office', 'recreation', 'terrace', 'toilet']

import collections, urllib
import bridges

bridge = bridges.current()

def connected():
    return bool(bridge)

def lights():
    lights = dict((light_info['name'], (int(light_id), light_info))
                  for (light_id, light_info) in bridge.lights().iteritems()
                  if light_info['state']['reachable'])
    return collections.OrderedDict(sorted(lights.items()))

def light(light_id):
    return bridge.lights[light_id]

def item_for_light(light_id, light_info):
    icon = 'font-awesome:fa-lightbulb-o'
    if light_info['manufacturername'] == 'Philips':
        icon = HUE_PRODUCTS.get(light_info['modelid'], icon)
    return dict(
        title=light_info['name'],
        icon=icon,
        iconIsTemplate=True)

def action_url(kind, **params):
    return 'x-launchbar:action/net.sabi.LaunchBar.action.Hue/%s?%s' % (
        kind, urllib.urlencode(params))

def toggle_item_for_light(light_id, light_info):
    item = item_for_light(light_id, light_info)
    on = bool(light_info['state']['on'])
    want_on = 0 if on else 1
    item.update(
        action='action.py',
        url=action_url('light', id=light_id, on=want_on))
    if on:
        item['badge'] = 'ON'
    return item

def scenes():
    def lights_as_set(lights):
        return frozenset(map(int, lights))
    lights_groups = dict(
        (lights_as_set(group_info['lights']),
         (int(group_id), group_info))
        for (group_id, group_info) in bridge.groups().iteritems()
        if len(group_info['lights']))
    scenes_by_group = {}
    for (scene_id, scene_info) in bridge.scenes().iteritems():
        if scene_info['recycle']: # temporary, ignore
            continue
        lights_set = lights_as_set(scene_info['lights'])
        group_id, group_info = lights_groups.get(lights_set, (None, None))
        if group_id is None:
            continue
        group_name = group_info['name']
        scenes_by_group.setdefault(
            (group_name, group_id), (group_info, []))[1].append(
                (scene_info['name'], scene_id))
    scenes_by_group = collections.OrderedDict(
        sorted((_, (group_info, sorted(scenes)))
               for (_, (group_info, scenes)) in scenes_by_group.iteritems()))
    scenes_by_group[(None, 0)] = ({}, [])
    return scenes_by_group

def group(group_id):
    return bridge.groups[group_id]

def item_for_group(group_id, group_info):
    if group_id is 0:
        return dict(title='All', icon='font-awesome:cubes')

    group_name = group_info['name']
    lower_name = group_name.lower()
    for room in HUE_ROOMS:
        if room in lower_name:
            icon = room
            break
    else:
        icon = 'other'
    item = dict(title=group_name, icon=icon, iconIsTemplate=True)
    state = group_info['state']
    if bool(state['all_on']):
        item['badge'] = 'ALL ON'
    elif bool(state['any_on']):
        item['badge'] = 'ON'
    return item

def scenes_item_for_group((group_name, group_id), (group_info, group_scenes)):
    item = item_for_group(group_id, group_info)
    item.update(
        children=[set_item_for_scene(group_id, scene)
                  for scene in group_scenes] + [
                          dict(title='All On',
                               icon='font-awesome:toggle-on',
                               action='action.py',
                               url=action_url('group', id=group_id, on=1)),
                          dict(title='All Off',
                               icon='font-awesome:toggle-off',
                               action='action.py',
                               url=action_url('group', id=group_id, on=0))])
    return item

def scene(scene_id):
    return bridge.scenes[scene_id]

def item_for_scene_name(scene_name):
    return dict(
        title=scene_name,
        icon='font-awesome:picture-o')

def set_item_for_scene(group_id, (scene_name, scene_id)):
    item = item_for_scene_name(scene_name)
    item.update(
        action='action.py',
        url=action_url('group', id=group_id, scene=scene_id))
    return item


text:
Edit Aircraft Charter Testimonial edit aircraft charter page testimonial

<a href="<?php echo base_url(); ?>dashboard"> Dashboard

Edit Aircraft Charter Testimonial

Edit Aircraft Charter Testimonial

                    <form id="edit_home_page_testimonial_form" method="post" enctype="multipart/form-data" role="form">

								Content
								<textarea class="form-control" id="home_page_testimonial_content" name="home_page_testimonial_content" rows="7"><?php echo $home_page_testimonial_array['home_page_testimonial_content']; ?></textarea>

								Person
								<input type="text" name="home_page_testimonial_person" id="home_page_testimonial_person" class="form-control" value="<?php echo $home_page_testimonial_array['home_page_testimonial_person']; ?>"/>

								 Select Image
								 Change Image (*.jpg, .png)(150 x 150)
								<input type="hidden" name="home_page_testimonial_image" value="<?php echo $home_page_testimonial_array['home_page_testimonial_image']; ?>" id="home_page_testimonial_image">
								<a href="<?php echo base_url() . 'uploads/page_testimonials/home_page' . date('/Y/m/d/H/i/s/', strtotime($home_page_testimonial_array['home_page_testimonial_created'])) . $home_page_testimonial_array['home_page_testimonial_image']; ?>" target="_blank" title="click to view" id="image_link">
									<img src="<?php echo base_url() . 'uploads/page_testimonials/home_page' . date('/Y/m/d/H/i/s/', strtotime($home_page_testimonial_array['home_page_testimonial_created'])) . $home_page_testimonial_array['home_page_testimonial_image']; ?>" style="max-width: 100px;max-height: 100px" id="home_page_testimonial_image_show"/>

							<button id="edit_home_page_testimonial_button" type="button" class="btn btn-primary" onclick="edit_home_page_testimonial();" data-loading-text="Please Wait..">Update </button>

					</form>


text:
import os

from splits.util import path_for_part

class SplitWriter(object):
    def __init__(self, basepath,
                 suffix='',
                 lines_per_file=100000,
                 fileClass=open,
                 fileArgs={'mode': 'wb'}):
        self.suffix = suffix
        self.basepath = basepath
        self.lines_per_file = lines_per_file
        self.fileClass = fileClass
        self.fileArgs = fileArgs
        self._seqnum = 0
        self._linenum = 0
        self._filelinenum = 0
        self._written_file_paths = []
        self._current_file = self._create_file()

    def __enter__(self):
        return self

    def __exit__(self, type, value, traceback):
        self.close()

    def write(self, data):
        if not isinstance(data, bytes):
            data = data.encode('utf-8')
        cnt = data.count(b'\n')
        for index, line in enumerate(data.split(b'\n')):
            if index == cnt:
                self._write_line(line)
            else:
                self._write_line(line + b'\n')

    def writelines(self, lines):
        for line in lines:
            if not isinstance(line, bytes):
                line = line.encode('utf-8')
            self._write_line(line)

    def _write_line(self, line):
        f = self._get_current_file()
        f.write(line)
        self._linenum += line.count(b'\n')
        self._filelinenum += line.count(b'\n')

    def close(self):
        if self._current_file:
            self._current_file.close()

        path = self.basepath[:-1] if self.basepath.endswith('/') else self.basepath
        path += '.manifest'

        f = self.fileClass(path, **self.fileArgs)
        f.write(b''.join([x + b'\n' for x in self._written_file_paths]))
        f.close()

    def _get_current_file(self):
        if self._filelinenum >= self.lines_per_file:

            if self._current_file:
                self._current_file.close()

            self._current_file = self._create_file()

        return self._current_file

    def _create_file(self):
        self._seqnum += 1
        self._filelinenum = 0
        path = path_for_part(self.basepath, self._seqnum, self.suffix)
        self._written_file_paths.append(path.encode('utf-8'))
        return self.fileClass(path, **self.fileArgs)


text:
* The app streams the data from Twitter. User can add specific column for each twitter data stream.

###Demos
* Demo Live(PROD): https://tweetdeck.herokuapp.com/
* Demo Live(QA): https://tweetdeck-qa.herokuapp.com/
* Demo Live(DEV): https://tweetdeck-dev.herokuapp.com/
* Demo Video: https://www.youtube.com/watch?v=uaiUTC5TwbM

###Used
* Langauges:
   * Go, HTML5, CSS3, JS
* Libraries:
    * GO:  github.com/op/go-logging
    * GO:  github.com/gorilla/websocket
    * GO:  github.com/dghubble/go-twitter/twitter
    * GO:  github.com/dghubble/oauth1
    * CSS: github.com/miniMAC/magic
    * JS:  github.com/jquery/jquery
* Dependency tool:
    * GO: github.com/tools/godep
* Hosting
    * Heroku
* Continuous Integration (CI)
    * Travis CI with GitHub (dev, qa, prod)
* Continuous Delivery (CD)
    * Heroku Pipeline with GitHub (dev, qa, prod)
* Frameworks :
    *  Materialize CSS framework
* APIs:
    * Twitter Stream API
* Protocols
    * WebSocket Secure
    * HTTPS
* Authorization
    * OAuth 1.0A (used for Twitter API)

### Heroku Pipeline
![alt tag](http://passion-projects.weebly.com/uploads/4/2/6/7/42671647/9046146_orig.png)

###ScreenShots
![alt tag](http://passion-projects.weebly.com/uploads/4/2/6/7/42671647/5498636_orig.png)

![alt tag](http://passion-projects.weebly.com/uploads/4/2/6/7/42671647/525838_orig.png)

![alt tag](http://passion-projects.weebly.com/uploads/4/2/6/7/42671647/6814398_orig.png)

![alt tag](http://passion-projects.weebly.com/uploads/4/2/6/7/42671647/3183811_orig.png)

![alt tag](http://passion-projects.weebly.com/uploads/4/2/6/7/42671647/7650381_orig.png)


text:
namespace Shapes
{
    using System;

    internal class Square : Shape
    {
        public Square(double side)
            : base(side, side)
        {
        }

        public override double CalculateSurface()
        {
            return base.Width * base.Heigth;
        }
    }
}


text:
* For proposing a new feature, please start a discussion on the Elixir Core mailing list: https://groups.google.com/group/elixir-lang-core
* For bugs, do a quick search and make sure the bug has not yet been reported
* Please disclose security vulnerabilities privately at elixir-security@googlegroups.com
* Do not use the issues tracker for guidance, questions or support (try Elixir Forum, Stack Overflow, Slack, etc. instead)
* Finally, be nice and have fun!

### Environment

* Elixir & Erlang/OTP versions (elixir --version):
* Operating system:

### Current behavior

Include code samples, errors and stacktraces if appropriate.
If reporting a bug, please include the reproducing steps.

### Expected behavior

A short description on how you expect the code to behave.


text:
(function () {
    'use strict';

    describe('Testing select2 configuration', function () {
        var entity, scope, config, httpBackend;

        beforeEach(module('mds'));

        beforeEach(inject(function(_$httpBackend_, $rootScope, $controller) {
            httpBackend = _$httpBackend_;
            scope = $rootScope.$new();

            scope.msg = function (arg) {
                return arg;
            };

            httpBackend.expectGET('../mds/available/types').respond([]);

            $controller('MdsSchemaEditorCtrl', { $scope: scope });
            config = scope.SELECT_ENTITY_CONFIG;

            expect(config).not.toEqual(undefined);
        }));

        beforeEach(function () {
            entity = {
                name: 'test-name',
                module: 'test-module',
                namespace: 'test-namespace'
            };
        });

        it('Should correctly format the selected entity', function () {
            expect(config.formatSelection(entity))
                .toEqual('test-name (mds.module: test-module  mds.namespace: test-namespace)');

            delete entity.module;
            expect(config.formatSelection(entity))
                .toEqual('test-name (mds.namespace: test-namespace)');

            delete entity.namespace;
            entity.module = 'test-module';
            expect(config.formatSelection(entity))
                .toEqual('test-name (mds.module: test-module)');

            delete entity.module;
            delete entity.namespace;
            expect(config.formatSelection(entity)).toEqual('test-name');
        });

        it('Should return error message if label for an selected entity cannot be created',
            function () {
            expect(config.formatSelection({})).toEqual('mds.error');
            expect(config.formatSelection(null)).toEqual('mds.error');
            expect(config.formatSelection(undefined)).toEqual('mds.error');
        });

        it('Should correctly format an entity on list', function () {
            var strong = angular.element('').text(entity.name),
                name = angular.element('
').append(strong),
                module = angular.element('')
                        .text(' {0}: {1}'.format(scope.msg('mds.module'), entity.module)),
                namespace = angular.element('')
                        .text(' {0}: {1}'.format(scope.msg('mds.namespace'), entity.namespace)),
                info = angular.element('
').append(module).append(namespace),
                parent = angular.element('
').append(name).append(info);

            expect(config.formatResult(entity).wrapAll('

').parent().html())
                .toEqual(parent.wrapAll('

').parent().html());

            delete entity.module;
            info = angular.element('
').append(namespace);
            parent = angular.element('
').append(name).append(info);

            expect(config.formatResult(entity).wrapAll('

').parent().html())
                .toEqual(parent.wrapAll('

').parent().html());

            delete entity.namespace;
            entity.module = 'test-module';
            info = angular.element('
').append(module);
            parent = angular.element('
').append(name).append(info);

            expect(config.formatResult(entity).wrapAll('

').parent().html())
                .toEqual(parent.wrapAll('

').parent().html());

            delete entity.module;
            delete entity.namespace;
            parent = angular.element('
').append(name);

            expect(config.formatResult(entity).wrapAll('

').parent().html())
                .toEqual(parent.wrapAll('

').parent().html());
        });

        it('Should return error message if label for an entity on list cannot be created',
            function () {
            expect(config.formatResult({})).toEqual('mds.error');
            expect(config.formatResult(null)).toEqual('mds.error');
            expect(config.formatResult(undefined)).toEqual('mds.error');
        });

    });

}());


text:
<?php

namespace Models;

use Lib\Database;

abstract class AbstractModel
{
    /**
     * List of all model properties
     * @var array
     */
    protected $properties = [];

    public static function findById(int $id)
    {
        $fields = Database::instance()->selectOne(static::TABLE_NAME, $id);

        if ($fields) {
            return static::compileEntity($fields);
        }

        return false;
    }

    public static function find(array $where = [], array $sort = [], $limit = null): array
    {
        $data = Database::instance()->select(static::TABLE_NAME, $where, $sort, $limit);

        $result = [];
        foreach ($data as $element) {
            $result[] = static::compileEntity($element);
        }

        return $result;
    }

    public static function delete(int $id): bool
    {
        return Database::instance()->delete(static::TABLE_NAME, ['id' => $id]);
    }

    public static function count(array $where = []): int
    {
        return Database::instance()->count(static::TABLE_NAME, $where);
    }

    public function save()
    {
        if (isset($this->id)) {
            if (!Database::instance()->update(static::TABLE_NAME, $this->toArray(), ['id' => $this->id])){
                return false;
            }
        } else {
            if (!$id = Database::instance()->insert(static::TABLE_NAME, $this->toArray())) {
                return false;
            }
            $this->id = $id;
        }

        return $this->id;
    }

    public function toArray(): array
    {
        $result = [];
        foreach ($this->properties as $property) {
            if (is_null($this->{$property})) {
                continue;
            }

            $result[$property] = $this->{$property};
        }

        return $result;
    }

    protected static function compileEntity(array $data = [])
    {
        $entity = new static();

        foreach ($entity->properties as $property) {
            if (!isset($data[$property])) {
                continue;
            }

            $entity->{$property} = $data[$property];
        }

        return $entity;
    }
}


text:
Search Bermuda Classified Sites
===============================

Use this tool to search several Bermuda classifieds sites from one place.
<br>*Original source/site: http://bdasearch.com/*

The way this works is that after you load the website, when a submission is made it does the following:

1. Sends three requests to Yahoo YQL API in parallel
2. Yahoo issues GET requests to each target.
3. Each target responds to Yahoo's requests
4. Yahoo returns the content to the browser client
5. The browser client then parses the content
6. The browser client displays the parsed results


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using VVVV.PluginInterfaces.V2;
using VVVV.PluginInterfaces.V1;
using VVVV.SkeletonInterfaces;
using System.ComponentModel.Composition;
using AssimpNet;

namespace VVVV.DX11.Nodes.AssetImport
{
    [PluginInfo(Name = "Skeleton",
                Category = "Skeleton",
                Version = "Assimp",
                Author = "vux",
                Help = "Loads a skeleton from an Assimp Scene",
                Tags = "")]
    public class AssimpSkeletonNode : IPluginEvaluate
    {
        [Input("Scene", IsSingle = true, CheckIfChanged=true)]
        protected Pin<AssimpScene> FInScene;

        [Input("Root", IsSingle = true)]
        protected IDiffSpread<string> FInRoot;

        private INodeOut FSkeletonOutput;
        private Skeleton FSkeleton;

        [ImportingConstructor()]
        public AssimpSkeletonNode(IPluginHost host)
        {
            FSkeleton = new Skeleton();

            System.Guid[] guids = new System.Guid[1];
            guids[0] = new Guid("AB312E34-8025-40F2-8241-1958793F3D39");

            host.CreateNodeOutput("Skeleton", TSliceMode.Dynamic, TPinVisibility.True, out FSkeletonOutput);
            FSkeletonOutput.SetSubType2(typeof(Skeleton), guids, "Skeleton");
        }

        public void Evaluate(int SpreadMax)
        {
            if (this.FInScene.PluginIO.IsConnected)
            {
                this.FSkeletonOutput.SliceCount = 1;

                if (this.FInScene.IsChanged || this.FInRoot.IsChanged)
                {

                    FSkeleton.ClearAll();

                    List<AssimpNode> allnodes = new List<AssimpNode>();
                    this.RecurseNodes(allnodes, this.FInScene[0].RootNode);

                    AssimpNode found = null;
                    foreach (AssimpNode node in allnodes) { if (node.Name == this.FInRoot[0]) { found = node; } }

                    if (found != null)
                    {
                        int id = 0;
                        CreateSkeleton(ref FSkeleton, found, "",ref id);
                    }

                    FSkeletonOutput.SetInterface(FSkeleton);
                    FSkeletonOutput.MarkPinAsChanged();
                }
            }
            else
            {
                this.FSkeletonOutput.SliceCount = 0;
            }
        }

        #region helper
        private void CreateSkeleton(ref Skeleton skeleton, AssimpNode node,string parent, ref int id)
        {
            IJoint joint = new AssimpBoneWrapper(node);
            joint.Id = id;
            id++;
            if (skeleton.Root == null)
                skeleton.InsertJoint("", joint);
            else
                skeleton.InsertJoint(parent, joint);

            foreach (AssimpNode child in node.Children)
            {
                CreateSkeleton(ref skeleton,child, node.Name, ref id);
            }
        }
        #endregion

        private void RecurseNodes(List<AssimpNode> nodes, AssimpNode current)
        {
            nodes.Add(current);
            foreach (AssimpNode child in current.Children)
            {
                RecurseNodes(nodes, child);
            }
        }
    }
}


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
Annls mycol. 18(1-3): 56 (1920)

#### Original name
Gloeosporium mirabilis Bres.

### Remarks
null


text:
@Export
@Version("1.0.0")
package test.export.annotation.testNoimport.used;

import org.osgi.annotation.bundle.Export;
import org.osgi.annotation.versioning.Version;


text:
abstract class Test {
  abstract int foo(int i<caret>i, boolean... args);
}


text:
namespace AutoMapper.UnitTests.Bug
{
    using System.Collections.Generic;
    using System.Linq;
    using Should;
    using Xunit;

    public class One
    {
        public IEnumerable<string> Stuff { get; set; }
    }

    public class Two
    {
        public IEnumerable<Item> Stuff { get; set; }
    }

    public class Item
    {
        public string Value { get; set; }
    }

    public class StringToItemConverter : TypeConverter<IEnumerable<string>, IEnumerable<Item>>
    {
        protected override IEnumerable<Item> ConvertCore(IEnumerable<string> source)
        {
            var result = new List<Item>();
            foreach (var s in source)
                if (!string.IsNullOrEmpty(s))
                    result.Add(new Item {Value = s});
            return result;
        }
    }

    public class AutoMapperBugTest
    {
        /// <summary>
        /// This is now very <see cref="MapperContext"/> oriented. Everything flows through its context.
        /// </summary>
        [Fact]
        public void Should_map_one_to_two()
        {
            //TODO: may want to run this through MapperContextFactory, at least PlatformAdapter ...
            var context = new MapperContext();

            context.Configuration.CreateMap<One, Two>();

            context.Configuration.CreateMap<IEnumerable<string>, IEnumerable<Item>>()
                .ConvertUsing<StringToItemConverter>();

            context.AssertConfigurationIsValid();

            var one = new One
            {
                Stuff = new List<string> {"hi", "", "mom"}
            };

            var two = context.Engine.Map<One, Two>(one);

            two.ShouldNotBeNull();
            two.Stuff.Count().ShouldEqual(2);
        }
    }
}


text:
///////////////////////////////////////////////////////////////////////////////
//  This file is generated automatically using Prop (version 2.4.0),
//  last updated on Jul 1, 2011.
//  The original source file is "..\..\prop-src\adaptgen.ph".
///////////////////////////////////////////////////////////////////////////////

#line 1 "../../prop-src/adaptgen.ph"
///////////////////////////////////////////////////////////////////////////////
//
//  This file defines the adaptive traversal class generator
//
///////////////////////////////////////////////////////////////////////////////

#ifndef adaptive_class_h
#define adaptive_class_h

#include "basics.h"
#include "ir.h"
#include "codegen.h"
#include "classdef.h"

///////////////////////////////////////////////////////////////////////////////
//
//  Definition of an adaptive class
//
///////////////////////////////////////////////////////////////////////////////

class AdaptiveClass : public ClassDefinition
{
  AdaptiveClass(const AdaptiveClass&);
  void operator = (const AdaptiveClass&);
public:
  AdaptiveClass(Id, Inherits, TyQual, Decls);
  ~AdaptiveClass();
};

///////////////////////////////////////////////////////////////////////////////
//
//  Definition of the adaptive class compiler
//
///////////////////////////////////////////////////////////////////////////////

class AdaptiveClassCompiler : public virtual CodeGen
{
  AdaptiveClassCompiler(const AdaptiveClassCompiler&);
  void operator = (const AdaptiveClassCompiler&);
public:
  AdaptiveClassCompiler();
  ~AdaptiveClassCompiler();
};

#endif
#line 46 "../../prop-src/adaptgen.ph"
/*
------------------------------- Statistics -------------------------------
Merge matching rules         = yes
Number of DFA nodes merged   = 0
Number of ifs generated      = 0
Number of switches generated = 0
Number of labels             = 0
Number of gotos              = 0
Adaptive matching            = disabled
Fast string matching         = disabled
Inline downcasts             = disabled
--------------------------------------------------------------------------
*/


text:
package Labb2;

public class Uppgift2 {

	/**
	 * @param args
	 */
	public static void main(String[] args) 	{
		// TODO Auto-generated method stub
		int i = 1;

		while (i <=10) {//while loopen ser till att for loopen upprepas 10 gånger.

			for (char alfabet = 'A'; alfabet != '['; alfabet ++){
				System.out.print(alfabet);
				/* For loopen skriver ut alfabetet.
[ tecknet kommer direkt efter Z i unicode chartern.*/
			}

			i++;

			System.out.println();
// ger varje alfabet en ny rad så det blir lite snyggare
		}
	}

}


text:
/*************************************************************************************************/

#ifndef GIL_DYNAMICIMAGE_ALGORITHM_HPP
#define GIL_DYNAMICIMAGE_ALGORITHM_HPP

#include "../../algorithm.hpp"
#include "any_image.hpp"
#include <boost/bind.hpp>

////////////////////////////////////////////////////////////////////////////////////////
/// \file
/// \brief Some basic STL-style algorithms when applied to runtime type specified image views
/// \author Lubomir Bourdev and Hailin Jin \n
///         Adobe Systems Incorporated
/// \date 2005-2007 \n Last updated on September 24, 2006
///
////////////////////////////////////////////////////////////////////////////////////////

namespace boost { namespace gil {

namespace detail {
    struct equal_pixels_fn : public binary_operation_obj<equal_pixels_fn,bool> {
        template <typename V1, typename V2>
        BOOST_FORCEINLINE bool apply_compatible(const V1& v1, const V2& v2) const {
            return equal_pixels(v1,v2);
        }
    };
} // namespace detail

/// \ingroup ImageViewSTLAlgorithmsEqualPixels
template <typename Types1,  // Model MPL Random Access Container of models of ImageViewConcept
          typename View2>   // Model MutableImageViewConcept
bool equal_pixels(const any_image_view<Types1>& src, const View2& dst) {
    return apply_operation(src,boost::bind(detail::equal_pixels_fn(), _1, dst));
}

/// \ingroup ImageViewSTLAlgorithmsEqualPixels
template <typename View1,   // Model ImageViewConcept
          typename Types2>  // Model MPL Random Access Container of models of MutableImageViewConcept
bool equal_pixels(const View1& src, const any_image_view<Types2>& dst) {
    return apply_operation(dst,boost::bind(detail::equal_pixels_fn(), src, _1));
}

/// \ingroup ImageViewSTLAlgorithmsEqualPixels
template <typename Types1,  // Model MPL Random Access Container of models of ImageViewConcept
          typename Types2>  // Model MPL Random Access Container of models of MutableImageViewConcept
bool equal_pixels(const any_image_view<Types1>& src, const any_image_view<Types2>& dst) {
    return apply_operation(src,dst,detail::equal_pixels_fn());
}

namespace detail {
    struct copy_pixels_fn : public binary_operation_obj<copy_pixels_fn> {
        template <typename View1, typename View2>
        BOOST_FORCEINLINE void apply_compatible(const View1& src, const View2& dst) const {
            copy_pixels(src,dst);
        }
    };
}

/// \ingroup ImageViewSTLAlgorithmsCopyPixels
template <typename Types1,  // Model MPL Random Access Container of models of ImageViewConcept
          typename View2>   // Model MutableImageViewConcept
void copy_pixels(const any_image_view<Types1>& src, const View2& dst) {
    apply_operation(src,boost::bind(detail::copy_pixels_fn(), _1, dst));
}

/// \ingroup ImageViewSTLAlgorithmsCopyPixels
template <typename View1,   // Model ImageViewConcept
          typename Types2>  // Model MPL Random Access Container of models of MutableImageViewConcept
void copy_pixels(const View1& src, const any_image_view<Types2>& dst) {
    apply_operation(dst,boost::bind(detail::copy_pixels_fn(), src, _1));
}

/// \ingroup ImageViewSTLAlgorithmsCopyPixels
template <typename Types1,  // Model MPL Random Access Container of models of ImageViewConcept
          typename Types2>  // Model MPL Random Access Container of models of MutableImageViewConcept
void copy_pixels(const any_image_view<Types1>& src, const any_image_view<Types2>& dst) {
    apply_operation(src,dst,detail::copy_pixels_fn());
}

//forward declaration for default_color_converter (see full definition in color_convert.hpp)
struct default_color_converter;

/// \ingroup ImageViewSTLAlgorithmsCopyAndConvertPixels
template <typename Types1,  // Model MPL Random Access Container of models of ImageViewConcept
          typename View2,   // Model MutableImageViewConcept
          typename CC>      // Model ColorConverterConcept
void copy_and_convert_pixels(const any_image_view<Types1>& src, const View2& dst, CC cc) {
    apply_operation(src,boost::bind(detail::copy_and_convert_pixels_fn<CC>(cc), _1, dst));
}

/// \ingroup ImageViewSTLAlgorithmsCopyAndConvertPixels
template <typename Types1,  // Model MPL Random Access Container of models of ImageViewConcept
          typename View2>   // Model MutableImageViewConcept
void copy_and_convert_pixels(const any_image_view<Types1>& src, const View2& dst) {
    apply_operation(src,boost::bind(detail::copy_and_convert_pixels_fn<default_color_converter>(), _1, dst));
}

/// \ingroup ImageViewSTLAlgorithmsCopyAndConvertPixels
template <typename View1,   // Model ImageViewConcept
          typename Types2,  // Model MPL Random Access Container of models of MutableImageViewConcept
          typename CC>      // Model ColorConverterConcept
void copy_and_convert_pixels(const View1& src, const any_image_view<Types2>& dst, CC cc) {
    apply_operation(dst,boost::bind(detail::copy_and_convert_pixels_fn<CC>(cc), src, _1));
}

/// \ingroup ImageViewSTLAlgorithmsCopyAndConvertPixels
template <typename View1,   // Model ImageViewConcept
          typename Types2>  // Model MPL Random Access Container of models of MutableImageViewConcept
void copy_and_convert_pixels(const View1& src, const any_image_view<Types2>& dst) {
    apply_operation(dst,boost::bind(detail::copy_and_convert_pixels_fn<default_color_converter>(), src, _1));
}

/// \ingroup ImageViewSTLAlgorithmsCopyAndConvertPixels
template <typename Types1,  // Model MPL Random Access Container of models of ImageViewConcept
          typename Types2,  // Model MPL Random Access Container of models of MutableImageViewConcept
          typename CC>      // Model ColorConverterConcept
void copy_and_convert_pixels(const any_image_view<Types1>& src, const any_image_view<Types2>& dst, CC cc) {
    apply_operation(src,dst,detail::copy_and_convert_pixels_fn<CC>(cc));
}

/// \ingroup ImageViewSTLAlgorithmsCopyAndConvertPixels
template <typename Types1,  // Model MPL Random Access Container of models of ImageViewConcept
          typename Types2>  // Model MPL Random Access Container of models of MutableImageViewConcept
void copy_and_convert_pixels(const any_image_view<Types1>& src, const any_image_view<Types2>& dst) {
    apply_operation(src,dst,detail::copy_and_convert_pixels_fn<default_color_converter>());
}

namespace detail {
template <bool COMPATIBLE> struct fill_pixels_fn1 {
    template <typename V, typename Value> static void apply(const V& src, const Value& val) { fill_pixels(src,val); }
};

// copy_pixels invoked on incompatible images
template <> struct fill_pixels_fn1<false> {
    template <typename V, typename Value> static void apply(const V&, const Value&) { throw std::bad_cast();}
};

template <typename Value>
struct fill_pixels_fn {
    fill_pixels_fn(const Value& val) : _val(val) {}

    typedef void result_type;
    template <typename V> result_type operator()(const V& img_view) const {
        fill_pixels_fn1<pixels_are_compatible<typename V::value_type, Value>::value>::apply(img_view,_val);
    }
    Value _val;
};
}

/// \ingroup ImageViewSTLAlgorithmsFillPixels
/// \brief fill_pixels for any image view. The pixel to fill with must be compatible with the current view
template <typename Types, // Model MPL Random Access Container of models of MutableImageViewConcept
          typename Value>
void fill_pixels(const any_image_view<Types>& img_view, const Value& val) {
    apply_operation(img_view,detail::fill_pixels_fn<Value>(val));
}

} }  // namespace boost::gil

#endif


text:
package ctx

import (
	"context"
	"net/http"
	"net/textproto"
	"strings"

	"github.com/micro/go-micro/v3/metadata"
)

func FromRequest(r *http.Request) context.Context {
	ctx := r.Context()
	md, ok := metadata.FromContext(ctx)
	if !ok {
		md = make(metadata.Metadata)
	}
	for k, v := range r.Header {
		md[textproto.CanonicalMIMEHeaderKey(k)] = strings.Join(v, ",")
	}
	// pass http host
	md["Host"] = r.Host
	// pass http method
	md["Method"] = r.Method
	return metadata.NewContext(ctx, md)
}


text:
// Accord Statistics Library
// The Accord.NET Framework
// http://accord-framework.net
//
// Copyright © César Souza, 2009-2015
// cesarsouza at gmail.com
//
//    This library is free software; you can redistribute it and/or
//    modify it under the terms of the GNU Lesser General Public
//    License as published by the Free Software Foundation; either
//    version 2.1 of the License, or (at your option) any later version.
//
//    This library is distributed in the hope that it will be useful,
//    but WITHOUT ANY WARRANTY; without even the implied warranty of
//    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
//    Lesser General Public License for more details.
//
//    You should have received a copy of the GNU Lesser General Public
//    License along with this library; if not, write to the Free Software
//    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
//

namespace Accord.Statistics.Models.Regression
{
    using System;
    using Accord.Statistics.Links;
    using AForge;

    /// <summary>
    ///   Binary Logistic Regression.
    /// </summary>
    ///
    /// <remarks>
    /// <para>
    ///   In statistics, logistic regression (sometimes called the logistic model or
    ///   Logit model) is used for prediction of the probability of occurrence of an
    ///   event by fitting data to a logistic curve. It is a generalized linear model
    ///   used for binomial regression.</para>
    /// <para>
    ///   Like many forms of regression analysis, it makes use of several predictor
    ///   variables that may be either numerical or categorical. For example, the
    ///   probability that a person has a heart attack within a specified time period
    ///   might be predicted from knowledge of the person's age, sex and body mass index.</para>
    /// <para>
    ///   Logistic regression is used extensively in the medical and social sciences
    ///   as well as marketing applications such as prediction of a customer's
    ///   propensity to purchase a product or cease a subscription.</para>
    ///
    /// <para>
    ///   References:
    ///   <list type="bullet">
    ///     <item><description>
    ///       Bishop, Christopher M.; Pattern Recognition and Machine Learning.
    ///       Springer; 1st ed. 2006.</description></item>
    ///     <item><description>
    ///       Amos Storkey. (2005). Learning from Data: Learning Logistic Regressors. School of Informatics.
    ///       Available on: http://www.inf.ed.ac.uk/teaching/courses/lfd/lectures/logisticlearn-print.pdf </description></item>
    ///     <item><description>
    ///       Cosma Shalizi. (2009). Logistic Regression and Newton's Method. Available on:
    ///       http://www.stat.cmu.edu/~cshalizi/350/lectures/26/lecture-26.pdf </description></item>
    ///     <item><description>
    ///       Edward F. Conor. Logistic Regression. Website. Available on:
    ///       http://userwww.sfsu.edu/~efc/classes/biol710/logistic/logisticreg.htm </description></item>
    ///   </list></para>
    /// </remarks>
    ///
    /// <example>
    ///   <code>
    ///    // Suppose we have the following data about some patients.
    ///    // The first variable is continuous and represent patient
    ///    // age. The second variable is dichotomic and give whether
    ///    // they smoke or not (This is completely fictional data).
    ///    double[][] input =
    ///    {
    ///        new double[] { 55, 0 }, // 0 - no cancer
    ///        new double[] { 28, 0 }, // 0
    ///        new double[] { 65, 1 }, // 0
    ///        new double[] { 46, 0 }, // 1 - have cancer
    ///        new double[] { 86, 1 }, // 1
    ///        new double[] { 56, 1 }, // 1
    ///        new double[] { 85, 0 }, // 0
    ///        new double[] { 33, 0 }, // 0
    ///        new double[] { 21, 1 }, // 0
    ///        new double[] { 42, 1 }, // 1
    ///    };
    ///
    ///    // We also know if they have had lung cancer or not, and
    ///    // we would like to know whether smoking has any connection
    ///    // with lung cancer (This is completely fictional data).
    ///    double[] output =
    ///    {
    ///        0, 0, 0, 1, 1, 1, 0, 0, 0, 1
    ///    };
    ///
    ///
    ///    // To verify this hypothesis, we are going to create a logistic
    ///    // regression model for those two inputs (age and smoking).
    ///    LogisticRegression regression = new LogisticRegression(inputs: 2);
    ///
    ///    // Next, we are going to estimate this model. For this, we
    ///    // will use the Iteratively Reweighted Least Squares method.
    ///    var teacher = new IterativeReweightedLeastSquares(regression);
    ///
    ///    // Now, we will iteratively estimate our model. The Run method returns
    ///    // the maximum relative change in the model parameters and we will use
    ///    // it as the convergence criteria.
    ///
    ///    double delta = 0;
    ///    do
    ///    {
    ///        // Perform an iteration
    ///        delta = teacher.Run(input, output);
    ///
    ///    } while (delta > 0.001);
    ///
    ///    // At this point, we can compute the odds ratio of our variables.
    ///    // In the model, the variable at 0 is always the intercept term,
    ///    // with the other following in the sequence. Index 1 is the age
    ///    // and index 2 is whether the patient smokes or not.
    ///
    ///    // For the age variable, we have that individuals with
    ///    //   higher age have 1.021 greater odds of getting lung
    ///    //   cancer controlling for cigarette smoking.
    ///    double ageOdds = regression.GetOddsRatio(1); // 1.0208597028836701
    ///
    ///    // For the smoking/non smoking category variable, however, we
    ///    //   have that individuals who smoke have 5.858 greater odds
    ///    //   of developing lung cancer compared to those who do not
    ///    //   smoke, controlling for age (remember, this is completely
    ///    //   fictional and for demonstration purposes only).
    ///    double smokeOdds = regression.GetOddsRatio(2); // 5.8584748789881331
    ///   </code>
    /// </example>
    ///
    [Serializable]
    public class LogisticRegression : GeneralizedLinearRegression
    {

        /// <summary>
        ///   Creates a new Logistic Regression Model.
        /// </summary>
        ///
        /// <param name="inputs">The number of input variables for the model.</param>
        ///
        public LogisticRegression(int inputs)
            : base(new LogitLinkFunction(), inputs) { }

        /// <summary>
        ///   Creates a new Logistic Regression Model.
        /// </summary>
        ///
        /// <param name="inputs">The number of input variables for the model.</param>
        /// <param name="intercept">The starting intercept value. Default is 0.</param>
        ///
        public LogisticRegression(int inputs, double intercept)
            : base(new LogitLinkFunction(), inputs, intercept) { }

        /// <summary>
        ///   Gets the 95% confidence interval for the
        ///   Odds Ratio for a given coefficient.
        /// </summary>
        ///
        /// <param name="index">
        ///   The coefficient's index. The first value
        ///   (at zero index) is the intercept value.
        /// </param>
        ///
        public DoubleRange GetConfidenceInterval(int index)
        {
            double coeff = Coefficients[index];
            double error = StandardErrors[index];

            double upper = coeff + 1.9599 * error;
            double lower = coeff - 1.9599 * error;

            DoubleRange ci = new DoubleRange(Math.Exp(lower), Math.Exp(upper));

            return ci;
        }

        /// <summary>
        ///   Gets the Odds Ratio for a given coefficient.
        /// </summary>
        ///
        /// <remarks>
        ///   The odds ratio can be computed raising Euler's number
        ///   (e ~~ 2.71) to the power of the associated coefficient.
        /// </remarks>
        ///
        /// <param name="index">
        ///   The coefficient's index. The first value
        ///   (at zero index) is the intercept value.
        /// </param>
        ///
        /// <returns>
        ///   The Odds Ratio for the given coefficient.
        /// </returns>
        ///
        public double GetOddsRatio(int index)
        {
            return Math.Exp(Coefficients[index]);
        }

        /// <summary>
        ///   Constructs a new <see cref="LogisticRegression"/> from
        ///   an array of weights (linear coefficients). The first
        ///   weight is interpreted as the intercept value.
        /// </summary>
        ///
        /// <param name="weights">An array of linear coefficients.</param>
        ///
        /// <returns>
        ///   A <see cref="LogisticRegression"/> whose
        ///   <see cref="GeneralizedLinearRegression.Coefficients"/> are
        ///   the same as in the given <paramref name="weights"/> array.
        /// </returns>
        ///
        public static LogisticRegression FromWeights(double[] weights)
        {
            var lr = new LogisticRegression(weights.Length - 1);
            for (int i = 0; i < weights.Length; i++)
                lr.Coefficients[i] = weights[i];

            return lr;
        }
    }
}


text:
<!DOCTYPE html>

        <meta charset="utf-8">
        <title>Pushbullet</title>
        <link rel="stylesheet" type="text/css" href="base.css">
        <link rel="stylesheet" type="text/css" href="picker.css">
        <link rel="stylesheet" type="text/css" href="dropzone.css">
        <link rel="stylesheet" type="text/css" href="fake-notifications.css">
        <link rel="stylesheet" type="text/css" href="chat-ui.css">
        <link rel="stylesheet" type="text/css" href="panel-messaging-push.css">
        <link rel="stylesheet" type="text/css" href="panel-messaging-sms.css">
        <link rel="stylesheet" type="text/css" href="panel-messaging.css">
        <link rel="stylesheet" type="text/css" href="panel.css">

                                Instantly share links between any of your devices. Never email yourself a link again just to get it somewhere else.

                                Pushbullet works on all of your devices, making sharing and chatting with friends more convenient than ever.

                                Moving pictures and files between your devices has never been easier. Just drag and drop onto Pushbullet.

                        <button id="sign-up"></button>

                                            <input id="me-device" type="text">

                                                <input id="push-link-title" type="text">
                                                <input id="push-link-url" type="text">

                                                <textarea id="push-input" tabindex="1"></textarea>

To continue texting, please update the Pushbullet app on your phone.

(Sorry for the inconvenience!)

                                                <textarea id="sms-input" tabindex="1"></textarea>

                                    <input id="compose-recipient" type="text">

                                        <textarea id="compose-message" tabindex="2"></textarea>

            <input type="file" id="file-input" name="upload" style="display:none;" />


text:
using System;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Migrations;
using Dite.CoreApi.Models;

namespace Dite.CoreApi.Migrations
{
    [DbContext(typeof(ApplicationDbContext))]
    [Migration("20160306162543_targetDetails")]
    partial class targetDetails
    {
        protected override void BuildTargetModel(ModelBuilder modelBuilder)
        {
            modelBuilder
                .HasAnnotation("ProductVersion", "7.0.0-rc1-16348")
                .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);

            modelBuilder.Entity("Dite.CoreApi.Models.ApplicationUser", b =>
                {
                    b.Property<string>("Id");

                    b.Property<int>("AccessFailedCount");

                    b.Property<string>("ConcurrencyStamp")
                        .IsConcurrencyToken();

                    b.Property<string>("Email")
                        .HasAnnotation("MaxLength", 256);

                    b.Property<bool>("EmailConfirmed");

                    b.Property<bool>("LockoutEnabled");

                    b.Property<DateTimeOffset?>("LockoutEnd");

                    b.Property<string>("NormalizedEmail")
                        .HasAnnotation("MaxLength", 256);

                    b.Property<string>("NormalizedUserName")
                        .HasAnnotation("MaxLength", 256);

                    b.Property<string>("PasswordHash");

                    b.Property<string>("PhoneNumber");

                    b.Property<bool>("PhoneNumberConfirmed");

                    b.Property<string>("SecurityStamp");

                    b.Property<bool>("TwoFactorEnabled");

                    b.Property<string>("UserName")
                        .HasAnnotation("MaxLength", 256);

                    b.HasKey("Id");

                    b.HasIndex("NormalizedEmail")
                        .HasAnnotation("Relational:Name", "EmailIndex");

                    b.HasIndex("NormalizedUserName")
                        .HasAnnotation("Relational:Name", "UserNameIndex");

                    b.HasAnnotation("Relational:TableName", "AspNetUsers");
                });

            modelBuilder.Entity("Dite.Model.TimerCounter", b =>
                {
                    b.Property<Guid>("TimerCounterId")
                        .ValueGeneratedOnAdd();

                    b.Property<bool>("IsRunning");

                    b.Property<double>("Seconds");

                    b.Property<DateTime>("TimerEnd");

                    b.Property<Guid>("TimerHandlerId");

                    b.Property<DateTime>("TimerStart");

                    b.HasKey("TimerCounterId");
                });

            modelBuilder.Entity("Dite.Model.TimerHandler", b =>
                {
                    b.Property<Guid>("TimerHandlerId")
                        .ValueGeneratedOnAdd();

                    b.Property<bool>("IsRunning");

                    b.Property<string>("Name");

                    b.HasKey("TimerHandlerId");
                });

            modelBuilder.Entity("Dite.Model.TimerResult", b =>
                {
                    b.Property<Guid>("TimerResultId")
                        .ValueGeneratedOnAdd();

                    b.Property<int>("DayOfMonth");

                    b.Property<string>("DayOfWeek");

                    b.Property<int>("DayOfYear");

                    b.Property<int>("HourOfDay");

                    b.Property<int>("MinuteOfHour");

                    b.Property<int>("MonthOfYear");

                    b.Property<string>("Name");

                    b.Property<double>("Seconds");

                    b.Property<Guid>("TimerCounterId");

                    b.Property<Guid>("TimerHandlerId");

                    b.Property<int>("WeekOfMonth");

                    b.Property<int>("WeekOfYear");

                    b.Property<int>("Year");

                    b.HasKey("TimerResultId");
                });

            modelBuilder.Entity("Dite.Model.TimerTarget", b =>
                {
                    b.Property<Guid>("TimerTargetId")
                        .ValueGeneratedOnAdd();

                    b.Property<int>("DayTargetHours");

                    b.Property<int>("DayTargetMinutes");

                    b.Property<int>("MonthTargetHours");

                    b.Property<int>("MonthTargetMinutes");

                    b.Property<string>("Name");

                    b.Property<double>("Seconds");

                    b.Property<int>("SecondsPerDay");

                    b.Property<int>("SecondsPerMonth");

                    b.Property<int>("SecondsPerWeek");

                    b.Property<int>("SecondsPerYear");

                    b.Property<int>("SecondsTotal");

                    b.Property<Guid>("TimerHandlerId");

                    b.Property<int>("TotalTargetHours");

                    b.Property<int>("TotalTargetMinutes");

                    b.Property<int>("WeekTargetHours");

                    b.Property<int>("WeekTargetMinutes");

                    b.Property<int>("YearTargetHours");

                    b.Property<int>("YearTargetMinutes");

                    b.HasKey("TimerTargetId");
                });

            modelBuilder.Entity("Microsoft.AspNetCore.Identity.EntityFramework.IdentityRole", b =>
                {
                    b.Property<string>("Id");

                    b.Property<string>("ConcurrencyStamp")
                        .IsConcurrencyToken();

                    b.Property<string>("Name")
                        .HasAnnotation("MaxLength", 256);

                    b.Property<string>("NormalizedName")
                        .HasAnnotation("MaxLength", 256);

                    b.HasKey("Id");

                    b.HasIndex("NormalizedName")
                        .HasAnnotation("Relational:Name", "RoleNameIndex");

                    b.HasAnnotation("Relational:TableName", "AspNetRoles");
                });

            modelBuilder.Entity("Microsoft.AspNetCore.Identity.EntityFramework.IdentityRoleClaim<string>", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd();

                    b.Property<string>("ClaimType");

                    b.Property<string>("ClaimValue");

                    b.Property<string>("RoleId")
                        .IsRequired();

                    b.HasKey("Id");

                    b.HasAnnotation("Relational:TableName", "AspNetRoleClaims");
                });

            modelBuilder.Entity("Microsoft.AspNetCore.Identity.EntityFramework.IdentityUserClaim<string>", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd();

                    b.Property<string>("ClaimType");

                    b.Property<string>("ClaimValue");

                    b.Property<string>("UserId")
                        .IsRequired();

                    b.HasKey("Id");

                    b.HasAnnotation("Relational:TableName", "AspNetUserClaims");
                });

            modelBuilder.Entity("Microsoft.AspNetCore.Identity.EntityFramework.IdentityUserLogin<string>", b =>
                {
                    b.Property<string>("LoginProvider");

                    b.Property<string>("ProviderKey");

                    b.Property<string>("ProviderDisplayName");

                    b.Property<string>("UserId")
                        .IsRequired();

                    b.HasKey("LoginProvider", "ProviderKey");

                    b.HasAnnotation("Relational:TableName", "AspNetUserLogins");
                });

            modelBuilder.Entity("Microsoft.AspNetCore.Identity.EntityFramework.IdentityUserRole<string>", b =>
                {
                    b.Property<string>("UserId");

                    b.Property<string>("RoleId");

                    b.HasKey("UserId", "RoleId");

                    b.HasAnnotation("Relational:TableName", "AspNetUserRoles");
                });

            modelBuilder.Entity("Dite.Model.TimerCounter", b =>
                {
                    b.HasOne("Dite.Model.TimerHandler")
                        .WithMany()
                        .HasForeignKey("TimerHandlerId");
                });

            modelBuilder.Entity("Dite.Model.TimerResult", b =>
                {
                    b.HasOne("Dite.Model.TimerCounter")
                        .WithMany()
                        .HasForeignKey("TimerCounterId");
                });

            modelBuilder.Entity("Dite.Model.TimerTarget", b =>
                {
                    b.HasOne("Dite.Model.TimerHandler")
                        .WithMany()
                        .HasForeignKey("TimerHandlerId");
                });

            modelBuilder.Entity("Microsoft.AspNetCore.Identity.EntityFramework.IdentityRoleClaim<string>", b =>
                {
                    b.HasOne("Microsoft.AspNetCore.Identity.EntityFramework.IdentityRole")
                        .WithMany()
                        .HasForeignKey("RoleId");
                });

            modelBuilder.Entity("Microsoft.AspNetCore.Identity.EntityFramework.IdentityUserClaim<string>", b =>
                {
                    b.HasOne("Dite.CoreApi.Models.ApplicationUser")
                        .WithMany()
                        .HasForeignKey("UserId");
                });

            modelBuilder.Entity("Microsoft.AspNetCore.Identity.EntityFramework.IdentityUserLogin<string>", b =>
                {
                    b.HasOne("Dite.CoreApi.Models.ApplicationUser")
                        .WithMany()
                        .HasForeignKey("UserId");
                });

            modelBuilder.Entity("Microsoft.AspNetCore.Identity.EntityFramework.IdentityUserRole<string>", b =>
                {
                    b.HasOne("Microsoft.AspNetCore.Identity.EntityFramework.IdentityRole")
                        .WithMany()
                        .HasForeignKey("RoleId");

                    b.HasOne("Dite.CoreApi.Models.ApplicationUser")
                        .WithMany()
                        .HasForeignKey("UserId");
                });
        }
    }
}


text:
name: :bug: Bug fix or new feature
about: Fixing a problem with Redux
---

## PR Type

### Does this PR add a new _feature_, or fix a _bug_?

### Why should this PR be included?

## Checklist

- [ ] Have you added an explanation of what your changes do and why you'd like us to include them?
- [ ] Is there an existing issue for this PR?
  - _link issue here_
- [ ] Have the files been linted and formatted?
- [ ] Have the docs been updated to match the changes in the PR?
- [ ] Have the tests been updated to match the changes in the PR?
- [ ] Have you run the tests locally to confirm they pass?

## New Features

### What new capabilities does this PR add?

### What docs changes are needed to explain this?

## Bug Fixes

### What is the current behavior, and the steps to reproduce the issue?

### What is the expected behavior?

### How does this PR fix the problem?