text:
<?php

namespace Toobo\SeaLion\Tests\Route;

use Toobo\SeaLion\Route\Route;
use Toobo\SeaLion\Router;
use Toobo\SeaLion\Matcher\Matcher;

/**
 * @author  Giuseppe Mazzapica <giuseppe.mazzapica@gmail.com>
 * @license http://opensource.org/licenses/MIT MIT
 */
class RouteTest extends \PHPUnit_Framework_TestCase
{
    /**
     * @var \Toobo\SeaLion\Matcher\MatcherInterface
     */
    private $matcher;

    private function getRoute()
    {
        $this->matcher = $this->getMockBuilder('Toobo\SeaLion\Matcher\MatcherInterface')->getMock();

        return new Route($this->matcher);
    }

    /**
     * @expectedException \RuntimeException
     */
    public function testGetFailsIfWrongMatcher()
    {
        $route = $this->getRoute();
        $route->get(Router::ARGUMENTS, new Matcher());
    }

    /**
     * @expectedException \InvalidArgumentException
     */
    public function testGetFailsIfWrongWhich()
    {
        $route = $this->getRoute();
        $route->get('foo', $this->matcher);
    }

    public function testBuildFromString()
    {
        $route = $this->getRoute()
                      ->withArguments(['Arg!'])
                      ->withOptions(['opt' => 'Opt!'])
                      ->withFlags(['flag' => 'Flag!']);
        /** @var \Closure[] */
        $arg = $route->get(Router::ARGUMENTS, $this->matcher);
        /** @var \Closure[] */
        $opt = $route->get(Router::OPTIONS, $this->matcher);
        /** @var \Closure[] */
        $flag = $route->get(Router::FLAGS, $this->matcher);
        assertTrue($arg[0]('Arg!', 0));
        assertFalse($arg[0]('Arg', 0));
        assertTrue($opt['opt']('Opt!', 'opt'));
        assertFalse($opt['opt']('Opt', 'opt'));
        assertTrue($flag['flag']('Flag!', 'flag'));
        assertFalse($flag['flag']('Flag', 'flag'));
    }

    public function testBuildFromBool()
    {
        $route = $this->getRoute()
                      ->withArguments([true])
                      ->withOptions(['opt' => true]);
        /** @var \Closure[] */
        $arg = $route->get(Router::ARGUMENTS, $this->matcher);
        /** @var \Closure[] */
        $opt = $route->get(Router::OPTIONS, $this->matcher);
        assertTrue($arg[0]('foo', 0));
        assertFalse($arg[0]('', 0));
        assertTrue($opt['opt']('1', 'opt'));
        assertFalse($opt['opt']('', 'opt'));
    }

    public function testBuildFromRegex()
    {
        $route = $this->getRoute()
                      ->withArguments(['R{/^arg[0-9]{1}$/}'])
                      ->withOptions(['opt' => 'R{/^opt[0-9]{1}$/}']);
        /** @var \Closure[] */
        $arg = $route->get(Router::ARGUMENTS, $this->matcher);
        /** @var \Closure[] */
        $opt = $route->get(Router::OPTIONS, $this->matcher);
        assertTrue($arg[0]('arg1', 0));
        assertFalse($arg[0]('foo', 0));
        assertTrue($opt['opt']('opt1', 'opt'));
        assertFalse($opt['opt']('meh', 'opt'));
    }

    public function testBuildFromCallable()
    {
        $cb = function ($value, $key) {
            return is_numeric($key) ? $value === 'Argument!' : $value === 'Option!';
        };
        $route = $this->getRoute()
                      ->withArguments([$cb])
                      ->withOptions(['opt' => $cb]);
        /** @var \Closure[] */
        $arg = $route->get(Router::ARGUMENTS, $this->matcher);
        /** @var \Closure[] */
        $opt = $route->get(Router::OPTIONS, $this->matcher);
        assertTrue($arg[0]('Argument!', 0));
        assertFalse($arg[0]('Argument', 0));
        assertTrue($opt['opt']('Option!', 'opt'));
        assertFalse($opt['opt']('Option', 'opt'));
    }
}


text:
import struct
from unittest import TestCase
import binascii

from instructor import model as instructor_model
from instructor import fields as instructor_fields
from instructor import errors as instructor_errors

class InstructorTest(TestCase):
    def test_simple_test(self):
        class Protocol(instructor_model.InstructorModel):
            byte_order = instructor_fields.NetworkByteOrder()
            protocol = instructor_fields.UInt16(default=1)
            length = instructor_fields.UInt32(default=0)
            name = instructor_fields.Str(length)

        data = '\x00\x01\x00\x00\x00\x0c\x48\x65\x6c\x6c\x6f\x20\x57\x6f\x72\x6c\x64\x21'
        p1 = Protocol(data)

        name = 'Hello World!'
        p2 = Protocol(length=len(name), name=name)

        self.assertTrue(p1.protocol == p2.protocol)
        self.assertTrue(p1.length == p2.length)
        self.assertTrue(p1.name == p2.name)

        self.assertTrue(data == p2.pack())

    def test_memcached_protocol(self):
        class MemcachedProtocol(instructor_model.InstructorModel):
            byte_order = instructor_fields.NetworkByteOrder()
            magic = instructor_fields.UInt8()
            opcode = instructor_fields.UInt8()
            key_length = instructor_fields.UInt16()
            ext_length = instructor_fields.UInt8()
            data_type = instructor_fields.UInt8()
            status = instructor_fields.UInt16()
            body_length = instructor_fields.ULong32()
            opaque = instructor_fields.ULong32()
            cas = instructor_fields.UInt64()

        package = '\x81\x00\x00\x00\x04\x00\x00\x00\x00\x00\x00\x08\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00c'

        p = MemcachedProtocol(package)
        self.assertTrue(p.magic == 129)
        self.assertTrue(package == p.pack())

        p.magic = 123
        self.assertTrue(p.magic == 123)

        package2 = p.pack()
        self.assertTrue(package2 != package)

        p = MemcachedProtocol(package2)
        self.assertTrue(p.magic == 123)
        self.assertTrue(package2 == p.pack())

    def test_protocol_str_field_size_is_defined(self):
        class Protocol(instructor_model.InstructorModel):
            byte_order = instructor_fields.BigEndianByteOrder()
            protocol = instructor_fields.UInt16()
            received_status = instructor_fields.UInt8()
            urgency = instructor_fields.UInt8()
            data = instructor_fields.Str(8)

        protocol = 6
        received_status = 3
        urgency = 1
        data = '01234567'

        package = struct.pack('>HBB8s', protocol, received_status, urgency, data)

        p = Protocol(package)
        self.assertTrue(p.protocol == protocol)
        self.assertTrue(p.received_status == received_status)
        self.assertTrue(p.urgency == urgency)
        self.assertTrue(p.data == data)

        self.assertTrue(p.pack() == package)

    def test_protocol_str_field_length_depended_from_other_field(self):
        class Protocol(instructor_model.InstructorModel):
            byte_order = instructor_fields.BigEndianByteOrder()
            protocol = instructor_fields.UInt16(default=7)
            received_status = instructor_fields.UInt8(default=0)
            urgency = instructor_fields.UInt8(default=0)
            msglen = instructor_fields.UInt32(default=0)
            data = instructor_fields.Str(msglen, default='')

        protocol = 7
        received_status = 3
        urgency = 1
        data = '''test text
        '''
        msglen = len(data)

        fmt = '>HBBI{}s'.format(msglen)

        package = struct.pack(fmt, protocol, received_status, urgency, msglen, data)

        p = Protocol(package)
        self.assertTrue(p.protocol == protocol)
        self.assertTrue(p.received_status == received_status)
        self.assertTrue(p.urgency == urgency)
        self.assertTrue(p.msglen == msglen)
        self.assertTrue(p.data == data)

        self.assertTrue(p.pack() == package)

    def test_protocol_field_with_default_value(self):
        class Protocol(instructor_model.InstructorModel):
            byte_order = instructor_fields.BigEndianByteOrder()
            protocol = instructor_fields.UInt16(default=8)

        protocol = 8
        received_status = 3
        urgency = 1
        data = '01234567'

        package = struct.pack('>HBB8s', protocol, received_status, urgency, data)

        p = Protocol(package)
        self.assertTrue(p.protocol == protocol)
        with self.assertRaises(AttributeError):
            self.assertTrue(p.received_status == received_status)

        self.assertTrue(p.pack() != package)
        self.assertTrue(package.startswith(p.pack()))

    def test_instances_of_two_protocols(self):
        class Protocol(instructor_model.InstructorModel):
            byte_order = instructor_fields.BigEndianByteOrder()
            protocol = instructor_fields.UInt16(default=7)
            received_status = instructor_fields.UInt8(default=0)
            urgency = instructor_fields.UInt8(default=0)
            msglen = instructor_fields.UInt32(default=0)
            data = instructor_fields.Str(msglen, default='')

        data1 = 'test data'
        msglen1 = len(data1)
        p1 = Protocol(data=data1, msglen=msglen1)
        self.assertTrue(p1.protocol == 7)
        self.assertTrue(p1.received_status == 0)
        self.assertTrue(p1.urgency == 0)
        self.assertTrue(p1.msglen == msglen1)
        self.assertTrue(p1.data == data1)

        self.assertTrue(p1.pack())

        protocol2 = 7
        data2 = 'test'
        msglen2 = len(data2)
        p2 = Protocol(data=data2, msglen=msglen2, protocol=protocol2)
        self.assertTrue(p2.protocol == protocol2)
        self.assertTrue(p2.received_status == 0)
        self.assertTrue(p2.urgency == 0)
        self.assertTrue(p2.msglen == msglen2)
        self.assertTrue(p2.data == data2)

        self.assertTrue(p1.data != p2.data)

        self.assertTrue(p2.pack())

    def test_protocol_creation_str_length_is_defined(self):
        protocol = 9
        name = '0123456789'
        length = 5

        fields = {
            'byte_order': instructor_fields.NetworkByteOrder(),
            'protocol': instructor_fields.UInt16(default=protocol),
            'name': instructor_fields.Str(length)
        }
        Protocol = type('BaseProtocol', (instructor_model.InstructorModel,), fields)

        package = struct.pack('>H{}s'.format(length), protocol, name.encode('utf-8'))

        p = Protocol(package)
        self.assertTrue(p.protocol == protocol)
        self.assertTrue(p.name.decode('utf-8') == name[:length])

        self.assertTrue(p.pack() == package)

    def test_protocol_creation_str_length_depended_as_str(self):
        protocol = 9
        length = 5
        name = '0123456789'

        fields = {
            'byte_order': instructor_fields.NetworkByteOrder(),
            'protocol': instructor_fields.UInt16(default=protocol),
            'length': instructor_fields.UInt32(default=length),
            'name': instructor_fields.Str('length')
        }
        Protocol = type('BaseProtocol', (instructor_model.InstructorModel,), fields)

        package = struct.pack('>HI{}s'.format(length), protocol, length, name)

        p = Protocol(package)
        self.assertTrue(p.protocol == protocol)
        self.assertTrue(p.length == length)
        self.assertTrue(p.name == name[:length])

        self.assertTrue(p.pack() == package)

    def test_protocol_creation_str_length_depended_as_field(self):
        protocol = 9
        length = 5
        name = '0123456789'

        # Fields must be created in order
        fields = {
            'byte_order': instructor_fields.NetworkByteOrder(),
            'protocol': instructor_fields.UInt16(default=protocol)
        }
        fields['length'] = instructor_fields.UInt32(default=length)
        fields['name'] = instructor_fields.Str(fields['length'])

        Protocol = type('BaseProtocol', (instructor_model.InstructorModel,), fields)

        package = struct.pack('>HI{}s'.format(length), protocol, length, name)

        p = Protocol(package)
        self.assertTrue(p.protocol == protocol)
        self.assertTrue(p.length == length)
        self.assertTrue(p.name == name[:length])

        self.assertTrue(p.pack() == package)

    def test_protocol_InvalidDataSize_size_too_long(self):
        proto = 9
        str_length = 5
        name = '0123456789'

        class Protocol(instructor_model.InstructorModel):
            byte_order = instructor_fields.NetworkByteOrder()
            protocol = instructor_fields.UInt16(default=proto)
            length = instructor_fields.UInt32(default=str_length)
            name = instructor_fields.Str(length)

        package = struct.pack('>Hi{}s'.format(str_length), proto, -str_length, name)

        with self.assertRaises(instructor_errors.InvalidDataSize):
            Protocol(package)

    def test_protocol_InvalidDataSize(self):
        proto = 9
        str_length = 5
        name = '0123456789'

        class Protocol(instructor_model.InstructorModel):
            byte_order = instructor_fields.NetworkByteOrder()
            protocol = instructor_fields.UInt16(default=proto)
            length = instructor_fields.UInt32(default=str_length)
            name = instructor_fields.Str('length')

        package = struct.pack('>HI{}s'.format(str_length - 1), proto, str_length, name)

        with self.assertRaises(instructor_errors.InvalidDataSize):
            Protocol(package)

