text:
<!doctype html>

    <title>Code coverage report for expressMongo\index.js</title>
    <meta charset="utf-8" />
    <link rel="stylesheet" href="../prettify.css" />
    <link rel="stylesheet" href="../base.css" />
    <meta name="viewport" content="width=device-width, initial-scale=1">

      all files / expressMongo/ index.js

        85.19%
        Statements
        23/27

        100%
        Branches
        0/0

        50%
        Functions
        1/2

        85.19%
        Lines
        23/27

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62	1×
1×
1×
1×
1×
1×
1×
1×
1×
1×

1×
1×

1×

1×

1×

1×

1×

1×

1×

1×

1×

1×
1×

var path = require('path');
var config = require('config-lite');
var mongoose = require('mongoose');
var express = require('express');
var session = require('express-session');
var MongoStore = require('connect-mongo')(session);
var flash = require('connect-flash');
var config = require('config-lite');
var routes = require('./routes/indexRoute');
var pkg = require('./package');

var app = express();
mongoose.connect(config.mongodb);
// 设置模板目录
app.set('views', path.join(__dirname, 'views'));
// 设置模板引擎为 ejs
app.set('view engine', 'ejs');

// 设置静态文件目录
app.use(express.static(path.join(__dirname, 'public')));
// session 中间件
app.use(session({
    name: config.session.key, // 设置 cookie 中保存 session id 的字段名称
    secret: config.session.secret, // 通过设置 secret 来计算 hash 值并放在 cookie 中,使产生的 signedCookie 防篡改
    resave: true, // 强制更新 session
    saveUninitialized: false, // 设置为 false,强制创建一个 session,即使用户未登录
    cookie: {
        maxAge: config.session.maxAge // 过期时间,过期后 cookie 中的 session id 自动删除
    },
    store: new MongoStore({ // 将 session 存储到 mongodb
        url: config.mongodb // mongodb 地址
    })
}));
// flash 中间件,用来显示通知
app.use(flash());
// 处理表单及文件上传的中间件
app.use(require('express-formidable')({
    uploadDir: path.join(__dirname, 'uploads'), // 上传文件目录
    keepExtensions: true // 保留后缀
}));

// 设置模板全局常量
app.locals.blog = {
    title: pkg.name,
    description: pkg.description
};

// 添加模板必需的三个变量
app.use(function(req, res, next) {
    res.locals.user = req.session.user;
    res.locals.success = req.flash('success').toString();
    res.locals.error = req.flash('error').toString();
    next();
});
// 路由
routes(app);

// 监听端口,启动程序
app.listen(config.port, function() {
    console.log(`${pkg.name} listening on port ${config.port}`);
});

  Code coverage
  generated by istanbul at Thu Mar 30 2017 15:38:47 GMT+0800 (中国标准时间)


