text:
if (typeof exports === 'object' && typeof define !== 'function') {
    var define = function (factory) {
        factory(require, exports, module);
    };
}

define(function (require, exports, module) {
    var zendStudio55Like = require('./Zend Studio 55 Like/zendStudio55Like.js');
    var zenburnZ = require('./Zenburn Z/zenburnZ.js');
    var zenburnBasedOnTheEmacsVersion = require('./Zenburn Based On The Emacs Version/zenburnBasedOnTheEmacsVersion.js');
    var zenburn = require('./Zenburn/zenburn.js');
    var xoria2_256 = require('./Xoria2 256/xoria2_256.js');
    var xorTheme = require('./Xor Theme/xorTheme.js');
    var xcodeMidnight = require('./Xcode Midnight/xcodeMidnight.js');
    var xcodeInspired = require('./Xcode Inspired/xcodeInspired.js');
    var wombatVI = require('./Wombat V I/wombatVI.js');
    var wombatScala = require('./Wombat Scala/wombatScala.js');
    var wombat = require('./Wombat/wombat.js');
    var withLoveForDartEditor = require('./With Love For Dart Editor/withLoveForDartEditor.js');
    var vosthinLjubicanstvena = require('./Vosthin Ljubicanstvena/vosthinLjubicanstvena.js');
    var vividchalk = require('./Vividchalk/vividchalk.js');
    var visualStudioTheme = require('./Visual Studio Theme/visualStudioTheme.js');
    var visualStudio2013Edit = require('./Visual Studio 2013edit/visualStudio2013Edit.js');
    var visualStudio2013Dark = require('./Visual Studio 2013 Dark/visualStudio2013Dark.js');
    var visualStudio2013 = require('./Visual Studio 2013/visualStudio2013.js');
    var vimDesert = require('./Vim Desert/vimDesert.js');
    var vimDark = require('./Vim Dark/vimDark.js');
    var vibrantUnknownNonDarcula = require('./Vibrant Unknown Non Darcula/vibrantUnknownNonDarcula.js');
    var vibrantUnknownDarcula = require('./Vibrant Unknown Darcula/vibrantUnknownDarcula.js');
    var vibrantInk = require('./Vibrant Ink/vibrantInk.js');
    var typeSafeClassic = require('./Type Safe Classic/typeSafeClassic.js');
    var tuteta = require('./Tuteta/tuteta.js');
    var tomorrowNightGreyPlus = require('./Tomorrow Night Grey Plus/tomorrowNightGreyPlus.js');
    var tomorrowNight = require('./Tomorrow Night/tomorrowNight.js');
    var tomorrowGreyMat = require('./Tomorrow Grey Mat/tomorrowGreyMat.js');
    var titaniumStudio = require('./Titanium Studio/titaniumStudio.js');
    var textMateTwilight = require('./Text Mate Twilight/textMateTwilight.js');
    var tauCeti = require('./Tau Ceti/tauCeti.js');
    var tangoDark = require('./Tango Dark/tangoDark.js');
    var tango = require('./Tango/tango.js');
    var tangid = require('./Tangid/tangid.js');
    var talskiDark = require('./Talski Dark/talskiDark.js');
    var sunshine = require('./Sunshine/sunshine.js');
    var sunflower = require('./Sunflower/sunflower.js');
    var sunburst = require('./Sunburst/sunburst.js');
    var sunbreak = require('./Sunbreak/sunbreak.js');
    var sublimeText2 = require('./Sublime Text 2/sublimeText2.js');
    var sublimeMonokaiTrue = require('./Sublime Monokai True/sublimeMonokaiTrue.js');
    var spacegray2 = require('./Spacegray 2/spacegray2.js');
    var spacegray = require('./Spacegray/spacegray.js');
    var sonOfObsidianVariation = require('./Son Of Obsidian Variation/sonOfObsidianVariation.js');
    var sonOfObsidian = require('./Son Of Obsidian/sonOfObsidian.js');
    var sonOfDarcula = require('./Son Of Darcula/sonOfDarcula.js');
    var solarizedLightAlternate = require('./Solarized Light Alternate/solarizedLightAlternate.js');
    var solarizedLight = require('./Solarized Light/solarizedLight.js');
    var solarizedDark = require('./Solarized Dark/solarizedDark.js');
    var solarized = require('./Solarized/solarized.js');
    var slate = require('./Slate/slate.js');
    var simpleBen = require('./Simple Ben/simpleBen.js');
    var simonDark = require('./Simon Dark/simonDark.js');
    var seagrape = require('./Seagrape/seagrape.js');
    var sciTE = require('./Sci T E/sciTE.js');
    var schuss = require('./Schuss/schuss.js');
    var rudy = require('./Rudy/rudy.js');
    var rubyblue = require('./Rubyblue/rubyblue.js');
    var rubyK = require('./Ruby K/rubyK.js');
    var rubyBlue = require('./Ruby Blue/rubyBlue.js');
    var rs = require('./Rs/rs.js');
    var roboticket = require('./Roboticket/roboticket.js');
    var river = require('./River/river.js');
    var retta = require('./Retta/retta.js');
    var relaxYourEyes = require('./Relax Your Eyes/relaxYourEyes.js');
    var regalObsidian = require('./Regal Obsidian/regalObsidian.js');
    var recognEyes = require('./Recogn Eyes/recognEyes.js');
    var recogSublime = require('./Recog Sublime/recogSublime.js');
    var realGithub = require('./Real Github/realGithub.js');
    var rat49 = require('./Rat49/rat49.js');
    var rainbowDrops = require('./Rainbow Drops/rainbowDrops.js');
    var railscastsGreyComments = require('./Railscasts Grey Comments/railscastsGreyComments.js');
    var purpleTouch = require('./Purple Touch/purpleTouch.js');
    var programmerModified = require('./Programmer Modified/programmerModified.js');
    var programmer = require('./Programmer/programmer.js');
    var predawnSublimeText = require('./Predawn Sublime Text/predawnSublimeText.js');
    var predawn = require('./Predawn/predawn.js');
    var playFramework = require('./Play Framework/playFramework.js');
    var pinkyPurple = require('./Pinky Purple/pinkyPurple.js');
    var personal = require('./Personal/personal.js');
    var pdestal = require('./Pdestal/pdestal.js');
    var pastel = require('./Pastel/pastel.js');
    var oughsumm = require('./Oughsumm/oughsumm.js');
    var oceanSunset = require('./Ocean Sunset/oceanSunset.js');
    var obsidianBladeNonDarcula = require('./Obsidian Blade Non Darcula/obsidianBladeNonDarcula.js');
    var obsidianBladeDarcula = require('./Obsidian Blade Darcula/obsidianBladeDarcula.js');
    var obsidian = require('./Obsidian/obsidian.js');
    var obsidiMod = require('./Obsidi Mod/obsidiMod.js');
    var oblivionWithGroovy = require('./Oblivion With Groovy/oblivionWithGroovy.js');
    var oblivionV2 = require('./Oblivion V2/oblivionV2.js');
    var oblivion = require('./Oblivion/oblivion.js');
    var notepadLike = require('./Notepad Like/notepadLike.js');
    var notSoBright = require('./Not So Bright/notSoBright.js');
    var noCrapCDT = require('./No Crap C D T/noCrapCDT.js');
    var nightLionAptanaTheme = require('./Night Lion Aptana Theme/nightLionAptanaTheme.js');
    var nightFall = require('./Night Fall/nightFall.js');
    var nicePython = require('./Nice Python/nicePython.js');
    var netbeansPlain = require('./Netbeans Plain/netbeansPlain.js');
    var netbeans8 = require('./Netbeans 8/netbeans8.js');
    var netbeans70 = require('./Netbeans 70/netbeans70.js');
    var netbeans6 = require('./Netbeans 6/netbeans6.js');
    var myTheme = require('./My Theme/myTheme.js');
    var mr = require('./Mr/mr.js');
    var moose = require('./Moose/moose.js');
    var monokaiSublimeText3Jar = require('./Monokai Sublime Text 3jar/monokaiSublimeText3Jar.js');
    var monokaiSublimeText3 = require('./Monokai Sublime Text 3/monokaiSublimeText3.js');
    var monokaiFb = require('./Monokai Fb/monokaiFb.js');
    var monokaiBlueHiDPI = require('./Monokai Blue Hi D P I/monokaiBlueHiDPI.js');
    var monokai2 = require('./Monokai 2/monokai2.js');
    var monokai = require('./Monokai/monokai.js');
    var mondayMorning = require('./Monday Morning/mondayMorning.js');
    var modernClassicLight = require('./Modern Classic Light/modernClassicLight.js');
    var modernClassicDark = require('./Modern Classic Dark/modernClassicDark.js');
    var mkii = require('./Mkii/mkii.js');
    var minimal = require('./Minimal/minimal.js');
    var mindshareLabs = require('./Mindshare Labs/mindshareLabs.js');
    var mashupTheme = require('./Mashup Theme/mashupTheme.js');
    var lumicode = require('./Lumicode/lumicode.js');
    var laurent = require('./Laurent/laurent.js');
    var ladiesNight = require('./Ladies Night/ladiesNight.js');
    var juhakuV2 = require('./Juhaku V2/juhakuV2.js');
    var juhaku = require('./Juhaku/juhaku.js');
    var jellybeanInspired = require('./Jellybean Inspired/jellybeanInspired.js');
    var javaslang11 = require('./Javaslang 11/javaslang11.js');
    var javaslang = require('./Javaslang/javaslang.js');
    var javaDev = require('./Java Dev/javaDev.js');
    var inkpot = require('./Inkpot/inkpot.js');
    var ingweland = require('./Ingweland/ingweland.js');
    var impulse = require('./Impulse/impulse.js');
    var igor = require('./Igor/igor.js');
    var ideaDarkTheme = require('./Idea Dark Theme/ideaDarkTheme.js');
    var ideaBlueOrange = require('./Idea Blue Orange/ideaBlueOrange.js');
    var humaneIst = require('./Humane Ist/humaneIst.js');
    var heptica = require('./Heptica/heptica.js');
    var havenjark = require('./Havenjark/havenjark.js');
    var hardcoded = require('./Hardcoded/hardcoded.js');
    var hackerGym = require('./Hacker Gym/hackerGym.js');
    var gvim = require('./Gvim/gvim.js');
    var greenish = require('./Greenish/greenish.js');
    var goodGithub = require('./Good Github/goodGithub.js');
    var github2 = require('./Github2/github2.js');
    var github2015 = require('./Github 2015/github2015.js');
    var github = require('./Github/github.js');
    var gitHubRemixed = require('./Git Hub Remixed/gitHubRemixed.js');
    var genXen = require('./Gen Xen/genXen.js');
    var genX = require('./Gen X/genX.js');
    var geditOriginalOblivion = require('./Gedit Original Oblivion/geditOriginalOblivion.js');
    var geditForElegantGnome = require('./Gedit For Elegant Gnome/geditForElegantGnome.js');
    var frontenddev = require('./Frontenddev/frontenddev.js');
    var foggyDay = require('./Foggy Day/foggyDay.js');
    var fascination = require('./Fascination/fascination.js');
    var fadeComments = require('./Fade Comments/fadeComments.js');
    var eyeCandy = require('./Eye Candy/eyeCandy.js');
    var espressoWebStyle = require('./Espresso Web Style/espressoWebStyle.js');
    var espressoLibre = require('./Espresso Libre/espressoLibre.js');
    var ergo = require('./Ergo/ergo.js');
    var emacsColorThemeDarkBlue = require('./Emacs Color Theme Dark Blue/emacsColorThemeDarkBlue.js');
    var emacs2 = require('./Emacs 2/emacs2.js');
    var emacs = require('./Emacs/emacs.js');
    var eclipsePlain = require('./Eclipse Plain/eclipsePlain.js');
    var eclipseLike = require('./Eclipse Like/eclipseLike.js');
    var eclipse = require('./Eclipse/eclipse.js');
    var eclectideMonokai = require('./Eclectide Monokai/eclectideMonokai.js');
    var easyView = require('./Easy View/easyView.js');
    var easyOnTheEyes = require('./Easy On The Eyes/easyOnTheEyes.js');
    var easyEyesYellow = require('./Easy Eyes Yellow/easyEyesYellow.js');
    var dreamweaver = require('./Dreamweaver/dreamweaver.js');
    var django = require('./Django/django.js');
    var developer = require('./Developer/developer.js');
    var desert = require('./Desert/desert.js');
    var defaultTheme = require('./Default/defaultTheme.js');
    var darkWorld = require('./Dark World/darkWorld.js');
    var darkVoid = require('./Dark Void/darkVoid.js');
    var darkVisualStudio = require('./Dark Visual Studio/darkVisualStudio.js');
    var darkRoom = require('./Dark Room/darkRoom.js');
    var darkMagic = require('./Dark Magic/darkMagic.js');
    var darkKnight2 = require('./Dark Knight 2/darkKnight2.js');
    var darkKnight = require('./Dark Knight/darkKnight.js');
    var darkJuno = require('./Dark Juno/darkJuno.js');
    var darkHope = require('./Dark Hope/darkHope.js');
    var darkFlashBuilder = require('./Dark Flash Builder/darkFlashBuilder.js');
    var darkCyan = require('./Dark Cyan/darkCyan.js');
    var darkCold = require('./Dark Cold/darkCold.js');
    var darkBlue = require('./Dark Blue/darkBlue.js');
    var darculaStudio = require('./Darcula Studio/darculaStudio.js');
    var cylox = require('./Cylox/cylox.js');
    var coolProgrammer = require('./Cool Programmer/coolProgrammer.js');
    var colorfulTheme = require('./Colorful Theme/colorfulTheme.js');
    var colorfulJava = require('./Colorful Java/colorfulJava.js');
    var codeRush = require('./Code Rush/codeRush.js');
    var codeBlocksDark = require('./Code Blocks Dark/codeBlocksDark.js');
    var codeBlocks = require('./Code Blocks/codeBlocks.js');
    var coddingHorror = require('./Codding Horror/coddingHorror.js');
    var cobalt = require('./Cobalt/cobalt.js');
    var classicEclipse = require('./Classic Eclipse/classicEclipse.js');
    var ciderTheme = require('./Cider Theme/ciderTheme.js');
    var caritos = require('./Caritos/caritos.js');
    var brackets = require('./Brackets/brackets.js');
    var bluish = require('./Bluish/bluish.js');
    var blueIsh = require('./Blue Ish/blueIsh.js');
    var blueHippo = require('./Blue Hippo/blueHippo.js');
    var blue = require('./Blue/blue.js');
    var blackPastel = require('./Black Pastel/blackPastel.js');
    var base16Ocean = require('./Base16 Ocean/base16Ocean.js');
    var base16DefaultDark = require('./Base16 Default Dark/base16DefaultDark.js');
    var asd = require('./Asd/asd.js');
    var aptanaStudio3 = require('./Aptana Studio 3/aptanaStudio3.js');
    var aptanaByAlexmeia = require('./Aptana By Alexmeia/aptanaByAlexmeia.js');
    var agedCider = require('./Aged Cider/agedCider.js');
    var afterGlow = require('./After Glow/afterGlow.js');

    module.exports = {
        zendStudio55Like: zendStudio55Like,
        zenburnZ: zenburnZ,
        zenburnBasedOnTheEmacsVersion: zenburnBasedOnTheEmacsVersion,
        zenburn: zenburn,
        xoria2_256: xoria2_256,
        xorTheme: xorTheme,
        xcodeMidnight: xcodeMidnight,
        xcodeInspired: xcodeInspired,
        wombatVI: wombatVI,
        wombatScala: wombatScala,
        wombat: wombat,
        withLoveForDartEditor: withLoveForDartEditor,
        vosthinLjubicanstvena: vosthinLjubicanstvena,
        vividchalk: vividchalk,
        visualStudioTheme: visualStudioTheme,
        visualStudio2013Edit: visualStudio2013Edit,
        visualStudio2013Dark: visualStudio2013Dark,
        visualStudio2013: visualStudio2013,
        vimDesert: vimDesert,
        vimDark: vimDark,
        vibrantUnknownNonDarcula: vibrantUnknownNonDarcula,
        vibrantUnknownDarcula: vibrantUnknownDarcula,
        vibrantInk: vibrantInk,
        typeSafeClassic: typeSafeClassic,
        tuteta: tuteta,
        tomorrowNightGreyPlus: tomorrowNightGreyPlus,
        tomorrowNight: tomorrowNight,
        tomorrowGreyMat: tomorrowGreyMat,
        titaniumStudio: titaniumStudio,
        textMateTwilight: textMateTwilight,
        tauCeti: tauCeti,
        tangoDark: tangoDark,
        tango: tango,
        tangid: tangid,
        talskiDark: talskiDark,
        sunshine: sunshine,
        sunflower: sunflower,
        sunburst: sunburst,
        sunbreak: sunbreak,
        sublimeText2: sublimeText2,
        sublimeMonokaiTrue: sublimeMonokaiTrue,
        spacegray2: spacegray2,
        spacegray: spacegray,
        sonOfObsidianVariation: sonOfObsidianVariation,
        sonOfObsidian: sonOfObsidian,
        sonOfDarcula: sonOfDarcula,
        solarizedLightAlternate: solarizedLightAlternate,
        solarizedLight: solarizedLight,
        solarizedDark: solarizedDark,
        solarized: solarized,
        slate: slate,
        simpleBen: simpleBen,
        simonDark: simonDark,
        seagrape: seagrape,
        sciTE: sciTE,
        schuss: schuss,
        rudy: rudy,
        rubyblue: rubyblue,
        rubyK: rubyK,
        rubyBlue: rubyBlue,
        rs: rs,
        roboticket: roboticket,
        river: river,
        retta: retta,
        relaxYourEyes: relaxYourEyes,
        regalObsidian: regalObsidian,
        recognEyes: recognEyes,
        recogSublime: recogSublime,
        realGithub: realGithub,
        rat49: rat49,
        rainbowDrops: rainbowDrops,
        railscastsGreyComments: railscastsGreyComments,
        purpleTouch: purpleTouch,
        programmerModified: programmerModified,
        programmer: programmer,
        predawnSublimeText: predawnSublimeText,
        predawn: predawn,
        playFramework: playFramework,
        pinkyPurple: pinkyPurple,
        personal: personal,
        pdestal: pdestal,
        pastel: pastel,
        oughsumm: oughsumm,
        oceanSunset: oceanSunset,
        obsidianBladeNonDarcula: obsidianBladeNonDarcula,
        obsidianBladeDarcula: obsidianBladeDarcula,
        obsidian: obsidian,
        obsidiMod: obsidiMod,
        oblivionWithGroovy: oblivionWithGroovy,
        oblivionV2: oblivionV2,
        oblivion: oblivion,
        notepadLike: notepadLike,
        notSoBright: notSoBright,
        noCrapCDT: noCrapCDT,
        nightLionAptanaTheme: nightLionAptanaTheme,
        nightFall: nightFall,
        nicePython: nicePython,
        netbeansPlain: netbeansPlain,
        netbeans8: netbeans8,
        netbeans70: netbeans70,
        netbeans6: netbeans6,
        myTheme: myTheme,
        mr: mr,
        moose: moose,
        monokaiSublimeText3Jar: monokaiSublimeText3Jar,
        monokaiSublimeText3: monokaiSublimeText3,
        monokaiFb: monokaiFb,
        monokaiBlueHiDPI: monokaiBlueHiDPI,
        monokai2: monokai2,
        monokai: monokai,
        mondayMorning: mondayMorning,
        modernClassicLight: modernClassicLight,
        modernClassicDark: modernClassicDark,
        mkii: mkii,
        minimal: minimal,
        mindshareLabs: mindshareLabs,
        mashupTheme: mashupTheme,
        lumicode: lumicode,
        laurent: laurent,
        ladiesNight: ladiesNight,
        juhakuV2: juhakuV2,
        juhaku: juhaku,
        jellybeanInspired: jellybeanInspired,
        javaslang11: javaslang11,
        javaslang: javaslang,
        javaDev: javaDev,
        inkpot: inkpot,
        ingweland: ingweland,
        impulse: impulse,
        igor: igor,
        ideaDarkTheme: ideaDarkTheme,
        ideaBlueOrange: ideaBlueOrange,
        humaneIst: humaneIst,
        heptica: heptica,
        havenjark: havenjark,
        hardcoded: hardcoded,
        hackerGym: hackerGym,
        gvim: gvim,
        greenish: greenish,
        goodGithub: goodGithub,
        github2: github2,
        github2015: github2015,
        github: github,
        gitHubRemixed: gitHubRemixed,
        genXen: genXen,
        genX: genX,
        geditOriginalOblivion: geditOriginalOblivion,
        geditForElegantGnome: geditForElegantGnome,
        frontenddev: frontenddev,
        foggyDay: foggyDay,
        fascination: fascination,
        fadeComments: fadeComments,
        eyeCandy: eyeCandy,
        espressoWebStyle: espressoWebStyle,
        espressoLibre: espressoLibre,
        ergo: ergo,
        emacsColorThemeDarkBlue: emacsColorThemeDarkBlue,
        emacs2: emacs2,
        emacs: emacs,
        eclipsePlain: eclipsePlain,
        eclipseLike: eclipseLike,
        eclipse: eclipse,
        eclectideMonokai: eclectideMonokai,
        easyView: easyView,
        easyOnTheEyes: easyOnTheEyes,
        easyEyesYellow: easyEyesYellow,
        dreamweaver: dreamweaver,
        django: django,
        developer: developer,
        desert: desert,
        defaultTheme: defaultTheme,
        darkWorld: darkWorld,
        darkVoid: darkVoid,
        darkVisualStudio: darkVisualStudio,
        darkRoom: darkRoom,
        darkMagic: darkMagic,
        darkKnight2: darkKnight2,
        darkKnight: darkKnight,
        darkJuno: darkJuno,
        darkHope: darkHope,
        darkFlashBuilder: darkFlashBuilder,
        darkCyan: darkCyan,
        darkCold: darkCold,
        darkBlue: darkBlue,
        darculaStudio: darculaStudio,
        cylox: cylox,
        coolProgrammer: coolProgrammer,
        colorfulTheme: colorfulTheme,
        colorfulJava: colorfulJava,
        codeRush: codeRush,
        codeBlocksDark: codeBlocksDark,
        codeBlocks: codeBlocks,
        coddingHorror: coddingHorror,
        cobalt: cobalt,
        classicEclipse: classicEclipse,
        ciderTheme: ciderTheme,
        caritos: caritos,
        brackets: brackets,
        bluish: bluish,
        blueIsh: blueIsh,
        blueHippo: blueHippo,
        blue: blue,
        blackPastel: blackPastel,
        base16Ocean: base16Ocean,
        base16DefaultDark: base16DefaultDark,
        asd: asd,
        aptanaStudio3: aptanaStudio3,
        aptanaByAlexmeia: aptanaByAlexmeia,
        agedCider: agedCider,
        afterGlow: afterGlow
    };
});