redpajama_set_name: RedPajamaGithub


text:
(function() {

    module("connect1");

    // Test case : Gitana Connect #1
    _asyncTest("Gitana Connect #1", function()
    {
        expect(16);

        var appKey = "app-" + new Date().getTime();

        var f1 = function()
        {
            // use the connect() method to take advantage of Gitana's automatic connection loading
            // this will sign on anew and pre-load information for the given stack
            // if a "key" is provided, the driver is cached
            Gitana.disconnect("default");
            Gitana.connect({
                "clientKey": GitanaTest.TEST_CLIENT_KEY,
                "clientSecret": GitanaTest.TEST_CLIENT_SECRET,
                "username": "admin",
                "password": "admin",
                "application": appKey,
                "key": "default"
            }).app({
                "appCacheKey": "xyz"
            },
            function(err) {

                // this = app helper
                var ah = this;

                ah.datastore("content").listBranches().then(function() {
                    ok(true, "Pass 1 - Found content");

                    ah.datastore("users").listUsers().then(function() {
                        ok(true, "Pass 1 - Found users");

                        ah.datastore("app").then(function() {
                            ok(true, "Pass 1 - Found app");

                            f2();
                        });
                    });
                });
            });
        };

        var f2 = function()
        {
            // now request again, should incur no reload
            var count1 = Gitana.requestCount;
            Gitana.connect({
                "key": "default"
            }).app({
                "appCacheKey": "xyz"
            },function(err) {

                // this = app helper
                var ah = this;

                ah.datastore("content").then(function() {
                    ok(true, "Pass 2 - Found content");

                    ah.datastore("users").then(function() {
                        ok(true, "Pass 2 - Found users");

                        ah.datastore("app").then(function() {
                            ok(true, "Pass 2 - Found app");

                            equal(Gitana.requestCount, count1, "Request count did not go up");
                            f3();
                        });
                    });
                });
            });
        };

        var f3 = function()
        {
            // and again, this time using connect() callback
            var count2 = Gitana.requestCount;
            Gitana.connect({
                "key": "default",
                "appCacheKey": "xyz"
            }, function(err) {

                // this = app helper
                var ah = this;

                ah.datastore("content").then(function() {
                    ok(true, "Pass 3 - Found content");

                    ah.datastore("users").then(function() {
                        ok(true, "Pass 3 - Found users");

                        ah.datastore("app").then(function() {
                            ok(true, "Pass 3 - Found app");

                            equal(Gitana.requestCount, count2, "Request count did not go up");
                            f4();
                        });
                    });
                });
            });
        };

        var f4 = function()
        {
            // now disconnect
            Gitana.disconnect({
                "key": "default"
            });
            ok(true, "Successfully disconnected");

            // now connect and ensure re-authentication
            // this time we split the appKey out into the call to app()
            var count3 = Gitana.requestCount;
            Gitana.connect({
                "clientKey": GitanaTest.TEST_CLIENT_KEY,
                "clientSecret": GitanaTest.TEST_CLIENT_SECRET,
                "username": "admin",
                "password": "admin",
                "key": "default"
            }).app({
                "application": appKey
            }, function(err) {

                // this = app helper
                var ah = this;

                ah.datastore("content").then(function() {
                    ok(true, "Pass 4 - Found content");

                    ah.datastore("users").then(function() {
                        ok(true, "Pass 4 - Found users");

                        ah.datastore("app").then(function() {
                            ok(true, "Pass 4 - Found app");

                            ok(Gitana.requestCount > count3, "Request count increased");
                            success();
                        });
                    });
                });
            });
        };

        var success = function()
        {
            start();
        };

        // create stack + some data stores and things
        GitanaTest.authenticateFullOAuth().then(function() {

            // this == platform

            var stack = null;
            this.createStack().then(function() {
                stack = this;
            });
            this.then(function() {

                // this == platform

                this.createRepository().then(function() {
                    this.subchain(stack).assignDataStore(this, "content");
                });
                this.createDomain().then(function() {
                    this.subchain(stack).assignDataStore(this, "users");
                });
                this.createApplication({"key": appKey}).then(function() {
                    this.subchain(stack).assignDataStore(this, "app");
                });
            }).then(function() {
                f1();
            });
        });

    });

}());


text:
var express = require('express'),
    bodyParser = require('body-parser'),
    transactionsController=require('./controllers/transactionsController'),
    path = require('path'),
    spawn = require('child_process').spawn,
    fs = require('fs'),
    methodOverride = require('method-override'),
    mongoose = require('mongoose'),
    app = express(),
    http = require('http').Server(app),
    readLine = require('readline'),
    io = require('socket.io').listen(http),
	session = require('express-session');

Array.prototype.findBy = function (item, attr) {
	if (attr === undefined)
		return this.indexOf(item);
	for (var i = 0; i < this.length; i++) {
		if (this[i][attr] === item[attr])
			return i;
	}
	return -1;
};

var config = JSON.parse(fs.readFileSync('config.cnf', 'utf8'));

app.use(session({secret: config.secret}));
app.use(bodyParser.json({ limit: '50mb' }));
app.use(bodyParser.urlencoded({ limit: '50mb', extended: false }));
app.use(methodOverride('_method'));

app.use(express.static(path.join(__dirname, 'public')));

var transactions = require('./routes/transactions');
app.use('/api/transactions', transactions);

var admin = require('./routes/admin');
app.use('/api/admin', admin);

mongoose.connect('mongodb://localhost/bytepayr');

var db = mongoose.connection;
db.on('error', console.error.bind(console, 'connection error:'));
db.once('open', function() {

    transactionsController.init(io,function(){
        http.listen(3000, function () {
          console.log('Gateway listening on port 3000');
        });
    });

});