text:
- [Retail Digital Signage](http://www.intel.com/content/www/us/en/retail/retail-digital-signage.html)

- Digital Signage
- Point Of Sales
- Kiosk
- Vending
- Retail Mobility
- Intel® RCM and Intel® AIM Suite
- Payment Technology
- Retail Ecosystem

redpajama_set_name: RedPajamaGithub


text:
<?php

namespace Oro\Bundle\UserBundle\Provider;

use Doctrine\Common\Collections\ArrayCollection;
use Oro\Bundle\SecurityBundle\Model\AclPrivilege;
use Oro\Bundle\UserBundle\Entity\AbstractRole;
use Oro\Bundle\UserBundle\Form\Handler\AclRoleHandler;
use Oro\Bundle\UserBundle\Model\PrivilegeCategory;
use Symfony\Contracts\Translation\TranslatorInterface;

abstract class RolePrivilegeAbstractProvider
{
    /** @var TranslatorInterface */
    protected $translator;

    /** @var RolePrivilegeCategoryProvider */
    protected $categoryProvider;

    /** @var AclRoleHandler */
    protected $aclRoleHandler;

    /**
     * @param TranslatorInterface           $translator
     * @param RolePrivilegeCategoryProvider $categoryProvider
     * @param AclRoleHandler                $aclRoleHandler
     */
    public function __construct(
        TranslatorInterface $translator,
        RolePrivilegeCategoryProvider $categoryProvider,
        AclRoleHandler $aclRoleHandler
    ) {
        $this->translator = $translator;
        $this->categoryProvider = $categoryProvider;
        $this->aclRoleHandler = $aclRoleHandler;
    }

    /**
     * @param AclPrivilege        $privilege
     * @param PrivilegeCategory[] $categories
     *
     * @return string
     */
    protected function getPrivilegeCategory(AclPrivilege $privilege, $categories)
    {
        $categories = array_map(function ($category) {
            /** @var PrivilegeCategory $category */
            return $category->getId();
        }, $categories);
        $category = $privilege->getCategory();
        if (!in_array($category, $categories)) {
            $category = PrivilegeCategoryProviderInterface::DEFAULT_ACTION_CATEGORY;

            return $category;
        }

        return $category;
    }

    /**
     * @param AbstractRole $role
     * @param string $type
     *
     * @return array|AclPrivilege[]
     */
    protected function preparePrivileges(AbstractRole $role, $type)
    {
        $allPrivileges = [];
        /**
         * @var string $type
         * @var ArrayCollection $sortedPrivileges
         */
        foreach ($this->aclRoleHandler->getAllPrivileges($role) as $privilegeType => $sortedPrivileges) {
            if ($privilegeType === $type) {
                $allPrivileges = array_merge($allPrivileges, $sortedPrivileges->toArray());
            }
        }

        return $allPrivileges;
    }
}


text:
namespace AppliedAlgebra.WaveletCodesTools.Encoding.MultilevelEncoderDependencies.DetailsVectorCorrector
{
    using GfAlgorithms.Matrices;

    /// <summary>
    /// Contract for details vector corrector that changes details vector components
    /// in order to provide required number of trailing zeros in the signal
    /// </summary>
    public interface IDetailsVectorCorrector
    {
        /// <summary>
        /// Corrects details vector in order to provide required number of trailing zeros in the signal
        /// </summary>
        /// <param name="iterationMatrices">Matrices for performing signal reconstruction</param>
        /// <param name="approximationVector">Approximation vector defined as a column vector</param>
        /// <param name="detailsVector">Details vector defined as a column vector</param>
        /// <param name="correctableComponentsCount">Number of the correctable components in the end of the details vector</param>
        /// <param name="requiredZerosCount">Required number of trailing zeros in the signal</param>
        /// <param name="options">Details vector corrector options</param>
        /// <returns>Corrected details vector defined as a column vector</returns>
        FieldElementsMatrix CorrectDetailsVector(
            (FieldElementsMatrix hMatrix, FieldElementsMatrix gMatrix) iterationMatrices,
            FieldElementsMatrix approximationVector,
            FieldElementsMatrix detailsVector,
            int correctableComponentsCount,
            int requiredZerosCount,
            CorrectorOptions options = null
        );
    }
}


text:
package vkaretko;

import org.junit.Test;

import static org.hamcrest.core.Is.is;
import static org.junit.Assert.assertThat;

/**
 * Test-class for SubString (Part_1, Lesson_6)
 *
 * @author Karetko Victor
 * @version 1.00
 * @since 01.11.2016
 */
public class SubStringTest {
    @Test
    public void whenStringFromAToZContainsSubstringStuThenResultTrue() {
        SubString subStr = new SubString();
        String testString = "abcdefghijklmnopqrstuvwxyz";
        String testSubString = "stu";
        assertThat(subStr.contains(testString,testSubString), is(true));
    }

    @Test
    public void whenStringFromAToZContainsSubstringMnopqThenResultTrue() {
        SubString subStr = new SubString();
        String testString = "abcdefghijklmnopqrstuvwxyz";
        String testSubString = "mnopq";
        assertThat(subStr.contains(testString,testSubString), is(true));
    }

    @Test
    public void whenStringFromAToZNotContainsSubstringStunThenResultFalse() {
        SubString subStr = new SubString();
        String testString = "abcdefghijklmnopqrstuvwxyz";
        String testSubString = "stun";
        assertThat(subStr.contains(testString,testSubString), is(false));
    }

}


text:
package youroom4j.model;

import java.io.Serializable;

/**
 * Representing one single category status.
 *
 * @author Shintaro Katafuchi
 */
public class Category implements Serializable {

  private static final long serialVersionUID = 1L;

  private String name;

  private int toParam;

  private int id;

  private String color;

  public Category() {}

  public String getName() {
    return name;
  }

  public void setName(String name) {
    this.name = name;
  }

  public int getToParam() {
    return toParam;
  }

  public void setToParam(int toParam) {
    this.toParam = toParam;
  }

  public int getId() {
    return id;
  }

  public void setId(int id) {
    this.id = id;
  }

  public String getColor() {
    return color;
  }

  public void setColor(String color) {
    this.color = color;
  }

  @Override
  public String toString() {
    return "Categroy{" +
        "name=" + name +
        ", to_param=" + toParam +
        ", id=" + id +
        ", color=" + color + "}";
  }
}


text:
/**
 * Autogenerated by Thrift Compiler (0.9.1)
 *
 * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
 *  @generated
 */
#ifndef applicationDeploymentModel_TYPES_H
#define applicationDeploymentModel_TYPES_H

#include <thrift/Thrift.h>
#include <thrift/TApplicationException.h>
#include <thrift/protocol/TProtocol.h>
#include <thrift/transport/TTransport.h>

#include <thrift/cxxfunctional.h>

namespace apache { namespace airavata { namespace model { namespace appcatalog { namespace appdeployment {

struct ApplicationParallelismType {
  enum type {
    SERIAL = 0,
    MPI = 1,
    OPENMP = 2,
    OPENMP_MPI = 3
  };
};

extern const std::map<int, const char*> _ApplicationParallelismType_VALUES_TO_NAMES;

class SetEnvPaths {
 public:

  static const char* ascii_fingerprint; // = "07A9615F837F7D0A952B595DD3020972";
  static const uint8_t binary_fingerprint[16]; // = {0x07,0xA9,0x61,0x5F,0x83,0x7F,0x7D,0x0A,0x95,0x2B,0x59,0x5D,0xD3,0x02,0x09,0x72};

  SetEnvPaths() : name(), value() {
  }

  virtual ~SetEnvPaths() throw() {}

  std::string name;
  std::string value;

  void __set_name(const std::string& val) {
    name = val;
  }

  void __set_value(const std::string& val) {
    value = val;
  }

  bool operator == (const SetEnvPaths & rhs) const
  {
    if (!(name == rhs.name))
      return false;
    if (!(value == rhs.value))
      return false;
    return true;
  }
  bool operator != (const SetEnvPaths &rhs) const {
    return !(*this == rhs);
  }

  bool operator < (const SetEnvPaths & ) const;

  uint32_t read(::apache::thrift::protocol::TProtocol* iprot);
  uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const;

};

void swap(SetEnvPaths &a, SetEnvPaths &b);

typedef struct _ApplicationModule__isset {
  _ApplicationModule__isset() : appModuleVersion(false), appModuleDescription(false) {}
  bool appModuleVersion;
  bool appModuleDescription;
} _ApplicationModule__isset;

class ApplicationModule {
 public:

  static const char* ascii_fingerprint; // = "FED0FBEAA0C90D1589E8B650561B7675";
  static const uint8_t binary_fingerprint[16]; // = {0xFE,0xD0,0xFB,0xEA,0xA0,0xC9,0x0D,0x15,0x89,0xE8,0xB6,0x50,0x56,0x1B,0x76,0x75};

  ApplicationModule() : appModuleId("DO_NOT_SET_AT_CLIENTS"), appModuleName(), appModuleVersion(), appModuleDescription() {
  }

  virtual ~ApplicationModule() throw() {}

  std::string appModuleId;
  std::string appModuleName;
  std::string appModuleVersion;
  std::string appModuleDescription;

  _ApplicationModule__isset __isset;

  void __set_appModuleId(const std::string& val) {
    appModuleId = val;
  }

  void __set_appModuleName(const std::string& val) {
    appModuleName = val;
  }

  void __set_appModuleVersion(const std::string& val) {
    appModuleVersion = val;
    __isset.appModuleVersion = true;
  }

  void __set_appModuleDescription(const std::string& val) {
    appModuleDescription = val;
    __isset.appModuleDescription = true;
  }

  bool operator == (const ApplicationModule & rhs) const
  {
    if (!(appModuleId == rhs.appModuleId))
      return false;
    if (!(appModuleName == rhs.appModuleName))
      return false;
    if (__isset.appModuleVersion != rhs.__isset.appModuleVersion)
      return false;
    else if (__isset.appModuleVersion && !(appModuleVersion == rhs.appModuleVersion))
      return false;
    if (__isset.appModuleDescription != rhs.__isset.appModuleDescription)
      return false;
    else if (__isset.appModuleDescription && !(appModuleDescription == rhs.appModuleDescription))
      return false;
    return true;
  }
  bool operator != (const ApplicationModule &rhs) const {
    return !(*this == rhs);
  }

  bool operator < (const ApplicationModule & ) const;

  uint32_t read(::apache::thrift::protocol::TProtocol* iprot);
  uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const;

};

void swap(ApplicationModule &a, ApplicationModule &b);

typedef struct _ApplicationDeploymentDescription__isset {
  _ApplicationDeploymentDescription__isset() : appDeploymentDescription(false), moduleLoadCmds(false), libPrependPaths(false), libAppendPaths(false), setEnvironment(false), preJobCommands(false), postJobCommands(false) {}
  bool appDeploymentDescription;
  bool moduleLoadCmds;
  bool libPrependPaths;
  bool libAppendPaths;
  bool setEnvironment;
  bool preJobCommands;
  bool postJobCommands;
} _ApplicationDeploymentDescription__isset;

class ApplicationDeploymentDescription {
 public:

  static const char* ascii_fingerprint; // = "3B2F93AE9F0E6A621AF867419ADD9E5A";
  static const uint8_t binary_fingerprint[16]; // = {0x3B,0x2F,0x93,0xAE,0x9F,0x0E,0x6A,0x62,0x1A,0xF8,0x67,0x41,0x9A,0xDD,0x9E,0x5A};

  ApplicationDeploymentDescription() : appDeploymentId("DO_NOT_SET_AT_CLIENTS"), appModuleId(), computeHostId(), executablePath(), parallelism((ApplicationParallelismType::type)0), appDeploymentDescription() {
    parallelism = (ApplicationParallelismType::type)0;

  }

  virtual ~ApplicationDeploymentDescription() throw() {}

  std::string appDeploymentId;
  std::string appModuleId;
  std::string computeHostId;
  std::string executablePath;
  ApplicationParallelismType::type parallelism;
  std::string appDeploymentDescription;
  std::vector<std::string>  moduleLoadCmds;
  std::vector<SetEnvPaths>  libPrependPaths;
  std::vector<SetEnvPaths>  libAppendPaths;
  std::vector<SetEnvPaths>  setEnvironment;
  std::vector<std::string>  preJobCommands;
  std::vector<std::string>  postJobCommands;

  _ApplicationDeploymentDescription__isset __isset;

  void __set_appDeploymentId(const std::string& val) {
    appDeploymentId = val;
  }

  void __set_appModuleId(const std::string& val) {
    appModuleId = val;
  }

  void __set_computeHostId(const std::string& val) {
    computeHostId = val;
  }

  void __set_executablePath(const std::string& val) {
    executablePath = val;
  }

  void __set_parallelism(const ApplicationParallelismType::type val) {
    parallelism = val;
  }

  void __set_appDeploymentDescription(const std::string& val) {
    appDeploymentDescription = val;
    __isset.appDeploymentDescription = true;
  }

  void __set_moduleLoadCmds(const std::vector<std::string> & val) {
    moduleLoadCmds = val;
    __isset.moduleLoadCmds = true;
  }

  void __set_libPrependPaths(const std::vector<SetEnvPaths> & val) {
    libPrependPaths = val;
    __isset.libPrependPaths = true;
  }

  void __set_libAppendPaths(const std::vector<SetEnvPaths> & val) {
    libAppendPaths = val;
    __isset.libAppendPaths = true;
  }

  void __set_setEnvironment(const std::vector<SetEnvPaths> & val) {
    setEnvironment = val;
    __isset.setEnvironment = true;
  }

  void __set_preJobCommands(const std::vector<std::string> & val) {
    preJobCommands = val;
    __isset.preJobCommands = true;
  }

  void __set_postJobCommands(const std::vector<std::string> & val) {
    postJobCommands = val;
    __isset.postJobCommands = true;
  }

  bool operator == (const ApplicationDeploymentDescription & rhs) const
  {
    if (!(appDeploymentId == rhs.appDeploymentId))
      return false;
    if (!(appModuleId == rhs.appModuleId))
      return false;
    if (!(computeHostId == rhs.computeHostId))
      return false;
    if (!(executablePath == rhs.executablePath))
      return false;
    if (!(parallelism == rhs.parallelism))
      return false;
    if (__isset.appDeploymentDescription != rhs.__isset.appDeploymentDescription)
      return false;
    else if (__isset.appDeploymentDescription && !(appDeploymentDescription == rhs.appDeploymentDescription))
      return false;
    if (__isset.moduleLoadCmds != rhs.__isset.moduleLoadCmds)
      return false;
    else if (__isset.moduleLoadCmds && !(moduleLoadCmds == rhs.moduleLoadCmds))
      return false;
    if (__isset.libPrependPaths != rhs.__isset.libPrependPaths)
      return false;
    else if (__isset.libPrependPaths && !(libPrependPaths == rhs.libPrependPaths))
      return false;
    if (__isset.libAppendPaths != rhs.__isset.libAppendPaths)
      return false;
    else if (__isset.libAppendPaths && !(libAppendPaths == rhs.libAppendPaths))
      return false;
    if (__isset.setEnvironment != rhs.__isset.setEnvironment)
      return false;
    else if (__isset.setEnvironment && !(setEnvironment == rhs.setEnvironment))
      return false;
    if (__isset.preJobCommands != rhs.__isset.preJobCommands)
      return false;
    else if (__isset.preJobCommands && !(preJobCommands == rhs.preJobCommands))
      return false;
    if (__isset.postJobCommands != rhs.__isset.postJobCommands)
      return false;
    else if (__isset.postJobCommands && !(postJobCommands == rhs.postJobCommands))
      return false;
    return true;
  }
  bool operator != (const ApplicationDeploymentDescription &rhs) const {
    return !(*this == rhs);
  }

  bool operator < (const ApplicationDeploymentDescription & ) const;

  uint32_t read(::apache::thrift::protocol::TProtocol* iprot);
  uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const;

};

void swap(ApplicationDeploymentDescription &a, ApplicationDeploymentDescription &b);

}}}}} // namespace

#endif


text:
require "spec_helper"

describe MarkdownToWord do
  it "converts the file" do
    content = subject.convert("# Test").contents
    as_markdown(content) { |md| expect(md).to eql("# Test") }
  end

  it "returns the default template" do
    template_dir = MarkdownToWord.default_templates_path
    expect(template_dir).to eql(File.expand_path("../lib/markdown_to_word", File.dirname(__FILE__)))
    template = File.expand_path("default.docx", template_dir)
    expect(File.exists?(template)).to eql(true)
  end
end


text:
angular.module('grillApp')

    .factory('globals', ['$window', '$rootScope', 'socketService',
        function ($window, $rootScope, socketService) {
            var username;
            var grillName;
            var myUniqueCuid;
            var mySocketRoom;
            var currentGrillStatus = {};
            var adminClientOrders = [];
            return {
                username: function (newUsername) {
                    if (newUsername) {
                        username = newUsername;
                        return username;
                    } else {
                        return username;
                    }
                },

                grillName: function (newGrillName) {
                    if (newGrillName) {
                        grillName = newGrillName;
                        return grillName;
                    } else {
                        return grillName;
                    }
                },

                uniqueCuid: function (newUniqueCuid) {
                    if (newUniqueCuid) {
                        myUniqueCuid = newUniqueCuid;
                        return myUniqueCuid;
                    } else {
                        return myUniqueCuid;
                    }
                },

                socketRoom: function (newSocketRoom) {
                    if (newSocketRoom) {
                        mySocketRoom = newSocketRoom;
                    } else {
                        return mySocketRoom;
                    }
                },

                currentGrillStatus: function (newGrillStatus, broadcast, refreshGrillStatus) {
                    if (refreshGrillStatus) {
                        socketService.getCurrentGrillStatus()
                            .success(function (resp) {
                                $rootScope.$broadcast('responseStatusHandler', resp);
                                currentGrillStatus = resp.currentGrillStatus;

                                if (broadcast) {
                                    $rootScope.$broadcast('currentGrillStatus', currentGrillStatus);
                                }
                            })
                            .error(function (errResponse) {
                                $rootScope.$broadcast('responseStatusHandler', errResponse);
                            });
                    } else {

                        if (newGrillStatus) {
                            currentGrillStatus = newGrillStatus;
                        }

                        if (broadcast) {
                            $rootScope.$broadcast('currentGrillStatus', currentGrillStatus);
                        }
                    }

                    return currentGrillStatus;
                },

                adminClientOrders: function (amount, broadcast, getFromServer, refresh, currentOrdersToBeSkipped) {
                    if (getFromServer) {
                        socketService.getAdminClientOrders(amount, currentOrdersToBeSkipped)
                            .success(function (resp) {
                                $rootScope.$broadcast('responseStatusHandler', resp);
                                adminClientOrders = resp.orders;

                                if (refresh) {
                                    //a true of refresh causes a broadcast an event which refreshes the currentIncomingOrders
                                    if (broadcast) {
                                        $rootScope.$broadcast('adminClientOrdersRefresh', adminClientOrders);
                                    }
                                } else {
                                    //no refresh
                                    //just broadcast the one new order, this does not cause a refresh of the current
                                    // incoming orders
                                    if (broadcast) {
                                        $rootScope.$broadcast('adminClientOrdersRefreshNoRefresh', adminClientOrders);
                                    }
                                }
                            })
                            .error(function (errResponse) {
                                $rootScope.$broadcast('responseStatusHandler', errResponse);
                            });
                    } else if (broadcast) {
                        $rootScope.$broadcast('adminClientOrders', adminClientOrders);
                    }
                    return adminClientOrders;
                }

            }
        }]);


text:
layout: post
title: First Post
excerpt: "Ive started a blog"
modified:
tags: [uoft, oer, blogging, SPARC]
comments: true
category: blog
---

This is the first post on my blog.

I've decided to actualize my long-dormant ambitions to write a blog (and have a pro·fes·sion·al profile websitey thing) because as of this week, I am one of SPARC's 24  2018-2019 Open Education Leadership Fellows.

So,  in the spirit of the openness that SPARC fights for, I'm going to *Blog* about the Fellowship and share any artifacts, outcomes, assignments, or thoughts that I think might be of value or interest to others here on this dang website (powered by Jekyll).


text:
[![Build Status](https://travis-ci.org/plu/JPSimulatorHacks.svg?branch=master)](https://travis-ci.org/plu/JPSimulatorHacks)
[![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage)

# JPSimulatorHacks

## Description

Hack the Simulator in your tests (grant access to photos, contacts, calendar ...).

Did you ever have the problem that your code was wrapping the `AddressBook`, the `EventKit` or the `ALAssetsLibrary` APIs? Running tests can be annoying then. There's this `UIAlertView` asking the user to grant access to the contacts and photos, which blocks and breaks your tests. Using `JPSimulatorHacks` you can easily grant this access before running your tests.

If you encounter any problems, please check out the [caveats](#caveats)
documented below.

### Installation

Install JPSimulatorHacks with [CocoaPods](http://cocoapods.org/)

```
pod 'JPSimulatorHacks'
```

Or, install via [Carthage](https://github.com/Carthage/Carthage)

```
github "plu/JPSimulatorHacks"
```

## Usage

### AddressBook

```objc
#import <JPSimulatorHacks/JPSimulatorHacks.h>

@implementation MyAppTests

+ (void)setUp
{
    [super setUp];
    [JPSimulatorHacks grantAccessToAddressBook];
}

@end
```

This will grant access to the addressbook for the current bundle identifier.
There's also an API to specify the bundle identifier, if necessary:

```objc
+ (BOOL)grantAccessToAddressBookForBundleIdentifier:(NSString *)bundleIdentifier;
```

### Calendar

```objc
#import <JPSimulatorHacks/JPSimulatorHacks.h>

@implementation MyAppTests

+ (void)setUp
{
    [super setUp];
    [JPSimulatorHacks grantAccessToCalendar];
}

@end
```

This will grant access to the calendar for the current bundle identifier.
There's also an API to specify the bundle identifier, if necessary:

```objc
+ (BOOL)grantAccessToCalendarForBundleIdentifier:(NSString *)bundleIdentifier;
```

### HomeKit

```objc
#import <JPSimulatorHacks/JPSimulatorHacks.h>

@implementation MyAppTests

+ (void)setUp
{
    [super setUp];
    [JPSimulatorHacks grantAccessToHomeKit];
}

@end
```

This will grant access to `HomeKit` for the current bundle identifier.
There's also an API to specify the bundle identifier, if necessary:

```objc
+ (BOOL) grantAccessToHomeKitForBundleIdentifier:(NSString *)bundleIdentifier;
```

### Photos

```objc
#import <JPSimulatorHacks/JPSimulatorHacks.h>

@implementation MyAppTests

+ (void)setUp
{
    [super setUp];
    [JPSimulatorHacks grantAccessToPhotos];
}

@end
```

This will grant access to the photos library for the current bundle identifier.
There's also an API to specify the bundle identifier, if necessary:

```objc
+ (BOOL)grantAccessToPhotosForBundleIdentifier:(NSString *)bundleIdentifier;
```

You can also add some test images from a given URL. The method will block until
the Asset has been stored. This is helpful so your tests will only start after
the Asset is available.

```objc
[JPSimulatorHacks grantAccessToPhotos];
NSURL *assetURL = [NSURL URLWithString:@"https://raw.githubusercontent.com/plu/JPSimulatorHacks/master/Data/test.png"];
ALAsset *asset = [JPSimulatorHacks addAssetWithURL:assetURL];
```

### Contacts (iOS 9)

This will grant permission for the new Contacts Framework which comes with iOS 9.

```objc
#import <JPSimulatorHacks/JPSimulatorHacks.h>

@implementation MyAppTests

+ (void)setUp
{
    [super setUp];
    [JPSimulatorHacks grantAccessToContacts];
}

@end
```

### Timeout

By default it tries to write the necessary entries to the `TCC.db` within
15 seconds. If that's not enough time, it just gives up and returns `NO`
from the methods. If for any reason that is not enough time, you can
change this default timeout via:

```objc
+ (void)setUp
{
    [super setUp];
    [JPSimulatorHacks setTimeout:30.0f];
}
```

## Caveats

* `JPSimulatorHacks` only works if unit test suite is run against
real application target: Its `Host Application` *is not* set to `None`!
See also: http://stackoverflow.com/a/28135995/598057
* When using Xcode bots, sometimes the tests run into an timeout.
* The keyboard helpers have been removed in 1.3.0

## License (MIT)

Copyright (C) 2014 Johannes Plunien

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.


text:
"""Triggering DAG runs APIs."""
import json
from datetime import datetime
from typing import List, Optional, Union

from airflow.exceptions import DagNotFound, DagRunAlreadyExists
from airflow.models import DagBag, DagModel, DagRun
from airflow.utils import timezone
from airflow.utils.state import State
from airflow.utils.types import DagRunType

def _trigger_dag(
        dag_id: str,
        dag_bag: DagBag,
        dag_run: DagModel,
        run_id: Optional[str],
        conf: Optional[Union[dict, str]],
        execution_date: Optional[datetime],
        replace_microseconds: bool,
) -> List[DagRun]:  # pylint: disable=too-many-arguments
    """Triggers DAG run.

    :param dag_id: DAG ID
    :param dag_bag: DAG Bag model
    :param dag_run: DAG Run model
    :param run_id: ID of the dag_run
    :param conf: configuration
    :param execution_date: date of execution
    :param replace_microseconds: whether microseconds should be zeroed
    :return: list of triggered dags
    """
    dag = dag_bag.get_dag(dag_id)  # prefetch dag if it is stored serialized

    if dag_id not in dag_bag.dags:
        raise DagNotFound("Dag id {} not found".format(dag_id))

    execution_date = execution_date if execution_date else timezone.utcnow()

    if not timezone.is_localized(execution_date):
        raise ValueError("The execution_date should be localized")

    if replace_microseconds:
        execution_date = execution_date.replace(microsecond=0)

    if dag.default_args and 'start_date' in dag.default_args:
        min_dag_start_date = dag.default_args["start_date"]
        if min_dag_start_date and execution_date < min_dag_start_date:
            raise ValueError(
                "The execution_date [{0}] should be >= start_date [{1}] from DAG's default_args".format(
                    execution_date.isoformat(),
                    min_dag_start_date.isoformat()))

    run_id = run_id or DagRun.generate_run_id(DagRunType.MANUAL, execution_date)
    dag_run = dag_run.find(dag_id=dag_id, run_id=run_id)

    if dag_run:
        raise DagRunAlreadyExists(
            f"Run id {dag_run.run_id} already exists for dag id {dag_id}"
        )

    run_conf = None
    if conf:
        run_conf = conf if isinstance(conf, dict) else json.loads(conf)

    triggers = []
    dags_to_trigger = [dag] + dag.subdags
    for _dag in dags_to_trigger:
        trigger = _dag.create_dagrun(
            run_id=run_id,
            execution_date=execution_date,
            state=State.RUNNING,
            conf=run_conf,
            external_trigger=True,
        )

        triggers.append(trigger)
    return triggers

def trigger_dag(
        dag_id: str,
        run_id: Optional[str] = None,
        conf: Optional[Union[dict, str]] = None,
        execution_date: Optional[datetime] = None,
        replace_microseconds: bool = True,
) -> Optional[DagRun]:
    """Triggers execution of DAG specified by dag_id

    :param dag_id: DAG ID
    :param run_id: ID of the dag_run
    :param conf: configuration
    :param execution_date: date of execution
    :param replace_microseconds: whether microseconds should be zeroed
    :return: first dag run triggered - even if more than one Dag Runs were triggered or None
    """
    dag_model = DagModel.get_current(dag_id)
    if dag_model is None:
        raise DagNotFound("Dag id {} not found in DagModel".format(dag_id))

    def read_store_serialized_dags():
        from airflow.configuration import conf
        return conf.getboolean('core', 'store_serialized_dags')
    dagbag = DagBag(
        dag_folder=dag_model.fileloc,
        store_serialized_dags=read_store_serialized_dags()
    )
    dag_run = DagRun()
    triggers = _trigger_dag(
        dag_id=dag_id,
        dag_run=dag_run,
        dag_bag=dagbag,
        run_id=run_id,
        conf=conf,
        execution_date=execution_date,
        replace_microseconds=replace_microseconds,
    )

    return triggers[0] if triggers else None


text:
'use strict';

const is = require('is-type-of');
const debug = require('debug')('socket-msessenger:util');

const INT_32_LENGTH = 4;

const util = {
  getLength(data) {
    const limit = data.readInt32BE(0) + INT_32_LENGTH;
    return limit;
  },

  getCompleteData(data) {
    const limit = util.getLength(data);

    if (data.length < limit) {
      return {};
    }

    const completeData = Buffer.alloc(limit);
    data.copy(completeData, 0, 0, limit);

    const modLength = data.length - limit;
    if (modLength > 0) {
      const modData = Buffer.alloc(modLength);

      data.copy(modData, 0, limit, data.length);
      return {
        completeData,
        modData,
      };
    }

    return { completeData };
  },

  encode(data) {
    if (!is.string(data)) {
      data = JSON.stringify(data);
    }

    const bodyLength = util.getBodyLength(data);
    const resultData = Buffer.alloc(INT_32_LENGTH + bodyLength);
    resultData.writeInt32BE(bodyLength, 0);
    resultData.write(data, INT_32_LENGTH);

    return resultData;
  },

  getBodyLength(str) {
    return new Buffer(str).length;
  },

  decode(data) {
    const bodyLength = data.readInt32BE();
    return JSON.parse(data.slice(INT_32_LENGTH, INT_32_LENGTH + bodyLength).toString());
  },

  generateMailNo(prefix, NO) {
    return `${prefix}#${NO}`;
  },
};

module.exports = util;


text:
package io.sarl.lang.tests.bugs.to01399;

import static io.sarl.tests.api.tools.TestEObjects.file;
import static io.sarl.tests.api.tools.TestUtils.multilineString;
import static io.sarl.tests.api.tools.TestValidator.validate;
import static org.junit.jupiter.api.Assertions.assertEquals;

import org.eclipse.xtend.core.xtend.XtendPackage;
import org.eclipse.xtext.common.types.TypesPackage;
import org.eclipse.xtext.xbase.XbasePackage;
import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.Tag;
import org.junit.jupiter.api.Test;

import io.sarl.lang.SARLVersion;
import io.sarl.lang.sarl.SarlPackage;
import io.sarl.lang.sarl.SarlScript;
import io.sarl.lang.validation.IssueCodes;
import io.sarl.tests.api.AbstractSarlTest;
import io.sarl.tests.api.tools.TestValidator.Validator;

/** Testing class for issue: Invalid warning "Possible invalid usage of 'occurrence'".
 *
 * <p>https://github.com/sarl/sarl/issues/1013
 *
 * @author $Author: sgalland$
 * @version $Name$ $Revision$ $Date$
 * @mavengroupid $GroupId$
 * @mavenartifactid $ArtifactId$
 * @see "https://github.com/sarl/sarl/issues/1013"
 */
@DisplayName("Bug #1013")
@SuppressWarnings("all")
@Tag("core")
@Tag("sarlParsing")
public class Bug1013Test extends AbstractSarlTest {

	private static final String SARL_CODE_01 = multilineString(
			"package io.sarl.lang.tests.bug1013",
			"import io.sarl.core.Logging",
			"import java.util.Map",
			"event E_SetupPlayer {",
			"	var agentName : String",
			"	var configDir : String",
			"	var configFile : String",
			"	var teamRoles : Map<String, Integer>",
			"	var centralBuilder : String",
			"	new(agentName : String, configDir : String, configFile : String, teamRoles : Map<String, Integer>, centralBuilder : String) {",
			"		this.agentName = agentName",
			"		this.configDir = configDir",
			"		this.configFile = configFile",
			"		this.teamRoles = teamRoles",
			"		this.centralBuilder = centralBuilder",
			"	}",
			"}",
			"agent Bug1013Agent {",
			"   uses Logging",
			"   var agentName : String",
			"   on E_SetupPlayer [occurrence.agentName == this.agentName] {",
			"		val teamRoles = occurrence.teamRoles",
			"       info(teamRoles)",
			"   }",
			"}");

	@Test
	@DisplayName("occurrence field to local variable")
	public void parsing01() throws Exception {
		SarlScript mas = file(getParseHelper(), SARL_CODE_01);
		final Validator validator = validate(getValidationHelper(), getInjector(), mas);
		validator
			.assertWarning(
				XbasePackage.eINSTANCE.getXMemberFeatureCall(),
				IssueCodes.DISCOURAGED_OCCURRENCE_READONLY_USE,
				"Possible invalid usage of 'occurrence'",
				"be copied within a local variable")
			.assertNoIssues();
	}

	private static final String SARL_CODE_02 = multilineString(
			"package io.sarl.lang.tests.bug1013",
			"import io.sarl.core.Logging",
			"import java.util.Map",
			"event E_SetupPlayer {",
			"	var agentName : String",
			"	var configDir : String",
			"	var configFile : String",
			"	var teamRoles : Map<String, Integer>",
			"	var centralBuilder : String",
			"	new(agentName : String, configDir : String, configFile : String, teamRoles : Map<String, Integer>, centralBuilder : String) {",
			"		this.agentName = agentName",
			"		this.configDir = configDir",
			"		this.configFile = configFile",
			"		this.teamRoles = teamRoles",
			"		this.centralBuilder = centralBuilder",
			"	}",
			"}",
			"agent Bug1013Agent {",
			"   uses Logging",
			"   var agentName : String",
			"   on E_SetupPlayer [occurrence.agentName == this.agentName] {",
			"		debug(\"Starting to register new behaviors and skills using {0} file\", occurrence.configFile)",
			"   }",
			"}");

	@Test
	@DisplayName("occurrence field to function")
	public void parsing02() throws Exception {
		SarlScript mas = file(getParseHelper(), SARL_CODE_02);
		final Validator validator = validate(getValidationHelper(), getInjector(), mas);
		validator
			.assertNoIssues();
	}

	private static final String SARL_CODE_03 = multilineString(
			"package io.sarl.lang.tests.bug1013",
			"import io.sarl.core.Logging",
			"import java.util.Map",
			"event E_SetupPlayer {",
			"	var agentName : String",
			"	var configDir : String",
			"	var configFile : String",
			"	var teamRoles : Map<String, Integer>",
			"	var centralBuilder : String",
			"	new(agentName : String, configDir : String, configFile : String, teamRoles : Map<String, Integer>, centralBuilder : String) {",
			"		this.agentName = agentName",
			"		this.configDir = configDir",
			"		this.configFile = configFile",
			"		this.teamRoles = teamRoles",
			"		this.centralBuilder = centralBuilder",
			"	}",
			"}",
			"agent Bug1013Agent {",
			"   uses Logging",
			"   var agentName : String",
			"   on E_SetupPlayer [occurrence.agentName == this.agentName] {",
			"		debug(\"Starting to register new behaviors and skills using {0} file\", occurrence.configFile)",
			"		val teamRoles = occurrence.teamRoles",
			"       info(teamRoles)",
			"   }",
			"}");

	@Test
	@DisplayName("occurrence field to local variable and function argument")
	public void parsing03() throws Exception {
		SarlScript mas = file(getParseHelper(), SARL_CODE_03);
		final Validator validator = validate(getValidationHelper(), getInjector(), mas);
		validator
			.assertWarning(
				XbasePackage.eINSTANCE.getXMemberFeatureCall(),
				IssueCodes.DISCOURAGED_OCCURRENCE_READONLY_USE,
				"Possible invalid usage of 'occurrence'",
				"be copied within a local variable")
			.assertNoIssues();
	}

	private static final String SARL_CODE_04 = multilineString(
			"package io.sarl.lang.tests.bug1013",
			"import io.sarl.core.Logging",
			"import java.util.Map",
			"event E_SetupPlayer {",
			"	var agentName : String",
			"	var configDir : String",
			"	var configFile : String",
			"	var teamRoles : Map<String, Integer>",
			"	var centralBuilder : String",
			"	new(agentName : String, configDir : String, configFile : String, teamRoles : Map<String, Integer>, centralBuilder : String) {",
			"		this.agentName = agentName",
			"		this.configDir = configDir",
			"		this.configFile = configFile",
			"		this.teamRoles = teamRoles",
			"		this.centralBuilder = centralBuilder",
			"	}",
			"}",
			"agent Bug1013Agent {",
			"   uses Logging",
			"   var agentName : String",
			"   on E_SetupPlayer [occurrence.agentName == this.agentName] {",
			"		debug(\"Starting to register new behaviors and skills using {0} file\", occurrence.configFile)",
			"		val teamRoles = occurrence.teamRoles",
			"   }",
			"}");

	@Test
	@DisplayName("occurrence field to local variable and function argument, no local variable use")
	public void parsing04() throws Exception {
		SarlScript mas = file(getParseHelper(), SARL_CODE_04);
		final Validator validator = validate(getValidationHelper(), getInjector(), mas);
		validator
			.assertWarning(
				XbasePackage.eINSTANCE.getXMemberFeatureCall(),
				IssueCodes.DISCOURAGED_OCCURRENCE_READONLY_USE,
				"Possible invalid usage of 'occurrence'",
				"be copied within a local variable")
			.assertWarning(
					XtendPackage.eINSTANCE.getXtendVariableDeclaration(),
					org.eclipse.xtext.xbase.validation.IssueCodes.UNUSED_LOCAL_VARIABLE,
					"local variable teamRoles is not used")
			.assertNoIssues();
	}

}


text:
package protocol_test

import (
	"net/http"
	"net/url"
	"testing"

	"github.com/aws/aws-sdk-go/aws/client/metadata"
	"github.com/aws/aws-sdk-go/aws/request"
	"github.com/aws/aws-sdk-go/awstesting"
	"github.com/aws/aws-sdk-go/private/protocol"
	"github.com/aws/aws-sdk-go/private/protocol/ec2query"
	"github.com/aws/aws-sdk-go/private/protocol/jsonrpc"
	"github.com/aws/aws-sdk-go/private/protocol/query"
	"github.com/aws/aws-sdk-go/private/protocol/rest"
	"github.com/aws/aws-sdk-go/private/protocol/restjson"
	"github.com/aws/aws-sdk-go/private/protocol/restxml"
)

func xmlData(set bool, b []byte, size, delta int) {
	const openingTags = ""
	const closingTags = ""
	if !set {
		copy(b, []byte(openingTags))
	}
	if size == 0 {
		copy(b[delta-len(closingTags):], []byte(closingTags))
	}
}

func jsonData(set bool, b []byte, size, delta int) {
	if !set {
		copy(b, []byte("{\"A\": \""))
	}
	if size == 0 {
		copy(b[delta-len("\"}"):], []byte("\"}"))
	}
}

func buildNewRequest(data interface{}) *request.Request {
	v := url.Values{}
	v.Set("test", "TEST")
	v.Add("test1", "TEST1")

	req := &request.Request{
		HTTPRequest: &http.Request{
			Header: make(http.Header),
			Body:   &awstesting.ReadCloser{Size: 2048},
			URL: &url.URL{
				RawQuery: v.Encode(),
			},
		},
		Params: &struct {
			LocationName string `locationName:"test"`
		}{
			"Test",
		},
		ClientInfo: metadata.ClientInfo{
			ServiceName:   "test",
			TargetPrefix:  "test",
			JSONVersion:   "test",
			APIVersion:    "test",
			Endpoint:      "test",
			SigningName:   "test",
			SigningRegion: "test",
		},
		Operation: &request.Operation{
			Name: "test",
		},
	}
	req.HTTPResponse = &http.Response{
		Body: &awstesting.ReadCloser{Size: 2048},
		Header: http.Header{
			"X-Amzn-Requestid": []string{"1"},
		},
		StatusCode: http.StatusOK,
	}

	if data == nil {
		data = &struct {
			_            struct{} `type:"structure"`
			LocationName *string  `locationName:"testName"`
			Location     *string  `location:"statusCode"`
			A            *string  `type:"string"`
		}{}
	}

	req.Data = data

	return req
}

type expected struct {
	dataType  int
	closed    bool
	size      int
	errExists bool
}

const (
	jsonType = iota
	xmlType
)

func checkForLeak(data interface{}, build, fn func(*request.Request), t *testing.T, result expected) {
	req := buildNewRequest(data)
	reader := req.HTTPResponse.Body.(*awstesting.ReadCloser)
	switch result.dataType {
	case jsonType:
		reader.FillData = jsonData
	case xmlType:
		reader.FillData = xmlData
	}
	build(req)
	fn(req)

	if result.errExists {
		if err := req.Error; err == nil {
			t.Errorf("expect error")
		}
	} else {
		if err := req.Error; err != nil {
			t.Errorf("expect nil, %v", err)
		}
	}

	if e, a := reader.Closed, result.closed; e != a {
		t.Errorf("expect %v, got %v", e, a)
	}
	if e, a := reader.Size, result.size; e != a {
		t.Errorf("expect %v, got %v", e, a)
	}
}

func TestJSONRpc(t *testing.T) {
	checkForLeak(nil, jsonrpc.Build, jsonrpc.Unmarshal, t, expected{jsonType, true, 0, false})
	checkForLeak(nil, jsonrpc.Build, jsonrpc.UnmarshalMeta, t, expected{jsonType, false, 2048, false})
	checkForLeak(nil, jsonrpc.Build, jsonrpc.UnmarshalError, t, expected{jsonType, true, 0, true})
}

func TestQuery(t *testing.T) {
	checkForLeak(nil, query.Build, query.Unmarshal, t, expected{jsonType, true, 0, false})
	checkForLeak(nil, query.Build, query.UnmarshalMeta, t, expected{jsonType, false, 2048, false})
	checkForLeak(nil, query.Build, query.UnmarshalError, t, expected{jsonType, true, 0, true})
}

func TestRest(t *testing.T) {
	// case 1: Payload io.ReadSeeker
	checkForLeak(nil, rest.Build, rest.Unmarshal, t, expected{jsonType, false, 2048, false})
	checkForLeak(nil, query.Build, query.UnmarshalMeta, t, expected{jsonType, false, 2048, false})

	// case 2: Payload *string
	// should close the body
	dataStr := struct {
		_            struct{} `type:"structure" payload:"Payload"`
		LocationName *string  `locationName:"testName"`
		Location     *string  `location:"statusCode"`
		A            *string  `type:"string"`
		Payload      *string  `locationName:"payload" type:"blob" required:"true"`
	}{}
	checkForLeak(&dataStr, rest.Build, rest.Unmarshal, t, expected{jsonType, true, 0, false})
	checkForLeak(&dataStr, query.Build, query.UnmarshalMeta, t, expected{jsonType, false, 2048, false})

	// case 3: Payload []byte
	// should close the body
	dataBytes := struct {
		_            struct{} `type:"structure" payload:"Payload"`
		LocationName *string  `locationName:"testName"`
		Location     *string  `location:"statusCode"`
		A            *string  `type:"string"`
		Payload      []byte   `locationName:"payload" type:"blob" required:"true"`
	}{}
	checkForLeak(&dataBytes, rest.Build, rest.Unmarshal, t, expected{jsonType, true, 0, false})
	checkForLeak(&dataBytes, query.Build, query.UnmarshalMeta, t, expected{jsonType, false, 2048, false})

	// case 4: Payload unsupported type
	// should close the body
	dataUnsupported := struct {
		_            struct{} `type:"structure" payload:"Payload"`
		LocationName *string  `locationName:"testName"`
		Location     *string  `location:"statusCode"`
		A            *string  `type:"string"`
		Payload      string   `locationName:"payload" type:"blob" required:"true"`
	}{}
	checkForLeak(&dataUnsupported, rest.Build, rest.Unmarshal, t, expected{jsonType, true, 0, true})
	checkForLeak(&dataUnsupported, query.Build, query.UnmarshalMeta, t, expected{jsonType, false, 2048, false})
}

func TestRestJSON(t *testing.T) {
	checkForLeak(nil, restjson.Build, restjson.Unmarshal, t, expected{jsonType, true, 0, false})
	checkForLeak(nil, restjson.Build, restjson.UnmarshalMeta, t, expected{jsonType, false, 2048, false})
	checkForLeak(nil, restjson.Build, restjson.UnmarshalError, t, expected{jsonType, true, 0, true})
}

func TestRestXML(t *testing.T) {
	checkForLeak(nil, restxml.Build, restxml.Unmarshal, t, expected{xmlType, true, 0, false})
	checkForLeak(nil, restxml.Build, restxml.UnmarshalMeta, t, expected{xmlType, false, 2048, false})
	checkForLeak(nil, restxml.Build, restxml.UnmarshalError, t, expected{xmlType, true, 0, true})
}

func TestXML(t *testing.T) {
	checkForLeak(nil, ec2query.Build, ec2query.Unmarshal, t, expected{jsonType, true, 0, false})
	checkForLeak(nil, ec2query.Build, ec2query.UnmarshalMeta, t, expected{jsonType, false, 2048, false})
	checkForLeak(nil, ec2query.Build, ec2query.UnmarshalError, t, expected{jsonType, true, 0, true})
}

func TestProtocol(t *testing.T) {
	checkForLeak(nil, restxml.Build, protocol.UnmarshalDiscardBody, t, expected{xmlType, true, 0, false})
}


text:
"use strict";

var describe = require("mocha/lib/mocha.js").describe,
	it = require("mocha/lib/mocha.js").it,
	path = require("path"),
	exec = require("child_process").exec,
	config = require("./../../../lib/readConfig"),
	fileManagement = require("./../../../lib/fileManagement");

/**
 * Test /lib/fileManagement.js
 */
describe("fileManagement", function() {
	/**
	 * Test the method "moveFiles" from the module fileManagement.js
	 */
	it("moveFiles", function(done) {
		this.timeout(15000);

		config.read({cwd: path.join(__dirname, "../../../.testFolder/tempU/under")}).then(
			function(conf) {
				exec("bower install", {cwd: conf.cwd}, function(error) {
					if (error) {
						done(error);
					} else {
						fileManagement.moveFiles(conf).then(
							function() {
								done();
							},
							function(e) {
								done(e);
							}
						);
					}
				});
			},
			function(e) {
				done(e);
			}
		);
	});

	/**
	 * Run the method "moveFilesAndRemove" from the module fileManagement.js
	 */
	it("moveFilesAndRemove", function(done) {
		this.timeout(15000);

		config.read({cwd: path.join(__dirname, "../../../.testFolder/tempU/under")}).then(
			function(conf) {
				exec("bower install", {cwd: conf.cwd}, function(error) {
					if (error) {
						done(error);
					} else {
						fileManagement.moveFilesAdnRemove(conf).then(
							function() {
								done();
							},
							function(e) {
								done(e);
							}
						);
					}
				});
			},
			function(e) {
				done(e);
			}
		);
	});
});


text:
(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
exports.parse = require("../src/parse");
exports.toHtml = require("../src/toHtml");

},{"../src/parse":2,"../src/toHtml":3}],2:[function(require,module,exports){
'use strict';

var slidesMethods = {
  toHtml : function() {
    return "";
  }
};

function newSlides() {
  var slides = [];
  slides.__proto__ = slidesMethods;
  return slides;
}

exports.parse = function(slidemarkCode) {
  if (slidemarkCode === undefined) {
    throw new Error("slidemark code is not defined");
  }
  var slides = newSlides();

  var trimmedCode = slidemarkCode.trim();
  if (trimmedCode === "") {
    return slides;
  }

  throw new Error("not implemented");
};

},{}],3:[function(require,module,exports){
'use strict';

var parse = require("./parse").parse;

exports.toHtml = function(slidemarkCode) {
  return parse(slidemarkCode).toHtml();
};

},{"./parse":2}]},{},[1]);


text:
"""Test a Fast R-CNN network on an imdb (image database)."""

from fast_rcnn.config import cfg, get_output_dir
import argparse
from utils.timer import Timer
import numpy as np
import cv2
import caffe
from utils.cython_nms import nms
import cPickle
import heapq
from utils.blob import im_list_to_blob
import os
import scipy.io as sio
import utils.cython_bbox
import pdb

def _get_image_blob(im):
    """Converts an image into a network input.

    Arguments:
        im (ndarray): a color image in BGR order

    Returns:
        blob (ndarray): a data blob holding an image pyramid
        im_scale_factors (list): list of image scales (relative to im) used
            in the image pyramid
    """
    im_orig = im.astype(np.float32, copy=True)
    im_orig -= cfg.PIXEL_MEANS

    im_shape = im_orig.shape
    im_size_min = np.min(im_shape[0:2])
    im_size_max = np.max(im_shape[0:2])

    processed_ims = []
    im_scale_factors = []

    for target_size in cfg.TEST.SCALES:
        im_scale = float(target_size) / float(im_size_min)
        # Prevent the biggest axis from being more than MAX_SIZE
        if np.round(im_scale * im_size_max) > cfg.TEST.MAX_SIZE:
            im_scale = float(cfg.TEST.MAX_SIZE) / float(im_size_max)
        im = cv2.resize(im_orig, None, None, fx=im_scale, fy=im_scale,
                        interpolation=cv2.INTER_LINEAR)
        im_scale_factors.append(im_scale)
        processed_ims.append(im)

    # Create a blob to hold the input images
    blob = im_list_to_blob(processed_ims)

    return blob, np.array(im_scale_factors)

def _get_rois_blob(im_rois, im_scale_factors):
    """Converts RoIs into network inputs.

    Arguments:
        im_rois (ndarray): R x 4 matrix of RoIs in original image coordinates
        im_scale_factors (list): scale factors as returned by _get_image_blob

    Returns:
        blob (ndarray): R x 5 matrix of RoIs in the image pyramid
    """
    rois, levels = _project_im_rois(im_rois, im_scale_factors)
    rois_blob = np.hstack((levels, rois))
    return rois_blob.astype(np.float32, copy=False)

def _project_im_rois(im_rois, scales):
    """Project image RoIs into the image pyramid built by _get_image_blob.

    Arguments:
        im_rois (ndarray): R x 4 matrix of RoIs in original image coordinates
        scales (list): scale factors as returned by _get_image_blob

    Returns:
        rois (ndarray): R x 4 matrix of projected RoI coordinates
        levels (list): image pyramid levels used by each projected RoI
    """
    im_rois = im_rois.astype(np.float, copy=False)

    if len(scales) > 1:
        widths = im_rois[:, 2] - im_rois[:, 0] + 1
        heights = im_rois[:, 3] - im_rois[:, 1] + 1

        areas = widths * heights
        scaled_areas = areas[:, np.newaxis] * (scales[np.newaxis, :] ** 2)
        diff_areas = np.abs(scaled_areas - 224 * 224)
        levels = diff_areas.argmin(axis=1)[:, np.newaxis]
    else:
        levels = np.zeros((im_rois.shape[0], 1), dtype=np.int)

    rois = im_rois * scales[levels]

    return rois, levels

def _get_blobs(im, rois):
    """Convert an image and RoIs within that image into network inputs."""
    blobs = {'data' : None, 'rois' : None, 'secondary_rois': None}
    blobs['data'], im_scale_factors = _get_image_blob(im)
    blobs['rois'] = _get_rois_blob(rois, im_scale_factors)
    blobs['secondary_rois'] = _get_rois_blob(rois, im_scale_factors)
    return blobs, im_scale_factors

def _bbox_pred(boxes, box_deltas):
    """Transform the set of class-agnostic boxes into class-specific boxes
    by applying the predicted offsets (box_deltas)
    """
    if boxes.shape[0] == 0:
        return np.zeros((0, box_deltas.shape[1]))

    boxes = boxes.astype(np.float, copy=False)
    widths = boxes[:, 2] - boxes[:, 0] + cfg.EPS
    heights = boxes[:, 3] - boxes[:, 1] + cfg.EPS
    ctr_x = boxes[:, 0] + 0.5 * widths
    ctr_y = boxes[:, 1] + 0.5 * heights

    dx = box_deltas[:, 0::4]
    dy = box_deltas[:, 1::4]
    dw = box_deltas[:, 2::4]
    dh = box_deltas[:, 3::4]

    pred_ctr_x = dx * widths[:, np.newaxis] + ctr_x[:, np.newaxis]
    pred_ctr_y = dy * heights[:, np.newaxis] + ctr_y[:, np.newaxis]
    pred_w = np.exp(dw) * widths[:, np.newaxis]
    pred_h = np.exp(dh) * heights[:, np.newaxis]

    pred_boxes = np.zeros(box_deltas.shape)
    # x1
    pred_boxes[:, 0::4] = pred_ctr_x - 0.5 * pred_w
    # y1
    pred_boxes[:, 1::4] = pred_ctr_y - 0.5 * pred_h
    # x2
    pred_boxes[:, 2::4] = pred_ctr_x + 0.5 * pred_w
    # y2
    pred_boxes[:, 3::4] = pred_ctr_y + 0.5 * pred_h

    return pred_boxes

def _clip_boxes(boxes, im_shape):
    """Clip boxes to image boundaries."""
    # x1 >= 0
    boxes[:, 0::4] = np.maximum(boxes[:, 0::4], 0)
    # y1 >= 0
    boxes[:, 1::4] = np.maximum(boxes[:, 1::4], 0)
    # x2 < im_shape[1]
    boxes[:, 2::4] = np.minimum(boxes[:, 2::4], im_shape[1] - 1)
    # y2 < im_shape[0]
    boxes[:, 3::4] = np.minimum(boxes[:, 3::4], im_shape[0] - 1)
    return boxes

def im_detect(net, im, boxes, gt_label):
    """Detect object classes in an image given object proposals.

    Arguments:
        net (caffe.Net): Fast R-CNN network to use
        im (ndarray): color image to test (in BGR order)
        boxes (ndarray): R x 4 array of object proposals

    Returns:
        scores (ndarray): R x K array of object class scores (K includes
            background as object category 0)
        boxes (ndarray): R x (4*K) array of predicted bounding boxes
    """
    blobs, unused_im_scale_factors = _get_blobs(im, boxes)
    base_shape = blobs['data'].shape

    gt_inds = np.where(gt_label>-1)[0]
    num_rois = len(gt_inds)
    blobs_rois = blobs['rois'][gt_inds].astype(np.float32, copy=False)
    blobs_rois = blobs_rois[:, :, np.newaxis, np.newaxis]

    non_gt_inds = np.where(gt_label==-1)[0]
    num_sec_rois = len(non_gt_inds)
    blobs_sec_rois = blobs['secondary_rois'][non_gt_inds].astype(np.float32, copy=False)
    blobs_sec_rois = blobs_sec_rois[:, :, np.newaxis, np.newaxis]

    # reshape network inputs
    net.blobs['data'].reshape(base_shape[0], base_shape[1],
                              base_shape[2], base_shape[3])
    net.blobs['rois'].reshape(num_rois, 5, 1, 1)
    net.blobs['secondary_rois'].reshape(num_sec_rois, 5, 1, 1)
    blobs_out = net.forward(data=blobs['data'].astype(np.float32, copy=False),
                            rois=blobs_rois,
                            secondary_rois = blobs_sec_rois)

    scores = blobs_out['cls_score']
    secondary_scores = blobs_out['context_cls_score']

    gt_boxes = boxes[gt_inds]
    sec_boxes = boxes[non_gt_inds]

    # Compute overlap
    boxes_overlaps = \
      utils.cython_bbox.bbox_overlaps(sec_boxes.astype(np.float),
                                      gt_boxes.astype(np.float))

    selected_boxes = np.zeros((scores.shape[1], 4, gt_boxes.shape[0]))

    # Sum of Max
    for i in xrange(gt_boxes.shape[0]):
        keep_inds = np.where((boxes_overlaps[:,i]>=cfg.TEST.IOU_LB) &
                             (boxes_overlaps[:,i]<=cfg.TEST.IOU_UB))[0]
        if keep_inds.size > 0:
            this_scores = np.amax(secondary_scores[keep_inds,:], axis=0)
            scores[i,:] = scores[i,:]+this_scores
            winner_ind  = np.argmax(secondary_scores[keep_inds,:], axis=0)
            selected_boxes[:,:,i] = sec_boxes[keep_inds[winner_ind]]

    # Softmax
    scores = np.exp(scores-np.amax(scores))
    scores = scores / np.array(np.sum(scores, axis=1), ndmin=2).T

    # Apply bounding-box regression deltas
    box_deltas = blobs_out['bbox_pred']
    pred_boxes = _bbox_pred(gt_boxes, box_deltas)
    pred_boxes = _clip_boxes(pred_boxes, im.shape)

    return scores, secondary_scores, selected_boxes

def vis_detections(im, boxes, scores, classes):
    """Visual debugging of detections."""
    import matplotlib.pyplot as plt
    im = im[:, :, (2, 1, 0)]
    for i in xrange(1):
        pdb.set_trace()
        bbox = boxes[i, :4]
        sscore = scores[i, :]
        cls_ind = sscore.argmax()
        sscore = sscore.max()

        #plt.cla()
        plt.imshow(im)
        plt.gca().add_patch(
            plt.Rectangle((bbox[0], bbox[1]),
                           bbox[2] - bbox[0],
                           bbox[3] - bbox[1], fill=False,
                          edgecolor='r', linewidth=3)
                )
        plt.title('{}  {:.3f}'.format(classes[cls_ind], sscore))
        plt.show()

def test_net(net, imdb):
    """Test a R*CNN network on an image database."""
    num_images = len(imdb.image_index)
    num_classes = imdb.num_classes

    all_scores = {}
    all_labels = {}
    for a in xrange(num_classes):
      all_scores[imdb.classes[a]] = np.zeros((num_images,1), dtype = np.float32)
      all_labels[imdb.classes[a]] = -np.ones((num_images,1), dtype = np.int16)

    output_dir = get_output_dir(imdb, net)
    if not os.path.exists(output_dir):
        os.makedirs(output_dir)

    # timers
    _t = {'im_detect' : Timer()}

    roidb = imdb.roidb
    for i in xrange(num_images):
        im = cv2.imread(imdb.image_path_at(i))

        gt = np.where(roidb[i]['gt_classes']>-1)[0]
        gt_boxes = roidb[i]['boxes'][gt]
        gt_class = roidb[i]['gt_classes'][gt]

        assert (gt_boxes.shape[0]==1)

        _t['im_detect'].tic()
        scores, secondary_scores, selected_boxes = im_detect(net, im, roidb[i]['boxes'], roidb[i]['gt_classes'])
        _t['im_detect'].toc()

        # Visualize detections
        # vis_detections(im, gt_boxes, scores, imdb.classes)

        for a in xrange(num_classes):
          all_scores[imdb.classes[a]][i] = scores[0,a]
          all_labels[imdb.classes[a]][i] = gt_class

        print 'im_detect: {:d}/{:d} {:.3f}s' \
              .format(i + 1, num_images, _t['im_detect'].average_time)

    #f = {'images': imdb.image_index, 'scores': all_boxes, 'classes': imdb.classes, 'context_boxes': all_selected_boxes}
    #output_dir = os.path.join(os.path.dirname(__file__), 'output',
    #             'Action_MIL_wContextBoxes_'+ imdb.name)
    #if not os.path.exists(output_dir):
    #    os.makedirs(output_dir)
    #det_file = os.path.join(output_dir, 'res.mat')
    #sio.savemat(det_file, {'data': f})
    #print 'Saving in', det_file

    imdb._ap(all_scores, all_labels)


text:
var util        = require('util'),
  Client      = require('../client').Client;

var Votes = exports.Votes = function (options) {
  this.jsonAPINames = [ 'votes', 'vote' ];
  Client.call(this, options);
};

// Inherit from Client base object
util.inherits(Votes, Client);

// ######################################################## Votes

// ====================================== Listing Votes By User

Votes.prototype.listByUser = function (userID, cb) {
  //Do not need requesetAll
  return this.request('GET', ['users', userID, 'votes'], cb);
};

// ====================================== Listing Votes By Article

Votes.prototype.listByArticle = function (articleID, cb) {
  //Do not need requesetAll
  return this.request('GET', ['articles', articleID, 'votes'], cb);
};

// ====================================== Viewing Votes
Votes.prototype.show = function (voteID, cb) {
  return this.request('GET', ['votes', voteID], cb);
};

// ====================================== Vote Up For Article
Votes.prototype.createUpVoteForArticle = function (articleID, cb) {
  return this.request('POST', ['articles' , articleID, 'up'], cb);
};

// ====================================== Vote Down For Article
Votes.prototype.createDownVoteForArticle = function (articleID, cb) {
  return this.request('POST', ['articles' , articleID, 'down'], cb);
};

// ====================================== Vote Up For Question
Votes.prototype.createUpVoteForQuestion = function (questionID, cb) {
  return this.request('POST', ['questions' , questionID, 'up'], cb);
};

// ====================================== Vote Down For Question
Votes.prototype.createDownVoteForQuestion = function (questionID, cb) {
  return this.request('POST', ['questions' , questionID, 'down'], cb);
};

// ====================================== Vote Up For Answer
Votes.prototype.createUpVoteForAnswer = function (answerID, cb) {
  return this.request('POST', ['answers' , answerID, 'up'], cb);
};

// ====================================== Vote Down For Answer
Votes.prototype.createDownVoteForAnswer = function (answerID, cb) {
  return this.request('POST', ['answers' , answerID, 'down'], cb);
};

// ====================================== Deleting Votes
Votes.prototype.delete = function (voteID, cb) {
  return this.request('DELETE', ['votes', voteID],  cb);
};


text:
'use strict'

//----------------------------------------------------------
// modules
//----------------------------------------------------------
// node
const p = require('path')

// npm
const P = require('bluebird')
const co = require('co')
const fm = require('yaml-fm')
const merge = require('lodash.merge')

// local
const defaults = require('./lib/defaults')
const u = require('./lib/utils')
const x = require('./lib/transforms')

//----------------------------------------------------------
// logic
//----------------------------------------------------------
module.exports = class Smg {
  constructor(custom) {
    const opts = merge({}, defaults, custom)
    Object.keys(opts).map(k => this[k] = opts[k])
    return co(() => this.main()).catch(u.errHandler)
  }

  /**
    Main logic loop:
      - call methods (pages/posts/templates)
      - render content
      - write output

    @returns {String[]} array of all paths written to
   */
  * main() {
    const pages = yield this.pages(this.paths.pages)
    const posts = yield this.posts(this.paths.posts)

    const content = u.flatAr([pages, posts])
    const injectedContent = x.injectPostData(this.needPosts, content, posts)

    const templates = yield this.templates(this.paths.templates)
    const html = x.render(injectedContent, templates)

    yield u.write2D(html)

    return html.map(_ => _[0])
  }

  /**
    Read and parse page content.

    @param {String|String[]} glob - glob of paths to page content
    @returns {Object[]} array of page data objects
   */
  * pages(glob) {
    return P.resolve(yield u.readContent(glob))
      .map(fm(this.delims.yaml))
      .map(x.splitPreview(this.delims.preview))
      .map(x.markdown)
      .map(x.addNav(this.nav))
      .map(x.addAuthor(this.defaultAuthor))
      .map(x.defaultTemplate(this.defaultTemplate))
      .map(x.addCanonical(this.hostname))
      .map(x.addPath(this.paths.dist))
  }

  /**
    Read and parse post content.

    @param {String|String[]} glob - glob of paths to post content
    @returns {Object[]} array of post data objects
   */
  * posts(glob) {
    return P.resolve(yield this.pages(glob))
      .map(x.ert(this.wpm))
      .map(x.addDateOb)
      .map(x.addDate)
      .map(x.addDateNum)
      .then(_ => _.sort(x.byReverseDate))
  }

  /**
    Read templates.

    @param {String|String[]} glob - glob of paths to templates
    @returns {Object} templates: {foo: renderFn, bar: renderFn}
   */
  * templates(glob) {
    return P.resolve(yield u.readTemplates(glob))
      .map(u.arToOb)
      .reduce(u.flatOb)
  }
}


text:
namespace xFunc.Tests.Expressions.Matrices;

public class VectorTest : BaseExpressionTests
{
    [Fact]
    public void NullArgumentsTest()
    {
        Assert.Throws<ArgumentNullException>(() => new Vector(null));
    }

    [Fact]
    public void EmptyArgumentsTest()
    {
        Assert.Throws<ArgumentException>(() => new Vector(new IExpression[0]));
    }

    [Fact]
    public void NullTest()
    {
        Assert.Throws<ArgumentNullException>(() => new Vector(new IExpression[] { null, null }));
    }

    [Fact]
    public void VectorArgumentIsNotNumber()
    {
        var exp = new Vector(new IExpression[] { Bool.False });

        TestNotSupported(exp);
    }

    [Fact]
    public void MulByNumberVectorTest()
    {
        var vector = new Vector(new[] { Number.Two, new Number(3) });
        var number = new Number(5);
        var exp = new Mul(vector, number);

        var expected = new Vector(new[] { new Number(10), new Number(15) });
        var result = exp.Execute();

        Assert.Equal(expected, result);
    }

    [Fact]
    public void AddVectorsTest()
    {
        var vector1 = new Vector(new[] { Number.Two, new Number(3) });
        var vector2 = new Vector(new[] { new Number(7), Number.One });
        var exp = new Add(vector1, vector2);

        var expected = new Vector(new[] { new Number(9), new Number(4) });
        var result = exp.Execute();

        Assert.Equal(expected, result);
    }

    [Fact]
    public void VectorWithAddTest()
    {
        var vector = new Vector(new[] { new Add(Number.Two, new Number(3)) });
        var expected = new Vector(new[] { new Number(5) });
        var result = vector.Execute();

        Assert.Equal(expected, result);
    }

    [Fact]
    public void AddVectorsDiffSizeTest()
    {
        var vector1 = new Vector(new[] { Number.Two, new Number(3) });
        var vector2 = new Vector(new[] { new Number(7), Number.One, new Number(3) });
        var exp = new Add(vector1, vector2);

        Assert.Throws<ArgumentException>(() => exp.Execute());
    }

    [Fact]
    public void SubVectorsTest()
    {
        var vector1 = new Vector(new[] { Number.Two, new Number(3) });
        var vector2 = new Vector(new[] { new Number(7), Number.One });
        var exp = new Sub(vector1, vector2);

        var expected = new Vector(new[] { new Number(-5), Number.Two });
        var result = exp.Execute();

        Assert.Equal(expected, result);
    }

    [Fact]
    public void SubVectorsDiffSizeTest()
    {
        var vector1 = new Vector(new[] { Number.Two, new Number(3) });
        var vector2 = new Vector(new[] { new Number(7), Number.One, new Number(3) });
        var exp = new Sub(vector1, vector2);

        Assert.Throws<ArgumentException>(() => exp.Execute());
    }

    [Fact]
    public void TransposeVectorTest()
    {
        var vector = new Vector(new[] { Number.One, Number.Two });
        var exp = new Transpose(vector);

        var expected = new Matrix(new[]
        {
            new Vector(new[] { Number.One }),
            new Vector(new[] { Number.Two })
        });
        var result = exp.Execute();

        Assert.Equal(expected, result);
    }

    [Fact]
    public void VectorMulMatrixTest()
    {
        var vector = new Vector(new[] { new Number(-2), Number.One });
        var matrix = new Matrix(new[]
        {
            new Vector(new[] { new Number(3) }),
            new Vector(new[] { new Number(-1) })
        });
        var exp = new Mul(vector, matrix);

        var expected = new Matrix(new[] { new Vector(new[] { new Number(-7) }) });
        var result = exp.Execute();

        Assert.Equal(expected, result);
    }

    [Fact]
    public void MultiOpMulAdd()
    {
        // ({1, 2, 3} * 4) + {2, 3, 4}
        var vector1 = new Vector(new[] { Number.One, Number.Two, new Number(3) });
        var vector2 = new Vector(new[] { Number.Two, new Number(3), new Number(4) });
        var mul = new Mul(vector1, new Number(4));
        var add = new Add(mul, vector2);

        var expected = new Vector(new[] { new Number(6), new Number(11), new Number(16) });
        var result = add.Execute();

        Assert.Equal(expected, result);
    }

    [Fact]
    public void MultiOpMulSub()
    {
        // ({1, 2, 3} * 4) - {2, 3, 4}
        var vector1 = new Vector(new[] { Number.One, Number.Two, new Number(3) });
        var vector2 = new Vector(new[] { Number.Two, new Number(3), new Number(4) });
        var mul = new Mul(vector1, new Number(4));
        var sub = new Sub(mul, vector2);

        var expected = new Vector(new[] { Number.Two, new Number(5), new Number(8) });
        var result = sub.Execute();

        Assert.Equal(expected, result);
    }

    [Fact]
    public void MultiOpSubMul()
    {
        // ({2, 3, 4} - {1, 2, 3}) * 4
        var vector1 = new Vector(new[] { Number.One, Number.Two, new Number(3) });
        var vector2 = new Vector(new[] { Number.Two, new Number(3), new Number(4) });
        var sub = new Sub(vector2, vector1);
        var mul = new Mul(sub, new Number(4));

        var expected = new Vector(new[] { new Number(4), new Number(4), new Number(4) });
        var result = mul.Execute();

        Assert.Equal(expected, result);
    }

    [Fact]
    public void MultiOpAddMul()
    {
        // ({2, 3, 4} + {1, 2, 3}) * 4
        var vector1 = new Vector(new[] { Number.One, Number.Two, new Number(3) });
        var vector2 = new Vector(new[] { Number.Two, new Number(3), new Number(4) });
        var add = new Add(vector2, vector1);
        var mul = new Mul(add, new Number(4));

        var expected = new Vector(new[] { new Number(12), new Number(20), new Number(28) });
        var result = mul.Execute();

        Assert.Equal(expected, result);
    }

    [Fact]
    public void MultiOpMulMul()
    {
        // ({1, 2, 3} * 2) * 4
        var vector = new Vector(new[] { Number.One, Number.Two, new Number(3) });
        var mul1 = new Mul(vector, Number.Two);
        var mul2 = new Mul(mul1, new Number(4));

        var expected = new Vector(new[] { new Number(8), new Number(16), new Number(24) });
        var result = mul2.Execute();

        Assert.Equal(expected, result);
    }

    [Fact]
    public void CloneTest()
    {
        var exp = new Vector(new[] { Number.One, Number.Two, new Number(3) });
        var clone = exp.Clone();

        Assert.Equal(exp, clone);
    }
}


text:
// stdafx.h : include file for standard system include files,
// or project specific include files that are used frequently, but
// are changed infrequently
//

#pragma once
#ifndef AIMLIB_STDAFX_H_INCLUDED
#define AIMLIB_STDAFX_H_INCLUDED

#if !defined( __GNUC__ )

// Modify the following defines if you have to target a platform prior to the ones specified below.
// Refer to MSDN for the latest info on corresponding values for different platforms.
#ifndef WINVER				// Allow use of features specific to Windows XP or later.
#define WINVER 0x0501		// Change this to the appropriate value to target other versions of Windows.
#endif

#ifndef _WIN32_WINNT		// Allow use of features specific to Windows XP or later.
#define _WIN32_WINNT 0x0501	// Change this to the appropriate value to target other versions of Windows.
#endif

#ifndef _WIN32_WINDOWS		// Allow use of features specific to Windows 98 or later.
#define _WIN32_WINDOWS 0x0410 // Change this to the appropriate value to target Windows Me or later.
#endif

#ifndef _WIN32_IE			// Allow use of features specific to IE 6.0 or later.
#define _WIN32_IE 0x0600	// Change this to the appropriate value to target other versions of IE.
#endif

#define WIN32_LEAN_AND_MEAN		// Exclude rarely-used stuff from Windows headers
// Windows Header Files:
#include <tchar.h>
#include <windows.h>

#endif // __GNUC__

#include <cassert>

#include "AIMCommon.h" // export declaration, etc.

// Standard C array size calculation
#define ArraySize( A ) (sizeof(A)/sizeof(*A))
#define ArraySizePtr( A ) (sizeof(*A)/sizeof(**A))

// TODO: reference additional headers your program requires here

//{{AFX_INSERT_LOCATION}}

#endif // AIMLIB_STDAFX_H_INCLUDED


text:
@interface SplashScreenViewController ()

@end

@implementation SplashScreenViewController

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
        // Custom initialization
    }
    return self;
}

- (void)viewDidLoad
{
    [super viewDidLoad];
	// Do any additional setup after loading the view.
    [self.btnLogin addTarget:self action:@selector(buttonHighlight:) forControlEvents:UIControlEventTouchDown];
    [self.btnLogin addTarget:self action:@selector(buttonNormal:) forControlEvents:UIControlEventTouchUpOutside | UIControlEventTouchUpInside];
    [self.btnSignup addTarget:self action:@selector(buttonHighlight:) forControlEvents:UIControlEventTouchDown];
    [self.btnSignup addTarget:self action:@selector(buttonNormal:) forControlEvents:UIControlEventTouchUpOutside | UIControlEventTouchUpInside];

//    [self.btnLogin setBackgroundColor:[LensRocketConstants loginButtonColorNormal]];
//    [self.btnSignup setBackgroundColor:[LensRocketConstants signupButtonColorNormal]];

    [self.navigationController setNavigationBarHidden:YES];

    if ([self.lensRocketService isUserAuthenticated]) {
        [self.lensRocketService getFriendsFromServer];
        [self.lensRocketService getRocketsFromServer];
        [self.lensRocketService getUserPreferences];
        [self performSegueWithIdentifier:@"modalRecordSegue" sender:self];
    }
}

-(void) buttonHighlight:(UIButton *)sender {
//    [sender setBackgroundColor:[LensRocketConstants darkerColorForColor:[sender backgroundColor]]];
}

-(void) buttonNormal:(UIButton *)sender {
//    [sender setBackgroundColor:[LensRocketConstants lighterColorForColor:[sender backgroundColor]]];
}

- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

- (IBAction)tappedLogin:(id)sender {
    NSLog(@"Login");
}

- (IBAction)tappedSignup:(id)sender {
    NSLog(@"Signup");
}

-(IBAction)reset:(UIStoryboardSegue *)segue {
    //do stuff
    NSLog(@"RESET!");
    [self.lensRocketService killAuthInfo];
}

-(BOOL)canPerformUnwindSegueAction:(SEL)action fromViewController:(UIViewController *)fromViewController withSender:(id)sender {
    return YES;
}

-(void)viewWillAppear:(BOOL)animated {
    [[UIApplication sharedApplication] setStatusBarHidden:YES];
}

@end


text:
import { core as config } from './conf';
import logger from './logger';

if (config.has('auth.type') && config.get('auth.type') !== 'google') {
  logger.warn(`Client Auth type not implemented for ${config.get('auth.type')}`);
}

export default function middleware(req, res) {
  let enabled = false;
  try {
    enabled = !!config.get('auth.type');
  } catch (e) {
    enabled = false;
  }

  const clientId = config.get('auth.googleClientId');
  const templ = `/* global window */
  window.ncodr = {
    useAuth: ${enabled},
    clientId: '${clientId}'
  };`;

  return res.set('Content-Type', 'application/javascript').status(200).send(templ);
}


text:
package ru.kpfu.itis.group11501.utkin.Servlets;

import ru.kpfu.itis.group11501.utkin.Helpers.TemplateHelper;
import ru.kpfu.itis.group11501.utkin.Models.User;
import ru.kpfu.itis.group11501.utkin.Services.GameServiceImpl;
import ru.kpfu.itis.group11501.utkin.Services.UserServiceImpl;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map;

/**
 * Created by user on 16.11.2016.
 */
public class ServletPlayers extends HttpServlet {
    GameServiceImpl gameService;
    UserServiceImpl userService;

    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {

    }

    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        Map<String, Object> root = new HashMap<>();
        userService = new UserServiceImpl();
        ArrayList<User> users = userService.getAllUsers();
        boolean logged = request.getSession().getAttribute("current_user") != null;
        root.put("users",users);
        root.put("logged", logged);
        response.setContentType("text/html; charset=utf-8");
        TemplateHelper.render(request, response, "players.ftl",root);
    }
}


text:
<!--

     Copyright 2005-2015 Red Hat, Inc.

     Red Hat licenses this file to you under the Apache License, version
     2.0 (the "License"); you may not use this file except in compliance
     with the License.  You may obtain a copy of the License at

        http://www.apache.org/licenses/LICENSE-2.0

     Unless required by applicable law or agreed to in writing, software
     distributed under the License is distributed on an "AS IS" BASIS,
     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
     implied.  See the License for the specific language governing
     permissions and limitations under the License.

-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
  <modelVersion>4.0.0</modelVersion>

  <parent>
    <groupId>io.fabric8.jube</groupId>
    <artifactId>parent-project</artifactId>
    <version>2.3-SNAPSHOT</version>
  </parent>

  <artifactId>process-manager</artifactId>

  <name>Jube :: Process Manager</name>

  <dependencies>
    <dependency>
      <groupId>io.fabric8.jube</groupId>
      <artifactId>core</artifactId>
      <version>${project.version}</version>
    </dependency>
    <dependency>
      <groupId>io.hawt</groupId>
      <artifactId>hawtio-aether</artifactId>
      <version>${hawtio.version}</version>
      <exclusions>
        <exclusion>
          <groupId>com.google.collections</groupId>
          <artifactId>google-collections</artifactId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>io.fabric8</groupId>
      <artifactId>fabric8-utils</artifactId>
    </dependency>
    <dependency>
      <groupId>org.jboss.weld.servlet</groupId>
      <artifactId>weld-servlet-core</artifactId>
      <version>${weld.version}</version>
    </dependency>
    <dependency>
      <groupId>org.apache.deltaspike.core</groupId>
      <artifactId>deltaspike-core-api</artifactId>
    </dependency>
    <dependency>
      <groupId>org.apache.deltaspike.core</groupId>
      <artifactId>deltaspike-core-impl</artifactId>
    </dependency>

    <!-- testing -->
    <dependency>
        <groupId>junit</groupId>
        <artifactId>junit</artifactId>
        <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.assertj</groupId>
      <artifactId>assertj-core</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.commons</groupId>
      <artifactId>commons-lang3</artifactId>
      <scope>test</scope>
    </dependency>
  </dependencies>

  <build>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-plugin</artifactId>
        <configuration>
          <workingDirectory>target</workingDirectory>
        </configuration>
      </plugin>
    </plugins>
  </build>

</project>


text:
var flappy_locale = {lc:{"ar":function(n){
  if (n === 0) {
    return 'zero';
  }
  if (n == 1) {
    return 'one';
  }
  if (n == 2) {
    return 'two';
  }
  if ((n % 100) >= 3 && (n % 100) <= 10 && n == Math.floor(n)) {
    return 'few';
  }
  if ((n % 100) >= 11 && (n % 100) <= 99 && n == Math.floor(n)) {
    return 'many';
  }
  return 'other';
},"en":function(n){return n===1?"one":"other"},"bg":function(n){return n===1?"one":"other"},"bn":function(n){return n===1?"one":"other"},"ca":function(n){return n===1?"one":"other"},"cs":function(n){
  if (n == 1) {
    return 'one';
  }
  if (n == 2 || n == 3 || n == 4) {
    return 'few';
  }
  return 'other';
},"da":function(n){return n===1?"one":"other"},"de":function(n){return n===1?"one":"other"},"el":function(n){return n===1?"one":"other"},"es":function(n){return n===1?"one":"other"},"et":function(n){return n===1?"one":"other"},"eu":function(n){return n===1?"one":"other"},"fa":function(n){return "other"},"fi":function(n){return n===1?"one":"other"},"fil":function(n){return n===0||n==1?"one":"other"},"fr":function(n){return Math.floor(n)===0||Math.floor(n)==1?"one":"other"},"ga":function(n){return n==1?"one":(n==2?"two":"other")},"gl":function(n){return n===1?"one":"other"},"he":function(n){return n===1?"one":"other"},"hi":function(n){return n===0||n==1?"one":"other"},"hr":function(n){
  if ((n % 10) == 1 && (n % 100) != 11) {
    return 'one';
  }
  if ((n % 10) >= 2 && (n % 10) <= 4 &&
      ((n % 100) < 12 || (n % 100) > 14) && n == Math.floor(n)) {
    return 'few';
  }
  if ((n % 10) === 0 || ((n % 10) >= 5 && (n % 10) <= 9) ||
      ((n % 100) >= 11 && (n % 100) <= 14) && n == Math.floor(n)) {
    return 'many';
  }
  return 'other';
},"hu":function(n){return "other"},"id":function(n){return "other"},"is":function(n){
    return ((n%10) === 1 && (n%100) !== 11) ? 'one' : 'other';
  },"it":function(n){return n===1?"one":"other"},"ja":function(n){return "other"},"ko":function(n){return "other"},"lt":function(n){
  if ((n % 10) == 1 && ((n % 100) < 11 || (n % 100) > 19)) {
    return 'one';
  }
  if ((n % 10) >= 2 && (n % 10) <= 9 &&
      ((n % 100) < 11 || (n % 100) > 19) && n == Math.floor(n)) {
    return 'few';
  }
  return 'other';
},"lv":function(n){
  if (n === 0) {
    return 'zero';
  }
  if ((n % 10) == 1 && (n % 100) != 11) {
    return 'one';
  }
  return 'other';
},"mk":function(n){return (n%10)==1&&n!=11?"one":"other"},"mr":function(n){return n===1?"one":"other"},"ms":function(n){return "other"},"mt":function(n){
  if (n == 1) {
    return 'one';
  }
  if (n === 0 || ((n % 100) >= 2 && (n % 100) <= 4 && n == Math.floor(n))) {
    return 'few';
  }
  if ((n % 100) >= 11 && (n % 100) <= 19 && n == Math.floor(n)) {
    return 'many';
  }
  return 'other';
},"nl":function(n){return n===1?"one":"other"},"no":function(n){return n===1?"one":"other"},"pl":function(n){
  if (n == 1) {
    return 'one';
  }
  if ((n % 10) >= 2 && (n % 10) <= 4 &&
      ((n % 100) < 12 || (n % 100) > 14) && n == Math.floor(n)) {
    return 'few';
  }
  if ((n % 10) === 0 || n != 1 && (n % 10) == 1 ||
      ((n % 10) >= 5 && (n % 10) <= 9 || (n % 100) >= 12 && (n % 100) <= 14) &&
      n == Math.floor(n)) {
    return 'many';
  }
  return 'other';
},"pt":function(n){return n===1?"one":"other"},"ro":function(n){
  if (n == 1) {
    return 'one';
  }
  if (n === 0 || n != 1 && (n % 100) >= 1 &&
      (n % 100) <= 19 && n == Math.floor(n)) {
    return 'few';
  }
  return 'other';
},"ru":function(n){
  if ((n % 10) == 1 && (n % 100) != 11) {
    return 'one';
  }
  if ((n % 10) >= 2 && (n % 10) <= 4 &&
      ((n % 100) < 12 || (n % 100) > 14) && n == Math.floor(n)) {
    return 'few';
  }
  if ((n % 10) === 0 || ((n % 10) >= 5 && (n % 10) <= 9) ||
      ((n % 100) >= 11 && (n % 100) <= 14) && n == Math.floor(n)) {
    return 'many';
  }
  return 'other';
},"sk":function(n){
  if (n == 1) {
    return 'one';
  }
  if (n == 2 || n == 3 || n == 4) {
    return 'few';
  }
  return 'other';
},"sl":function(n){
  if ((n % 100) == 1) {
    return 'one';
  }
  if ((n % 100) == 2) {
    return 'two';
  }
  if ((n % 100) == 3 || (n % 100) == 4) {
    return 'few';
  }
  return 'other';
},"sq":function(n){return n===1?"one":"other"},"sr":function(n){
  if ((n % 10) == 1 && (n % 100) != 11) {
    return 'one';
  }
  if ((n % 10) >= 2 && (n % 10) <= 4 &&
      ((n % 100) < 12 || (n % 100) > 14) && n == Math.floor(n)) {
    return 'few';
  }
  if ((n % 10) === 0 || ((n % 10) >= 5 && (n % 10) <= 9) ||
      ((n % 100) >= 11 && (n % 100) <= 14) && n == Math.floor(n)) {
    return 'many';
  }
  return 'other';
},"sv":function(n){return n===1?"one":"other"},"ta":function(n){return n===1?"one":"other"},"th":function(n){return "other"},"tr":function(n){return n===1?"one":"other"},"uk":function(n){
  if ((n % 10) == 1 && (n % 100) != 11) {
    return 'one';
  }
  if ((n % 10) >= 2 && (n % 10) <= 4 &&
      ((n % 100) < 12 || (n % 100) > 14) && n == Math.floor(n)) {
    return 'few';
  }
  if ((n % 10) === 0 || ((n % 10) >= 5 && (n % 10) <= 9) ||
      ((n % 100) >= 11 && (n % 100) <= 14) && n == Math.floor(n)) {
    return 'many';
  }
  return 'other';
},"ur":function(n){return n===1?"one":"other"},"vi":function(n){return "other"},"zh":function(n){return "other"}},
c:function(d,k){if(!d)throw new Error("MessageFormat: Data required for '"+k+"'.")},
n:function(d,k,o){if(isNaN(d[k]))throw new Error("MessageFormat: '"+k+"' isn't a number.");return d[k]-(o||0)},
v:function(d,k){flappy_locale.c(d,k);return d[k]},
p:function(d,k,o,l,p){flappy_locale.c(d,k);return d[k] in p?p[d[k]]:(k=flappy_locale.lc[l](d[k]-o),k in p?p[k]:p.other)},
s:function(d,k,p){flappy_locale.c(d,k);return d[k] in p?p[d[k]]:p.other}};
(window.blockly = window.blockly || {}).flappy_locale = {
"continue":function(d){return "Pokračovat"},
"doCode":function(d){return "dělej"},
"elseCode":function(d){return "jinak"},
"endGame":function(d){return "konec hry"},
"endGameTooltip":function(d){return "Ukončí hru."},
"finalLevel":function(d){return "Gratulujeme! Vyřešil jsi poslední puzzle."},
"flap":function(d){return "mávni"},
"flapRandom":function(d){return "mávni náhodně silně"},
"flapVerySmall":function(d){return "mávni velmi slabě"},
"flapSmall":function(d){return "mávni slabě"},
"flapNormal":function(d){return "mávni normálně"},
"flapLarge":function(d){return "mávni silně"},
"flapVeryLarge":function(d){return "mávni velmi silně"},
"flapTooltip":function(d){return "Vyletí s Flappym vzhůru."},
"flappySpecificFail":function(d){return "Tvůj kód vypadá dobře - zamává při každém kliknutí. Ale musíš kliknout víckrát, aby ses dostal k cíli."},
"incrementPlayerScore":function(d){return "přidej bod"},
"incrementPlayerScoreTooltip":function(d){return "Přidá aktuálnímu hráči jeden bod."},
"nextLevel":function(d){return "Dobrá práce! Dokončil jsi tuto hádanku."},
"no":function(d){return "Ne"},
"numBlocksNeeded":function(d){return "Tato hádanka může být vyřešena pomoci %1 bloků."},
"playSoundRandom":function(d){return "přehrát náhodný zvuk"},
"playSoundBounce":function(d){return "přehrát zvuk odrazu"},
"playSoundCrunch":function(d){return "přehrát zvuk křupání"},
"playSoundDie":function(d){return "přehrát smutný zvuk"},
"playSoundHit":function(d){return "přehrát zvuk rány"},
"playSoundPoint":function(d){return "přehrát zvuk bodu"},
"playSoundSwoosh":function(d){return "přehrát zvuk šustění"},
"playSoundWing":function(d){return "přehrát zvuk křídel"},
"playSoundJet":function(d){return "přehrát zvuk stíhačky"},
"playSoundCrash":function(d){return "přehrát zvuk srážky"},
"playSoundJingle":function(d){return "přehrát zvuk rolničky"},
"playSoundSplash":function(d){return "přehrát zvuk šplouchnutí"},
"playSoundLaser":function(d){return "přehrát zvuk laseru"},
"playSoundTooltip":function(d){return "Přehraj vybraný zvuk."},
"reinfFeedbackMsg":function(d){return "Můžeš stisknout tlačítko \"Zkusit znovu\" a vrátit se zpět ke své hře."},
"scoreText":function(d){return "Body: "+flappy_locale.v(d,"playerScore")},
"setBackground":function(d){return "nastavit scénu"},
"setBackgroundRandom":function(d){return "nastavit scénu Náhodná"},
"setBackgroundFlappy":function(d){return "nastavit scénu Město (ve dne)"},
"setBackgroundNight":function(d){return "nastavit scénu Město (v noci)"},
"setBackgroundSciFi":function(d){return "nasatvit scénu Sci-Fi"},
"setBackgroundUnderwater":function(d){return "nastavit scénu Pod vodou"},
"setBackgroundCave":function(d){return "nastavit scénu Jeskyně"},
"setBackgroundSanta":function(d){return "nastavit scénu Santa"},
"setBackgroundTooltip":function(d){return "Nastavit obrázek pozadí"},
"setGapRandom":function(d){return "nastavit náhodnou mezeru"},
"setGapVerySmall":function(d){return "nastavit velmi malou mezeru"},
"setGapSmall":function(d){return "nastavit malou mezeru"},
"setGapNormal":function(d){return "nastavit normální mezeru"},
"setGapLarge":function(d){return "nastavit velkou mezeru"},
"setGapVeryLarge":function(d){return "nastavit velmi velkou mezeru"},
"setGapHeightTooltip":function(d){return "Nastaví svislou mezeru v překážce"},
"setGravityRandom":function(d){return "nastavit gravitaci Náhodně"},
"setGravityVeryLow":function(d){return "nastavit velmi nízkou gravitaci"},
"setGravityLow":function(d){return "nastavit nízkou gravitaci"},
"setGravityNormal":function(d){return "nastavit normální gravitaci"},
"setGravityHigh":function(d){return "nastavit vysokou gravitaci"},
"setGravityVeryHigh":function(d){return "nastavit velmi vysokou gravitaci"},
"setGravityTooltip":function(d){return "Nastaví úroveň gravitace"},
"setGround":function(d){return "nastavit terén"},
"setGroundRandom":function(d){return "nastavit terén Náhodně"},
"setGroundFlappy":function(d){return "nastavit terén Země"},
"setGroundSciFi":function(d){return "nastavit terén Sci-Fi"},
"setGroundUnderwater":function(d){return "nastavit terén Pod vodou"},
"setGroundCave":function(d){return "nastavit terén Jeskyně"},
"setGroundSanta":function(d){return "nastavit terén Santa"},
"setGroundLava":function(d){return "nastavit terén Láva"},
"setGroundTooltip":function(d){return "Nastaví obrázek terénu"},
"setObstacle":function(d){return "nastavit překážku"},
"setObstacleRandom":function(d){return "nastavit překážku Náhodně"},
"setObstacleFlappy":function(d){return "nastavit překážku Potrubí"},
"setObstacleSciFi":function(d){return "nastavit překážku Sci-Fi"},
"setObstacleUnderwater":function(d){return "nastavit překážku Rostlina"},
"setObstacleCave":function(d){return "nastavit překážku Jeskyně"},
"setObstacleSanta":function(d){return "nastavit překážku Komín"},
"setObstacleLaser":function(d){return "nastavit překážku Laser"},
"setObstacleTooltip":function(d){return "Nastaví obrázek překážky"},
"setPlayer":function(d){return "nastavit hráče"},
"setPlayerRandom":function(d){return "nastavit hráče Náhodně"},
"setPlayerFlappy":function(d){return "nastavit hráče Žlutý pták"},
"setPlayerRedBird":function(d){return "nastavit hráče Červený pták"},
"setPlayerSciFi":function(d){return "nastavit hráče Kosmická loď"},
"setPlayerUnderwater":function(d){return "nastavit hráče Ryba"},
"setPlayerCave":function(d){return "nastavit hráče Netopýr"},
"setPlayerSanta":function(d){return "nastavit hráče Santa"},
"setPlayerShark":function(d){return "nastavit hráče Žralok"},
"setPlayerEaster":function(d){return "nastavit hráče Velikonoční zajíček"},
"setPlayerBatman":function(d){return "nastavit hráče Netopýří chlap"},
"setPlayerSubmarine":function(d){return "nastavit hráče Ponorka"},
"setPlayerUnicorn":function(d){return "nastavit hráče Jednorožec"},
"setPlayerFairy":function(d){return "nastavit hráče Víla"},
"setPlayerSuperman":function(d){return "nastavit hráče Flappyman"},
"setPlayerTurkey":function(d){return "nastavit hráče Krocan"},
"setPlayerTooltip":function(d){return "Nastaví obrázek hráče"},
"setScore":function(d){return "nastavit body"},
"setScoreTooltip":function(d){return "Nastaví body hráče"},
"setSpeed":function(d){return "nastavit rychlost"},
"setSpeedTooltip":function(d){return "Nastaví rychlost úrovně"},
"shareFlappyTwitter":function(d){return "Podívejte se na hru Flappy, kterou jsem vytvořil/a. Napsal/a jsem ji sám/sama s pomocí @codeorg"},
"shareGame":function(d){return "Sdílej svou hru:"},
"soundRandom":function(d){return "náhodně"},
"soundBounce":function(d){return "Odrazit"},
"soundCrunch":function(d){return "křupnutí"},
"soundDie":function(d){return "smutný"},
"soundHit":function(d){return "rána"},
"soundPoint":function(d){return "bod"},
"soundSwoosh":function(d){return "šustění"},
"soundWing":function(d){return "křídlo"},
"soundJet":function(d){return "stíhačka"},
"soundCrash":function(d){return "srážka"},
"soundJingle":function(d){return "rolnička"},
"soundSplash":function(d){return "šplouchnutí"},
"soundLaser":function(d){return "laser"},
"speedRandom":function(d){return "nastavit rychlost náhodně"},
"speedVerySlow":function(d){return "nastavit velmi pomalou rychlost"},
"speedSlow":function(d){return "nastavit pomalou rychlost"},
"speedNormal":function(d){return "nastavit normální rychlost"},
"speedFast":function(d){return "nastavit vysokou rychlost"},
"speedVeryFast":function(d){return "nastavit nelmi vysokou rychlost"},
"whenClick":function(d){return "když klikneš"},
"whenClickTooltip":function(d){return "Provést akce uvedené níže, když dojde ke kliknutí."},
"whenCollideGround":function(d){return "když se dotkne země"},
"whenCollideGroundTooltip":function(d){return "Provést akce uvedené níže, když se Flappy dotkne země."},
"whenCollideObstacle":function(d){return "když se dotkne překážky"},
"whenCollideObstacleTooltip":function(d){return "Provést akce uvedené níže, když se Flappy dotkne překážky."},
"whenEnterObstacle":function(d){return "když mine překážku"},
"whenEnterObstacleTooltip":function(d){return "Provést akce uvedené níže, když Flappy vjede do překážky."},
"whenRunButtonClick":function(d){return "když hra začne"},
"whenRunButtonClickTooltip":function(d){return "Provést akce uvedené níže, když hra začne."},
"yes":function(d){return "Ano"}};


text:
'use strict';

exports.__esModule = true;

var _component = require('../../component.js');

var _component2 = _interopRequireDefault(_component);

require('./seek-bar.js');

require('./mouse-time-display.js');

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

function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }

function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }

function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } /**
                                                                                * @file progress-control.js
                                                                                */

/**
 * The Progress Control component contains the seek bar, load progress,
 * and play progress
 *
 * @param {Player|Object} player
 * @param {Object=} options
 * @extends Component
 * @class ProgressControl
 */
var ProgressControl = function (_Component) {
  _inherits(ProgressControl, _Component);

  function ProgressControl() {
    _classCallCheck(this, ProgressControl);

    return _possibleConstructorReturn(this, _Component.apply(this, arguments));
  }

  /**
   * Create the component's DOM element
   *
   * @return {Element}
   * @method createEl
   */
  ProgressControl.prototype.createEl = function createEl() {
    return _Component.prototype.createEl.call(this, 'div', {
      className: 'vjs-progress-control vjs-control'
    });
  };

  return ProgressControl;
}(_component2['default']);

ProgressControl.prototype.options_ = {
  children: ['seekBar']
};

_component2['default'].registerComponent('ProgressControl', ProgressControl);
exports['default'] = ProgressControl;


text:
@implementation NetworkError

+(NetworkError *)errorWithServerError:(NSError *)serverError
{
    NSString *msg = [serverError.domain isEqualToString:@"NSURLErrorDomain"] ? @"服务器繁忙,请稍后重试" : serverError.domain;
    NSInteger code = serverError.code;

    NetworkError * error = [NetworkError new];
    error.msg = msg;
    error.code = code;
    return error;
}
+(NetworkError *)errorWithResponseCode:(NSInteger)responseCode responseMsg:(NSString *)responseMsg
{
    NetworkError * error = [NetworkError new];
    error.msg = responseMsg;
    error.code = responseCode;
    return error;
}
@end