text:
dofile("script/gamefunctions/itemfunctions.lua")

--  Load room functions
dofile("script/gamefunctions/roomfunctions.lua")

--  Load the help screen
dofile("script/gamefunctions/helpscreen.lua")

--  Initialize all gameplay values
function game.init ()
  game.enteredNewRoom = false
  game.turnCount = 0

  game.initItems()
  game.initRooms()
end

--  We want to move to a new room
function game.requestTravel (direction)
  local requiredDirection = ""

  if direction == "north" then requiredDirection = "s" end
  if direction == "south" then requiredDirection = "n" end
  if direction == "east" then requiredDirection = "w" end
  if direction == "west" then requiredDirection = "e" end

  local roomID = {}

  for i,v in pairs(game.rooms) do
    if v.exits[requiredDirection] then table.insert(roomID, v.id) end
  end

  local num = math.random(#roomID)

  roomID = roomID[num]

  local room = deepcopy(game.getRoom(roomID))
  room = game.initRoomItems(room)

  game.currentRoom = room

  if game.currentRoom.enterfunc then
    game.currentRoom.enterfunc(game.currentRoom)
  end

  game.printRoomDescription()

end

--  Game over, man.
function game.quit ()
  game.shouldQuit = true
end

--  Resolve actions at the beginning of a new turn
function game.main()
  if game.shouldQuit then return true end
  --  Start of the game
  if game.turnCount == 0 then
    game.printRoomDescription()
  end

  if game.currentRoom.updatefunc and game.turnCount >= 1 then
    game.currentRoom.updatefunc(game.currentRoom)
  end

  game.turnCount = game.turnCount + 1
  return false
end

redpajama_set_name: RedPajamaGithub


text:
#define BOOST_TEST_DYN_LINK
#define BOOST_TEST_MODULE SdpEndpoint
#include <boost/test/unit_test.hpp>
#include <MediaPipelineImpl.hpp>
#include <MediaElementImpl.hpp>
#include <ElementConnectionData.hpp>
#include <MediaType.hpp>
#include <KurentoException.hpp>
#include <objects/MediaObjectImpl.hpp>
#include <string>
#include <MediaSet.hpp>
#include <ModuleManager.hpp>

using namespace kurento;

ModuleManager moduleManager;
boost::property_tree::ptree config;

struct GF {
  GF();
  ~GF();
};

BOOST_GLOBAL_FIXTURE (GF);

GF::GF()
{
  gst_init(nullptr, nullptr);
  moduleManager.loadModulesFromDirectories ("../../src/server");
}

GF::~GF()
{
  MediaSet::deleteMediaSet();
}

static std::shared_ptr <MediaElementImpl>
createDummyElement (const std::string &name, const std::string &mediaPipelineId)
{
  auto mediaObject = MediaSet::getMediaSet()->ref (new  MediaElementImpl (
                       boost::property_tree::ptree(),
                       MediaSet::getMediaSet()->getMediaObject (mediaPipelineId),
                       name) );
  std::shared_ptr <MediaElementImpl> element = std::dynamic_pointer_cast
      <MediaElementImpl> (mediaObject);
  MediaSet::getMediaSet()->ref ("", mediaObject);

  return element;
}

static void
releaseMediaObject (const std::string &id)
{
  MediaSet::getMediaSet ()->release (id);
}

BOOST_AUTO_TEST_CASE (add_tag)
{
  std::shared_ptr <MediaObjectImpl> mediaObject ( new  MediaObjectImpl
      (boost::property_tree::ptree() ) );

  mediaObject->removeTag ("1");

  mediaObject->addTag ("1", "test1");
  mediaObject->addTag ("2", "test2");
  mediaObject->addTag ("3", "test3");

  mediaObject->removeTag ("3");
  mediaObject->removeTag ("5");
  mediaObject->removeTag ("3");

  mediaObject.reset ();
}

BOOST_AUTO_TEST_CASE (add_tag_media_element)
{
  std::string mediaPipelineId =
    moduleManager.getFactory ("MediaPipeline")->createObject (
      config, "",
      Json::Value() )->getId();
  std::shared_ptr <MediaElementImpl> mediaElement =
    createDummyElement ("dummyduplex", mediaPipelineId);

  mediaElement->removeTag ("1");

  mediaElement->addTag ("1", "test1");
  mediaElement->addTag ("2", "test2");
  mediaElement->addTag ("3", "test3");

  mediaElement->removeTag ("3");
  mediaElement->removeTag ("5");
  mediaElement->removeTag ("3");

  releaseMediaObject (mediaElement->getId() );
  releaseMediaObject (mediaPipelineId);

  mediaElement.reset ();
}

BOOST_AUTO_TEST_CASE (get_tag)
{
  std::string mediaPipelineId =
    moduleManager.getFactory ("MediaPipeline")->createObject (
      config, "",
      Json::Value() )->getId();
  std::shared_ptr <MediaElementImpl> mediaElement =
    createDummyElement ("dummyduplex", mediaPipelineId);

  mediaElement->addTag ("1", "test1");
  mediaElement->addTag ("2", "test2");

  try {
    std::string ret = mediaElement->getTag ("1");

    if (ret != "test1") {
      BOOST_ERROR ("Bad response");
    }
  } catch (KurentoException &e) {
    BOOST_ERROR ("Tag not found");
  }

  try {
    std::string ret = mediaElement->getTag ("3");
    BOOST_ERROR ("Tag not found not detected");
  } catch (KurentoException &e) {
    if (e.getCode () != 40110) {
      BOOST_ERROR ("Tag not found not detected");
    }
  }

  releaseMediaObject (mediaElement->getId() );
  releaseMediaObject (mediaPipelineId);

  mediaElement.reset ();
}

BOOST_AUTO_TEST_CASE (get_tags)
{
  std::string mediaPipelineId =
    moduleManager.getFactory ("MediaPipeline")->createObject (
      config, "",
      Json::Value() )->getId();
  std::shared_ptr <MediaElementImpl> mediaElement =
    createDummyElement ("dummyduplex", mediaPipelineId);
  std::vector<std::shared_ptr<Tag>> ret ;
  int i = 1;

  mediaElement->addTag ("1", "test1");
  mediaElement->addTag ("2", "test2");
  mediaElement->addTag ("3", "test3");

  ret = mediaElement->getTags ();

  if (ret.size () == 0) {
    BOOST_ERROR ("Tag list is empty");
  }

  for (auto it : ret ) {
    std::string key (std::to_string (i) );
    std::string value ("test" + std::to_string (i) );

    if ( (it->getKey() != key) || (it->getValue() != value) ) {
      BOOST_ERROR ("Tag list is wrong");
    }

    i++;
  }

  releaseMediaObject (mediaElement->getId() );
  releaseMediaObject (mediaPipelineId);

  mediaElement.reset ();
}

BOOST_AUTO_TEST_CASE (creation_time)
{
  std::string mediaPipelineId =
    moduleManager.getFactory ("MediaPipeline")->createObject (
      config, "",
      Json::Value() )->getId();
  std::shared_ptr <MediaElementImpl> mediaElement =
    createDummyElement ("dummyduplex", mediaPipelineId);
  std::shared_ptr <MediaPipelineImpl> pipe = std::dynamic_pointer_cast
      <MediaPipelineImpl> (MediaSet::getMediaSet()->getMediaObject (
                             mediaPipelineId) );
  time_t now = time(nullptr);

  BOOST_CHECK (pipe->getCreationTime() <= mediaElement->getCreationTime() );
  BOOST_CHECK (pipe->getCreationTime() <= now);
  BOOST_CHECK (mediaElement->getCreationTime() <= now);

  releaseMediaObject (mediaElement->getId() );
  releaseMediaObject (mediaPipelineId);

  mediaElement.reset ();
  pipe.reset ();
}


text:
<?php

namespace Tests\Magium\Magento18\Extractors;

use Magium\Magento\AbstractMagentoTestCase;
use Magium\Magento\Extractors\Catalog\LayeredNavigation\LayeredNavigation;
use Magium\Magento\Navigators\BaseMenu;

class LayeredNavigationExtractorTest extends \Tests\Magium\Magento\Extractors\LayeredNavigationExtractorTest
{

    protected $category = 'Apparel/Shirts';
    protected $filter = 'Color';

    protected $expectedFilter = [
        'Green',
        2
    ];

    protected function setUp()
    {
        parent::setUp();
        $this->switchThemeConfiguration('Magium\Magento\Themes\Magento18\ThemeConfiguration');
    }

    public function testSwatchValues()
    {
        self::markTestSkipped('Configurable Swatches not available in CE 1.8');
    }

    public function testPriceValuesForNoValueReturnNull()
    {
        self::markTestSkipped('This test would actually work in CE 1.8 except that it requires changes to the sample data.  Therefore we will skip');
    }

    public function testDefaultValues()
    {
        parent::testDefaultValues(); // TODO: Change the autogenerated stub
    }
}


text:
<title>Frame Handling Terminology - GDB Internals</title>
<meta http-equiv="Content-Type" content="text/html">
<meta name="description" content="GDB Internals">
<meta name="generator" content="makeinfo 4.11">
<link title="Top" rel="start" href="index.html#Top">
<link rel="up" href="Frame-Interpretation.html#Frame-Interpretation" title="Frame Interpretation">
<link rel="prev" href="All-About-Stack-Frames.html#All-About-Stack-Frames" title="All About Stack Frames">
<link rel="next" href="Prologue-Caches.html#Prologue-Caches" title="Prologue Caches">
<link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">

<meta http-equiv="Content-Style-Type" content="text/css">

Next: Prologue Caches,
Previous: All About Stack Frames,
Up: Frame Interpretation

11.7.2 Frame Handling Terminology

It is easy to get confused when referencing stack frames.  gdb
uses some precise terminology.

<dfn>THIS</dfn> frame is the frame currently under consideration.

The <dfn>NEXT</dfn> frame, also sometimes called the inner or newer frame is the
frame of the function called by the function of THIS frame.

The <dfn>PREVIOUS</dfn> frame, also sometimes called the outer or older frame is
the frame of the function which called the function of THIS frame.

So in the example in the previous section (see All About Stack Frames), if THIS frame is #3 (the call to
fact (3)), the NEXT frame is frame #2 (the call to
fact (2)) and the PREVIOUS frame is frame #4 (the call to
main ()).