text:
[![Build Status](https://travis-ci.org/JPEGtheDev/Particle-Viewer.svg?branch=master)](https://travis-ci.org/JPEGtheDev/Particle-Viewer)
[![Build status](https://ci.appveyor.com/api/projects/status/9pu5howob96kpf6w?svg=true)](https://ci.appveyor.com/project/JPEGtheDev/particle-viewer)
___

## TL;DR:
A viewer for N-Body simulations.

___

## Long Description:

This is a project created by Jonathan Petz for Tarleton State University's Particle Modeling Group. The purpose of this application is to view N-Body simulations in a 3D environment. The secondary purpose of this application is to take screenshots, to be compiled into a video, in order to demonstrate the particle group's findings. The final purpose of this application is to allow me to create a pseudo game engine / hone in on my OpenGl programming skills, while also providing a viewer to the TSU Particle Modeling Group.

## Currently Used Libraries:
* [GLFW](https://github.com/glfw/glfw)
* [GLAD](https://github.com/Dav1dde/glad)
* [GLM](https://github.com/g-truc/glm)
* [stb](https://github.com/nothings/stb)
* [Tiny File Dialogs](http://sourceforge.net/projects/tinyfiledialogs/)
___
## Utilities Used:
[CMAKE](https://cmake.org/")
___

## Why this is under a MIT license:
I wanted to be able to share the code that I have created for the group with anyone else who wants to create videos of their N-Body simulations. I also want people to use this as a starting point, and modify this application in order to make it better. This allows the group to continue the particle viewer, long after I have left the group / University, while also allowing outside sources to assist in any development issues / to improve the viewer.


text:
/**
 * Sample React Native App
 * https://github.com/facebook/react-native
 *
 * @format
 */

import React from 'react';
import type {PropsWithChildren} from 'react';
import {
  SafeAreaView,
  ScrollView,
  StatusBar,
  StyleSheet,
  Text,
  useColorScheme,
  View,
} from 'react-native';

import {
  Colors,
  DebugInstructions,
  Header,
  LearnMoreLinks,
  ReloadInstructions,
} from 'react-native/Libraries/NewAppScreen';

type SectionProps = PropsWithChildren<{
  title: string;
}>;

function Section({children, title}: SectionProps): JSX.Element {
  const isDarkMode = useColorScheme() === 'dark';
  return (
    <View style={styles.sectionContainer}>
      <Text
        style={[
          styles.sectionTitle,
          {
            color: isDarkMode ? Colors.white : Colors.black,
          },
        ]}>
        {title}
      </Text>
      <Text
        style={[
          styles.sectionDescription,
          {
            color: isDarkMode ? Colors.light : Colors.dark,
          },
        ]}>
        {children}
      </Text>
    </View>
  );
}

function App(): JSX.Element {
  const isDarkMode = useColorScheme() === 'dark';

  const backgroundStyle = {
    backgroundColor: isDarkMode ? Colors.darker : Colors.lighter,
  };

  return (
    <SafeAreaView style={backgroundStyle}>
      <StatusBar
        barStyle={isDarkMode ? 'light-content' : 'dark-content'}
        backgroundColor={backgroundStyle.backgroundColor}
      />
      <ScrollView
        contentInsetAdjustmentBehavior="automatic"
        style={backgroundStyle}>

        <View
          style={{
            backgroundColor: isDarkMode ? Colors.black : Colors.white,
          }}>

            Edit <Text style={styles.highlight}>App.tsx</Text> to change this
            screen and then come back to see your edits.

            <ReloadInstructions />

            <DebugInstructions />

            Read the docs to discover what to do next:

          <LearnMoreLinks />
        </View>
      </ScrollView>
    </SafeAreaView>
  );
}

const styles = StyleSheet.create({
  sectionContainer: {
    marginTop: 32,
    paddingHorizontal: 24,
  },
  sectionTitle: {
    fontSize: 24,
    fontWeight: '600',
  },
  sectionDescription: {
    marginTop: 8,
    fontSize: 18,
    fontWeight: '400',
  },
  highlight: {
    fontWeight: '700',
  },
});

export default App;


text:
(function (global, factory) {
	typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
	typeof define === 'function' && define.amd ? define(factory) :
	(global.flyd = factory());
}(this, (function () { 'use strict';

function _arity(n, fn) {
  /* eslint-disable no-unused-vars */
  switch (n) {
    case 0:
      return function () {
        return fn.apply(this, arguments);
      };
    case 1:
      return function (a0) {
        return fn.apply(this, arguments);
      };
    case 2:
      return function (a0, a1) {
        return fn.apply(this, arguments);
      };
    case 3:
      return function (a0, a1, a2) {
        return fn.apply(this, arguments);
      };
    case 4:
      return function (a0, a1, a2, a3) {
        return fn.apply(this, arguments);
      };
    case 5:
      return function (a0, a1, a2, a3, a4) {
        return fn.apply(this, arguments);
      };
    case 6:
      return function (a0, a1, a2, a3, a4, a5) {
        return fn.apply(this, arguments);
      };
    case 7:
      return function (a0, a1, a2, a3, a4, a5, a6) {
        return fn.apply(this, arguments);
      };
    case 8:
      return function (a0, a1, a2, a3, a4, a5, a6, a7) {
        return fn.apply(this, arguments);
      };
    case 9:
      return function (a0, a1, a2, a3, a4, a5, a6, a7, a8) {
        return fn.apply(this, arguments);
      };
    case 10:
      return function (a0, a1, a2, a3, a4, a5, a6, a7, a8, a9) {
        return fn.apply(this, arguments);
      };
    default:
      throw new Error('First argument to _arity must be a non-negative integer no greater than ten');
  }
}
var _arity_1 = _arity;

function _isPlaceholder(a) {
       return a != null && typeof a === 'object' && a['@@functional/placeholder'] === true;
}
var _isPlaceholder_1 = _isPlaceholder;

/**
 * Optimized internal one-arity curry function.
 *
 * @private
 * @category Function
 * @param {Function} fn The function to curry.
 * @return {Function} The curried function.
 */

function _curry1(fn) {
  return function f1(a) {
    if (arguments.length === 0 || _isPlaceholder_1(a)) {
      return f1;
    } else {
      return fn.apply(this, arguments);
    }
  };
}
var _curry1_1 = _curry1;

/**
 * Optimized internal two-arity curry function.
 *
 * @private
 * @category Function
 * @param {Function} fn The function to curry.
 * @return {Function} The curried function.
 */

function _curry2(fn) {
  return function f2(a, b) {
    switch (arguments.length) {
      case 0:
        return f2;
      case 1:
        return _isPlaceholder_1(a) ? f2 : _curry1_1(function (_b) {
          return fn(a, _b);
        });
      default:
        return _isPlaceholder_1(a) && _isPlaceholder_1(b) ? f2 : _isPlaceholder_1(a) ? _curry1_1(function (_a) {
          return fn(_a, b);
        }) : _isPlaceholder_1(b) ? _curry1_1(function (_b) {
          return fn(a, _b);
        }) : fn(a, b);
    }
  };
}
var _curry2_1 = _curry2;

/**
 * Internal curryN function.
 *
 * @private
 * @category Function
 * @param {Number} length The arity of the curried function.
 * @param {Array} received An array of arguments received thus far.
 * @param {Function} fn The function to curry.
 * @return {Function} The curried function.
 */

function _curryN(length, received, fn) {
  return function () {
    var combined = [];
    var argsIdx = 0;
    var left = length;
    var combinedIdx = 0;
    while (combinedIdx < received.length || argsIdx < arguments.length) {
      var result;
      if (combinedIdx < received.length && (!_isPlaceholder_1(received[combinedIdx]) || argsIdx >= arguments.length)) {
        result = received[combinedIdx];
      } else {
        result = arguments[argsIdx];
        argsIdx += 1;
      }
      combined[combinedIdx] = result;
      if (!_isPlaceholder_1(result)) {
        left -= 1;
      }
      combinedIdx += 1;
    }
    return left <= 0 ? fn.apply(this, combined) : _arity_1(left, _curryN(length, combined, fn));
  };
}
var _curryN_1 = _curryN;

/**
 * Returns a curried equivalent of the provided function, with the specified
 * arity. The curried function has two unusual capabilities. First, its
 * arguments needn't be provided one at a time. If `g` is `R.curryN(3, f)`, the
 * following are equivalent:
 *
 *   - `g(1)(2)(3)`
 *   - `g(1)(2, 3)`
 *   - `g(1, 2)(3)`
 *   - `g(1, 2, 3)`
 *
 * Secondly, the special placeholder value [`R.__`](#__) may be used to specify
 * "gaps", allowing partial application of any combination of arguments,
 * regardless of their positions. If `g` is as above and `_` is [`R.__`](#__),
 * the following are equivalent:
 *
 *   - `g(1, 2, 3)`
 *   - `g(_, 2, 3)(1)`
 *   - `g(_, _, 3)(1)(2)`
 *   - `g(_, _, 3)(1, 2)`
 *   - `g(_, 2)(1)(3)`
 *   - `g(_, 2)(1, 3)`
 *   - `g(_, 2)(_, 3)(1)`
 *
 * @func
 * @memberOf R
 * @since v0.5.0
 * @category Function
 * @sig Number -> (* -> a) -> (* -> a)
 * @param {Number} length The arity for the returned function.
 * @param {Function} fn The function to curry.
 * @return {Function} A new, curried function.
 * @see R.curry
 * @example
 *
 *      var sumArgs = (...args) => R.sum(args);
 *
 *      var curriedAddFourNumbers = R.curryN(4, sumArgs);
 *      var f = curriedAddFourNumbers(1, 2);
 *      var g = f(3);
 *      g(4); //=> 10
 */

var curryN = /*#__PURE__*/_curry2_1(function curryN(length, fn) {
  if (length === 1) {
    return _curry1_1(fn);
  }
  return _arity_1(length, _curryN_1(length, [], fn));
});
var curryN_1 = curryN;

// Utility
function isFunction(obj) {
  return !!(obj && obj.constructor && obj.call && obj.apply);
}
function trueFn() { return true; }

// Globals
var toUpdate = [];
var inStream;
var order = [];
var orderNextIdx = -1;
var flushingUpdateQueue = false;
var flushingStreamValue = false;

function flushing() {
  return flushingUpdateQueue || flushingStreamValue;
}

/** @namespace */
var flyd = {};

// /////////////////////////// API ///////////////////////////////// //

/**
 * Creates a new stream
 *
 * __Signature__: `a -> Stream a`
 *
 * @name flyd.stream
 * @param {*} initialValue - (Optional) the initial value of the stream
 * @return {stream} the stream
 *
 * @example
 * var n = flyd.stream(1); // Stream with initial value `1`
 * var s = flyd.stream(); // Stream with no initial value
 */
flyd.stream = function(initialValue) {
  var endStream = createDependentStream([], trueFn);
  var s = createStream();
  s.end = endStream;
  s.fnArgs = [];
  endStream.listeners.push(s);
  if (arguments.length > 0) s(initialValue);
  return s;
};
// fantasy-land Applicative
flyd.stream['fantasy-land/of'] = flyd.stream.of = flyd.stream;

/**
 * Create a new dependent stream
 *
 * __Signature__: `(...Stream * -> Stream b -> b) -> [Stream *] -> Stream b`
 *
 * @name flyd.combine
 * @param {Function} fn - the function used to combine the streams
 * @param {Array<stream>} dependencies - the streams that this one depends on
 * @return {stream} the dependent stream
 *
 * @example
 * var n1 = flyd.stream(0);
 * var n2 = flyd.stream(0);
 * var max = flyd.combine(function(n1, n2, self, changed) {
 *   return n1() > n2() ? n1() : n2();
 * }, [n1, n2]);
 */
flyd.combine = curryN_1(2, combine);
function combine(fn, streams) {
  var i, s, deps, depEndStreams;
  var endStream = createDependentStream([], trueFn);
  deps = []; depEndStreams = [];
  for (i = 0; i < streams.length; ++i) {
    if (streams[i] !== undefined) {
      deps.push(streams[i]);
      if (streams[i].end !== undefined) depEndStreams.push(streams[i].end);
    }
  }
  s = createDependentStream(deps, fn);
  s.depsChanged = [];
  s.fnArgs = s.deps.concat([s, s.depsChanged]);
  s.end = endStream;
  endStream.listeners.push(s);
  addListeners(depEndStreams, endStream);
  endStream.deps = depEndStreams;
  updateStream(s);
  return s;
}

/**
 * Returns `true` if the supplied argument is a Flyd stream and `false` otherwise.
 *
 * __Signature__: `* -> Boolean`
 *
 * @name flyd.isStream
 * @param {*} value - the value to test
 * @return {Boolean} `true` if is a Flyd streamn, `false` otherwise
 *
 * @example
 * var s = flyd.stream(1);
 * var n = 1;
 * flyd.isStream(s); //=> true
 * flyd.isStream(n); //=> false
 */
flyd.isStream = function(stream) {
  return isFunction(stream) && 'hasVal' in stream;
};

/**
 * Invokes the body (the function to calculate the value) of a dependent stream
 *
 * By default the body of a dependent stream is only called when all the streams
 * upon which it depends has a value. `immediate` can circumvent this behaviour.
 * It immediately invokes the body of a dependent stream.
 *
 * __Signature__: `Stream a -> Stream a`
 *
 * @name flyd.immediate
 * @param {stream} stream - the dependent stream
 * @return {stream} the same stream
 *
 * @example
 * var s = flyd.stream();
 * var hasItems = flyd.immediate(flyd.combine(function(s) {
 *   return s() !== undefined && s().length > 0;
 * }, [s]);
 * console.log(hasItems()); // logs `false`. Had `immediate` not been
 *                          // used `hasItems()` would've returned `undefined`
 * s([1]);
 * console.log(hasItems()); // logs `true`.
 * s([]);
 * console.log(hasItems()); // logs `false`.
 */
flyd.immediate = function(s) {
  if (s.depsMet === false) {
    s.depsMet = true;
    updateStream(s);
  }
  return s;
};

/**
 * Changes which `endsStream` should trigger the ending of `s`.
 *
 * __Signature__: `Stream a -> Stream b -> Stream b`
 *
 * @name flyd.endsOn
 * @param {stream} endStream - the stream to trigger the ending
 * @param {stream} stream - the stream to be ended by the endStream
 * @param {stream} the stream modified to be ended by endStream
 *
 * @example
 * var n = flyd.stream(1);
 * var killer = flyd.stream();
 * // `double` ends when `n` ends or when `killer` emits any value
 * var double = flyd.endsOn(flyd.merge(n.end, killer), flyd.combine(function(n) {
 *   return 2 * n();
 * }, [n]);
*/
flyd.endsOn = function(endS, s) {
  detachDeps(s.end);
  endS.listeners.push(s.end);
  s.end.deps.push(endS);
  return s;
};

/**
 * Map a stream
 *
 * Returns a new stream consisting of every value from `s` passed through
 * `fn`. I.e. `map` creates a new stream that listens to `s` and
 * applies `fn` to every new value.
 * __Signature__: `(a -> result) -> Stream a -> Stream result`
 *
 * @name flyd.map
 * @param {Function} fn - the function that produces the elements of the new stream
 * @param {stream} stream - the stream to map
 * @return {stream} a new stream with the mapped values
 *
 * @example
 * var numbers = flyd.stream(0);
 * var squaredNumbers = flyd.map(function(n) { return n*n; }, numbers);
 */
// Library functions use self callback to accept (null, undefined) update triggers.
function map(f, s) {
  return combine(function(s, self) { self(f(s.val)); }, [s]);
}
flyd.map = curryN_1(2, map);

/**
 * Chain a stream
 *
 * also known as flatMap
 *
 * Where `fn` returns a stream this function will flatten the resulting streams.
 * Every time `fn` is called the context of the returned stream will "switch" to that stream.
 *
 * __Signature__: `(a -> Stream b) -> Stream a -> Stream b`
 *
 * @name flyd.chain
 * @param {Function} fn - the function that produces the streams to be flattened
 * @param {stream} stream - the stream to map
 * @return {stream} a new stream with the mapped values
 *
 * @example
 * var filter = flyd.stream('who');
 * var items = flyd.chain(function(filter){
 *   return flyd.stream(findUsers(filter));
 * }, filter);
 */
flyd.chain = curryN_1(2, chain);

/**
 * Apply a stream
 *
 * Applies the value in `s2` to the function in `s1`.
 *
 * __Signature__: `Stream (a -> b) -> Stream a -> Stream b`
 *
 * @name flyd.ap
 * @param {stream} s1 - The value to be applied
 * @param {stream} s2 - The function expecting the value
 * @return {stream} a new stream with the mapped values
 *
 * @example
 * var add = stream(a => b => a + b)
 * var n1 = stream(1)
 * var n2 = stream(2)
 *
 * var added = flyd.ap(n2, flyd.ap(n1, add)) // stream(3)
 * // can also be written using pipe
 * var added_pipe = add
 *   .pipe(ap(n1))
 *   .pipe(ap(n2));
 * added_pipe() // 3
 */
flyd.ap = curryN_1(2, ap);

/**
 * Listen to stream events
 *
 * Similar to `map` except that the returned stream is empty. Use `on` for doing
 * side effects in reaction to stream changes. Use the returned stream only if you
 * need to manually end it.
 *
 * __Signature__: `(a -> result) -> Stream a -> Stream undefined`
 *
 * @name flyd.on
 * @param {Function} cb - the callback
 * @param {stream} stream - the stream
 * @return {stream} an empty stream (can be ended)
 */
flyd.on = curryN_1(2, function(f, s) {
  return combine(function(s) { f(s.val); }, [s]);
});

/**
 * Creates a new stream with the results of calling the function on every incoming
 * stream with and accumulator and the incoming value.
 *
 * __Signature__: `(a -> b -> a) -> a -> Stream b -> Stream a`
 *
 * @name flyd.scan
 * @param {Function} fn - the function to call
 * @param {*} val - the initial value of the accumulator
 * @param {stream} stream - the stream source
 * @return {stream} the new stream
 *
 * @example
 * var numbers = flyd.stream();
 * var sum = flyd.scan(function(sum, n) { return sum+n; }, 0, numbers);
 * numbers(2)(3)(5);
 * sum(); // 10
 */
flyd.scan = curryN_1(3, function(f, acc, s) {
  var ns = combine(function(s, self) {
    self(acc = f(acc, s.val));
  }, [s]);
  if (!ns.hasVal) ns(acc);
  return ns;
});

/**
 * Creates a new stream down which all values from both `stream1` and `stream2`
 * will be sent.
 *
 * __Signature__: `Stream a -> Stream a -> Stream a`
 *
 * @name flyd.merge
 * @param {stream} source1 - one stream to be merged
 * @param {stream} source2 - the other stream to be merged
 * @return {stream} a stream with the values from both sources
 *
 * @example
 * var btn1Clicks = flyd.stream();
 * button1Elm.addEventListener(btn1Clicks);
 * var btn2Clicks = flyd.stream();
 * button2Elm.addEventListener(btn2Clicks);
 * var allClicks = flyd.merge(btn1Clicks, btn2Clicks);
 */
flyd.merge = curryN_1(2, function(s1, s2) {
  var s = flyd.immediate(combine(function(s1, s2, self, changed) {
    if (changed[0]) {
      self(changed[0]());
    } else if (s1.hasVal) {
      self(s1.val);
    } else if (s2.hasVal) {
      self(s2.val);
    }
  }, [s1, s2]));
  flyd.endsOn(combine(function() {
    return true;
  }, [s1.end, s2.end]), s);
  return s;
});

/**
 * Creates a new stream resulting from applying `transducer` to `stream`.
 *
 * __Signature__: `Transducer -> Stream a -> Stream b`
 *
 * @name flyd.transduce
 * @param {Transducer} xform - the transducer transformation
 * @param {stream} source - the stream source
 * @return {stream} the new stream
 *
 * @example
 * var t = require('transducers.js');
 *
 * var results = [];
 * var s1 = flyd.stream();
 * var tx = t.compose(t.map(function(x) { return x * 2; }), t.dedupe());
 * var s2 = flyd.transduce(tx, s1);
 * flyd.combine(function(s2) { results.push(s2()); }, [s2]);
 * s1(1)(1)(2)(3)(3)(3)(4);
 * results; // => [2, 4, 6, 8]
 */
flyd.transduce = curryN_1(2, function(xform, source) {
  xform = xform(new StreamTransformer());
  return combine(function(source, self) {
    var res = xform['@@transducer/step'](undefined, source.val);
    if (res && res['@@transducer/reduced'] === true) {
      self.end(true);
      return res['@@transducer/value'];
    } else {
      return res;
    }
  }, [source]);
});

/**
 * Returns `fn` curried to `n`. Use this function to curry functions exposed by
 * modules for Flyd.
 *
 * @name flyd.curryN
 * @function
 * @param {Integer} arity - the function arity
 * @param {Function} fn - the function to curry
 * @return {Function} the curried function
 *
 * @example
 * function add(x, y) { return x + y; };
 * var a = flyd.curryN(2, add);
 * a(2)(4) // => 6
 */
flyd.curryN = curryN_1;

/**
 * Returns a new stream identical to the original except every
 * value will be passed through `f`.
 *
 * _Note:_ This function is included in order to support the fantasy land
 * specification.
 *
 * __Signature__: Called bound to `Stream a`: `(a -> b) -> Stream b`
 *
 * @name stream.map
 * @param {Function} function - the function to apply
 * @return {stream} a new stream with the values mapped
 *
 * @example
 * var numbers = flyd.stream(0);
 * var squaredNumbers = numbers.map(function(n) { return n*n; });
 */
function boundMap(f) { return map(f, this); }

/**
 * Returns the result of applying function `fn` to this stream
 *
 * __Signature__: Called bound to `Stream a`: `(a -> Stream b) -> Stream b`
 *
 * @name stream.pipe
 * @param {Function} fn - the function to apply
 * @return {stream} A new stream
 *
 * @example
 * var numbers = flyd.stream(0);
 * var squaredNumbers = numbers.pipe(flyd.map(function(n){ return n*n; }));
 */
function operator_pipe(f) { return f(this) }

function boundChain(f) {
  return chain(f, this);
}

function chain(f, s) {
  // Internal state to end flat map stream
  var flatEnd = flyd.stream(1);
  var internalEnded = flyd.on(function() {
    var alive = flatEnd() - 1;
    flatEnd(alive);
    if (alive <= 0) {
      flatEnd.end(true);
    }
  });

  internalEnded(s.end);
  var last = flyd.stream();
  var flatStream = flyd.combine(function(s, own) {
    last.end(true);
    // Our fn stream makes streams
    var newS = f(s());
    flatEnd(flatEnd() + 1);
    internalEnded(newS.end);

    // Update self on call -- newS is never handed out so deps don't matter
    last = map(own, newS);
  }, [s]);

  flyd.endsOn(flatEnd.end, flatStream);

  return flatStream;
}

flyd.fromPromise = function fromPromise(p) {
  var s = flyd.stream();
  p.then(function(val) {
    s(val);
    s.end(true);
  });
  return s;
};

flyd.flattenPromise = function flattenPromise(s) {
  return combine(function(s, self) {
    s().then(self);
  }, [s])
};

/**
 * Returns a new stream which is the result of applying the
 * functions from `this` stream to the values in `stream` parameter.
 *
 * `this` stream must be a stream of functions.
 *
 * _Note:_ This function is included in order to support the fantasy land
 * specification.
 *
 * __Signature__: Called bound to `Stream (a -> b)`: `a -> Stream b`
 *
 * @name stream.ap
 * @param {stream} stream - the values stream
 * @return {stream} a new stream with the functions applied to values
 *
 * @example
 * var add = flyd.curryN(2, function(x, y) { return x + y; });
 * var numbers1 = flyd.stream();
 * var numbers2 = flyd.stream();
 * var addToNumbers1 = flyd.map(add, numbers1);
 * var added = addToNumbers1.ap(numbers2);
 */
function ap(s2, s1) {
  return combine(function(s1, s2, self) { self(s1.val(s2.val)); }, [s1, s2]);
}

function boundAp(s2) {
  return ap(s2, this);
}

/**
 * @private
 */
function fantasy_land_ap(s1) {
  return ap(this, s1);
}

/**
 * Get a human readable view of a stream
 * @name stream.toString
 * @return {String} the stream string representation
 */
function streamToString() {
  return 'stream(' + this.val + ')';
}

/**
 * @name stream.end
 * @memberof stream
 * A stream that emits `true` when the stream ends. If `true` is pushed down the
 * stream the parent stream ends.
 */

/**
 * @name stream.of
 * @function
 * @memberof stream
 * Returns a new stream with `value` as its initial value. It is identical to
 * calling `flyd.stream` with one argument.
 *
 * __Signature__: Called bound to `Stream (a)`: `b -> Stream b`
 *
 * @param {*} value - the initial value
 * @return {stream} the new stream
 *
 * @example
 * var n = flyd.stream(1);
 * var m = n.of(1);
 */

// /////////////////////////// PRIVATE ///////////////////////////////// //
/**
 * @private
 * Create a stream with no dependencies and no value
 * @return {Function} a flyd stream
 */
function createStream() {
  function s(n) {
    if (arguments.length === 0) return s.val
    updateStreamValue(n, s);
    return s
  }
  s.hasVal = false;
  s.val = undefined;
  s.updaters = [];
  s.listeners = [];
  s.queued = false;
  s.end = undefined;

  // fantasy-land compatibility
  s.ap = boundAp;
  s['fantasy-land/map'] = s.map = boundMap;
  s['fantasy-land/ap'] = fantasy_land_ap;
  s['fantasy-land/of'] = s.of = flyd.stream;
  s['fantasy-land/chain'] = s.chain = boundChain;

  s.pipe = operator_pipe;

  // According to the fantasy-land Applicative specification
  // Given a value f, one can access its type representative via the constructor property:
  // `f.constructor.of`
  s.constructor = flyd.stream;

  s.toJSON = function() {
    return s.val;
  };
  s.toString = streamToString;
  return s;
}

/**
 * @private
 * Create a dependent stream
 * @param {Array<stream>} dependencies - an array of the streams
 * @param {Function} fn - the function used to calculate the new stream value
 * from the dependencies
 * @return {stream} the created stream
 */
function createDependentStream(deps, fn) {
  var s = createStream();
  s.fn = fn;
  s.deps = deps;
  s.depsMet = false;
  s.depsChanged = deps.length > 0 ? [] : undefined;
  s.shouldUpdate = false;
  addListeners(deps, s);
  return s;
}

/**
 * @private
 * Check if all the dependencies have values
 * @param {stream} stream - the stream to check depencencies from
 * @return {Boolean} `true` if all dependencies have vales, `false` otherwise
 */
function initialDependenciesMet(stream) {
  stream.depsMet = stream.deps.every(function(s) {
    return s.hasVal;
  });
  return stream.depsMet;
}

function dependenciesAreMet(stream) {
  return stream.depsMet === true || initialDependenciesMet(stream);
}

function isEnded(stream) {
  return stream.end && stream.end.val === true;
}

function listenersNeedUpdating(s) {
  return s.listeners.some(function(s) { return s.shouldUpdate; });
}

/**
 * @private
 * Update a dependent stream using its dependencies in an atomic way
 * @param {stream} stream - the stream to update
 */
function updateStream(s) {
  if (isEnded(s) || !dependenciesAreMet(s)) return;
  if (inStream !== undefined) {
    updateLaterUsing(updateStream, s);
    return;
  }
  inStream = s;
  if (s.depsChanged) s.fnArgs[s.fnArgs.length - 1] = s.depsChanged;
  var returnVal = s.fn.apply(s.fn, s.fnArgs);
  if (returnVal !== undefined) {
    s(returnVal);
  }
  inStream = undefined;
  if (s.depsChanged !== undefined) s.depsChanged = [];
  s.shouldUpdate = false;
  if (flushing() === false) flushUpdate();
  if (listenersNeedUpdating(s)) {
    if (!flushingStreamValue) s(s.val);
    else {
      s.listeners.forEach(function(listener) {
        if (listener.shouldUpdate) updateLaterUsing(updateStream, listener);
      });
    }
  }
}

/**
 * @private
 * Update the dependencies of a stream
 * @param {stream} stream
 */
function updateListeners(s) {
  var i, o, list;
  var listeners = s.listeners;
  for (i = 0; i < listeners.length; ++i) {
    list = listeners[i];
    if (list.end === s) {
      endStream(list);
    } else {
      if (list.depsChanged !== undefined) list.depsChanged.push(s);
      list.shouldUpdate = true;
      findDeps(list);
    }
  }
  for (; orderNextIdx >= 0; --orderNextIdx) {
    o = order[orderNextIdx];
    if (o.shouldUpdate === true) updateStream(o);
    o.queued = false;
  }
}

/**
 * @private
 * Add stream dependencies to the global `order` queue.
 * @param {stream} stream
 * @see updateDeps
 */
function findDeps(s) {
  var i;
  var listeners = s.listeners;
  if (s.queued === false) {
    s.queued = true;
    for (i = 0; i < listeners.length; ++i) {
      findDeps(listeners[i]);
    }
    order[++orderNextIdx] = s;
  }
}

function updateLaterUsing(updater, stream) {
  toUpdate.push(stream);
  stream.updaters.push(updater);
  stream.shouldUpdate = true;
}

/**
 * @private
 */
function flushUpdate() {
  flushingUpdateQueue = true;
  while (toUpdate.length > 0) {
    var stream = toUpdate.shift();
    var nextUpdateFn = stream.updaters.shift();
    if (nextUpdateFn && stream.shouldUpdate) nextUpdateFn(stream);
  }
  flushingUpdateQueue = false;
}

/**
 * @private
 * Push down a value into a stream
 * @param {stream} stream
 * @param {*} value
 */
function updateStreamValue(n, s) {
  s.val = n;
  s.hasVal = true;
  if (inStream === undefined) {
    flushingStreamValue = true;
    updateListeners(s);
    if (toUpdate.length > 0) flushUpdate();
    flushingStreamValue = false;
  } else if (inStream === s) {
    markListeners(s, s.listeners);
  } else {
    updateLaterUsing(function(s) { updateStreamValue(n, s); }, s);
  }
}

/**
 * @private
 */
function markListeners(s, lists) {
  var i, list;
  for (i = 0; i < lists.length; ++i) {
    list = lists[i];
    if (list.end !== s) {
      if (list.depsChanged !== undefined) {
        list.depsChanged.push(s);
      }
      list.shouldUpdate = true;
    } else {
      endStream(list);
    }
  }
}

/**
 * @private
 * Add dependencies to a stream
 * @param {Array<stream>} dependencies
 * @param {stream} stream
 */
function addListeners(deps, s) {
  for (var i = 0; i < deps.length; ++i) {
    deps[i].listeners.push(s);
  }
}

/**
 * @private
 * Removes an stream from a dependency array
 * @param {stream} stream
 * @param {Array<stream>} dependencies
 */
function removeListener(s, listeners) {
  var idx = listeners.indexOf(s);
  listeners[idx] = listeners[listeners.length - 1];
  listeners.length--;
}

/**
 * @private
 * Detach a stream from its dependencies
 * @param {stream} stream
 */
function detachDeps(s) {
  for (var i = 0; i < s.deps.length; ++i) {
    removeListener(s, s.deps[i].listeners);
  }
  s.deps.length = 0;
}

/**
 * @private
 * Ends a stream
 */
function endStream(s) {
  if (s.deps !== undefined) detachDeps(s);
  if (s.end !== undefined) detachDeps(s.end);
}

/**
 * @private
 */
/**
 * @private
 * transducer stream transformer
 */
function StreamTransformer() { }
StreamTransformer.prototype['@@transducer/init'] = function() { };
StreamTransformer.prototype['@@transducer/result'] = function() { };
StreamTransformer.prototype['@@transducer/step'] = function(s, v) { return v; };

var lib = flyd;

return lib;

})));


text:
module.exports = function(Friend) {

};


text:
(function($, window, document, undefined) {
  'use strict';

  // DURATIONPICKER PUBLIC CLASS DEFINITION
  var Durationpicker = function(element, options) {
    this.widget = '';
    this.$element = $(element);
    this.defaultDuration = options.defaultDuration;
    this.disableFocus = options.disableFocus;
    this.disableMousewheel = options.disableMousewheel;
    this.isOpen = options.isOpen;
    this.minuteStep = options.minuteStep;
    this.modalBackdrop = options.modalBackdrop;
    this.orientation = options.orientation;
    this.secondStep = options.secondStep;
    this.showInputs = options.showInputs;
    this.showSeconds = options.showSeconds;
    this.template = options.template;
    this.customTemplateContent = options.customTemplateContent;
    this.appendWidgetTo = options.appendWidgetTo;
    this.showWidgetOnAddonClick = options.showWidgetOnAddonClick;

    this._init();
  };

  Durationpicker.prototype = {

    constructor: Durationpicker,
    _init: function() {
      var self = this;

      if (this.showWidgetOnAddonClick && (this.$element.parent().hasClass('input-append') || this.$element.parent().hasClass('input-prepend') || this.$element.parent().hasClass('input-group'))) {
        this.$element.parent('.input-append, .input-prepend, .input-group').find('.add-on, .input-group-addon').on({
          'click.durationpicker': $.proxy(this.showWidget, this)
        });
        this.$element.on({
          'focus.durationpicker': $.proxy(this.highlightUnit, this),
          'click.durationpicker': $.proxy(this.highlightUnit, this),
          'keydown.durationpicker': $.proxy(this.elementKeydown, this),
          'blur.durationpicker': $.proxy(this.blurElement, this),
          'mousewheel.durationpicker DOMMouseScroll.durationpicker': $.proxy(this.mousewheel, this)
        });
      } else {
        if (this.template) {
          this.$element.on({
            'focus.durationpicker': $.proxy(this.showWidget, this),
            'click.durationpicker': $.proxy(this.showWidget, this),
            'blur.durationpicker': $.proxy(this.blurElement, this),
            'mousewheel.durationpicker DOMMouseScroll.durationpicker': $.proxy(this.mousewheel, this)
          });
        } else {
          this.$element.on({
            'focus.durationpicker': $.proxy(this.highlightUnit, this),
            'click.durationpicker': $.proxy(this.highlightUnit, this),
            'keydown.durationpicker': $.proxy(this.elementKeydown, this),
            'blur.durationpicker': $.proxy(this.blurElement, this),
            'mousewheel.durationpicker DOMMouseScroll.durationpicker': $.proxy(this.mousewheel, this)
          });
        }
      }

      if (this.template !== false) {
        this.$widget = $(this.getTemplate()).on('click', $.proxy(this.widgetClick, this));
      } else {
        this.$widget = false;
      }

      if (this.showInputs && this.$widget !== false) {
        this.$widget.find('input').each(function() {
          $(this).on({
            'click.durationpicker': function() { $(this).select(); },
            'keydown.durationpicker': $.proxy(self.widgetKeydown, self),
            'keyup.durationpicker': $.proxy(self.widgetKeyup, self)
          });
        });
      }

      this.setDefaultDuration(this.defaultDuration);
    },

    blurElement: function() {
      this.highlightedUnit = null;
      this.updateFromElementVal();
    },

    clear: function() {
      this.hour = '';
      this.minute = '';
      this.second = '';

      this.$element.val('');
    },

    decrementHour: function() {
      if (this.hour <= 0) {
        this.hour = 0;
      } else {
        this.hour--;
      }
    },

    decrementMinute: function(step) {
      var newVal;

      if (step) {
        newVal = this.minute - step;
      } else {
        newVal = this.minute - this.minuteStep;
      }

      if (newVal < 0) {
        this.decrementHour();
        this.minute = newVal + 60;
      } else {
        this.minute = newVal;
      }
    },

    decrementSecond: function() {
      var newVal = this.second - this.secondStep;

      if (newVal < 0) {
        this.decrementMinute(true);
        this.second = newVal + 60;
      } else {
        this.second = newVal;
      }
    },

    elementKeydown: function(e) {
      switch (e.keyCode) {
      case 9: //tab
      case 27: // escape
        this.updateFromElementVal();
        break;
      case 37: // left arrow
        e.preventDefault();
        this.highlightPrevUnit();
        break;
      case 38: // up arrow
        e.preventDefault();
        switch (this.highlightedUnit) {
        case 'hour':
          this.incrementHour();
          this.highlightHour();
          break;
        case 'minute':
          this.incrementMinute();
          this.highlightMinute();
          break;
        case 'second':
          this.incrementSecond();
          this.highlightSecond();
          break;
        }
        this.update();
        break;
      case 39: // right arrow
        e.preventDefault();
        this.highlightNextUnit();
        break;
      case 40: // down arrow
        e.preventDefault();
        switch (this.highlightedUnit) {
        case 'hour':
          this.decrementHour();
          this.highlightHour();
          break;
        case 'minute':
          this.decrementMinute();
          this.highlightMinute();
          break;
        case 'second':
          this.decrementSecond();
          this.highlightSecond();
          break;
        }

        this.update();
        break;
      }
    },

    getCursorPosition: function() {
      var input = this.$element.get(0);

      if ('selectionStart' in input) {// Standard-compliant browsers

        return input.selectionStart;
      } else if (document.selection) {// IE fix
        input.focus();
        var sel = document.selection.createRange(),
          selLen = document.selection.createRange().text.length;

        sel.moveStart('character', - input.value.length);

        return sel.text.length - selLen;
      }
    },

    getTemplate: function() {
      var template,
        hourTemplate,
        minuteTemplate,
        secondTemplate,
        templateContent;

      if (this.showInputs) {
        hourTemplate = '<input type="text" class="bootstrap-durationpicker-hour" maxlength="3"/>';
        minuteTemplate = '<input type="text" class="bootstrap-durationpicker-minute" maxlength="2"/>';
        secondTemplate = '<input type="text" class="bootstrap-durationpicker-second" maxlength="2"/>';
      } else {
        hourTemplate = '';
        minuteTemplate = '';
        secondTemplate = '';
      }

      templateContent = (this.customTemplateContent !== false) ? this.customTemplateContent : '
'+
         '
'+
           '	'+
           ' 	'+
           '	'+
           (this.showSeconds ?
             ' 	'+
             '	'
           : '') +
         '
'+
         '
'+
           ''+ hourTemplate +'	 '+
           ':	'+
           ''+ minuteTemplate +'	 '+
           (this.showSeconds ?
            ':	'+
            ''+ secondTemplate +'	'
           : '') +
         '
'+
         '
'+
           '	'+
           '	'+
           '	'+
           (this.showSeconds ?
            ' 	'+
            '	'
           : '') +
         '
'+
       '
';

      switch(this.template) {
      case 'modal':
        template = '
'+
          '
'+
            '×'+
            '
Pick a Duration
'+
          '
'+
          '
'+
            templateContent +
          '
'+
          '
'+
            'OK'+
          '
'+
        '
';
        break;
      case 'dropdown':
        template = '
'+ templateContent +'
';
        break;
      }

      return template;
    },

    getDuration: function() {
      if (this.hour === '') {
        return '';
      }

      return this.hour + ':' + (this.minute.toString().length === 1 ? '0' + this.minute : this.minute) + (this.showSeconds ? ':' + (this.second.toString().length === 1 ? '0' + this.second : this.second) : '');
    },

    hideWidget: function() {
      if (this.isOpen === false) {
        return;
      }

      this.$element.trigger({
        'type': 'hide.durationpicker',
        'duration': {
          'value': this.getDuration(),
          'hours': this.hour,
          'minutes': this.minute,
          'seconds': this.second,
        }
      });

      if (this.template === 'modal' && this.$widget.modal) {
        this.$widget.modal('hide');
      } else {
        this.$widget.removeClass('open');
      }

      $(document).off('mousedown.durationpicker, touchend.durationpicker');

      this.isOpen = false;
      // show/hide approach taken by datepicker
      this.$widget.detach();
    },

    highlightUnit: function() {
      var hourLength = 2;
      if (this.hour >= 100) {
        hourLength = 3;
      } else if (self.hour < 10) {
        hourLength = 1
      }

      this.position = this.getCursorPosition();
      if (this.position >= 0 && this.position <= hourLength) {
        this.highlightHour();
      } else if (this.position >= hourLength+1 && this.position <= hourLength+3) {
        this.highlightMinute();
      } else if (this.position >= hourLength+4 && this.position <= hourLength+6) {
        if (this.showSeconds) {
          this.highlightSecond();
        }
      }
    },

    highlightNextUnit: function() {
      switch (this.highlightedUnit) {
      case 'hour':
        this.highlightMinute();
        break;
      case 'minute':
        if (this.showSeconds) {
          this.highlightSecond();
        } else {
          this.highlightHour();
        }
        break;
      case 'second':
          this.highlightHour();
        break;
      }
    },

    highlightPrevUnit: function() {
      switch (this.highlightedUnit) {
      case 'hour':
        if (this.showSeconds) {
          this.highlightSecond();
        } else {
          this.highlightMinute();
        }
        break;
      case 'minute':
        this.highlightHour();
        break;
      case 'second':
        this.highlightMinute();
        break;
      }
    },

    highlightHour: function() {
      var $element = this.$element.get(0),
          self = this;

      this.highlightedUnit = 'hour';

      if ($element.setSelectionRange) {
        setTimeout(function() {
          if (self.hour >= 100) {
            $element.setSelectionRange(0,3);
          } else if (self.hour < 10) {
            $element.setSelectionRange(0,1);
          } else {
            $element.setSelectionRange(0,2);
          }
        }, 0);
      }
    },

    highlightMinute: function() {
      var $element = this.$element.get(0),
          self = this;

      this.highlightedUnit = 'minute';

      if ($element.setSelectionRange) {
        setTimeout(function() {
          if (self.hour >= 100) {
            $element.setSelectionRange(4,6);
          } else if (self.hour < 10) {
            $element.setSelectionRange(2,4);
          } else {
            $element.setSelectionRange(3,5);
          }
        }, 0);
      }
    },

    highlightSecond: function() {
      var $element = this.$element.get(0),
          self = this;

      this.highlightedUnit = 'second';

      if ($element.setSelectionRange) {
        setTimeout(function() {
          if (self.hour >= 100) {
            $element.setSelectionRange(7,9);
          } else if (self.hour < 10) {
            $element.setSelectionRange(5,7);
          } else {
            $element.setSelectionRange(6,8);
          }
        }, 0);
      }
    },

    incrementHour: function() {
      this.hour++;
    },

    incrementMinute: function(step) {
      var newVal;

      if (step) {
        newVal = this.minute + step;
      } else {
        newVal = this.minute + this.minuteStep - (this.minute % this.minuteStep);
      }

      if (newVal > 59) {
        this.incrementHour();
        this.minute = newVal - 60;
      } else {
        this.minute = newVal;
      }
    },

    incrementSecond: function() {
      var newVal = this.second + this.secondStep - (this.second % this.secondStep);

      if (newVal > 59) {
        this.incrementMinute(true);
        this.second = newVal - 60;
      } else {
        this.second = newVal;
      }
    },

    mousewheel: function(e) {
      if (this.disableMousewheel) {
        return;
      }

      e.preventDefault();
      e.stopPropagation();

      var delta = e.originalEvent.wheelDelta || -e.originalEvent.detail,
          scrollTo = null;

      if (e.type === 'mousewheel') {
        scrollTo = (e.originalEvent.wheelDelta * -1);
      }
      else if (e.type === 'DOMMouseScroll') {
        scrollTo = 40 * e.originalEvent.detail;
      }

      if (scrollTo) {
        e.preventDefault();
        $(this).scrollTop(scrollTo + $(this).scrollTop());
      }

      switch (this.highlightedUnit) {
      case 'minute':
        if (delta > 0) {
          this.incrementMinute();
        } else {
          this.decrementMinute();
        }
        this.highlightMinute();
        break;
      case 'second':
        if (delta > 0) {
          this.incrementSecond();
        } else {
          this.decrementSecond();
        }
        this.highlightSecond();
        break;
      default:
        if (delta > 0) {
          this.incrementHour();
        } else {
          this.decrementHour();
        }
        this.highlightHour();
        break;
      }

      return false;
    },

    // This method was adapted from bootstrap-datepicker.
    place : function() {
      if (this.isInline) {
        return;
      }
      var widgetWidth = this.$widget.outerWidth(), widgetHeight = this.$widget.outerHeight(), visualPadding = 10, windowWidth =
        $(window).width(), windowHeight = $(window).height(), scrollTop = $(window).scrollTop();

      var zIndex = parseInt(this.$element.parents().filter(function() {}).first().css('z-index'), 10) + 10;
      var offset = this.component ? this.component.parent().offset() : this.$element.offset();
      var height = this.component ? this.component.outerHeight(true) : this.$element.outerHeight(false);
      var width = this.component ? this.component.outerWidth(true) : this.$element.outerWidth(false);
      var left = offset.left, top = offset.top;

      this.$widget.removeClass('durationpicker-orient-top durationpicker-orient-bottom durationpicker-orient-right durationpicker-orient-left');

      if (this.orientation.x !== 'auto') {
        this.picker.addClass('datepicker-orient-' + this.orientation.x);
        if (this.orientation.x === 'right') {
          left -= widgetWidth - width;
        }
      } else{
        // auto x orientation is best-placement: if it crosses a window edge, fudge it sideways
        // Default to left
        this.$widget.addClass('durationpicker-orient-left');
        if (offset.left < 0) {
          left -= offset.left - visualPadding;
        } else if (offset.left + widgetWidth > windowWidth) {
          left = windowWidth - widgetWidth - visualPadding;
        }
      }
      // auto y orientation is best-situation: top or bottom, no fudging, decision based on which shows more of the widget
      var yorient = this.orientation.y, topOverflow, bottomOverflow;
      if (yorient === 'auto') {
        topOverflow = -scrollTop + offset.top - widgetHeight;
        bottomOverflow = scrollTop + windowHeight - (offset.top + height + widgetHeight);
        if (Math.max(topOverflow, bottomOverflow) === bottomOverflow) {
          yorient = 'top';
        } else {
          yorient = 'bottom';
        }
      }
      this.$widget.addClass('durationpicker-orient-' + yorient);
      if (yorient === 'top'){
        top += height;
      } else{
        top -= widgetHeight + parseInt(this.$widget.css('padding-top'), 10);
      }

      this.$widget.css({
        top : top,
        left : left,
        zIndex : zIndex
      });
    },

    remove: function() {
      $('document').off('.durationpicker');
      if (this.$widget) {
        this.$widget.remove();
      }
      delete this.$element.data().durationpicker;
    },

    setDefaultDuration: function(defaultDuration) {
      if (!this.$element.val()) {
        if (defaultDuration === false) {
          this.hour = 0;
          this.minute = 0;
          this.second = 0;
        } else {
          this.setDuration(defaultDuration);
        }
      } else {
        this.updateFromElementVal();
      }
    },

    setDuration: function(duration, ignoreWidget) {
      if (!duration) {
        this.clear();
        return;
      }

      var durationArray,
          hour,
          minute,
          second;

      duration = duration.replace(/[^0-9\:]/g, '');

      durationArray = duration.split(':');

      hour = durationArray[0] ? durationArray[0].toString() : durationArray.toString();
      minute = durationArray[1] ? durationArray[1].toString() : '';
      second = durationArray[2] ? durationArray[2].toString() : '';

      hour = parseInt(hour, 10);
      minute = parseInt(minute, 10);
      second = parseInt(second, 10);

      if (isNaN(hour)) {
        hour = 0;
      }
      if (isNaN(minute)) {
        minute = 0;
      }
      if (isNaN(second)) {
        second = 0;
      }

      if (hour < 0) {
        hour = 0;
      }

      if (minute < 0) {
        minute = 0;
      } else if (minute >= 60) {
        minute = 59;
      }

      if (this.showSeconds) {
        if (isNaN(second)) {
        second = 0;
        } else if (second < 0) {
        second = 0;
        } else if (second >= 60) {
         second = 59;
        }
      }

      this.hour = hour;
      this.minute = minute;
      this.second = second;

      this.update(ignoreWidget);
    },

    showWidget: function() {
      if (this.isOpen) {
        return;
      }

      if (this.$element.is(':disabled')) {
        return;
      }

      // show/hide approach taken by datepicker
      this.$widget.appendTo(this.appendWidgetTo);
      var self = this;
      $(document).on('mousedown.durationpicker, touchend.durationpicker', function (e) {
        // This condition was inspired by bootstrap-datepicker.
        // The element the durationpicker is invoked on is the input but it has a sibling for addon/button.
        if (!(self.$element.parent().find(e.target).length ||
            self.$widget.is(e.target) ||
            self.$widget.find(e.target).length)) {
          self.hideWidget();
        }
      });

      this.$element.trigger({
        'type': 'show.durationpicker',
        'duration': {
          'value': this.getDuration(),
          'hours': this.hour,
          'minutes': this.minute,
          'seconds': this.second
        }
      });

      this.place();
      if (this.disableFocus) {
        this.$element.blur();
      }

      // widget shouldn't be empty on open
      if (this.hour === '') {
        if (this.defaultDuration) {
          this.setDefaultDuration(this.defaultDuration);
        } else {
          this.setDuration('0:0:0');
        }
      }

      if (this.template === 'modal' && this.$widget.modal) {
        this.$widget.modal('show').on('hidden', $.proxy(this.hideWidget, this));
      } else {
        if (this.isOpen === false) {
          this.$widget.addClass('open');
        }
      }

      this.isOpen = true;
    },

    update: function(ignoreWidget) {
      this.updateElement();
      if (!ignoreWidget) {
        this.updateWidget();
      }

      this.$element.trigger({
        'type': 'changeDuration.durationpicker',
        'duration': {
          'value': this.getDuration(),
          'hours': this.hour,
          'minutes': this.minute,
          'seconds': this.second
        }
      });
    },

    updateElement: function() {
      this.$element.val(this.getDuration()).change();
    },

    updateFromElementVal: function() {
      this.setDuration(this.$element.val());
    },

    updateWidget: function() {
      if (this.$widget === false) {
        return;
      }

      var hour = this.hour,
          minute = this.minute.toString().length === 1 ? '0' + this.minute : this.minute,
          second = this.second.toString().length === 1 ? '0' + this.second : this.second;

      if (this.showInputs) {
        this.$widget.find('input.bootstrap-durationpicker-hour').val(hour);
        this.$widget.find('input.bootstrap-durationpicker-minute').val(minute);

        if (this.showSeconds) {
          this.$widget.find('input.bootstrap-durationpicker-second').val(second);
        }
      } else {
        this.$widget.find('span.bootstrap-durationpicker-hour').text(hour);
        this.$widget.find('span.bootstrap-durationpicker-minute').text(minute);

        if (this.showSeconds) {
          this.$widget.find('span.bootstrap-durationpicker-second').text(second);
        }
      }
    },

    updateFromWidgetInputs: function() {
      if (this.$widget === false) {
        return;
      }

      var t = this.$widget.find('input.bootstrap-durationpicker-hour').val() + ':' +
              this.$widget.find('input.bootstrap-durationpicker-minute').val() +
              (this.showSeconds ? ':' + this.$widget.find('input.bootstrap-durationpicker-second').val() : '')
      ;

      this.setDuration(t, true);
    },

    widgetClick: function(e) {
      e.stopPropagation();
      e.preventDefault();

      var $input = $(e.target),
          action = $input.closest('a').data('action');

      if (action) {
        this[action]();
      }
      this.update();
      if ($input.is('input')) {
        if ($input.get(0).setSelectionRange) {
          $input.get(0).setSelectionRange(0, $input.val().length);
        }
      }
    },

    widgetKeydown: function(e) {
      var $input = $(e.target),
          name = $input.attr('class').replace('bootstrap-durationpicker-', '');

      switch (e.keyCode) {
      case 9: //tab
        if ((this.showSeconds && name === 'second') || (!this.showSeconds && name === 'minute')) {
          return this.hideWidget();
        }
        break;
      case 27: // escape
        this.hideWidget();
        break;
      case 38: // up arrow
        e.preventDefault();
        switch (name) {
        case 'hour':
          this.incrementHour();
          break;
        case 'minute':
          this.incrementMinute();
          break;
        case 'second':
          this.incrementSecond();
          break;
        }
        this.setDuration(this.getDuration());
        if ($input.get(0).setSelectionRange) {
          $input.get(0).setSelectionRange(0, $input.val().length);
        }
        break;
      case 40: // down arrow
        e.preventDefault();
        switch (name) {
        case 'hour':
          this.decrementHour();
          break;
        case 'minute':
          this.decrementMinute();
          break;
        case 'second':
          this.decrementSecond();
          break;
        }
        this.setDuration(this.getDuration());
        if ($input.get(0).setSelectionRange) {
          $input.get(0).setSelectionRange(0, $input.val().length);
        }
        break;
      }
    },

    widgetKeyup: function(e) {
      if ((e.keyCode === 65) || (e.keyCode === 77) || (e.keyCode === 80) || (e.keyCode === 46) || (e.keyCode === 8) || (e.keyCode >= 46 && e.keyCode <= 57)) {
        this.updateFromWidgetInputs();
      }
    }
  };

  //DURATIONPICKER PLUGIN DEFINITION
  $.fn.durationpicker = function(option) {
    var args = Array.apply(null, arguments);
    args.shift();
    return this.each(function() {
      var $this = $(this),
        data = $this.data('durationpicker'),
        options = typeof option === 'object' && option;

      if (!data) {
        $this.data('durationpicker', (data = new Durationpicker(this, $.extend({}, $.fn.durationpicker.defaults, options, $(this).data()))));
      }

      if (typeof option === 'string') {
        data[option].apply(data, args);
      }
    });
  };

  $.fn.durationpicker.defaults = {
    defaultDuration: false,
    disableFocus: false,
    disableMousewheel: false,
    isOpen: false,
    minuteStep: 15,
    modalBackdrop: false,
    orientation: { x: 'auto', y: 'auto'},
    secondStep: 15,
    showSeconds: false,
    showInputs: true,
    template: 'dropdown',
    customTemplateContent: false,
    appendWidgetTo: 'body',
    showWidgetOnAddonClick: true
  };

  $.fn.durationpicker.Constructor = Durationpicker;

})(jQuery, window, document);


text:
TCamera::TCamera()
{
	Position = TGfxVec2(0, 0);
	Height = SCREEN_H;
	Width = SCREEN_W;
}

TCamera::TCamera(int H, int W) : Height(H), Width(W)
{
	Position = TGfxVec2(0, 0);
}

void TCamera::Render()
{

	GfxSpriteSetPosition(World->GetSprite(), Width / 2 - Position.x, Height / 2 - Position.y);
	GfxSpriteRender(World->GetSprite());

	for (int i = 0; i < World->GetGameObjectNumber(); i++)
	{
		GfxSpriteSetPosition(World->GetGameObject(i)->Sprite, Width / 2 - Position.x + World->GetGameObject(i)->Position.x - GfxSpriteGetSizeX(World->GetGameObject(i)->Sprite) / 2, Height / 2 - Position.y + World->GetGameObject(i)->Position.y - GfxSpriteGetSizeY(World->GetGameObject(i)->Sprite) / 2);
		GfxSpriteRender(World->GetGameObject(i)->Sprite);
	}

	GfxSpriteRender(GUISprite);

}

void TCamera::Follow(shared_ptr<TGameObject> pGameObject)
{
	Position = pGameObject->Position;
}

void TCamera::UpdateGUI(shared_ptr<TCharacter> pCharacter)
{
	GfxLineSpriteReset(GUISprite);
	float EnergyLength = pCharacter->GetEnergy() / pCharacter->Class->GetBaseEnergy() * GfxGetDisplaySizeX();
	GfxLineSpriteSetDrawingColor(GUISprite, EGfxColor_Blue);
	for (int i = 0; i < 10; i++)
	{
		GfxLineSpriteJumpTo(GUISprite, 0.0f, (float)i);
		GfxLineSpriteLineTo(GUISprite, EnergyLength, (float)i);
	}
	float HealthLength = pCharacter->GetHp() / pCharacter->Class->GetBaseHp() * GfxGetDisplaySizeX();
	GfxLineSpriteSetDrawingColor(GUISprite, EGfxColor_Red);
	for (int i = 0; i < 10; i++)
	{
		GfxLineSpriteJumpTo(GUISprite, 0.0f, GfxGetDisplaySizeY() - 9.0f + (float)i);
		GfxLineSpriteLineTo(GUISprite, HealthLength, GfxGetDisplaySizeY() - 9.0f + (float)i);
	}
}

void TCamera::InitGUI()
{
	GUISprite = GfxLineSpriteCreate();
}


text: python parse-the-giant-excel.py working-copy-genome-list.txt > list-of-strains.txt


text:
title: Unable to Find Embedded Skin Error Occurs
page_title: Unable to Find Embedded Skin Error Occurs
description: "When working with Telerik UI for ASP.NET AJAX, I get an error that the embedded skin cannot be found."
slug: unable-to-find-embedded-skin
tags: telerik, asp, net, ajax, troubleshooting, skins, appearance, unable, to find, embedded, skin, error
type: troubleshooting
category: knowledge-base
res_type: kb
published: True
---

## Environment

			Product
			Progress® Telerik® UI for ASP.NET AJAX

## Description

When working with Telerik UI for ASP.NET AJAX, I get an error that the embedded skin cannot be found.

## Error Message

`Telerik.Web.UI.[Telerik Control] with ID='[Telerik Control ID]' was unable to find embedded skin with name '[Skin Name]'. Please, make sure that you spelled the skin name correctly, or if you want to use a custom skin, set EnableEmbeddedSkins=false.`

## Cause

The possible reasons for this issue include the following:

* As of Q3 2011, all built-in skins are located in the `Telerik.Web.UI.Skins.dll` assembly. The change was announced in a blog post with [Q2 2011](https://blogs.telerik.com/blogs/posts/11-07-05/new-telerik-ajax-skins-assembly.aspx) and again with [Q3 2011](https://blogs.telerik.com/blogs/posts/11-11-15/separate-skin-assembly-in-radcontrols-for-asp-net-ajax-with-q3-apos-11.aspx).

* If you get this error after an upgrade to a later version, the most likely reason for the problem is that an issue has occurred with the Visual Studio Project references.

## Solution

Depending on the use case, apply the respective approach to solve the issue:

* (`Telerik.Web.UI.Skins.dll` assembly) Add the `Telerik.Web.UI.Skins.dll` assembly to your project. For more information, refer to [this article]({%slug introduction/radcontrols-for-asp.net-ajax-fundamentals/controlling-visual-appearance/skins-location%}).

* (Visual Studio Project) Perform a [manual upgrade]({%slug introduction/installation/upgrading-instructions/upgrading-a-trial-to-a-developer-license-or-to-a-newer-version%}#manual-upgrade).

Note that if for some reason you cannot resolve the error or you'd like to resolve it right away, you can set the `Skins` property to `Default`. This approach will solve the issue as the Default skin is located in the main `Telerik.Web.UI.dll` assembly.


text:
unless defined?(RocketCMS) && RocketCMS.respond_to?(:orm) && [:active_record, :mongoid].include?(RocketCMS.orm)
  puts "please use rocket_cms_mongoid or rocket_cms_activerecord and not rocket_cms directly"
  exit 1
end

require 'rocket_cms/version'
require 'validates_email_format_of'
require 'smart_excerpt'
require 'filename_to_slug'

require 'kaminari'
require 'addressable/uri'
require 'turbolinks'

require 'rocket_cms/seo_helpers'
require 'rocket_cms/configuration'
require 'rocket_cms/patch'
require 'rocket_cms/admin'
require 'rocket_cms/search'
require 'rocket_cms/model'
if defined?(RailsAdmin)
  require 'rocket_cms/rails_admin_menu'
end
require 'rocket_cms/engine'
require 'rocket_cms/controller'

module RocketCMS
  class << self
    def mongoid?
      RocketCMS.orm == :mongoid
    end
    def full?
      !RocketCMS.light?
    end
    def active_record?
      RocketCMS.orm == :active_record
    end
    def model_namespace
      "RocketCMS::Models::#{RocketCMS.orm.to_s.camelize}"
    end
    def orm_specific(name)
      "#{model_namespace}::#{name}".constantize
    end

    def url_helper
      @@url_helper ||= RocketCMS::UrlHelper.new
    end

    def custom_app_url(object)
      url_helper.polymorphic_url(object, routing_type: :path)
    end

    def app_url(object)
      if object.class.name == 'Page'
        if object.fullpath.blank?
          url_helper.page_path(object)
        else
          object.fullpath
        end
      else
        RocketCMS.custom_app_url(object)
      end
    end
  end

  autoload :Menu, 'rocket_cms/menu'
  autoload :Migration, 'rocket_cms/migration'
  autoload :UrlHelper, 'rocket_cms/url_helper'

  module Models
    autoload :Seo,  'rocket_cms/models/seo'
    autoload :Menu, 'rocket_cms/models/menu'
    autoload :Page, 'rocket_cms/models/page'
    autoload :News, 'rocket_cms/models/news'
    autoload :ContactMessage, 'rocket_cms/models/contact_message'

    module Mongoid
      autoload :Seo,  'rocket_cms/models/mongoid/seo'
      autoload :Menu, 'rocket_cms/models/mongoid/menu'
      autoload :Page, 'rocket_cms/models/mongoid/page'
      autoload :News, 'rocket_cms/models/mongoid/news'
      autoload :ContactMessage, 'rocket_cms/models/mongoid/contact_message'
    end

    module ActiveRecord
      autoload :Seo,  'rocket_cms/models/active_record/seo'
      autoload :Menu, 'rocket_cms/models/active_record/menu'
      autoload :Page, 'rocket_cms/models/active_record/page'
      autoload :News, 'rocket_cms/models/active_record/news'
      autoload :ContactMessage, 'rocket_cms/models/active_record/contact_message'
    end
  end

  module Controllers
    autoload :Contacts, 'rocket_cms/controllers/contacts'
    autoload :News, 'rocket_cms/controllers/news'
    autoload :Pages, 'rocket_cms/controllers/pages'
    autoload :Search, 'rocket_cms/controllers/search'
  end
end

require 'rails_admin_nested_set/helper'

module RailsAdminNestedSet::Helper
  def extra_fields(node)
    if node.class.name == 'Page'
      ret = RocketCMS::Menu.build_toggles(self, node.class, node, 'xs', '')
      ('
' + ret.join(' ') + '
').html_safe
    else
      "".html_safe
    end
  end
end

require 'manual_slug'


text:
<?php
class IWD_OnepageCheckout_Adminhtml_Model_System_Config_Source_AgreementOptions
{
    public function toOptionArray()
    {
    	$help_obj	= Mage::helper('onepagecheckout');
    	$options	= array(
            array('value' => 'standard','label' => $help_obj->__('Standard')),
            array('value' => 'minimal',	'label' => $help_obj->__('Minimal'))
        );
        return $options;
    }
}


text:
set (ParallaxEngine_API_VERSION     100)
set (ParallaxEngine_VERSION_MAJOR 	0)
set (ParallaxEngine_VERSION_MINOR 	1)
set (ParallaxEngine_VERSION_PATCH   0)
string (TIMESTAMP ParallaxEngine_MAKE_DATE "%m%d%y")
string (TIMESTAMP ParallaxEngine_MAKE_HOUR "%H%M%S")

# Defines directories variables
set (ParallaxEngine_ROOT_DIR		${CMAKE_CURRENT_SOURCE_DIR})
set (ParallaxEngine_BUILD_DIR		${ParallaxEngine_ROOT_DIR}/build)
set (ParallaxEngine_HEADER_DIR		${ParallaxEngine_ROOT_DIR}/include)
set (ParallaxEngine_CONFIG_DIR		${ParallaxEngine_ROOT_DIR}/config)
set (ParallaxEngine_SRC_DIR			${ParallaxEngine_ROOT_DIR}/src)
set (ParallaxEngine_DOC_DIR			${ParallaxEngine_ROOT_DIR}/doc)
set (ParallaxEngine_LIB_DIR			${ParallaxEngine_ROOT_DIR}/lib)
set (ParallaxEngine_EXT_DIR			${ParallaxEngine_ROOT_DIR}/externals)
set (ParallaxEngine_3RD_PARTY       ${ParallaxEngine_ROOT_DIR}/3rdparty)

set (PARALLAX_GRAPHICS_VULKAN_ALLOWED   ${GRAPHICS_ALLOW_VULKAN})
set (PARALLAX_GRAPHICS_OPENGL_ALLOWED   ${GRAPHICS_ALLOW_OPENGL})

set (PARALLAX_PHYSICS_PHYSX_ALLOWED     ${PHYSICS_ALLOW_PHYSX})
set (PARALLAX_PHYSICS_BULLET_ALLOWED    ${PHYSICS_ALLOW_BULLET})


text:
using Umbraco.Core.Models;

namespace Umbraco.Tests.TestHelpers.Entities
{
    public class MockedPropertyTypes
    {
        /// <summary>
        /// Returns a decimal property.
        /// Requires a datatype definition Id, since this is not one of the pre-populated datatypes
        /// </summary>
        /// <param name="alias">Alias of the created property type</param>
        /// <param name="name">Name of the created property type</param>
        /// <param name="dtdId">Integer Id of a decimal datatype to use</param>
        /// <returns>Property type storing decimal value</returns>
        public static PropertyType CreateDecimalProperty(string alias, string name, int dtdId)
        {
            return
                new PropertyType("test", DataTypeDatabaseType.Decimal, alias)
                {
                    Name = name,
                    Description = "Decimal property type",
                    Mandatory = false,
                    SortOrder = 4,
                    DataTypeDefinitionId = dtdId
                };
        }

        /// <summary>
        /// Returns a integer property.
        /// </summary>
        /// <param name="alias">Alias of the created property type</param>
        /// <param name="name">Name of the created property type</param>
        /// <returns>Property type storing integer value</returns>
        public static PropertyType CreateIntegerProperty(string alias, string name)
        {
            return
                new PropertyType("test", DataTypeDatabaseType.Integer, alias)
                {
                    Name = name,
                    Description = "Integer property type",
                    Mandatory = false,
                    SortOrder = 4,
                    DataTypeDefinitionId = -51
                };
        }

        /// <summary>
        /// Returns a DateTime property.
        /// </summary>
        /// <param name="alias">Alias of the created property type</param>
        /// <param name="name">Name of the created property type</param>
        /// <returns>Property type storing DateTime value</returns>
        public static PropertyType CreateDateTimeProperty(string alias, string name)
        {
            return
                new PropertyType("test", DataTypeDatabaseType.Date, alias)
                {
                    Name = name,
                    Description = "DateTime property type",
                    Mandatory = false,
                    SortOrder = 4,
                    DataTypeDefinitionId = -36
                };
        }
    }
}


text:
namespace ptest {
namespace main {

SimpleMainImpl&
SimpleMainImpl::instance() {
  static SimpleMainImpl the_instance;
  return the_instance;
}

bool
SimpleMainImpl::run(const hiera::TestSuiteView& suite,
		    std::ostream& output,
		    std::ostream& error) {
  exec::TestRunnerListener listener = cmd::OutputterFactory::stream(output, error);
  exec::TestRunner runner = exec::RunnerFactory::simple(listener);
  runner.run_suite(suite);
  const bool success = listener.success();
  return success;
}

SimpleMainImpl::SimpleMainImpl() =default;

SimpleMainImpl::~SimpleMainImpl() =default;

} // namespace ptest::main
} // namespace ptest


text:
ALTER TABLE [Data].[ElectionLevel]
ADD	CONSTRAINT [FK_Data_ElectionLevel_ContentInspectionId] FOREIGN KEY ([ContentInspectionId]) REFERENCES [Data].[ContentInspection] ([ContentInspectionId])