The <dfn>innermost</dfn> frame is the frame of the current executing
function, or where the program stopped, in this example, in the middle
of the call to fact (0)).  It is always numbered frame #0.

The <dfn>base</dfn> of a frame is the address immediately before the start
of the NEXT frame.  For a stack which grows down in memory (a
<dfn>falling</dfn> stack) this will be the lowest address and for a stack
which grows up in memory (a <dfn>rising</dfn> stack) this will be the
highest address in the frame.

gdb functions to analyze the stack are typically given a
pointer to the NEXT frame to determine information about THIS
frame.  Information about THIS frame includes data on where the
registers of the PREVIOUS frame are stored in this stack frame.  In
this example the frame pointer of the PREVIOUS frame is stored at
offset 0 from the stack pointer of THIS frame.

The process whereby a function is given a pointer to the NEXT
frame to work out information about THIS frame is referred to as
<dfn>unwinding</dfn>.  The gdb functions involved in this typically
include unwind in their name.

The process of analyzing a target to determine the information that
should go in struct frame_info is called <dfn>sniffing</dfn>.  The functions
that carry this out are called sniffers and typically include sniffer
in their name.  More than one sniffer may be required to extract all
the information for a particular frame.

Because so many functions work using the NEXT frame, there is an issue
about addressing the innermost frame—it has no NEXT frame.  To solve
this gdb creates a dummy frame #-1, known as the
<dfn>sentinel</dfn> frame.


text:
<?php

namespace Pheal\Access;

/**
 * check access modules. Check if the given keyinfo allows a specific api call
 * access bits are static for performance reason. Feel free to write your own version
 * if you like to check api->calllist live.
 *
 * new/unknown api calls are allowed by default.
 */

use Pheal\Exceptions\AccessException;

class StaticCheck implements CanCheck
{
    /**
     * Key Type of the given API key
     * @var string (Account, Character, Corporation)
     */
    protected $keyType = null;

    /**
     * accessMask for this API Key
     * @var int
     */
    protected $accessMask = 0;

    /**
     * Database of calls to check against the given keyinfo
     * list based on pheal()->apiScope->calllist()
     * with manually added information
     * @var array
     */
    protected $bits = array(
        'char' => array(
            'contracts' => array('Character', 67108864),
            'wallettransactions' => array('Character', 4194304),
            'walletjournal' => array('Character', 2097152),
            'upcomingcalendarevents' => array('Character', 1048576),
            'standings' => array('Character', 524288),
            'skillqueue' => array('Character', 262144),
            'skillintraining' => array('Character', 131072),
            'research' => array('Character', 65536),
            'notificationtexts' => array('Character', 32768),
            'notifications' => array('Character', 16384),
            'medals' => array('Character', 8192),
            'marketorders' => array('Character', 4096),
            'mailmessages' => array('Character', 2048),
            'mailinglists' => array('Character', 1024),
            'mailbodies' => array('Character', 512),
            'killlog' => array('Character', 256),
            'industryjobs' => array('Character', 128),
            'facwarstats' => array('Character', 64),
            'contactnotifications' => array('Character', 32),
            'contactlist' => array('Character', 16),
            'charactersheet' => array('Character', 8),
            'calendareventattendees' => array('Character', 4),
            'assetlist' => array('Character', 2),
            'accountbalance' => array('Character', 1)
        ),
        'account' => array(
            'accountstatus' => array('Character', 33554432)
        ),
        'corp' => array(
            'contracts' => array('Corporation', 8388608),
            'titles' => array('Corporation', 4194304),
            'wallettransactions' => array('Corporation', 2097152),
            'walletjournal' => array('Corporation', 1048576),
            'starbaselist' => array('Corporation', 524288),
            'standings' => array('Corporation', 262144),
            'starbasedetail' => array('Corporation', 131072),
            'shareholders' => array('Corporation', 65536),
            'outpostservicedetail' => array('Corporation', 32768),
            'outpostlist' => array('Corporation', 16384),
            'medals' => array('Corporation', 8192),
            'marketorders' => array('Corporation', 4096),
            'membertracking' => array('Corporation', 2048),
            'membersecuritylog' => array('Corporation', 1024),
            'membersecurity' => array('Corporation', 512),
            'killlog' => array('Corporation', 256),
            'industryjobs' => array('Corporation', 128),
            'facwarstats' => array('Corporation', 64),
            'containerlog' => array('Corporation', 32),
            'contactlist' => array('Corporation', 16),
            'corporationsheet' => array('Corporation', 8),
            'membermedals' => array('Corporation', 4),
            'assetlist' => array('Corporation', 2),
            'accountbalance' => array('Corporation', 1)
        )

        // characterinfo is a public call with more details if you've better api keys
        // no detailed configuration needed atm
        /*
        'eve' => array(
            'characterinfo'           => array('Character', array(16777216, 8388608))
        )
        */
    );

    /**
     * Check if the api key is allowed to make this api call
     * @param string $scope
     * @param string $name
     * @param string $keyType
     * @param int $accessMask
     * @throws \Pheal\Exceptions\AccessException
     * @return bool
     */
    public function check($scope, $name, $keyType, $accessMask)
    {
        // there's no "Account" type on the access bits level
        $type = ($keyType == "Account") ? "Character" : $keyType;

        // no keyinfo configuration found
        // assume it's a public call or it's not yet defined
        // allow and let the CCP decide
        if (!$keyType
            || !in_array($type, array('Character', 'Corporation'))
            || !isset($this->bits[strtolower($scope)][strtolower($name)])
        ) {
            return true;
        }

        // check accessLevel
        $check = $this->bits[strtolower($scope)][strtolower($name)];

        // check if keytype is correct for this call
        if ($check[0] == $type) {

            // check single accessbit
            if (is_int($check[1]) && (int)$accessMask & (int)$check[1]) {
                return true;
            }

            // fix if multiple accessbits are valid (eve/CharacterInfo)
            //elseif(is_array($check[1]))
            //    foreach($check[1] as $checkbit)
            //        if($checkbit && $checkbit & $accessMask)
            //            return true;
        }

        // no match == no access right found.
        throw new AccessException(
            sprintf(
                "Pheal blocked an API call (%s/%s) which is not allowed by the given keyType/accessMask (%s/%d)",
                $scope,
                $name,
                $keyType,
                $accessMask
            )
        );
    }
}


text:
import Pointer from './pointer.js'

// iOS decelerationRate = normal
var DECELERATION_RATE = 325

function noop () {}

function activated (pointer) {
  return pointer.activated
}

function pressed (pointer) {
  return pointer.pressed
}

function alive (pointer) {
  return pointer.activated || pointer.pressed
}

function swiped (pointer) {
  return pointer.swiped
}

var mouseEventId = -1

class Kinetic {
  static spawn (kinetic) {
    Kinetic.instances.push(kinetic)
    kinetic.handleEvents()
  }

  static kill (kinetic) {
    var idx = Kinetic.instances.indexOf(kinetic)
    if (idx !== -1) {
      Kinetic.instances.splice(idx, 1)
      kinetic.unhandleEvents()
    }
  }

  static notify (time) {
    for (var i = 0, kinetic; i < Kinetic.instances.length; i++) {
      kinetic = Kinetic.instances[i]
      kinetic.track(time)
      kinetic.notify()
      kinetic.deactivate()
      kinetic.swipe(time)
      kinetic.collect()
      kinetic.check()
    }
  }

  static clientX (e) {
    return e.clientX
  }

  static clientY (e) {
    return e.clientY
  }

  constructor ({
    el,
    Vector,
    velocityThreshold,
    amplitudeFactor,
    deltaThreshold,
    movingAvarageFilter,
    ondragstart,
    ondragmove,
    ondragend,
    onswipestart,
    onswipeend
  }) {
    this.el = el
    this.Vector = Vector
    this.velocityThreshold = velocityThreshold || Kinetic.VELOCITY_THRESHOLD
    this.amplitudeFactor = amplitudeFactor || Kinetic.AMPLITUDE_FACTOR
    this.deltaThreshold = deltaThreshold || Kinetic.DELTA_THRESHOLD
    this.movingAvarageFilter = movingAvarageFilter || Kinetic.MOVING_AVARAGE_FILTER

    this.ondragstart = ondragstart || noop
    this.ondragmove = ondragmove || noop
    this.ondragend = ondragend || noop
    this.onswipestart = onswipestart || noop
    this.onswipeend = onswipeend || noop

    this.pointers = []
    this.events = []

    this._swiped = false
    this.offset = new this.Vector(0, 0)
  }

  position (e) {
    return new this.Vector(Kinetic.clientX(e), Kinetic.clientY(e))
  }

  subscribe (handler) {
    this.events.push(handler)
  }

  unsubscribe (handler) {
    var idx = this.events.indexOf(handler)
    if (idx !== -1) {
      this.events.splice(idx, 1)
    }
  }

  track (time) {
    for (var i = 0; i < this.pointers.length; i++) {
      var pointer = this.pointers[i]
      if (pointer.pressed) {
        pointer.track(time, this.movingAvarageFilter)
      }
    }
  }

  notify () {
    for (var i = 0; i < this.events.length; i++) {
      var pointers = this.pointers.filter(activated)
      if (pointers.length) {
        this.events[i](pointers)
      }
    }
  }

  deactivate () {
    for (var i = 0; i < this.pointers.length; i++) {
      this.pointers[i].deactivate()
    }
  }

  swipe (time) {
    for (var i = 0; i < this.pointers.length; i++) {
      var pointer = this.pointers[i]
      if (pointer.swiped) {
        pointer.swipe(time, DECELERATION_RATE, this.deltaThreshold)
      }
    }
  }

  collect () {
    this.pointers = this.pointers.filter(alive)
  }

  check () {
    if (!this._swiped) {
      if (this.pointers.filter(swiped).length) {
        this._swiped = true
        this.onswipestart()
      }
    } else {
      if (!this.pointers.filter(swiped).length) {
        this._swiped = false
        this.onswipeend()
      }
    }
  }

  find (id) {
    var result = null
    for (var i = 0; i < this.pointers.length; i++) {
      var pointer = this.pointers[i]
      if (pointer.id === id) {
        result = pointer
      }
    }
    if (!result) {
      if (this.pointers.length === 1 && this.pointers[0].swiped()) {
        result = this.pointers[0]
        result.id = id
      }
    }
    return result
  }

  add (pointer) {
    this.pointers.push(pointer)
  }

  handleEvents () {
    this.el.addEventListener('mousedown', this, true)
    this.el.addEventListener('touchstart', this, true)
    this.el.addEventListener('touchmove', this, true)
    this.el.addEventListener('touchend', this, true)
    this.el.addEventListener('touchcancel', this, true)
  }

  unhandleEvents () {
    this.el.removeEventListener('mousedown', this, true)
    this.el.removeEventListener('touchstart', this, true)
    this.el.removeEventListener('touchmove', this, true)
    this.el.removeEventListener('touchend', this, true)
    this.el.removeEventListener('touchcancel', this, true)
  }

  handleEvent (e) {
    e.preventDefault()
    switch (e.type) {
      case 'mousedown': return this.mousedownHandler(e)
      case 'mousemove': return this.mousemoveHandler(e)
      case 'mouseup': return this.mouseupHandler(e)
      case 'touchstart': return this.touchstartHandler(e)
      case 'touchmove': return this.touchmoveHandler(e)
      case 'touchend':
      case 'touchcancel': return this.touchendHandler(e)
    }
  }

  getId (e) {
    if (e.identifier) {
      return e.identifier
    } else {
      return mouseEventId
    }
  }

  tap (e) {
    var clientRect = this.el.getBoundingClientRect()
    this.offset = new this.Vector(clientRect.left, clientRect.top)

    var id = this.getId(e)
    var Vector = this.Vector
    var pointer = this.find(id)
    if (!pointer) {
      pointer = new Pointer({ id, Vector })
      this.add(pointer)
    }
    pointer.tap(this.position(e).isub(this.offset))

    this.ondragstart()
  }

  drag (e) {
    var position = this.position(e).isub(this.offset)
    var id = this.getId(e)
    var pointer = this.find(id)
    pointer.drag(position)

    this.ondragmove()
  }

  release (e) {
    var id = this.getId(e)
    var pointer = this.find(id)
    pointer.launch(this.velocityThreshold, this.amplitudeFactor)

    this.ondragend()
  }

  mousedownHandler (e) {
    document.addEventListener('mousemove', this, true)
    document.addEventListener('mouseup', this, true)

    this.tap(e)
  }

  mousemoveHandler (e) {
    if (e.type === 'mousemove' || this.pointers.filter(pressed).length) {
      this.drag(e)
    }
  }

  mouseupHandler (e) {
    document.removeEventListener('mousemove', this, true)
    document.removeEventListener('mouseup', this, true)

    this.release(e)
  }

  touchstartHandler (e) {
    for (var i = 0; i < e.changedTouches.length; i++) {
      this.tap(e.changedTouches[i])
    }
  }

  touchmoveHandler (e) {
    for (var i = 0; i < e.targetTouches.length; i++) {
      this.drag(e.targetTouches[i])
    }
  }

  touchendHandler (e) {
    for (var i = 0; i < e.changedTouches.length; i++) {
      this.release(e.changedTouches[i])
    }
  }
}

Kinetic.VELOCITY_THRESHOLD = 10
Kinetic.AMPLITUDE_FACTOR = 0.8
Kinetic.DELTA_THRESHOLD = 0.5
Kinetic.MOVING_AVARAGE_FILTER = 200

Kinetic.instances = []

export default Kinetic


text:
'''
Created on Apr 8, 2011

@author: awblocker
'''

# Load libraries
import re
import sys
import StringIO
import csv
import os
import time

import numpy as np
import pysam

# Define constants
ILLUMINA_REGEXP_PAIRED = re.compile(r"(.*#0/[12]):([^:]*):([^:]*)")
FASTQ_PATTERN = r"@\1\n\2\n+\1\n\3"

BOWTIE_FIELDS = ( "name", "strand", "refseq", "offset", "readseq",
                 "readqual", "nvalid", "mismatches" )
BOWTIE_DELIM = '\t'

ID_RE = re.compile(r"(.+)#.+")

OUTPUT_FIELDS = ("chromosome", "strand", "start", "end", "center", "length",
                 "nvalid")
HEADER = BOWTIE_DELIM.join(OUTPUT_FIELDS) + os.linesep

OUTPUT_FORMAT = BOWTIE_DELIM.join(("%s", "%s", "%d", "%d", "%.1f", "%d", "%d"))
OUTPUT_FORMAT += os.linesep

CHROM_RE = re.compile(r"[0-9]+")
CHROM_DELIM = ','

XM_RE = re.compile(r"XM:i:([0-9]+)")

CHROM_LENGTHS = (230208,813178,316617,1531919,576869,270148,1090947,562643,
                 439885,745741,666454,1078175,924429,784334,1091289,948062)
NCHROM = len(CHROM_LENGTHS)

def convertIlluminaToFASTQ(dataFile, outFile):
  '''Function to convert file from Illumina to FASTQ format'''
  for line in dataFile:
    match = ILLUMINA_REGEXP_PAIRED.match(line)
    if match:
      out = ILLUMINA_REGEXP_PAIRED.sub(FASTQ_PATTERN, line)
      outFile.write(out)

    return 0

def processBowtieOutput(alignmentFile, outFile, pairedEnd=True):
  '''Function to convert Bowtie output (standard format, not SAM) to read
  summaries. Takes alignment file and output file-like object as argument.
  Returns completion code.'''
  # Print header
  outFile.write(HEADER)

  # Setup DictReader to pull structured lines from Bowtie output file
  alignmentReader = csv.DictReader( alignmentFile, fieldnames=BOWTIE_FIELDS,
                                   delimiter=BOWTIE_DELIM )

  # Initialize alignments
  align2 = None
  align1 = alignmentReader.next()

  # Initialize ID values
  idMatch = ID_RE.match( align1['name'] )
  if idMatch is None:
    id1 = align1['name']
  else:
    id1 = idMatch.group(1)

  # If not paired-end, write first summary
  if not pairedEnd:
    output = combineAlignments(align1)
    outFile.write( OUTPUT_FORMAT % output )

  # Iterate through lines of file
  for line in alignmentReader:
    # Get next alignment from input
    align2 = align1
    id2 = id1
    align1 = line

    # Extract new ID
    idMatch = ID_RE.match( align1['name'] )
    if idMatch is None:
      id1 = align1['name']
    else:
      id1 = idMatch.group(1)

    # Check if IDs match (paired-end)
    if pairedEnd:
      if id1 == id2:
        # If they do, combine the two alignments & print result
        output = combineAlignments( align1, align2 )
        outFile.write( OUTPUT_FORMAT % output )
      else:
        output = combineAlignments(align1)
        outFile.write( OUTPUT_FORMAT % output )

  alignmentFile.close()

  return 0

def combineAlignments( *args ):
  '''Function to combine paired-end alignments into single summary of read.
  Takes parsed alignment dictionaries as inputs, returns read summary tuple.'''
  limits = []
  chromList = []
  nvalidList = []
  for align in args:
    # Find limits of reads
    start = int(align['offset'])
    readLen = len(align['readseq'])
    limits.append( (start, start+readLen) )

    # Extract chromosome ID
    match = CHROM_RE.search(align['refseq'])
    if match is None:
      chromList.append( align['refseq'] )
    else:
      chromList.append( align['refseq'][match.start():match.end()] )

    # Get number of valid alignments
    nvalidList.append( int(align['nvalid']) )

    # Combine limits
    limits = np.array(limits)
    start = limits.min()
    end = limits.max()+1
    length = limits.ptp()
    center = start + length/2.0

    # Combine chromosomes
    chromSet = set(chromList)
    chrom = CHROM_DELIM.join(chromSet)

    # Combine nvalid information
    nvalid = np.array( nvalidList ).sum()

    # Build tuple of return values
    retval = (chrom, '+', start, end, center, length, nvalid)

    return retval

def processSAMOutput(alignmentPath, outFile, pairedEnd=True, rmdup=False):
  '''Function to convert SAM output to read summaries. Takes alignment file and
  output file-like object as argument. Returns completion code.'''

  # Strip file extension from path
  file_name, file_ext = os.path.splitext(alignmentPath)

  # Check for special naming of file
  file_base, file_special = os.path.splitext(file_name)

  # Make into sorted BAM file
  inputPath = alignmentPath
  if file_ext.lower() != '.bam':
    os.system('samtools view -bS -o %s %s' %
              (file_base + '.bam', alignmentPath))
    inputPath = file_base + '.bam'

  if ((file_ext.lower() != '.bam') or
      (file_special.lower() not in ('.sorted', '.unique'))):
    os.system('samtools sort %s %s.sorted' %
              (inputPath, file_base))
    inputPath = file_base + '.sorted.bam'
  else:
    print >> sys.stderr, 'Skipping sorting due to %s extension' % (file_special
                                                                   + file_ext)

  # Remove duplicates if requested
  if rmdup and file_special.lower() != '.unique':
    os.system('samtools rmdup %s %s' %
              (inputPath, file_base + '.unique.bam'))
    inputPath = file_base + '.unique.bam'
  else:
    print >> sys.stderr, 'Skipping rmdup due to %s extension' % (file_special +
                                                                 file_ext)

  # Print header
  outFile.write(HEADER)

  # Iterate over alignments in SAM file
  time_start = time.time()
  with pysam.Samfile(inputPath, 'rb') as f:
    for alignedRead in f:
      if alignedRead.is_proper_pair and alignedRead.tlen > 0:
        rname = f.getrname(alignedRead.tid)
        match = CHROM_RE.search(rname)
        if match:
          chrom = int(match.group(0))
        else:
          chrom = rname

        start = alignedRead.pos
        length = alignedRead.tlen
        end = start + length - 1
        center = start + (length - 1) / 2.

        nvalid = [tag[1] for tag in alignedRead.tags if tag[0] == 'XM']
        if len(nvalid) == 0:
          nvalid = 0
        else:
          nvalid = nvalid[0]

        output = (chrom, '+', start, end, center, length, nvalid)
        outFile.write(OUTPUT_FORMAT % output)

  time_end = time.time()
  print >> sys.stderr, 'Processing time: %f seconds' % (time_end - time_start)

  return 0

def readsToCounts(dataFile, outFile, randomize=True):
  '''
  Function to convert read information to chromosome-level counts.
  Outputs comma-separated counts, one chromosome per line.
  '''
  # Setup data structure for read counts
  reads = []
  for i in xrange(NCHROM):
    reads.append( np.zeros(CHROM_LENGTHS[i], dtype=np.float64) )

  # Setup reader object to parse data file into structure format
  dataReader = csv.DictReader(dataFile, delimiter=BOWTIE_DELIM)

  chromSet = set()
  for line in dataReader:
    # Discard mitochondrial reads
    try:
      chromIndex = int(line['chromosome'])-1
    except:
      continue

    chromSet.add(chromIndex)

    # Extract start and length information
    start = int(line['start'])
    length = int(line['length'])
    center = float(line['center'])

    # Allocate read center to one of two positions
    if center==np.floor(center):
      reads[chromIndex][center] += 1.0
    else:
      if randomize:
        reads[chromIndex][np.floor(center)+np.random.randint(1)] += 1.0
      else:
        reads[chromIndex][np.floor(center):np.ceil(center)] += 0.5

  # sys.stderr.write(str(chromSet) + '\n')

  # Write results
  for chrom in reads:
    np.savetxt(outFile, chrom[np.newaxis,:],
               fmt='%.1f', delimiter=',' )

def getReadLengthDist(dataFile, outFile, offset=0):
  # Setup reader object to parse data file into structure format
  dataReader = csv.DictReader(dataFile, delimiter=BOWTIE_DELIM)

  # Read data and calculate read lengths
  dist = []

  for line in dataReader:
    # Discard mitochondrial reads
    try:
      chromIndex = int(line['chromosome'])-1
    except:
      continue

    readLength = int(line['length'])

    if len(dist) <= readLength:
      dist.extend([0]*(readLength-len(dist)+1))
      dist[readLength] += 1
    else:
      dist[readLength] += 1

  dist = np.array(dist)
  nonzero = np.where(dist > 0)[0]
  nonzero = np.arange(nonzero.min(), nonzero.max()+1, dtype='i')

  # Format & write output
  readLengths = np.vstack( (nonzero, dist[nonzero]) ).T
  np.savetxt(outFile, readLengths, fmt='%d')


text:
function HomeConfig($stateProvider) {
  'ngInject';

  $stateProvider
  .state('app.home', {
    url: '/home',
    controller: 'HomeCtrl',
    controllerAs: '$ctrl',
    templateUrl: 'home/home.html',
    title: 'Home'
  });

};

export default HomeConfig;


text:
Splitty is a tiny speedrun-oriented timer made in Javascript and HTML5.

## Use it online

Since this timer is written without any server-side language, you can use it directly from your browser from the Github Pages server at this address :

[http://ylorant.github.io/splitty](http://ylorant.github.io/splitty)

## What it can do

* Time speedruns, plays, pastas, whatever
* Have split-times
* Save your timers and splits
* Save your personal best on them
* Save your personal bests on each split ("gold" times)
* Delay timer start (but it can't delay splits)
* Import/Export timers in its own format.

## What it can't do (yet)

* Import/Export to another timer's format.
* Delay splitting on every split.
* Split graph
* Split icons

## Want to help / suggest an idea ?

If you want to help by giving some of your time to improve this little project,
you can clone this repository and then do some pull requests, they'll be implemented after verification :)

If you want to help too but you don't know how to program but you have some neat ideas you find could help,
feel free to open an [issue](https://github.com/ylorant/splitty/issues) describing your idea
and label it as an **enhancement**.

If you're using the timer and come across a bug, feel free to open an [issue](https://github.com/ylorant/splitty/issues) too
describing in what the bug consist, what lead you to come across it, and if possible an exported file of your timer and/or screenshots.


text:
$(document).ready(function(){
  //Logic for the go app.
  //Variables for the app.
  var apikey = 'AIzaSyC_ep81AybHxhf6J3pc2eJ-AFEbxQ1cMbI';
  var debugging = false;
  var currenteta = 0;
  var drivingtime = 0;
  var drivingdistance = 0;
  var buffer = 0;
  var gotime = 0;
  //Global Data Variables
  var flightdelay = 0;
  var flighteta = 0;
  var arrivalairportcode = '';
  var departureairportcode = '';
  var airportGPS = {};
  var wproute = [];
  var orginaddress = '';
  var destinationaddress = '';
  var gdirectionsService;
  var gdirectionsDisplay;
  //Tabs control jquery change
  $('ul.tabs li').click(function(){
		var tab_id = $(this).attr('data-tab');
		$('ul.tabs li').removeClass('current');
		$('.tab-content').removeClass('current');
		$(this).addClass('current');
		$("#"+tab_id).addClass('current');
	})
  //Function for angle caluation for flight icon rotation
  degrFrom_rad = function(rad) { return rad * 180 / Math.PI; }
  radFrom_degr  = function(degr) { return degr * Math.PI / 180; }
  getAngle = function(startLat,startLong,endLat,endLong){
    startLat = radFrom_degr(startLat), startLong = radFrom_degr(startLong), endLat = radFrom_degr(endLat), endLong = radFrom_degr(endLong);
    var x = endLong - startLong;
    var a = Math.log(Math.tan(endLat/2.0+Math.PI/4.0)/Math.tan(startLat/2.0+Math.PI/4.0));
    if (Math.abs(x) > Math.PI){ if (x > 0.0) { x = -(2.0 * Math.PI - x); } else {  x = (2.0 * Math.PI + x); } }
    return (degrFrom_rad(Math.atan2(x, a)) + 360.0) % 360.0;
  }
  //Trigger when slider is moved
  $("#slider").change(function(){
    //Gets the value and sets updated text to buffer
    var buffervalue = $("#slider").val();
    $("#bufferlabel").text("Buffer: " + buffervalue + " mins");
    buffer = buffervalue;
    //updateGoTime after buffer change
    updateGoTime();
  });
  //function will parse the url parameters and return the data.
  $.parameter = function(name){
	  var results = new RegExp('[\?&]' + name + '=([^&#]*)').exec(window.location.href);
	  return results[1] || 0;
  }
  //Debugging function with simple boolean switch
  function logs(data) {
    //Writes the data to console.
    if (debugging) { console.log(data); }
  }
  //Updates the go time.
  function updateGoTime() {
    gotime = flighteta - drivingtime - buffer;
    logs("Gotime: " + gotime);
    if (gotime > 0) {
      //Time caluation for leaving time
      var realmin = gotime % 60
      var hours = Math.floor(gotime / 60)
      $("#navleave").html("Leave in "+ hours +" h " + Math.round(realmin) +" mins ");
      $("#leavein").html("Leave in "+ hours +" h " + Math.round(realmin) +" mins ");
      $("#loading").hide();
    } else {
      //Time caluation for your late
      var gotimelate = Math.abs(gotime);
      var realminlate = gotime % 60
      var hourslate = Math.floor(gotimelate / 60)
      $("#navleave").html("Your late by "+ hourslate +" h " + Math.round(Math.abs(realminlate)) +" mins ");
      $("#leavein").html("Your late by "+ hourslate +" h " + Math.round(Math.abs(realminlate)) +" mins ");
      $("#loading").hide();
    }
  }
  //find the total distance by adding up the routes in response.
  function totalDistance(result) {
    //gets all the waypoints
    var routes = result.routes[0];
    var steps = [];
    //adds up all the mirco distances
    for (var c = 0; c < routes.legs.length; c++) {
      var leg = routes.legs[c];
      steps = steps.concat(leg.steps);
      drivingdistance += leg.distance.value;
      drivingtime += leg.duration.value;
    }
    //Creates the directions data for inject into directions element
    var directiondata = "";
    for (var i = 0, j = steps.length; i < j; i++) {
      var s = steps[i]
      var step = s.instructions;
      var distance = s.distance.text;
      var snum = i + 1;
      directiondata += "
"+ snum + ") " + step + " (" + distance + ")
";
    }
    $("#directions").html(directiondata);
    //Creates the routes data for inject into routes element
    var routesdata = "";
    routesdata += "
Start:" + orginaddress + "
";
    for (var x = 0, y = wproute.length; x < y; x++) {
      var wp = wproute[x];
      routesdata += "
"+ (x + 1) + ") "+ wp.title + "
<button id=\""+ x +"\" style=\"background-color:#bf1111;\"></button>
";
    }
    routesdata += "
End: " + destinationaddress + "
";
    $("#routes").html(routesdata);
    //gets the total in km.
    drivingdistance = drivingdistance / 1000;
    drivingtime = drivingtime / 60;
    //logs the distance
    logs('Distance: ' + drivingdistance);
    logs('Duration: ' + drivingtime);
    //Sets UI
    $("#drivingtime").text(Math.round(drivingtime) + " mins (" + drivingdistance + " km)");
    //updateGoTime with all data received
    updateGoTime();
  }
  //Detects the delete button being click to change routes waypoints
  $(document).on('click', '#routes button', function(){
     var id = parseInt(jQuery(this).attr("id"));
     wproute.splice(id, 1);
     $("#loading").show();
     //Re-caluation the directions
     findDirection(orginaddress, destinationaddress, gdirectionsService, gdirectionsDisplay);
  });
  //find the direction via google maps and displays them
  function findDirection(origin, destination, service, display) {
    //Creates the route request {location: new google.maps.LatLng(45.658197,-73.636333),stopover: true}
    gdirectionsService = service;
    gdirectionsDisplay = display;
    var points = [{location: origin}];
    for (var i = 0, j = wproute.length; i < j; i += 1) {
      var wp = wproute[i];
      points.push({location: new google.maps.LatLng(wp.position.lat(),wp.position.lng()),stopover: true});
    }
    points.push({location: destination});
    service.route({
      origin: origin, //sets the start location
      destination: destination, //sets the destination
      waypoints: points, //sets waypoints
      travelMode: 'DRIVING', //travel mode set to driving
      avoidTolls: true //avoid YES please who like toll trolls
    }, function(response, status) { //callback
      if (status === 'OK') { // Status 200
        logs(response); //logs the directions
        display.setDirections(response); //Writing the maps directions
        totalDistance(response);
      } else {
        //Directions failed
        alert("Sorry, your location is not supported in Go");
        $("#loading").hide();
      }
    });
  }
  //Added marker place to the routes
  function addToRoute(marker) {
    wproute.push(marker);
    $("#loading").show();
    //Re-caluation the directions
    findDirection(orginaddress, destinationaddress, gdirectionsService, gdirectionsDisplay);
  }
  //Gets the weather data
  function weatherLoad() {
    var base = '';
    if (debugging) {
      base = 'http://localhost:8080/api/weather/'
    } else {
      base = 'https://obscure-bastion-20749.herokuapp.com/api/weather/';
    }
    $.get(base  + airportGPS['lat'] +"/" + airportGPS['lng'], function(data, status){
        $('#temperature').html(" " + data['main']['temp'] + "℃");
        $('#temp').html(" " + data['main']['temp'] + "℃");
    });
  }
  //Compares two dates for minutes
  function dateDiff(date1, date2){
    var diff = (date2 - date1)/1000;
    var diff = Math.abs(Math.floor(diff));
    var min = Math.floor(diff/(60));
    return min;
  }
  //Processes the flight data and given location
  function processData(data,location) {
    //Logs flight to console
    logs(data);
    //Sets the flight information from the data to the UI labels
    $('#flight').val(data['displayIdent']);
    $('#airlinevalue').text(data['airline']['shortName']);
    $('#airlinenumber').text(data['codeShare']['friendlyIdent']);
    $('#equipmentvalue').text(data['aircraft']['friendlyType']);
    $('#arrivalvalue').text(data['destination']['friendlyName']);
    $('#departurevalue').text(data['origin']['friendlyName']);
    $('#terminal').text("#" + data['destination']['terminal']);
    //Destintation and orgin address sets
    destinationaddress = data['destination']['friendlyName'];
    orginaddress = location;
    //Gets the flight times to caluate the diff in time
    var gateArrivalTimes_estimated= new Date(data['gateArrivalTimes']['estimated']*1000);
    var gateArrivalTimes_scheduled= new Date(data['gateArrivalTimes']['scheduled']*1000);
    var diff = Math.abs(gateArrivalTimes_estimated - new Date());
    var minutes = Math.floor((diff/1000)/60);
    //Sets time will landed in miuntes
    flighteta = minutes;
    //Sets the time delay or early value
    var diffmin = dateDiff(gateArrivalTimes_estimated,gateArrivalTimes_scheduled);
    var diffminreal = diffmin % 60
    var diffhours = Math.floor(diffmin / 60)
    if( (gateArrivalTimes_estimated.getTime() > gateArrivalTimes_scheduled.getTime())) {
      $("#delayvalue").text("Delay: " + Math.round(diffhours) + " h " +  Math.round(diffminreal) + " mins");
      flightdelay = diffmin;
    } else {
      $("#delayvalue").text("Early: " + Math.round(diffhours) + " h " +  Math.round(diffminreal) + " mins");
      flightdelay = (diffmin * -1);
    }
    //Sets the ETA and IATA code
    $('#etavalue').text(gateArrivalTimes_estimated.toString());
    arrivalairportcode = data['destination']['iata'];
    //Makes the API call to the google API to get lat long of start location
    /*
    * Google Docs
    * https://developers.google.com/maps/documentation/geocoding/start
    */
    $('#youlocation').val(location);
    $.get('https://maps.googleapis.com/maps/api/geocode/json?address=' + encodeURIComponent(location) + '&key=' + apikey, function(startdata) {
      //Check if there is a valid address with array coiunt
      logs(startdata);
      if (startdata.results.length != 0) {
        //If valid get the gps object
        var gpslocation = startdata.results[0].geometry.location;
        //Accessing the map element
        var map = new google.maps.Map(document.getElementById('map'), { zoom: 11, center: gpslocation });
        //Creates the traffic layer
        var trafficLayer = new google.maps.TrafficLayer();
        //Sets the layer over the map.
        trafficLayer.setMap(map);
        //Creates the marker for the starting point
        var marker = new google.maps.Marker({ position: gpslocation, map: map });
        $.get('https://maps.googleapis.com/maps/api/geocode/json?address=' + arrivalairportcode + '&key=' + apikey, function(airportdata) {
          logs(airportdata);
          //Check if there is a valid airportdata
          if (airportdata.results.length != 0) {
            //If valid get the gps object
            var gpsairport = airportdata.results[0].geometry.location;
            airportGPS = gpsairport;
            weatherLoad();
            //Sets the airport marker
            var marker = new google.maps.Marker({ position: gpsairport, map: map });
            //Gets the airport shortname
            var aiportaddress = airportdata.results[0].address_components[0].short_name;
            logs("Arrival Airport: " + aiportaddress);
            //Sets UI for arrival
            $("#arrivalvalue").text(aiportaddress);
            //Waypoints of filed flight plane
            var waypoints = data['waypoints'];
            var flightPlanCoordinates = [];
            //Formats the data for google maps
            for (var i = 0, j = waypoints.length; i < j; i += 1) {
              var point = waypoints[i];
              flightPlanCoordinates.push({lat: point[1], lng: point[0]});
            }
            var lineSymbol = { path: 'M 0,-1 0,1', strokeOpacity: 1, scale: 4 };
            //Creates the polyline to set to the maps object
            var flightPath = new google.maps.Polyline({
              path: flightPlanCoordinates,
              strokeOpacity: 0,
              icons: [{
                icon: lineSymbol,
                offset: '0',
                repeat: '20px'
              }],
              strokeColor: '#939393'
            });
            flightPath.setMap(map);
            //Current waypoint from the actual flight
            var waypointtrack = data['track'];
            var flightPlanCoordinatetrack = [];
            //Formats the data for google maps
            for (var i = 0, j = waypointtrack.length; i < j; i += 1) {
              var point = waypointtrack[i].coord;
              flightPlanCoordinatetrack.push({lat: point[1], lng: point[0]});
            }
            //Creates the polyline to set to the maps object
            var flightPathTrack = new google.maps.Polyline({
              path: flightPlanCoordinatetrack, geodesic: true, strokeColor: '#333', strokeOpacity: 1.0, strokeWeight: 4
            });
            flightPathTrack.setMap(map);
            //Gets the last two plane waypoint to find angle to turn icon marker
            var lastItem = waypointtrack.pop();
            var secondlastItem = waypointtrack[waypointtrack.length - 1];
            var angle = getAngle(secondlastItem.coord[0],secondlastItem.coord[1],lastItem.coord[0],lastItem.coord[1]);
            logs(angle);
            //Plane icon with it svg data
            /*var plane = {
                path: 'm510,255c0,-20.4 -17.85,-38.25 -38.25,-38.25l-140.25,0l-127.5,-204l-51,0l63.75,204l-140.25,0l-38.25,-51l-38.25,0l25.5,89.25l-25.5,89.25l38.25,0l38.25,-51l140.25,0l-63.75,204l51,0l127.5,-204l140.25,0c20.4,0 38.25,-17.85 38.25,-38.25z',
                fillColor: 'black',fillOpacity: 0.8,scale: 0.1,strokeColor: 'black',strokeWeight: 1,anchor: new google.maps.Point(10, 250), rotation:angle
            };*/
            var plane = {
                path: google.maps.SymbolPath.CIRCLE,
                fillColor: 'black',fillOpacity: 1.0,scale: 10,strokeColor: 'black',strokeWeight: 1,rotation: angle
            };
            //Sets the plane marks for where it is located
            var marker = new google.maps.Marker({ position: {lat: lastItem.coord[1], lng: lastItem.coord[0]}, map: map, title: 'Plane Current Location',icon: plane });
            //Start caluating the directions via google maps
            //Creates the directions services
            var directionsService = new google.maps.DirectionsService;
            //Creates the directions rendering object with the draggable set to true and map element
            var directionsDisplay = new google.maps.DirectionsRenderer({
              draggable: true,
              map: map,
            });
            //Gets the search box
            var input = document.getElementById('search');
            //Creates new google Search box
            var searchBox = new google.maps.places.SearchBox(input);
            //Adds an listener to detect bounds change
            map.addListener('bounds_changed', function() {
              searchBox.setBounds(map.getBounds());
            });
            //Holding array for the markers
            var markers = [];
            //Adds listener to the search box for when new places are found
            searchBox.addListener('places_changed', function() {
              //Gets the places from search
              var places = searchBox.getPlaces();
              //Clears search input
              $("#search").val('');
              //Checks the length
              if (places.length == 0) { return; }
              //Sets all the markers from map
              markers.forEach(function(marker) {
                marker.setMap(null);
              });
              //Sets empty array
              markers = [];
              //Creates a new bounds map object
              var bounds = new google.maps.LatLngBounds();
              places.forEach(function(place) {
                //Checks is valid point
                if (!place.geometry) { return; }
                //Creates the icon linked to place
                var icon = {
                  url: place.icon, size: new google.maps.Size(71, 71), origin: new google.maps.Point(0, 0), anchor: new google.maps.Point(17, 34), scaledSize: new google.maps.Size(25, 25)
                };
                //Creates and setup the markers
                var marker = new google.maps.Marker({
                  map: map, icon: icon, title: place.name, position: place.geometry.location
                });
                //Stores the marker for later
                markers.push(marker);
                //Adds listener for the click and infowindow setup
                google.maps.event.addListener(marker, 'click', (function(marker, i) {
                  return function() {
                    //Creates new info window with add button
                    var infowindow = new google.maps.InfoWindow({ });
                    var popupString = '
' + marker.title + '<button id="add"></button>
';
                    //Sets the content and present to map
                    infowindow.setContent(popupString);
                    infowindow.open(map, marker);
                    //Detects add and will add to route
                    $("#add").click(function () {
                      //Start loading
                      $("#loading").show();
                      //Add waypoint
                      addToRoute(marker);
                      //CLose the info window
                      infowindow.close();
                    });
                  }
                })(marker, i));
                if (place.geometry.viewport) { bounds.union(place.geometry.viewport); } else { bounds.extend(place.geometry.location); }
              });
              //Resize map to fix bounds
              map.fitBounds(bounds);
            });
            //Detects drag in route change
            google.maps.event.addListener(directionsDisplay, 'directions_changed', function() {
                totalDistance(directionsDisplay.directions);
            });
            //finds the directions
            findDirection(location, arrivalairportcode, directionsService,directionsDisplay);
            $("#loading").hide();
            // error message in case airport is unrecognizable
          } else {
            alert("Sorry not valid airport.");
            window.location.href = "index.html";
            $("#loading").hide();
          }
        });
      } else {
        //Not valid start address
        alert("Sorry not a valid address!");
        window.location.href = "index.html";
        $("#loading").hide();
      }
    });
  }
  //Trigger function starts the processing
  function trigger() {
    var flight = $.parameter('flight');
    var location = decodeURI($.parameter('location'));
    processing(flight,location);
  }
  //the script to get GPS data and plot data
  function processing(flight,location){
    //Gets the flight ID from the URL
    var base = '';
    if (debugging) {
      base = 'http://localhost:8080/api/flight/'
    } else {
      base = 'https://obscure-bastion-20749.herokuapp.com/api/flight/';
    }
    $.ajax({
        type: "GET", url: base + flight, crossDomain : true
    }).done(function(data) {
      var unknown = data['flightdata']['unknown'];
      if (unknown == undefined) {
        processData(data['flightdata'],location);
      } else {
        alert("Not Valid Flight");
        window.location.href = "index.html";
      }
    }).fail( function(xhr, textStatus, errorThrown) {
      alert("Cannot connection to the serverside.");
    });
  }
  //Reruns the processing with the current value in the two textfields
  $('#rerun').click(function() {
    $("#loading").show();
    processing($('#flight').val(),$('#youlocation').val());
  });
  // To simulate the apps finding the data and rendering
  setTimeout(trigger, 100);
  // To trigger once the app sidebar is opened
  $('#openMenu').click(function() {
    document.getElementById("menu").style.display = "block";
  });
  // To trigger once the app sidebar is close
  $('#closeMenu').click(function() {
    document.getElementById("menu").style.display = "none";
  });
});


text:
#ifndef PHOENIX_PACKAGE_RUNTIME_INTERNAL_H
#define PHOENIX_PACKAGE_RUNTIME_INTERNAL_H
#include <stdio.h>
#include <stdarg.h>
inline void Out(const char* fmt,...)
{
	va_list args;
	int cnt;
	va_start(args,fmt);
	cnt=vprintf(fmt,args);
	va_end(args);
}

#ifdef __cplusplus
namespace detail {
  inline void consume() { }
  template <typename T0, typename... T>
  void consume(const T0 & t0, const T &... t) { (void)t0; consume(t...); }
}

#define noop(...) \
 (void)([&](){detail::consume(__VA_ARGS__);})
#else
#define noop(...) do { } while(0)
#endif

#ifdef DEBUG
#ifdef __cplusplus
extern "C"{
#endif
void TRACE(FILE *fp,const char* format,...);
#ifdef __cplusplus
}
#endif
#eles
#define TRACE noop;
#endif


text:
package gnu.classpath.jdwp.util;

import java.lang.reflect.Field;
import java.lang.reflect.Method;

/**
 * A class to compute class and method signatures.
 *
 * @author Tom Tromey  (tromey@redhat.com)
 * @author Keith Seitz  (keiths@redhat.com)
 */
public class Signature
{
  /**
   * Computes the class signature, i.e., java.lang.String.class
   * returns "Ljava/lang/String;".
   *
   * @param theClass  the class for which to compute the signature
   * @return          the class's type signature
   */
  public static String computeClassSignature (Class theClass)
  {
    StringBuffer sb = new StringBuffer ();
    _addToSignature (sb, theClass);
    return sb.toString ();
  }

  /**
   * Computes the field signature which is just the class signature of the
   * field's type, ie a Field of type java.lang.String this will return
   * "Ljava/lang/String;".
   *
   * @param field  the field for which to compute the signature
   * @return       the field's type signature
   */
  public static String computeFieldSignature (Field field)
  {
    return computeClassSignature (field.getType());
  }

  /**
   * Computes the method signature, i.e., java.lang.String.split (String, int)
   * returns "(Ljava/lang/String;I)[Ljava/lang/String;"
   *
   * @param method  the method for which to compute the signature
   * @return        the method's type signature
   */
  public static String computeMethodSignature (Method method)
  {
    return _computeSignature (method.getReturnType (),
			      method.getParameterTypes ());
  }

  private static String _computeSignature (Class returnType,
					   Class[] paramTypes)
  {
    StringBuffer sb = new StringBuffer ("(");
    if (paramTypes != null)
      {
	for (int i = 0; i < paramTypes.length; ++i)
	  _addToSignature (sb, paramTypes[i]);
      }
    sb.append (")");
    _addToSignature (sb, returnType);
    return sb.toString();
  }

  private static void _addToSignature (StringBuffer sb, Class k)
  {
    // For some reason there's no easy way to get the signature of a
    // class.
    if (k.isPrimitive ())
      {
        if (k == void.class)
          sb.append('V');
        else if (k == boolean.class)
          sb.append('Z');
        else if (k == byte.class)
          sb.append('B');
        else if (k == char.class)
          sb.append('C');
        else if (k == short.class)
          sb.append('S');
        else if (k == int.class)
          sb.append('I');
        else if (k == float.class)
          sb.append('F');
        else if (k == double.class)
          sb.append('D');
        else if (k == long.class)
          sb.append('J');
        return;
      }

    String name = k.getName ();
    int len = name.length ();
    sb.ensureCapacity (len);
    if (! k.isArray ())
      sb.append('L');
    for (int i = 0; i < len; ++i)
      {
	char c = name.charAt (i);
	if (c == '.')
	  c = '/';
	sb.append (c);
      }
    if (! k.isArray ())
      sb.append(';');
  }
}


text:
var config = require('enb-validate-code/jscs');

config.excludeFiles = [
    'node_modules'
];

module.exports = config;


text:
<?xml version="1.0" encoding="utf-8" ?>
<root>
    <payments-people>
        <description>
            <people>Payments of %alias%</people>
            <payments>People who payed %alias%</payments>
        </description>
        <displayname>%payments% payed by %people%</displayname>
        <link1>people</link1>
        <link2>payments</link2>

PeoplePayments

        <columns>
            <notes>
                <displayname>Notes</displayname>
                <type>text</type>
                <length>200</length>
                <allowempty>true</allowempty>
                <unique>false</unique>
            </notes>
        </columns>
        <orderby>
            <people>
                <column>id2</column>
                <reverse>false</reverse>
            </people>
            <payments>
                <column>id1</column>
                <reverse>false</reverse>
            </payments>
        </orderby>
        <searchminrows>5</searchminrows>
        <random>3</random>
        <add>
            <people>Add payment of %alias%</people>
            <payments>Add person who payed %alias%</payments>
        </add>
        <emptysethint>
            <people>No payments of %alias%</people>
            <payments>No people payed %alias%</payments>
        </emptysethint>
    </payments-people>
    <certificates-people>
        <description>
            <people>Certificates of %alias%</people>
            <certificates>People with %alias%</certificates>
        </description>
        <displayname>%certificates% of %people%</displayname>
        <link1>people</link1>
        <link2>certificates</link2>

CertificatesPeople

        <columns>
            <notes>
                <displayname>Notes</displayname>
                <type>string</type>
                <length>200</length>
                <allowempty>true</allowempty>
                <unique>false</unique>
            </notes>
        </columns>
        <searchminrows>5</searchminrows>
        <random>2</random>
        <add>
            <people>Add certificate of %alias%</people>
            <certificates>Add %alias% for person</certificates>
        </add>
        <emptysethint>
            <people>No certificates for %alias%</people>
            <certificates>No people has %alias%</certificates>
        </emptysethint>
    </certificates-people>
</root>


text:
package org.plukh.options;

/**
 * This exception is thrown if a particular Java class is not supported (yet) as a valid class for option properties. See
 * {@link org.plukh.options.impl.options} package description for a list of valid option classes.
 *
 * @see org.plukh.options.impl.options
 */
public class UnsupportedOptionClassException extends Exception {
    public UnsupportedOptionClassException() {
    }

    public UnsupportedOptionClassException(String message) {
        super(message);
    }
}


text:
<?php

namespace FOS\RestBundle\View;

/**
 * @author Toni Van de Voorde (toni [dot] vdv [AT] gmail [dot] com)
 */
interface ExceptionWrapperHandlerInterface
{
    /**
     * @param array $data
     *
     * @return mixed
     */
    public function wrap($data);
}


text:
import React from 'react'

import './footer.css'

const Footer = () => (
  <div className='footer'>
    © React Redux Example
  </div>
)

export default Footer


text:
/*
 * tree.c
 *
 * Tree structures and functions.
 *
 */

#include <stdlib.h>
#include <strings.h>
#include <assert.h>
#include <math.h>
#include <errno.h>

#include "misc.h"
#include "tree.h"
#include "tc.h"

union tc_value
min(union tc_valuep data, size_t N, enum tc_param_size size)
{
    size_t n = 0;
    union tc_value value;
    if (size == TC_FLOAT64) {
        value.float64 = NAN;
        for (n = 0; n < N; n++)
            if (isnan(value.float64) || data.float64[n] < value.float64)
                value.float64 = data.float64[n];
    } else if (size == TC_INT64) {
        value.int64 = INT64_MAX;
        for (n = 0; n < N; n++)
            if (data.int64[n] < value.int64)
                value.int64 = data.int64[n];
    } else assert(0);
    return value;
}

union tc_value
max(union tc_valuep data, size_t N, enum tc_param_size size)
{
    size_t n = 0;
    union tc_value value;
    if (size == TC_FLOAT64) {
        value.float64 = NAN;
        for (n = 0; n < N; n++)
            if (isnan(value.float64) || data.float64[n] > value.float64)
                value.float64 = data.float64[n];
    } else if (size == TC_INT64) {
        value.int64 = INT64_MAX;
        for (n = 0; n < N; n++)
            if (data.int64[n] > value.int64)
                value.int64 = data.int64[n];
    } else assert(0);
    return value;
}

/*
 * Free range `range`. The range needs to be deallocated in addition
 * if allocated dynamically.
 */
void
free_range(struct tc_range *range)
{
    if (range->categories != NULL) free(range->categories);
    range->categories = NULL;
    range->ncategories = 0;
}

/*
 * Free segment `segment`. The segment needs to be deallocated in addition
 * if allocated dynamically.
 */
void
free_segment(struct tc_segment *segment)
{
    size_t k = 0;
    for (k = 0; k < segment->K; k++) {
        free_range(&segment->ranges[k]);
    }
    free(segment->ranges);
    segment->K = 0;
    segment->NX = 0;
}

/*
 * Allocate buffer of size `size` on the tree `tree`. Returns NULL on failure.
 */
void *
tree_alloc(struct tc_tree *tree, size_t size)
{
    void *obj = tree->p;
    if ((tree->size - (tree->p - tree->buf)) < size) {
        return NULL; /* No space left in buf. */
    }
    tree->p += size;
    bzero(obj, size);
    return obj;
}

/*
 * Attach `node` to `tree`. The node is added to the sequential traversing.
 * The node needs to be added to the tree structure in addition.
 */
void
tree_attach_node(struct tc_node *node)
{
    size_t i = 0;
    struct tc_tree *tree = NULL;
    tree = node->tree;
    node->next = NULL;
    node->prev = tree->last;
    if (tree->last != NULL)
        tree->last->next = node;
    tree->last = node;
    if (tree->first == NULL)
        tree->first = node;
    for (i = 0; i < node->nchildren; i++)
        tree_attach_node(node->children[i]);
}

/*
 * Detach `node` from `tree`. The node is removed from sequential traversing.
 * The node needs to be removed from the tree structure in addition.
 */
void
tree_detach_node(struct tc_node *node)
{
    size_t i = 0;
    struct tc_tree *tree = NULL;
    tree = node->tree;
    for (i = 0; i < node->nchildren; i++)
        tree_detach_node(node->children[i]);
    if (node->prev) node->prev->next = node->next;
    if (node->next) node->next->prev = node->prev;
    if (tree->last == node) tree->last = node->prev;
    if (tree->first == node) tree->first = node->next;
    node->prev = NULL;
    node->next = NULL;
}

/*
 * Copy node `node` to the tree `tree`. Child nodes are preserved
 * (point to the old tree). Returns pointer to the new node or NULL on failure.
 */
struct tc_node *
copy_node(const struct tc_node *node, struct tc_tree *tree)
{

}

/*
 * Compact tree `old` into tree `new`. Returns 0 on success, -1 on failure.
 */
int
compact_tree(struct tc_tree *new, const struct tc_tree *old)
{
    size_t i = 0;
    const struct tc_node *node = NULL;
    copy_node(old->root, new);
    if (node == NULL) return -1;
    while (node != NULL) {
        /* Copy children to the new tree. */
        for (i = 0; i < node->nchildren; i++) {
            node->children[i] = copy_node(node->children[i], new);
            if (node->children[i] == NULL) return -1;
        }
        node = node->next;
    }
    return 0;
}

/*
 * Initialize segment `segment`. `K` is the number of child nodes.
 * Initialized segment needs to be freed with free_segment.
 */
int
init_segment(struct tc_segment *segment, size_t K)
{
    segment->K = K;
    segment->NX = 0;
    segment->V = 0;
    segment->ranges = calloc(K, sizeof(struct tc_range));
    if (segment->ranges == NULL) {
        errno = ENOMEM;
        return -1;
    }
}

/*
 * Determine range of node `node` in parameter `param`. The result is saved
 * to `range. The callee should call free_range on `range` after use.
 */
void
node_range(
    const struct tc_node *node,
    size_t param,
    struct tc_range *range
) {
    size_t i = 0;
    const struct tc_node *n = NULL, *child = NULL;
    const struct tc_param_def *pd = NULL;

    n = node;
    pd = &node->tree->param_def[param];
    range->min = pd->min.float64;
    range->max = pd->max.float64;
    range->categories = NULL;
    range->ncategories = 0;

    for (n = node->parent, child = node; n != NULL; child = n, n = n->parent) {
        if (n->param != param) continue;
        if (pd->type == TC_METRIC) {
            for (i = 0; i < n->nchildren; i++) {
                if (n->children[i] == child)
                    break; /* Found. */
            }
            assert(i != n->nchildren);
            if (i != 0)
                range->min = MAX(range->min, n->cuts[i-1]);
            if (i + 1 != n->nchildren)
                range->max = MIN(range->max, n->cuts[i]);
        } else if(pd->type == TC_NOMINAL) {
            /* Not implemented. */
        } else assert(0);
    }
}

/*
 * Find child node `child` of node `node`. Returns the index of the child node,
 * or -1 if not found.
 */
size_t
find_child(const struct tc_node *node, const struct tc_node *child)
{
    size_t i = 0;
    for (i = 0; i < node->nchildren; i++) {
        if (node->children[i] == child) return i;
    }
    return -1;
}

/*
 * Check tree `tree` for correctness.
 * Returns true when correct, false otherwise.
 */
bool
check_tree(const struct tc_tree *tree)
{
    if (tree->param_def == NULL) return false;
    if (tree->K < 0) return false;
    if (tree->root == NULL) return false;
    if (tree->first == NULL) return false;
    if (tree->last == NULL) return false;
    return check_subtree(tree, tree->root);
}

/*
 * Check subtree of tree `tree` at node `node`.
 * Returns true when correct, false otherwise.
 */
bool
check_subtree(const struct tc_tree *tree, const struct tc_node *node)
{
    size_t i = 0;
    const struct tc_param_def *pd = NULL;
    pd = &tree->param_def[node->param];
    if (node->nchildren < 0)
        return false;
    for (i = 0; i < node->nchildren; i++) {
        if (node->children[i]->parent != node)
            return false;
        if (!check_subtree(tree, node->children[i]))
            return false;
    }
    if (pd->type == TC_METRIC) {
        for (i = 1; i < node->ncuts; i++)
            if (node->cuts[i] < node->cuts[i-1])
                return false;
    }
    return true;
}

/*
 * Count the number of segments (left nodes) in tree `tree`.
 */
size_t
count_segments(const struct tc_tree *tree)
{
    size_t n = 0;
    struct tc_node *node = NULL;
    node = tree->first;
    while (node != NULL) {
        if (is_segment(node)) n++;
        node = node->next;
    }
    return n;
}

/*
 * Return the `s`-th segment of tree `tree` or NULL if s is greater than
 * the number of segments.
 */
struct tc_node *
select_segment(const struct tc_tree *tree, size_t s)
{
    size_t n = 0;
    struct tc_node *node = NULL;
    node = tree->first;
    while (node != NULL) {
        if (is_segment(node)) {
            if (n == s) return node;
            n++;
        }
        node = node->next;
    }
    return NULL;
}

/* Return true if a `node` is a supersegment, or false otherwise.
 * Supersegment is a node with two adjacent segments (metric parameter),
 * resp. two or more segments (nominal parameter).
 */
bool
is_supersegment(const struct tc_node *node)
{
    size_t i = 0;
    size_t S = 0;
    const struct tc_param_def *pd = NULL;
    pd = &node->tree->param_def[node->param];
    if (pd->type == TC_METRIC) {
        /* Need two adjacent segments. */
        for (i = 1; i < node->nchildren; i++) {
            if (is_segment(node->children[i-1]) &&
                is_segment(node->children[i]))
            {
                return true;
            }
        }
    } else if(pd->type == TC_NOMINAL) {
        /* Need two segments. */
        S = 0;
        for (i = 0; i < node->nchildren; i++)
            if (is_segment(node->children[i])) S++;
        return S >=2;
    } else assert(0);
    return false;
}

/*
 * Count the number of supersegments in `tree`.
 */
size_t
count_supersegments(const struct tc_tree *tree)
{
    size_t n = 0;
    struct tc_node *node = NULL;
    node = tree->first;
    while (node != NULL) {
        if (is_supersegment(node))
            n++;
        node = node->next;
    }
    return n;
}

/*
 * Return the `ss`-th supersegment of `tree`, or NULL if `ss` is greater
 * than the number of supersegments.
 */
struct tc_node *
select_supersegment(const struct tc_tree *tree, size_t ss)
{
    size_t i = 0;
    struct tc_node *node = NULL;
    node = tree->first;
    while (node != NULL) {
        if (is_supersegment(node))
            if (i++ == ss) return node;
        node = node->next;
    }
    return NULL;
}

/*
 * Return true if cut `i` of a metric node `node` is movable, false otherwise.
 * Movable cut is a cut between two segments.
 */
bool
is_movable_cut(const struct tc_node *node, size_t i)
{
    const struct tc_param_def *pd = NULL;
    pd = &node->tree->param_def[node->param];
    assert(pd->type == TC_METRIC);
    return is_segment(node->children[i]) &&
        is_segment(node->children[i+1]);
}

/*
 * Return count of movable cuts is `node`.
 */
size_t
count_movable_cuts(const struct tc_node *node)
{
    size_t i = 0;
    size_t n = 0;
    for (i = 0; i + 1 < node->nchildren; i++) {
        if (is_movable_cut(node, i))
            n++;
    }
    return n;
}

/*
 * Return the index of `c`-th movable cut of `node`.
 */
size_t
select_movable_cut(const struct tc_node *node, size_t c)
{
    size_t i = 0;
    size_t n = 0;
    for (i = 0; i + 1 < node->nchildren; i++)
        if (is_movable_cut(node, i))
            if (n++ == c) return i;
    return -1;
}