text:
//
//  QuizListViewController.m
//  iCY
//
//  Created by My Name on 2/3/16.
//  Copyright © 2016 My Name. All rights reserved.
//

#import "QuizListTableViewController.h"
#import "QuizTableViewController.h"

//#import "iCY-Bridging-Header.h"
//#import "iCY-Swift.h"

@interface QuizListTableViewController ()

@end

@implementation QuizListTableViewController

- (void)viewDidLoad {

    [super viewDidLoad];

    NSLog(@"Quiz list did load");

    AppDelegate *appDelegate = [UIApplication sharedApplication].delegate;
    self.quizList = appDelegate.data.quizNames;
}

-(UITableViewCell *)tableView:(UITableView *) tableView cellForRowAtIndexPath:(nonnull NSIndexPath *)indexPath {
    static NSString *cellIdentifier = @"quizNameCell";
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:cellIdentifier];

    if (cell == nil) {
        cell = [[UITableViewCell alloc] initWithStyle: UITableViewCellStyleDefault
                                      reuseIdentifier: cellIdentifier];
    }

    cell.textLabel.text = [[self.quizList objectAtIndex:indexPath.row] name];
    //cell.imageView.image =

    return cell;
}

-(NSInteger)tableView:(UITableView *) tableView numberOfRowsInSection:(NSInteger)section {

    return self.quizList.count;
}

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

-(void) tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
    //NSLog(@" Selected row is %ld", indexPath.row);

    QuizHeader *quiz = [self.quizList objectAtIndex:indexPath.row];
    NSString *storyBoardId = @"quizView";

    QuizTableViewController *quizVC = [self.storyboard instantiateViewControllerWithIdentifier:storyBoardId];
    quizVC.quizId = quiz.iD;

    //AppDelegate *appDelegate = [UIApplication sharedApplication].delegate;
    //appDelegate.window.rootViewController = detailsVC;
    [self.navigationController pushViewController: quizVC
                                         animated: YES];
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end


text:
<title>View Source Code</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

Source Code for config.jsp

Source Code for prelude.jspf

Source Code for coda.jspf

redpajama_set_name: RedPajamaGithub


text:
global.window = global;

const setGlobalVars = require('../dist/indexeddbshim-UnicodeIdentifiers-node');
// const setGlobalVars = require('../dist/indexeddbshim-node.min');

setGlobalVars();
// shimIndexedDB.__debug(true);

window.DOMException = indexedDB.modules.ShimDOMException;
window.Event = indexedDB.modules.ShimEvent;

module.exports = global.indexedDB;


text:
'use strict'
/* global describe, it */
const assert = require('assert')

describe('CollectionCsvService', () => {
  it('should exist', () => {
    assert(global.app.api.services['CollectionCsvService'])
  })
})


text:
package net.qiujuer.genius.kit.net;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.TimeUnit;

/**
 * TraceRoute class
 * extends {@link net.qiujuer.genius.kit.net.NetModel}
 * implements {@link TraceRouteThread.TraceThreadInterface}
 * <p/>
 * TraceRoute url or ip
 */
public class TraceRoute extends NetModel implements TraceRouteThread.TraceThreadInterface {
    private final static int ONCE_COUNT = Runtime.getRuntime().availableProcessors();
    private final static int LOOP_COUNT = 30 / ONCE_COUNT;

    private final Object mLock = new Object();
    private String mTarget;
    private String mIP;
    private List<String> mRoutes = null;

    private transient int errorCount = 0;
    private transient boolean isDone = false;
    private transient boolean isArrived = false;
    private transient List<TraceRouteContainer> routeContainers = null;
    private transient List<TraceRouteThread> threads = null;
    private transient CountDownLatch countDownLatch = null;

    /**
     * TraceRoute domain or ip
     * Return the  domain or ip route result
     *
     * @param target domain or ip
     */
    public TraceRoute(String target) {
        this.mTarget = target;
    }

    /**
     * Clear List
     */
    private void clear() {
        if (threads != null) {
            synchronized (mLock) {
                for (TraceRouteThread thread : threads) {
                    thread.cancel();
                }
            }
        }
    }

    @Override
    public void complete(TraceRouteThread trace, boolean isError, boolean isArrived, TraceRouteContainer routeContainer) {
        if (threads != null) {
            synchronized (mLock) {
                try {
                    threads.remove(trace);
                } catch (NullPointerException e) {
                    e.printStackTrace();
                }
            }
        }
        if (!isDone) {
            if (isError)
                this.errorCount++;
            this.isArrived = isArrived;
            if (routeContainers != null && routeContainer != null)
                routeContainers.add(routeContainer);
        }
        if (countDownLatch != null && countDownLatch.getCount() > 0)
            countDownLatch.countDown();
    }

    /**
     * Override Start
     */
    @Override
    public void start() {
        // Get IPs
        DnsResolve dns = new DnsResolve(mTarget);
        dns.start();
        List<String> ips = dns.getAddresses();
        if (dns.getError() != NetModel.SUCCEED || ips == null || ips.size() == 0)
            return;
        mIP = ips.get(0);

        // Init List
        routeContainers = new ArrayList<>();
        threads = new ArrayList<>(ONCE_COUNT);

        // Loop
        for (int i = 0; i < LOOP_COUNT; i++) {
            countDownLatch = new CountDownLatch(ONCE_COUNT);
            synchronized (mLock) {
                for (int j = 1; j <= ONCE_COUNT; j++) {
                    // Get ttl
                    final int ttl = i * ONCE_COUNT + j;
                    // Thread run get tp ttl ping information
                    threads.add(new TraceRouteThread(mIP, ttl, this));
                }
            }
            // Await 40 seconds long time
            try {
                countDownLatch.await(40, TimeUnit.SECONDS);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }

            // End
            if (countDownLatch.getCount() > 0) {
                clear();
            }

            // Clear
            countDownLatch = null;
            synchronized (mLock) {
                threads.clear();
            }

            // Break Loop
            if (isDone || isArrived || errorCount > 3)
                break;
        }

        // Set Result
        if (routeContainers.size() > 0) {
            // Sort
            Collections.sort(routeContainers, new TraceRouteContainer.TraceRouteContainerComparator());

            // Set values
            ArrayList<String> routes = new ArrayList<>();
            int size = routeContainers.size();
            String prevIP = null;

            // For
            for (int s = 0; s < size; s++) {
                TraceRouteContainer container = routeContainers.get(s);
                if (prevIP != null && container.mIP.equals(prevIP)) {
                    break;
                } else {
                    routes.add(container.toString());
                    prevIP = container.mIP;
                }
            }

            routes.trimToSize();
            mRoutes = routes;
        }

        // Clear
        routeContainers = null;
        threads = null;
    }

    /**
     * Override Cancel
     */
    @Override
    public void cancel() {
        isDone = true;
        clear();
    }

    /**
     * The Routes Target IP
     *
     * @return IP Address
     */
    public String getAddress() {
        return mIP;
    }

    /**
     * For routing values
     *
     * @return Routes
     */
    public List<String> getRoutes() {
        return mRoutes;
    }

    @Override
    public String toString() {
        return "IP:" + mIP + " Routes:" + (mRoutes == null ? "[]" : mRoutes.toString());
    }
}


text:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" parent-id="Services" uuid="0ba93a1c-0974-4a65-8b0f-c799615eb786" xsi:noNamespaceSchemaLocation="http://www.jetbrains.com/teamcity/schemas/9.0/project-config.xsd">
  <name>energy-gateway</name>
  <parameters />
  <cleanup />
</project>


text:
package me.realized.tokenmanager.command.commands.subcommands;

import me.realized.tokenmanager.TokenManagerPlugin;
import me.realized.tokenmanager.command.BaseCommand;
import org.bukkit.ChatColor;
import org.bukkit.command.CommandSender;

public class TransferCommand extends BaseCommand {

    public TransferCommand(final TokenManagerPlugin plugin) {
        super(plugin, "transfer", "transfer", null, 1, false);
    }

    @Override
    protected void execute(final CommandSender sender, final String label, final String[] args) {
        dataManager.transfer(sender, error -> sender.sendMessage(ChatColor.RED + "Could not transfer data: " + error));
    }
}


text:
package org.pitest.mutationtest.execute;

import static org.mockito.Matchers.any;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
import static org.pitest.mutationtest.LocationMother.aLocation;

import java.io.IOException;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.List;

import junit.framework.AssertionFailedError;

import org.junit.Before;
import org.junit.Ignore;
import org.junit.Test;
import org.mockito.Mock;
import org.mockito.MockitoAnnotations;
import org.pitest.classinfo.ClassName;
import org.pitest.functional.F3;
import org.pitest.mutationtest.DetectionStatus;
import org.pitest.mutationtest.MutationStatusTestPair;
import org.pitest.mutationtest.engine.Mutant;
import org.pitest.mutationtest.engine.Mutater;
import org.pitest.mutationtest.engine.MutationDetails;
import org.pitest.mutationtest.engine.MutationIdentifier;
import org.pitest.testapi.Description;
import org.pitest.testapi.ResultCollector;
import org.pitest.testapi.TestUnit;

public class MutationTestWorkerTest {

  private MutationTestWorker                       testee;

  @Mock
  private ClassLoader                              loader;

  @Mock
  private Mutater                                  mutater;

  @Mock
  private F3<ClassName, ClassLoader, byte[], Boolean> hotswapper;

  @Mock
  private TimeOutDecoratedTestSource               testSource;

  @Mock
  private Reporter                                 reporter;

  @Before
  public void setUp() {
    MockitoAnnotations.initMocks(this);
    this.testee = new MutationTestWorker(this.hotswapper, this.mutater,
        this.loader);
  }

  @Test
  public void shouldDescribeEachExaminedMutation() throws IOException {
    final MutationDetails mutantOne = makeMutant("foo", 1);
    final MutationDetails mutantTwo = makeMutant("foo", 2);
    final Collection<MutationDetails> range = Arrays.asList(mutantOne,
        mutantTwo);
    this.testee.run(range, this.reporter, this.testSource);
    verify(this.reporter).describe(mutantOne.getId());
    verify(this.reporter).describe(mutantTwo.getId());
  }

  @Test
  @Ignore("disabled while checking coverage issue")
  public void shouldReportNoCoverageForMutationWithNoTestCoverage()
      throws IOException {
    final MutationDetails mutantOne = makeMutant("foo", 1);
    final Collection<MutationDetails> range = Arrays.asList(mutantOne);
    this.testee.run(range, this.reporter, this.testSource);
    verify(this.reporter).report(mutantOne.getId(),
        new MutationStatusTestPair(0, DetectionStatus.NO_COVERAGE));
  }

  @SuppressWarnings("unchecked")
  @Test
  public void shouldReportWhenMutationNotDetected() throws IOException {
    final MutationDetails mutantOne = makeMutant("foo", 1);
    final Collection<MutationDetails> range = Arrays.asList(mutantOne);
    final TestUnit tu = makePassingTest();
    when(this.testSource.translateTests(any(List.class))).thenReturn(
        Collections.singletonList(tu));
    when(
        this.hotswapper.apply(any(ClassName.class), any(ClassLoader.class),
            any(byte[].class))).thenReturn(true);
    this.testee.run(range, this.reporter, this.testSource);
    verify(this.reporter).report(mutantOne.getId(),
        new MutationStatusTestPair(1, DetectionStatus.SURVIVED));

  }

  @SuppressWarnings("unchecked")
  @Test
  public void shouldReportWhenMutationNotViable() throws IOException {
    final MutationDetails mutantOne = makeMutant("foo", 1);
    final Collection<MutationDetails> range = Arrays.asList(mutantOne);
    final TestUnit tu = makePassingTest();
    when(this.testSource.translateTests(any(List.class))).thenReturn(
        Collections.singletonList(tu));
    when(
        this.hotswapper.apply(any(ClassName.class), any(ClassLoader.class),
            any(byte[].class))).thenReturn(false);
    this.testee.run(range, this.reporter, this.testSource);
    verify(this.reporter).report(mutantOne.getId(),
        new MutationStatusTestPair(0, DetectionStatus.NON_VIABLE));
  }

  @SuppressWarnings("unchecked")
  @Test
  public void shouldReportWhenMutationKilledByTest() throws IOException {
    final MutationDetails mutantOne = makeMutant("foo", 1);
    final Collection<MutationDetails> range = Arrays.asList(mutantOne);
    final TestUnit tu = makeFailingTest();
    when(this.testSource.translateTests(any(List.class))).thenReturn(
        Collections.singletonList(tu));
    when(
        this.hotswapper.apply(any(ClassName.class), any(ClassLoader.class),
            any(byte[].class))).thenReturn(true);
    this.testee.run(range, this.reporter, this.testSource);
    verify(this.reporter).report(
        mutantOne.getId(),
        new MutationStatusTestPair(1, DetectionStatus.KILLED, tu
            .getDescription().getName()));
  }

  private TestUnit makeFailingTest() {
    return new TestUnit() {

      public void execute(final ClassLoader loader, final ResultCollector rc) {
        rc.notifyStart(getDescription());
        rc.notifyEnd(getDescription(), new AssertionFailedError());
      }

      public Description getDescription() {
        return new Description("atest");
      }

    };
  }

  private TestUnit makePassingTest() {
    return new TestUnit() {

      public void execute(final ClassLoader loader, final ResultCollector rc) {
        rc.notifyStart(getDescription());
        rc.notifyEnd(getDescription());
      }

      public Description getDescription() {
        return new Description("atest");
      }

    };
  }

  public MutationDetails makeMutant(final String clazz, final int index) {
    final MutationDetails md = new MutationDetails(new MutationIdentifier(
        aLocation().withClass(clazz), index, "mutator"), "sourceFile", "desc",
         42, 0);

    when(this.mutater.getMutation(md.getId())).thenReturn(
        new Mutant(md, new byte[0]));

    return md;
  }

}


text:
namespace invalidation {

notifier::NotifierOptions ParseNotifierOptions(
    const base::CommandLine& command_line) {
  notifier::NotifierOptions notifier_options;

  if (command_line.HasSwitch(switches::kSyncNotificationHostPort)) {
    notifier_options.xmpp_host_port =
        net::HostPortPair::FromString(
            command_line.GetSwitchValueASCII(
                switches::kSyncNotificationHostPort));
    DVLOG(1) << "Using " << notifier_options.xmpp_host_port.ToString()
             << " for test sync notification server.";
  }

  notifier_options.allow_insecure_connection =
      command_line.HasSwitch(switches::kSyncAllowInsecureXmppConnection);
  DVLOG_IF(1, notifier_options.allow_insecure_connection)
      << "Allowing insecure XMPP connections.";

  return notifier_options;
}

std::string GenerateInvalidatorClientId() {
  // Generate a GUID with 128 bits worth of base64-encoded randomness.
  // This format is similar to that of sync's cache_guid.
  const int kGuidBytes = 128 / 8;
  std::string guid;
  base::Base64Encode(base::RandBytesAsString(kGuidBytes), &guid);
  DCHECK(!guid.empty());
  return guid;
}

}  // namespace invalidation


text:
var repo = require(process.cwd()+'/repo');
var spinsInfo = require(process.cwd()+'/bot/utilities/spins');

module.exports.dj = null;
module.exports.djStarted = false;
module.exports.djCanSpin = true;

var LIMIT = 50;

var vm = this;

module.exports.startDj = function startDj(bot, yt) {

    if(vm.dj) clearTimeout(vm.dj); //don't have multiple dj timeouts running at once

    //start another dj check in 2-5 min
    setTimeout(function(){vm.startDj(bot, yt)}, (Math.floor(Math.random() * (1000*60*2)) + (1000*60*5)));

    if(bot.getQueue().length >= 1 || vm.djStarted === true || !vm.djCanSpin) return; //don't start a dj if queue is too large or another is started

    vm.djStarted = true;

    var randspin = null;
    if (spinsInfo.spins.length > 0) {
        randspin = spinsInfo.spins[Math.floor(Math.random() * spinsInfo.spins.length)];
    }

    var s = randspin ? randspin : {'q': 'random'};
    bot.log("info", "BOT", 'Spinning something from: ' + JSON.stringify(s));

    yt.addParam('type', 'video');
    yt.addParam('videoCategoryId', '10');

    yt.search(s['q'], LIMIT, function(error, result) {
      if (error) {
        bot.log("info", "BOT", 'Error Response: ' + JSON.stringify(error));
      }
      else {
        var rand = (Math.floor(Math.random() * LIMIT - 1));
        if ('items' in result) {
            var qmed = result['items'][rand]['id']['videoId'];
            bot.queueMedia("youtube", qmed, function(response){});
        }
      }
    });
    vm.djStarted = false;
};


text:
package org.wso2.carbon.esb.mediator.test.enrich;

import org.apache.axiom.om.OMElement;
import org.testng.annotations.AfterClass;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;
import org.wso2.esb.integration.common.utils.ESBIntegrationTest;

import javax.xml.namespace.QName;

import static org.testng.Assert.assertEquals;
import static org.testng.Assert.assertNotEquals;
import static org.testng.Assert.assertNotNull;

public class EnrichIntegrationMultipleNodeReplace extends ESBIntegrationTest {

    @BeforeClass(alwaysRun = true)
    public void setEnvironment() throws Exception{
        super.init();
        verifyProxyServiceExistence("enrichMultipleNodeReplaceTestProxy");
    }

    //test whether the return element isreplaced by multiple node.
    @Test(groups = "wso2.esb" , description = "Replace the part of message defined by custom " +
                                              "xpath value with the envelope of source message ")
    public void testEnrichMediator() throws Exception{
        OMElement response;

        response=axis2Client.sendSimpleStockQuoteRequest(getProxyServiceURLHttp("enrichMultipleNodeReplaceTestProxy"),null,
                                                         "WSO2");

        assertNotNull(response, "Response message null");

        assertNotEquals(response.getFirstElement().getLocalName(),"return","Fault, multiple node replace");

        OMElement symbolElement=response.getFirstChildWithName(
                new QName("http://services.samples/xsd","symbol"));
        assertEquals(symbolElement.getText(),"WSO2","Fault, multiple node replace.");

    }

    @AfterClass(alwaysRun = true)
    public void close() throws Exception {
        super.cleanup();
    }

}


text:
export default function sortObject(obj) {
  return Object.keys(obj)
    .sort()
    .reduce((newObj, key) => {
      newObj[key] = obj[key]
      return newObj
    }, {})
}


text:
package uk.co.badgersinfoil.metaas.dom;

/**
 * A literal string value, such as "foo" or 'bar'.
 *
 * @see uk.co.badgersinfoil.metaas.ActionScriptFactory#newStringLiteral(String)
 */
public interface ASStringLiteral extends Literal {
	boolean isApostropheEnclosed();
    String getValue();
    String getUnescapedValue();
	void setValue(String value);
}


text:
package org.apache.ode.utils;

/**
 * An exception to encapsulate issues with system configuration. Examples
 * include the inability to find required services (e.g., XML parsing).
 */
public class SystemConfigurationException extends RuntimeException {

    private static final long serialVersionUID = -2330515949287155695L;

    /**
     * Construct a new instance with the specified message.
     *
     * @param message
     *            a descriptive message.
     * @see RuntimeException#RuntimeException(java.lang.String)
     */
    public SystemConfigurationException(String message) {
        super(message);
    }

    /**
     * Construct a new instance with the specified message and a
     * {@link Throwable} that triggered this exception.
     *
     * @param message
     *            a descriptive message
     * @param cause
     *            the cause
     * @see RuntimeException#RuntimeException(java.lang.String,
     *      java.lang.Throwable)
     */
    public SystemConfigurationException(String message, Throwable cause) {
        super(message, cause);
    }

    /**
     * Construct a new instance with the specified {@link Throwable} as the root
     * cause.
     *
     * @param cause
     *            the cause
     * @see RuntimeException#RuntimeException(java.lang.Throwable)
     */
    public SystemConfigurationException(Throwable cause) {
        super(cause);
    }
}


text:
WORKREPORT_STATISTIC_STATUS = {
    0: "",
    1: "complete",
    2: "partcomplete",
    3: "incomplete",
    4: "complete",
    5: "partcomplete",
    6: "incomplete",
}

WORKREPORT_STATUS_DEFAULT = 0 # default, no mean
WORKREPORT_STATUS_COMPLETE = 1 # complete in time
WORKREPORT_STATUS_PARTCOMPLETE = 2 # bu jiao
WORKREPORT_STATUS_INCOMPLETE = 3 # no complete

WORKREPORT_STATUS_TEAM_COMPLETE = 1 # complete in time
WORKREPORT_STATUS_TEAM_PARTCOMPLETE = 2 #
WORKREPORT_STATUS_TEAM_INCOMPLETE = 3 # no complete


text:
import React from 'react';
import TextInput from '../../components/TextInput/TextInput';
import SelectInput from '../../components/SelectInput/SelectInput';

const CourseForm =({course, allAuthors, onSave, onChange, saving, errors}) => {
    return (
        <form>

Manage Course

            <TextInput
                name="title"
                label="Title"
                value={course.title}
                onChange={onChange}
                error={errors.title}/>
            <SelectInput
                name="authorId"
                label="Author"
                value={course.authorId.toString()}
                defaultOption="Select Author"
                options={allAuthors}
                onChange={onChange}
                error={errors.authorId}/>
            <TextInput
                name="category"
                label="Category"
                value={course.category}
                onChange={onChange}
                error={errors.categor}/>
            <TextInput
                name="length"
                label="Length"
                value={course.length}
                onChange={onChange}
                error={errors.length}/>
            <TextInput
                name="watchHref"
                label="Watch Href"
                value={course.watchHref}
                onChange={onChange}
                error={errors.length}/>
            <input
                type="submit"
                disabled={saving}
                value={saving ? 'Saving...' : 'Save'}
                className="btn btn-primary"
                onClick={onSave}/>
        </form>
    );
};

CourseForm.propTypes = {
    course: React.PropTypes.object.isRequired,
    allAuthors: React.PropTypes.array,
    onSave: React.PropTypes.func.isRequired,
    onChange: React.PropTypes.func.isRequired,
    saving: React.PropTypes.bool,
    errors: React.PropTypes.object,
    savedCourse: React.PropTypes.bool
};

export default CourseForm;


text:
<?php
namespace ReceiptPrintHq\EscposTools\Parser\Command;

use ReceiptPrintHq\EscposTools\Parser\Command\CommandOneArg;

class EnableSmoothingCmd extends CommandOneArg
{

}


text:
package ru.job4j.sorrting;

/**
 * Represent users model.
 *
 * @author abondarev.
 * @since 19.08.2017.
 */
public class User implements Comparable<User> {

    /**
     * Holds name of user.
     */
    private String name;

    /**
     * Holds age of user.
     */
    private int age;

    /**
     * Constructor.
     *
     * @param name of the user
     * @param age of the user
     */
    public User(String name, int age) {
        this.name = name;
        this.age = age;
    }

    /**
     * Returns the name of the user.
     *
     * @return name of the user.
     */
    public String getName() {
        return name;
    }

    /**
     * Returns the age of the user.
     *
     * @return age of the user.
     */
    public int getAge() {
        return age;
    }

    /**
     * <@inheritedDoc>.
     *
     * @param o the object to be compared.
     * @return a negative integer, zero, or a positive integer as this object
     *          is less than, equal to, or greater than the specified object.
     */
    @Override
    public int compareTo(User o) {
        return (this.age == o.age) ? 0 : (this.age > o.age) ? 1 : -1;
    }
}


text:
import sys

''' Set USE_SDL to true to display the screen. ALE must be compilied
   with SDL enabled for this to work. On OSX, pygame init is used to
   proxy-call SDL_main. '''
def initializeSDL(ale):
  if sys.platform == 'darwin':
    import pygame
    pygame.init()
    ale.setBool('sound', False) # Sound doesn't work on OSX
  elif sys.platform.startswith('linux'):
    ale.setBool('sound', True)
  ale.setBool('display_screen', True)

def initializeALEParameters(ale, seed, frameSkip, repeatActionProbability, initSDL = False):
    ale.setInt("random_seed", seed)
    # ale.setInt("frame_skip", frameSkip)
    ale.setFloat("repeat_action_probability", repeatActionProbability)
    ale.setBool("showinfo", False)

    if initSDL:
        initializeSDL(ale)


text:
'use strict'; // eslint-disable-line strict

/*
 * The file contains multiple scenarios for measuring performance of single S3
 * 1. Lowest latency: single bucket
 * 2. Max number of operations/s: single & multiple buckets
 * 3. Max throughput: single & multiple buckets
 * Only sequential simulation is executed, i.e. at a time, a type of request
 *  with a single combination of (number of parallel requests, object size) is
 *  executed.
 */

const numCPUs = require('os').cpus().length;

const { config } = require('../../lib/Config');
const runS3Blaster = require('s3blaster').RunS3Blaster;

const numWorkers = Math.min(numCPUs, 8);
const S3Port = config.port;
const maxBktsNb = 30;
const outputDir = `${__dirname}/results`;

// params.paralReqs is an array of numbers of parallel requests sent from each
// worker. Hence, if there are multiple workers, total numbers of parallel
// requests are equal such numbers multipled with number of workers
const totalParalReqs = [32, 64, 128, 256, 512];
const paralReqs = totalParalReqs.map(num =>
                    Math.max(1, Math.floor(num / numWorkers)));

const params = {
    port: S3Port,
    forksNb: 1,
    bucketsNb: 1,
    bucketPrefix: 'bkts3std',
    objectsNb: 2000,
    sizes: [0, 10],
    unit: 'KB',
    requests: 'put,get,delete',
    range: ['0:1000', '1000:2000', '0:1000'],
    // put 1000 objects whose keys are in [1000, 2000]
    fillObjs: true,
    fillRange: '1000:2000',
    fillThreads: 64,
    paralReqs: 1,
    schedule: 'each',
    simulDelay: 5,
    nextKey: 'seq',
    observationsNb: 1e6,
    workOnCurrObjs: false,
    runTime: 10,
    // clean database after each test
    dontCleanDB: false,
    ssm: false,
    dirPath: outputDir,
    output: 's3standard',
    message: 'Performance measurement of S3 Server',
};

/* Find lowest latency */
describe('Single bucket, lowest latency', function fn() {
    this.timeout(0);

    before(() => {
        params.statsFolder = 'lowestLatency';
        params.forksNb = 1;
        params.paralReqs = [1];
    });

    it('Put, get, then delete', done => {
        params.output = 'lowestLatency';
        process.nextTick(runS3Blaster.start, params, done);
    });
});

/* Find max #operations/s */
describe('Single bucket, max ops/s', function fn() {
    this.timeout(0);

    before(() => {
        params.statsFolder = 'maxOps';
        params.forksNb = numWorkers;
        params.paralReqs = paralReqs;
    });

    it('Put, get, then delete', done => {
        params.output = 'singleBucket_maxOps';
        process.nextTick(runS3Blaster.start, params, done);
    });
});

describe('Multiple buckets, max ops/s', function fn() {
    this.timeout(0);

    before(() => {
        params.statsFolder = 'maxOps';
        params.bucketsNb = maxBktsNb;
    });

    it('Put, get, then delete', done => {
        params.output = `bkt${params.bucketsNb}_maxOps`;
        process.nextTick(runS3Blaster.start, params, done);
    });
});

/* Find throughput */
describe('Single bucket, throughput', function fn() {
    this.timeout(0);

    before(() => {
        params.statsFolder = 'throughput';
        params.sizes = [1];
        params.unit = 'MB';
        params.bucketsNb = 1;
    });

    it('Put, then get', done => {
        params.output = 'singleBucket_throughput';
        process.nextTick(runS3Blaster.start, params, done);
    });
});

describe('Multiple buckets, throughput', function fn() {
    this.timeout(0);

    before(() => {
        params.statsFolder = 'throughput';
        params.bucketsNb = maxBktsNb;
    });

    it('Put, get, then delete', done => {
        params.output = `bkt${params.bucketsNb}_throughput`;
        process.nextTick(runS3Blaster.start, params, done);
    });
});


text:
import { DataSourceCollection, defer } from "../../Source/Cesium.js";
import MockDataSource from "../MockDataSource.js";

describe("DataSources/DataSourceCollection", function () {
  it("contains, get, getLength, and indexOf work", function () {
    const collection = new DataSourceCollection();
    const source = new MockDataSource();

    expect(collection.length).toEqual(0);
    expect(collection.contains(source)).toEqual(false);

    return Promise.all([
      collection.add(new MockDataSource()),
      collection.add(source),
      collection.add(new MockDataSource()),
    ]).then(function () {
      expect(collection.length).toEqual(3);
      expect(collection.get(1)).toBe(source);
      expect(collection.indexOf(source)).toEqual(1);
      expect(collection.contains(source)).toEqual(true);

      collection.remove(collection.get(0));
      expect(collection.indexOf(source)).toEqual(0);

      expect(collection.remove(source)).toEqual(true);
      expect(collection.contains(source)).toEqual(false);
    });
  });

  it("getByName works", function () {
    const collection = new DataSourceCollection();
    const promises = [];
    const source1 = new MockDataSource();
    source1.name = "Name1";
    promises.push(collection.add(source1));

    const source2 = new MockDataSource();
    source2.name = "Name1";
    promises.push(collection.add(source2));

    const source3 = new MockDataSource();
    source3.name = "Name2";
    promises.push(collection.add(source3));

    return Promise.all(promises).then(function () {
      const res = collection.getByName("Name1");
      expect(res.length).toEqual(2);
      expect(res[0].name).toEqual("Name1");
      expect(res[1].name).toEqual("Name1");
    });
  });

  it("add and remove events work", function () {
    const source = new MockDataSource();
    const collection = new DataSourceCollection();

    const addSpy = jasmine.createSpy("dataSourceAdded");
    collection.dataSourceAdded.addEventListener(addSpy);

    const removeSpy = jasmine.createSpy("dataSourceRemoved");
    collection.dataSourceRemoved.addEventListener(removeSpy);

    return collection.add(source).then(function () {
      expect(addSpy).toHaveBeenCalledWith(collection, source);
      expect(removeSpy).not.toHaveBeenCalled();

      addSpy.calls.reset();
      removeSpy.calls.reset();

      expect(collection.remove(source)).toEqual(true);
      expect(addSpy).not.toHaveBeenCalled();
      expect(removeSpy).toHaveBeenCalledWith(collection, source);
    });
  });

  it("move event works", function () {
    const source = new MockDataSource();
    const collection = new DataSourceCollection();
    const moveSpy = jasmine.createSpy("dataSourceMoved");
    collection.dataSourceMoved.addEventListener(moveSpy);
    return collection
      .add(source)
      .then(function () {
        collection.raise(source);
        collection.lower(source);
        collection.raiseToTop(source);
        collection.lowerToBottom(source);

        expect(moveSpy).not.toHaveBeenCalled();

        return Promise.all([
          collection.add(new MockDataSource()),
          collection.add(new MockDataSource()),
        ]);
      })
      .then(function () {
        collection.raise(source);
        expect(moveSpy).toHaveBeenCalledWith(source, 1, 0);

        collection.lower(source);
        expect(moveSpy).toHaveBeenCalledWith(source, 0, 1);

        collection.raiseToTop(source);
        expect(moveSpy).toHaveBeenCalledWith(source, 2, 0);

        collection.lowerToBottom(source);
        expect(moveSpy).toHaveBeenCalledWith(source, 0, 2);
      });
  });

  it("add works with promise", function () {
    const deferred = defer();
    const source = new MockDataSource();
    const collection = new DataSourceCollection();

    const addSpy = jasmine.createSpy("dataSourceAdded");
    collection.dataSourceAdded.addEventListener(addSpy);
    const promise = collection.add(deferred.promise);

    expect(collection.length).toEqual(0);
    expect(addSpy).not.toHaveBeenCalled();

    deferred.resolve(source);
    return promise.then(function () {
      expect(addSpy).toHaveBeenCalledWith(collection, source);
      expect(collection.length).toEqual(1);
    });
  });

  it("promise does not get added if not resolved before removeAll", function () {
    const deferred = defer();
    const source = new MockDataSource();
    const collection = new DataSourceCollection();

    const addSpy = jasmine.createSpy("dataSourceAdded");
    collection.dataSourceAdded.addEventListener(addSpy);
    const promise = collection.add(deferred.promise);
    expect(collection.length).toEqual(0);

    expect(addSpy).not.toHaveBeenCalled();
    collection.removeAll();

    deferred.resolve(source);
    return promise.then(function () {
      expect(addSpy).not.toHaveBeenCalled();
      expect(collection.length).toEqual(0);
    });
  });

  it("removeAll triggers events", function () {
    const sources = [
      new MockDataSource(),
      new MockDataSource(),
      new MockDataSource(),
    ];
    const collection = new DataSourceCollection();

    let removeCalled = 0;
    collection.dataSourceRemoved.addEventListener(function (
      sender,
      dataSource
    ) {
      expect(sender).toBe(collection);
      expect(sources.indexOf(dataSource)).not.toEqual(-1);
      removeCalled++;
    });

    return Promise.all([
      collection.add(sources[0]),
      collection.add(sources[1]),
      collection.add(sources[2]),
    ]).then(function () {
      collection.removeAll();

      expect(collection.length).toEqual(0);
      expect(removeCalled).toEqual(sources.length);
    });
  });

  it("destroy triggers remove events and calls destroy", function () {
    const sources = [
      new MockDataSource(),
      new MockDataSource(),
      new MockDataSource(),
    ];
    const collection = new DataSourceCollection();

    let removeCalled = 0;
    collection.dataSourceRemoved.addEventListener(function (
      sender,
      dataSource
    ) {
      expect(sender).toBe(collection);
      expect(sources.indexOf(dataSource)).not.toEqual(-1);
      removeCalled++;
    });

    return Promise.all([
      collection.add(sources[0]),
      collection.add(sources[1]),
      collection.add(sources[2]),
    ]).then(function () {
      expect(collection.isDestroyed()).toEqual(false);
      collection.destroy();
      expect(collection.isDestroyed()).toEqual(true);
      expect(removeCalled).toEqual(sources.length);
      expect(sources[0].destroyed).toEqual(true);
      expect(sources[1].destroyed).toEqual(true);
      expect(sources[2].destroyed).toEqual(true);
    });
  });

  it("remove returns fails for non-member", function () {
    const collection = new DataSourceCollection();
    expect(collection.remove(new MockDataSource())).toEqual(false);
  });

  it("get throws if passed undefined", function () {
    const collection = new DataSourceCollection();
    expect(function () {
      collection.get(undefined);
    }).toThrowDeveloperError();
  });

  it("add throws if passed undefined", function () {
    const collection = new DataSourceCollection();
    expect(function () {
      collection.add(undefined);
    }).toThrowDeveloperError();
  });
});


text:
(function() {

  var module = angular.module('loom_remoteselect_directive', []);

  module.directive('loomRemoteselect',
      function($translate, remoteService) {
        return {
          templateUrl: 'sync/partials/remoteselect.tpl.html',
          link: function(scope) {
            scope.remoteService = remoteService;
            scope.selectedRepo = null;
            scope.finish = function() {
              $('#remoteSelectDialog').modal('toggle');
              remoteService.verificationResult.resolve(scope.selectedRepo);
              scope.selectedRepo = null;
            };
          }
        };
      }
  );
})();


text:
ForecastCFML
=========
ForecastCFML is a wrapper for the Forecast.io v2 api. Forecast.io claims to be "The easiest, most advanced, weather API on the web". https://developer.forecast.io/

Usage
-----------

You need an account with Forecast.io.
In the ```config.cfc```, replace _YOUR_APIKEY_GOES_HERE_ with your valid api key along with your _latitude_ and _longitude_
You may find your citys' coordinates by going to [LatLong.net.](http://www.latlong.net/)

To use, call the ```getWeather()``` function which takes four arguments:
* baseURL (required, which is _https://api.forecast.io/forecast_)
* apiKey (required)
* latitude (required)
* longitude (required)

Output
----
After plugging in with your parameters, code will generate this.

![this.](https://cloud.githubusercontent.com/assets/4027889/16498972/4c0cf05a-3ecc-11e6-9d8e-c2faa64f4e8b.PNG)

Scripts
----
css
---
* [Picnic](http://picnicss.com/)
* [Pure](http://purecss.io/)

js
---
* [Skycons](https://darkskyapp.github.io/skycons/)

Version
----

1.0 Written by DannyD

2.0 Written by [damiththa](https://github.com/damiththa)

License
----

Apache

Testing
----

Tested against Railo 4. Should work with ColdFusion (might have to import the https cert for https://api.forecast.io/forecast).


text:
<?php

namespace tests\codeception\_pages\user;

use yii\codeception\BasePage;

/**
 * Represents login page
 * @property \AcceptanceTester|\FunctionalTester $actor
 */
class SignupPage extends BasePage
{
    public $route = 'user/default/signup';

    /**
     * @param array $signupData
     */
    public function submit(array $signupData)
    {
        foreach ($signupData as $field => $value) {
            $inputType = $field === 'body' ? 'textarea' : 'input';
            $this->actor->fillField($inputType . '[name="SignupForm[' . $field . ']"]', $value);
        }
        $this->actor->click('signup-button');
    }
}


text:
using System;
using starshipxac.Shell.PropertySystem.Interop;

namespace starshipxac.Shell.PropertySystem
{
    /// <summary>
    ///     Define the attributes of the <c>TypeInfo</c> element in the property's <c>.propdesc</c> file.
    /// </summary>
    [Flags]
    public enum PropertyTypeFlags
    {
        Default = PROPDESC_TYPE_FLAGS.PDTF_DEFAULT,

        MultipleValues = PROPDESC_TYPE_FLAGS.PDTF_MULTIPLEVALUES,

        IsInnate = PROPDESC_TYPE_FLAGS.PDTF_ISINNATE,

        IsGroup = PROPDESC_TYPE_FLAGS.PDTF_ISGROUP,

        CanGroupBy = PROPDESC_TYPE_FLAGS.PDTF_CANGROUPBY,

        CanStackBy = PROPDESC_TYPE_FLAGS.PDTF_CANSTACKBY,

        IsTreeProperty = PROPDESC_TYPE_FLAGS.PDTF_ISTREEPROPERTY,

        IncludeInFullTextQuery = PROPDESC_TYPE_FLAGS.PDTF_INCLUDEINFULLTEXTQUERY,

        IsViewable = PROPDESC_TYPE_FLAGS.PDTF_ISVIEWABLE,

        IsQueryable = PROPDESC_TYPE_FLAGS.PDTF_ISQUERYABLE,

        CanBePurged = PROPDESC_TYPE_FLAGS.PDTF_CANBEPURGED,

        IsSystemProperty = PROPDESC_TYPE_FLAGS.PDTF_ISSYSTEMPROPERTY,

        MaskAll = PROPDESC_TYPE_FLAGS.PDTF_MASK_ALL,
    }
}


text:
// **********************************************************************
//
// <copyright>
//
//  BBN Technologies
//  10 Moulton Street
//  Cambridge, MA 02138
//  (617) 873-8000
//
//  Copyright (C) BBNT Solutions LLC. All rights reserved.
//
// </copyright>
// **********************************************************************
//
// $Source: /cvs/distapps/openmap/src/openmap/com/bbn/openmap/layer/mif/MIFPoint.java,v $
// $RCSfile: MIFPoint.java,v $
// $Revision: 1.4 $
// $Date: 2005/08/11 20:39:18 $
// $Author: dietrick $
//
// **********************************************************************

package com.bbn.openmap.layer.mif;

import java.awt.Graphics;

import com.bbn.openmap.omGraphics.OMPoint;
import com.bbn.openmap.proj.Projection;

/**
 * Extension of OMPoint to provide basic support to ensure that the
 * screen will not become cluttered This extension of OMPoint defines
 * a property visibleScale. visibleScale is the OpenMap maximum scale
 * at which the point will be rendered all scale values after the
 * visibleScale value will result in the point to be rendered.
 *

 *
 * if visible scale is set to -1 the point will be rendered all all
 * scale levels.
 *
 * @author Simon Bowen
 */
public class MIFPoint extends OMPoint implements MIFGraphic,
        java.io.Serializable {

    /**
     * default visibleScale value is -1
     */
    private float visibleScale = -1;

    private boolean renderPoint = true;

    /**
     * @param lat the latitude to display the text string
     * @param lon the longitude to display the text string
     * @param visibleScale if visible scale is set to -1 the text will
     *        be rendered all all scale levels.
     */
    public MIFPoint(float lat, float lon, float visibleScale) {
        super(lat, lon);
        this.visibleScale = visibleScale;
    }

    /**
     * sets the scale at which the graphic becomes visible, if set to
     * -1 the graphic is visible at all scale levels.
     *
     * @param visibleScale
     */
    public void setVisibleScale(float visibleScale) {
        this.visibleScale = visibleScale;
    }

    public float getVisibleScale() {
        return this.visibleScale;
    }

    /**
     * Overriden from OMPoint so that we can handle a flag
     * renderPoint to signal to the render method if
     * the scale is appropriate to render the point or not.
     */
    public synchronized boolean generate(Projection proj) {
        if ((proj.getScale() <= getVisibleScale()) || (getVisibleScale() == -1)) {
            this.renderPoint = true;
        } else {
            this.renderPoint = false;
        }

        return super.generate(proj);
    }

    /**
     * Overriden from OMPoint so that we can handle a flag
     * renderPoint to determine if the point should be
     * rendered or not.
     */
    public synchronized void render(Graphics g) {
        if (renderPoint) {
            super.render(g);
        }
    }
}
/** Last line of file * */


text:
"""Public section, including homepage and signup."""
from flask import Blueprint, flash, redirect, render_template, request, url_for
from flask_login import login_required, login_user, logout_user

from stuart.extensions import login_manager
from stuart.forms.login_form import LoginForm
from stuart.forms.register_form import RegisterForm
from stuart.models.user import User
from stuart.utils import flash_errors

public_blueprint = Blueprint(
    'public',
    __name__,
    static_folder='../static')

@login_manager.user_loader
def load_user(user_id):
    """Load user by ID."""
    return User.get_by_id(int(user_id))

@public_blueprint.route('/', methods=['GET', 'POST'])
def home():
    """Home page."""
    form = LoginForm(request.form)
    # Handle logging in
    if request.method == 'POST':
        if form.validate_on_submit():
            login_user(form.user)
            flash('You are logged in.', 'success')
            redirect_url = request.args.get('next') or url_for('user.members')
            return redirect(redirect_url)
        else:
            flash_errors(form)
    return render_template('public/home.html', form=form)

@public_blueprint.route('/logout/')
@login_required
def logout():
    """Logout."""
    logout_user()
    flash('You are logged out.', 'info')
    return redirect(url_for('public.home'))

@public_blueprint.route('/register/', methods=['GET', 'POST'])
def register():
    """Register new user."""
    form = RegisterForm(request.form)
    if form.validate_on_submit():
        User.create(username=form.username.data, email=form.email.data, password=form.password.data, active=True)
        flash('Thank you for registering. You can now log in.', 'success')
        return redirect(url_for('public.home'))
    else:
        flash_errors(form)
    return render_template('public/register.html', form=form)

@public_blueprint.route('/about/')
def about():
    """About page."""
    form = LoginForm(request.form)
    return render_template('public/about.html', form=form)


text:
  Sully-sur-Loire est
      une commune géographiquement positionnée dans le département de Loiret en Centre. Elle comptait 5 795 habitants en 2008.

La commune propose de nombreux  équipements, elle propose entre autres deux bassins de natation, un terrain de tennis, trois terrains de sport et deux boucles de randonnée.

La ville dispose s'agissant de des études de un collège.
S'agissant les plus jeunes, la commune est pourvue de une maternelle et trois écoles primaires.
Sully-sur-Loire propose les installations éducatives permettant une vie àgréable.
Si vous avez un projet d'acquisition immobilière à Sully-sur-Loire, il est important regarder la qualité des écoles de la communes

À Sully-sur-Loire, le prix moyen à la vente d'un appartement se situe à 1 078 € du m² en vente. Le prix moyen d'une maison à l'achat se situe à 1 741 € du m². À la location la valorisation moyenne se situe à 7,23 € du m² mensuel.

À Sully-sur-Loire le salaire médian par mois par individu se situe à environ 2 045 €  net. Ceci est inférieur à la moyenne nationale.

Le parc de logements, à Sully-sur-Loire, était réparti en 2011 en 863 appartements et 1 935 maisons soit
 un marché relativement équilibré.

À coté de Sully-sur-Loire sont situées les villes de
Saint-Père-sur-Loire située à 1 km, 1 035 habitants,
Viglain à 6 km, 873 habitants,
Bonnée située à 4 km, 672 habitants,
Lion-en-Sullias à 9 km, 405 habitants,
Bouzy-la-Forêt située à 9 km, 1 117 habitants,
Villemurlin à 8 km, 537 habitants,
 entre autres. De plus, Sully-sur-Loire est située à seulement 20 km de Gien.


text:
package org.zuinnote.spark.bitcoin.example;

import static org.junit.jupiter.api.Assertions.assertEquals;

import java.util.ArrayList;

import scala.Tuple2;

import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;

import org.zuinnote.hadoop.bitcoin.format.common.BitcoinTransaction;
import org.zuinnote.hadoop.bitcoin.format.common.BitcoinBlockWritable;
import org.zuinnote.hadoop.bitcoin.format.common.BitcoinTransactionWritable;

public class SparkBitcoinBlockCounterTest  {

   @BeforeAll
    public static void oneTimeSetUp() {

    }

    @AfterAll
    public static void oneTimeTearDown() {
        // one-time cleanup code
      }

    @BeforeEach
    public void setUp() {
    }

    @AfterEach
    public void tearDown() {
    }

    @Test
    public void mapNoOfTransaction() {
	SparkBitcoinBlockCounter sparkTransformator = new SparkBitcoinBlockCounter();
	  BitcoinBlockWritable testBlock = new BitcoinBlockWritable();
	  BitcoinTransaction testTransaction = new BitcoinTransaction();
	  ArrayList<BitcoinTransaction> testTransactionList = new ArrayList<BitcoinTransaction>();
	  testTransactionList.add(testTransaction);
	  testBlock.setTransactions(testTransactionList);
	  Tuple2<String,Long> result = sparkTransformator.mapNoOfTransaction(testBlock);
	  assertEquals((long)1,(long)result._2(),"One transaction should have been mapped");
    }

    @Test
    public void reduceSumUpTransactions() {
	SparkBitcoinBlockCounter sparkTransformator = new SparkBitcoinBlockCounter();
	Long transactionCountA = new Long(1);
	Long transactionCountB = new Long(2);
	assertEquals((long)3,(long)sparkTransformator.reduceSumUpTransactions(transactionCountA,transactionCountB),"Transaction count should sum up to 3");
    }

}


text:
package mooklabs.nausicaamod.keysticksetc;

import mooklabs.mookcore.Unused;
import mooklabs.nausicaamod.Main;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.EntityRenderer;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.MouseHelper;
import net.minecraft.util.Vec3;

public class BasicGlider extends MooklabTickHandler {

	private EntityPlayer player;
	private EntityRenderer renderer;

	// vars(constants)
	private double maxSpeedSurv = .9;
	private double minSpeedSurv = .08;
	private float camRollAmount = 10;

	// for the gliderspeed
	public static double thrust = 0;
	public static double counter = 0;

	// changeing
	private double maxSpeed = .9;
	private double minSpeed = .08;

	private boolean slowFromRotation = false;

	private int mouseMoveCounter = 0;
	private float mouseMovement = 0;
	private float mouseMovementModifyer = 2;

	public BasicGlider(Minecraft mc) {
		super(mc);
		// TODO Auto-generated constructor stub
	}

	@Override
	public void tickStart() {
	}// nothing

	@Override
	public void tickEnd() {
		player = Minecraft.getMinecraft().thePlayer;
		if (player != null) {
			if (player.getCurrentEquippedItem() != null) {
				// System.out.println(player.getCurrentEquippedItem().itemID);

				if (player.getCurrentEquippedItem().getItem() == Main.glider && Main.enableGlider) {
					// player.addChatMessage("glider active!");
					tiltScreen();

					renderer = Minecraft.getMinecraft().entityRenderer;
					double downforce = .5-BasicGlider.thrust/10;
					if(downforce<0)downforce = 0;
					Vec3 desiredDirection = player.getLookVec().addVector(0, downforce, 0).normalize();
					// SPeed? System.out.println(player.getLookVec().lengthVector());

					boolean nokeysdown = (MookKeyHandler.upKey && MookKeyHandler.downKey);// dont need stearing for this
					if (nokeysdown) {
						slowdown(); // if not accel, slow down
					} else {// check for what key and change movements
						if (player.capabilities.isCreativeMode) {
							maxSpeed = 30;
							minSpeed = 0;
						} else {
							maxSpeed = maxSpeedSurv;
							minSpeed = minSpeedSurv;
							if (BasicGlider.thrust > maxSpeed) BasicGlider.thrust = maxSpeed;
						}// make creative go much faster

						if (MookKeyHandler.upKey) {
							if (BasicGlider.thrust < maxSpeed) BasicGlider.thrust += 0.01;
							BasicGlider.counter = 1;
							//TODO lower fuel
						}
						if (MookKeyHandler.downKey) {
							if (BasicGlider.thrust > minSpeed) BasicGlider.thrust -= 0.01;
							BasicGlider.counter = 1;
						}
						if (MookKeyHandler.leftKey) {
							BasicGlider.thrust = this.minSpeed;
						}
						if (MookKeyHandler.rightKey) {
							if (BasicGlider.thrust < maxSpeed) BasicGlider.thrust = this.maxSpeed / 10;
						}

						double vx = BasicGlider.thrust * desiredDirection.xCoord;
						double vy = BasicGlider.thrust * desiredDirection.yCoord;
						double vz = BasicGlider.thrust * desiredDirection.zCoord;
						if (slowFromRotation) {
							vx *= .7;
							vy *= .7;
							vz *= .7;
						}
						player.motionX = vx;
						player.motionY = vy;
						player.motionZ = vz;
						// NOPE System.out.println( Math.pow(vx*vx+vy*vy+vz*vz,1/3));//(double)Math.pow(Math.abs(Math.pow(vx,2)+Math.pow(vy,2)+Math.pow(vz,2)),1/2));

					}
				}

				else {// if not glideing
					player = Minecraft.getMinecraft().thePlayer;
					if (player != null) {
						renderer = Minecraft.getMinecraft().entityRenderer;
						//renderer.camRoll = 0;
					}
				}
			}
		}
	}

	int prevDeltaX;

	/**
	 * this tilts the screen and makes you slow down(not yet)
	 */
	private void tiltScreen() {
		MouseHelper mouse = Minecraft.getMinecraft().mouseHelper;
		EntityRenderer renderer = Minecraft.getMinecraft().entityRenderer;

		prevDeltaX = mouse.deltaX;

		// if (mouseMoveCounter == 1) {
		// renderer.camRoll = (float) (mouseMovement + renderer.prevCamRoll) / 2;
		// }
		// mouseMovement = (float) ((prevDeltaX + mouse.deltaX) / mouseMovementModifyer);
		// renderer.camRoll = (mouseMovement+ prevDeltaX)/2;

		// System.out.println(mouse.deltaX);

		// if(renderer.camRoll<mouse.deltaX)
		// renderer.camRoll = (float) smooth(mouse.deltaX,.5F);
		// if((mouse.deltaX < 10) && renderer.camRoll != 0)
		// renderer.camRoll -= 1;

		// if((-10 < mouse.deltaX) && renderer.camRoll != 0)
		// renderer.camRoll += 10;

		// mouseMoveCounter = 0;
		// }
		// mouseMoveCounter++;
		// mouseMovement = (float) ((prevDeltaX + mouse.deltaX) / mouseMovementModifyer);
		/*if(mouse.deltaX>-1 || mouse.deltaX < 1) slowFromRotation = true; else slowFromRotation = false; */
	}

	private float a;
	private float b;
	private float c;

	/**
	 * Smooths mouse input
	 */
	// TODO finish this
	public float smooth(float par1, float par2) {
		this.a += par1;
		par1 = (this.a - this.b) * par2;
		this.c += (par1 - this.c) * 0.5F;

		if (par1 > 0.0F && par1 > this.c || par1 < 0.0F && par1 < this.c) {
			par1 = this.c;
		}

		this.b += par1;
		return par1;
	}

	@Unused
	public String getLabel() {
		return "NausicaaMod_Glider";
	}

	public void slowdown() {
		if (BasicGlider.counter > .1) {// && this.thrust > minSpeed)
			BasicGlider.counter -= .01;
			if (BasicGlider.thrust > minSpeed) BasicGlider.thrust -= .005;
		}
	}

	/**
	 * Sets the rotation of the entity not public in Entity.java
	 */
	protected void setYaw(float yaw) {
		player.rotationYaw = yaw % 360.0F;
	}

}


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

    <title>GroovySourceSet (Gradle API 2.3)</title>
    <meta name="date" content="2015-02-16">
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <link href="../../../../groovy.ico" type="image/x-icon" rel="shortcut icon">
    <link href="../../../../groovy.ico" type="image/x-icon" rel="icon">
    <link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Overview

Package

Class

Deprecated

Index

Help

Frames

No Frames

Summary:

            Nested   Field
Method

 | Detail:

            Field
Method

Package: org.gradle.api.tasks

[Java] Interface GroovySourceSet

 A GroovySourceSetConvention defines the properties and methods added to a SourceSet by the GroovyPlugin.

Methods Summary

Methods

                            Type
                            Name and description

                            SourceDirectorySet
                            getAllGroovy()
All Groovy source for this source set.

                            SourceDirectorySet
                            getGroovy()
Returns the source to be compiled by the Groovy compiler for this source set.

                            GroovySourceSet
                            groovy(Closure configureClosure)
Configures the Groovy source for this set.

Method Detail

public SourceDirectorySet getAllGroovy()

 All Groovy source for this source set.

Returns:

the Groovy source. Never returns null.

public SourceDirectorySet getGroovy()

 Returns the source to be compiled by the Groovy compiler for this source set. Any Java source present in this set
 will be passed to the Groovy compiler for joint compilation.

Returns:

The Groovy/Java source. Never returns null.

public GroovySourceSet groovy(Closure configureClosure)

 Configures the Groovy source for this set.

The given closure is used to configure the SourceDirectorySet which contains the Groovy source.

Parameters:

configureClosure -  The closure to use to configure the Groovy source.

Returns:

this

Overview

Package

Class

Deprecated

Index

Help

Frames

No Frames

Summary:

            Nested   Field
Method

 | Detail:

            Field
Method

Gradle API 2.3


text:
using System;
using System.Xml;
using System.Xml.Serialization;
using System.Collections.Generic;
using System.IO;
using System.Net;

namespace Moscrif.IDE.Iface.Entities
{

	public class ProxySetting
	{
		public ProxySetting(){
			ProxyType = ProxyTyp.SYSTEM;
			Proxy="";
			Password="";
		}

		public enum ProxyTyp{
			[XmlEnum("0")]
			NOPROXY = 0,
			[XmlEnum("1")]
			SYSTEM = 1,
			[XmlEnum("2")]
			CUSTON = 2
		}

		[XmlAttribute("proxyType")]
		public ProxyTyp ProxyType;

		[XmlAttribute("proxy")]
		public string Proxy;

		[XmlAttribute("port")]
		public int Port;

		[XmlAttribute("name")]
		public string Name;

		[XmlAttribute("password")]
		public string Password;
	}

}


text:
QT_BEGIN_NAMESPACE

class uiAtpCompanyPoints {
public:
	QGridLayout *gridLayout;
	QLineEdit *editPrice2;
	QLineEdit *editPrice1;
	QHBoxLayout *horizontalLayout;
	QPushButton *buttonOk;
	QPushButton *buttonNew;
	QPushButton *buttonDelete;
	QPushButton *buttonEdit;
	QPushButton *buttonCancel;
	QLineEdit *editName;
	QLabel *label_3;
	QTableView *tablePoint;
	QLabel *label;
	QLineEdit *editSearch;
	QLabel *label_2;
	QLabel *label_4;

	void setupUi(QWidget *AtpModulesPoints){
		if (AtpModulesPoints->objectName().isEmpty())
			AtpModulesPoints->setObjectName(QStringLiteral("AtpModulesPoints"));
		AtpModulesPoints->resize(639, 379);
		AtpModulesPoints->setWindowTitle("Company Point price editor");

		gridLayout = new QGridLayout(AtpModulesPoints);
		gridLayout->setObjectName(QStringLiteral("gridLayout"));

		editPrice2 = new QLineEdit(AtpModulesPoints);
		editPrice2->setObjectName(QStringLiteral("editPrice2"));
		QSizePolicy sizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
		sizePolicy.setHorizontalStretch(0);
		sizePolicy.setVerticalStretch(0);
		sizePolicy.setHeightForWidth(editPrice2->sizePolicy().hasHeightForWidth());
		editPrice2->setSizePolicy(sizePolicy);
		gridLayout->addWidget(editPrice2, 5, 3, 1, 1);

		editPrice1 = new QLineEdit(AtpModulesPoints);
		editPrice1->setObjectName(QStringLiteral("editPrice1"));
		sizePolicy.setHeightForWidth(editPrice1->sizePolicy().hasHeightForWidth());
		editPrice1->setSizePolicy(sizePolicy);
		gridLayout->addWidget(editPrice1, 5, 2, 1, 1);

		horizontalLayout = new QHBoxLayout();
		horizontalLayout->setObjectName(QStringLiteral("horizontalLayout"));
		buttonOk = new QPushButton(AtpModulesPoints);
		buttonOk->setObjectName(QStringLiteral("buttonOk"));
		sizePolicy.setHeightForWidth(buttonOk->sizePolicy().hasHeightForWidth());
		buttonOk->setSizePolicy(sizePolicy);
		buttonOk->setText("&Ok");
		horizontalLayout->addWidget(buttonOk);

		buttonNew = new QPushButton(AtpModulesPoints);
		buttonNew->setObjectName(QStringLiteral("buttonNew"));
		sizePolicy.setHeightForWidth(buttonNew->sizePolicy().hasHeightForWidth());
		buttonNew->setSizePolicy(sizePolicy);
		buttonNew->setText("&New");
		horizontalLayout->addWidget(buttonNew);

		buttonDelete = new QPushButton(AtpModulesPoints);
		buttonDelete->setObjectName(QStringLiteral("buttonDelete"));
		sizePolicy.setHeightForWidth(buttonDelete->sizePolicy().hasHeightForWidth());
		buttonDelete->setSizePolicy(sizePolicy);
		buttonDelete->setText("&Delete");
		horizontalLayout->addWidget(buttonDelete);

		buttonEdit = new QPushButton(AtpModulesPoints);
		buttonEdit->setObjectName(QStringLiteral("buttonEdit"));
		sizePolicy.setHeightForWidth(buttonEdit->sizePolicy().hasHeightForWidth());
		buttonEdit->setSizePolicy(sizePolicy);
		buttonEdit->setText("&Edit");
		horizontalLayout->addWidget(buttonEdit);

		buttonCancel = new QPushButton(AtpModulesPoints);
		buttonCancel->setObjectName(QStringLiteral("buttonCancel"));
		sizePolicy.setHeightForWidth(buttonCancel->sizePolicy().hasHeightForWidth());
		buttonCancel->setSizePolicy(sizePolicy);
		buttonCancel->setText("&Cancel");
		horizontalLayout->addWidget(buttonCancel);

		gridLayout->addLayout(horizontalLayout, 6, 1, 1, 2);

		editName = new QLineEdit(AtpModulesPoints);
		editName->setObjectName(QStringLiteral("editName"));
		gridLayout->addWidget(editName, 5, 0, 1, 2);

		label_3 = new QLabel(AtpModulesPoints);
		label_3->setObjectName(QStringLiteral("label_3"));
		label_3->setAlignment(Qt::AlignCenter);
		label_3->setText("Point price:");
		gridLayout->addWidget(label_3, 4, 2, 1, 2);

		tablePoint = new QTableView(AtpModulesPoints);
		tablePoint->setObjectName(QStringLiteral("tablePoint"));
		gridLayout->addWidget(tablePoint, 3, 0, 1, 4);

		label = new QLabel(AtpModulesPoints);
		label->setObjectName(QStringLiteral("label"));
		label->setText("Search:");
		gridLayout->addWidget(label, 1, 0, 1, 1);

		editSearch = new QLineEdit(AtpModulesPoints);
		editSearch->setObjectName(QStringLiteral("editSearch"));
		gridLayout->addWidget(editSearch, 2, 0, 1, 4);

		label_2 = new QLabel(AtpModulesPoints);
		label_2->setObjectName(QStringLiteral("label_2"));
		label_2->setText("Point name:");
		gridLayout->addWidget(label_2, 4, 0, 1, 1);

		label_4 = new QLabel(AtpModulesPoints);
		label_4->setObjectName(QStringLiteral("label_4"));
		QFont font;
		font.setPointSize(14);
		label_4->setFont(font);
		label_4->setAlignment(Qt::AlignCenter);
		label_4->setText("Points editor");
		gridLayout->addWidget(label_4, 0, 0, 1, 4);
	} // setupUi

	void enableAndDisable(QString condition){
		if (condition == "reset"){
			enableAndDisable("resetButtons");
			enableAndDisable("disableFields");
			enableAndDisable("clearFields");
		} else if (condition == "resetButtons"){
			buttonNew->setText("New");
			buttonNew->setEnabled(true);
			buttonEdit->setText("Edit");
			buttonEdit->setEnabled(false);
			buttonDelete->setEnabled(false);
		} else if (condition == "disableFields"){
			editPrice2->setEnabled(false);
			editPrice1->setEnabled(false);
			editName->setEnabled(false);
			editSearch->setEnabled(true);
			editSearch->clear();
			tablePoint->setEnabled(true);
		} else if (condition == "enableFields"){
			editName->setEnabled(true);
			editPrice1->setEnabled(true);
			editPrice2->setEnabled(true);
			editSearch->setEnabled(false);
			tablePoint->setEnabled(false);
		} else if (condition == "clearFields"){
			editName->clear();
			editPrice1->clear();
			editPrice2->clear();
			editSearch->clear();
			tablePoint->clearSelection();
		} else if (condition == "edit"){
			buttonEdit->setText("Save");
			buttonDelete->setEnabled(false);
			buttonNew->setEnabled(false);
			enableAndDisable("enableFields");
		} else if (condition == "new") {
			buttonNew->setText("Save");
			buttonDelete->setEnabled(false);
			buttonEdit->setEnabled(false);
			editSearch->setEnabled(false);
			enableAndDisable("clearFields");
			enableAndDisable("enableFields");
		}
	}
};

namespace Ui {
	class AtpCompanyPoints: public uiAtpCompanyPoints {};
} // namespace Ui

QT_END_NAMESPACE

#endif // UIATPCOMPANYPOINTS


text:
#import "CC3Environment.h"

@interface AppDelegate : NSObject <NSApplicationDelegate> {
	NSWindow* _window;
	CCGLView* _glView;
}

/** The window in which the app is displayed. */
@property (strong) IBOutlet NSWindow* window;

/** The view in which the 3D scene is displayed. */
@property (strong) IBOutlet CCGLView* glView;

/** Toggles the screen between standard and full-screen. */
-(IBAction) toggleFullScreen: (id) sender;

@end


text:
import unaryBy = require( './index' );

/**
* Evaluates the identity function.
*
* @param x - input value
* @returns input value
*/
function identity( x: number ): number {
	return x;
}

// TESTS //

// The function returns `undefined`...
{
	const x = new Float64Array( 10 );
	const y = new Float64Array( 10 );

	const arrays = [ x, y ];
	const shape = [ 10 ];
	const strides = [ 1, 1 ];

	unaryBy( arrays, shape, strides, identity, identity ); // $ExpectType void
	unaryBy( arrays, shape, strides, identity, identity, {} ); // $ExpectType void
}

// The compiler throws an error if the function is provided a first argument which is not an array-like object containing array-like objects...
{
	const shape = [ 10 ];
	const strides = [ 1, 1 ];

	unaryBy( 5, shape, strides, identity, identity ); // $ExpectError
	unaryBy( true, shape, strides, identity, identity ); // $ExpectError
	unaryBy( false, shape, strides, identity, identity ); // $ExpectError
	unaryBy( null, shape, strides, identity, identity ); // $ExpectError
	unaryBy( undefined, shape, strides, identity, identity ); // $ExpectError
	unaryBy( {}, shape, strides, identity, identity ); // $ExpectError
	unaryBy( [ 1 ], shape, strides, identity, identity ); // $ExpectError
	unaryBy( ( x: number ): number => x, shape, strides, identity, identity ); // $ExpectError

	unaryBy( 5, shape, strides, identity, identity, {} ); // $ExpectError
	unaryBy( true, shape, strides, identity, identity, {} ); // $ExpectError
	unaryBy( false, shape, strides, identity, identity, {} ); // $ExpectError
	unaryBy( null, shape, strides, identity, identity, {} ); // $ExpectError
	unaryBy( undefined, shape, strides, identity, identity, {} ); // $ExpectError
	unaryBy( {}, shape, strides, identity, identity, {} ); // $ExpectError
	unaryBy( [ 1 ], shape, strides, identity, identity, {} ); // $ExpectError
	unaryBy( ( x: number ): number => x, shape, strides, identity, identity, {} ); // $ExpectError
}

// The compiler throws an error if the function is provided a second argument which is not an array-like object containing numbers...
{
	const x = new Float64Array( 10 );
	const y = new Float64Array( 10 );

	const arrays = [ x, y ];
	const strides = [ 1, 1 ];

	unaryBy( arrays, '10', strides, identity, identity ); // $ExpectError
	unaryBy( arrays, 10, strides, identity, identity ); // $ExpectError
	unaryBy( arrays, true, strides, identity, identity ); // $ExpectError
	unaryBy( arrays, false, strides, identity, identity ); // $ExpectError
	unaryBy( arrays, null, strides, identity, identity ); // $ExpectError
	unaryBy( arrays, undefined, strides, identity, identity ); // $ExpectError
	unaryBy( arrays, [ '1' ], strides, identity, identity ); // $ExpectError
	unaryBy( arrays, {}, strides, identity, identity ); // $ExpectError
	unaryBy( arrays, ( x: number ): number => x, strides, identity, identity ); // $ExpectError

	unaryBy( arrays, '10', strides, identity, identity, {} ); // $ExpectError
	unaryBy( arrays, 10, strides, identity, identity, {} ); // $ExpectError
	unaryBy( arrays, true, strides, identity, identity, {} ); // $ExpectError
	unaryBy( arrays, false, strides, identity, identity, {} ); // $ExpectError
	unaryBy( arrays, null, strides, identity, identity, {} ); // $ExpectError
	unaryBy( arrays, undefined, strides, identity, identity, {} ); // $ExpectError
	unaryBy( arrays, [ '1' ], strides, identity, identity, {} ); // $ExpectError
	unaryBy( arrays, {}, strides, identity, identity, {} ); // $ExpectError
	unaryBy( arrays, ( x: number ): number => x, strides, identity, identity, {} ); // $ExpectError
}

// The compiler throws an error if the function is provided a third argument which is not an array-like object containing numbers...
{
	const x = new Float64Array( 10 );
	const y = new Float64Array( 10 );

	const arrays = [ x, y ];
	const shape = [ 10 ];

	unaryBy( arrays, shape, '10', identity, identity ); // $ExpectError
	unaryBy( arrays, shape, 5, identity, identity ); // $ExpectError
	unaryBy( arrays, shape, true, identity, identity ); // $ExpectError
	unaryBy( arrays, shape, false, identity, identity ); // $ExpectError
	unaryBy( arrays, shape, null, identity, identity ); // $ExpectError
	unaryBy( arrays, shape, undefined, identity, identity ); // $ExpectError
	unaryBy( arrays, shape, [ '1' ], identity, identity ); // $ExpectError
	unaryBy( arrays, shape, {}, identity, identity ); // $ExpectError
	unaryBy( arrays, shape, ( x: number ): number => x, identity, identity ); // $ExpectError

	unaryBy( arrays, shape, '10', identity, identity, {} ); // $ExpectError
	unaryBy( arrays, shape, 5, identity, identity, {} ); // $ExpectError
	unaryBy( arrays, shape, true, identity, identity, {} ); // $ExpectError
	unaryBy( arrays, shape, false, identity, identity, {} ); // $ExpectError
	unaryBy( arrays, shape, null, identity, identity, {} ); // $ExpectError
	unaryBy( arrays, shape, undefined, identity, identity, {} ); // $ExpectError
	unaryBy( arrays, shape, [ '1' ], identity, identity, {} ); // $ExpectError
	unaryBy( arrays, shape, {}, identity, identity, {} ); // $ExpectError
	unaryBy( arrays, shape, ( x: number ): number => x, identity, identity, {} ); // $ExpectError
}

// The compiler throws an error if the function is provided a fourth argument which is not a unary function...
{
	const x = new Float64Array( 10 );
	const y = new Float64Array( 10 );

	const arrays = [ x, y ];
	const shape = [ 10 ];
	const strides = [ 1, 1 ];

	unaryBy( arrays, shape, strides, '10', identity ); // $ExpectError
	unaryBy( arrays, shape, strides, 5, identity ); // $ExpectError
	unaryBy( arrays, shape, strides, true, identity ); // $ExpectError
	unaryBy( arrays, shape, strides, false, identity ); // $ExpectError
	unaryBy( arrays, shape, strides, null, identity ); // $ExpectError
	unaryBy( arrays, shape, strides, undefined, identity ); // $ExpectError
	unaryBy( arrays, shape, strides, [], identity ); // $ExpectError
	unaryBy( arrays, shape, strides, {}, identity ); // $ExpectError

	unaryBy( arrays, shape, strides, '10', identity, {} ); // $ExpectError
	unaryBy( arrays, shape, strides, 5, identity, {} ); // $ExpectError
	unaryBy( arrays, shape, strides, true, identity, {} ); // $ExpectError
	unaryBy( arrays, shape, strides, false, identity, {} ); // $ExpectError
	unaryBy( arrays, shape, strides, null, identity, {} ); // $ExpectError
	unaryBy( arrays, shape, strides, undefined, identity, {} ); // $ExpectError
	unaryBy( arrays, shape, strides, [], identity, {} ); // $ExpectError
	unaryBy( arrays, shape, strides, {}, identity, {} ); // $ExpectError
}

// The compiler throws an error if the function is provided a fifth argument which is not a function...
{
	const x = new Float64Array( 10 );
	const y = new Float64Array( 10 );

	const arrays = [ x, y ];
	const shape = [ 10 ];
	const strides = [ 1, 1 ];

	unaryBy( arrays, shape, strides, identity, '10' ); // $ExpectError
	unaryBy( arrays, shape, strides, identity, 5 ); // $ExpectError
	unaryBy( arrays, shape, strides, identity, true ); // $ExpectError
	unaryBy( arrays, shape, strides, identity, false ); // $ExpectError
	unaryBy( arrays, shape, strides, identity, null ); // $ExpectError
	unaryBy( arrays, shape, strides, identity, undefined ); // $ExpectError
	unaryBy( arrays, shape, strides, identity, [] ); // $ExpectError
	unaryBy( arrays, shape, strides, identity, {} ); // $ExpectError

	unaryBy( arrays, shape, strides, identity, '10', {} ); // $ExpectError
	unaryBy( arrays, shape, strides, identity, 5, {} ); // $ExpectError
	unaryBy( arrays, shape, strides, identity, true, {} ); // $ExpectError
	unaryBy( arrays, shape, strides, identity, false, {} ); // $ExpectError
	unaryBy( arrays, shape, strides, identity, null, {} ); // $ExpectError
	unaryBy( arrays, shape, strides, identity, undefined, {} ); // $ExpectError
	unaryBy( arrays, shape, strides, identity, [], {} ); // $ExpectError
	unaryBy( arrays, shape, strides, identity, {}, {} ); // $ExpectError
}

// The compiler throws an error if the function is provided an unsupported number of arguments...
{
	const x = new Float64Array( 10 );
	const y = new Float64Array( 10 );

	const arrays = [ x, y ];
	const shape = [ 10 ];
	const strides = [ 1, 1 ];

	unaryBy(); // $ExpectError
	unaryBy( arrays ); // $ExpectError
	unaryBy( arrays, shape ); // $ExpectError
	unaryBy( arrays, shape, strides ); // $ExpectError
	unaryBy( arrays, shape, strides, identity ); // $ExpectError
	unaryBy( arrays, shape, strides, identity, identity, identity, 10 ); // $ExpectError
}

// Attached to main export is an `ndarray` method which returns `undefined`...
{
	const x = new Float64Array( 10 );
	const y = new Float64Array( 10 );

	const arrays = [ x, y ];
	const shape = [ 10 ];
	const strides = [ 1, 1 ];
	const offsets = [ 0, 0 ];

	unaryBy.ndarray( arrays, shape, strides, offsets, identity, identity ); // $ExpectType void
	unaryBy.ndarray( arrays, shape, strides, offsets, identity, identity, {} ); // $ExpectType void
}

// The compiler throws an error if the `ndarray` method is provided a first argument which is not an array-like object containing array-like objects...
{
	const shape = [ 10 ];
	const strides = [ 1, 1 ];
	const offsets = [ 0, 0 ];

	unaryBy.ndarray( 5, shape, strides, offsets, identity, identity ); // $ExpectError
	unaryBy.ndarray( true, shape, strides, offsets, identity, identity ); // $ExpectError
	unaryBy.ndarray( false, shape, strides, offsets, identity, identity ); // $ExpectError
	unaryBy.ndarray( null, shape, strides, offsets, identity, identity ); // $ExpectError
	unaryBy.ndarray( undefined, shape, strides, offsets, identity, identity ); // $ExpectError
	unaryBy.ndarray( [ 1 ], shape, strides, offsets, identity, identity ); // $ExpectError
	unaryBy.ndarray( {}, shape, strides, offsets, identity, identity ); // $ExpectError
	unaryBy.ndarray( ( x: number ): number => x, shape, strides, offsets, identity, identity ); // $ExpectError

	unaryBy.ndarray( 5, shape, strides, offsets, identity, identity, {} ); // $ExpectError
	unaryBy.ndarray( true, shape, strides, offsets, identity, identity, {} ); // $ExpectError
	unaryBy.ndarray( false, shape, strides, offsets, identity, identity, {} ); // $ExpectError
	unaryBy.ndarray( null, shape, strides, offsets, identity, identity, {} ); // $ExpectError
	unaryBy.ndarray( undefined, shape, strides, offsets, identity, identity, {} ); // $ExpectError
	unaryBy.ndarray( [ 1 ], shape, strides, offsets, identity, identity, {} ); // $ExpectError
	unaryBy.ndarray( {}, shape, strides, offsets, identity, identity, {} ); // $ExpectError
	unaryBy.ndarray( ( x: number ): number => x, shape, strides, offsets, identity, identity, {} ); // $ExpectError
}

// The compiler throws an error if the `ndarray` method is provided a second argument which is not an array-like object containing numbers...
{
	const x = new Float64Array( 10 );
	const y = new Float64Array( 10 );

	const arrays = [ x, y ];
	const strides = [ 1, 1 ];
	const offsets = [ 0, 0 ];

	unaryBy.ndarray( arrays, '10', strides, offsets, identity, identity ); // $ExpectError
	unaryBy.ndarray( arrays, 10, strides, offsets, identity, identity ); // $ExpectError
	unaryBy.ndarray( arrays, true, strides, offsets, identity, identity ); // $ExpectError
	unaryBy.ndarray( arrays, false, strides, offsets, identity, identity ); // $ExpectError
	unaryBy.ndarray( arrays, null, strides, offsets, identity, identity ); // $ExpectError
	unaryBy.ndarray( arrays, undefined, strides, offsets, identity, identity ); // $ExpectError
	unaryBy.ndarray( arrays, [ '1' ], strides, offsets, identity, identity ); // $ExpectError
	unaryBy.ndarray( arrays, {}, strides, offsets, identity, identity ); // $ExpectError
	unaryBy.ndarray( arrays, ( x: number ): number => x, strides, offsets, identity, identity ); // $ExpectError

	unaryBy.ndarray( arrays, '10', strides, offsets, identity, identity, {} ); // $ExpectError
	unaryBy.ndarray( arrays, 10, strides, offsets, identity, identity, {} ); // $ExpectError
	unaryBy.ndarray( arrays, true, strides, offsets, identity, identity, {} ); // $ExpectError
	unaryBy.ndarray( arrays, false, strides, offsets, identity, identity, {} ); // $ExpectError
	unaryBy.ndarray( arrays, null, strides, offsets, identity, identity, {} ); // $ExpectError
	unaryBy.ndarray( arrays, undefined, strides, offsets, identity, identity, {} ); // $ExpectError
	unaryBy.ndarray( arrays, [ '1' ], strides, offsets, identity, identity, {} ); // $ExpectError
	unaryBy.ndarray( arrays, {}, strides, offsets, identity, identity, {} ); // $ExpectError
	unaryBy.ndarray( arrays, ( x: number ): number => x, strides, offsets, identity, identity, {} ); // $ExpectError
}

// The compiler throws an error if the `ndarray` method is provided a third argument which is not an array-like object containing numbers...
{
	const x = new Float64Array( 10 );
	const y = new Float64Array( 10 );

	const arrays = [ x, y ];
	const shape = [ 10 ];
	const offsets = [ 0, 0 ];

	unaryBy.ndarray( arrays, shape, '10', offsets, identity, identity ); // $ExpectError
	unaryBy.ndarray( arrays, shape, 5, offsets, identity, identity ); // $ExpectError
	unaryBy.ndarray( arrays, shape, true, offsets, identity, identity ); // $ExpectError
	unaryBy.ndarray( arrays, shape, false, offsets, identity, identity ); // $ExpectError
	unaryBy.ndarray( arrays, shape, null, offsets, identity, identity ); // $ExpectError
	unaryBy.ndarray( arrays, shape, undefined, offsets, identity, identity ); // $ExpectError
	unaryBy.ndarray( arrays, shape, [ '1' ], offsets, identity, identity ); // $ExpectError
	unaryBy.ndarray( arrays, shape, {}, offsets, identity, identity ); // $ExpectError
	unaryBy.ndarray( arrays, shape, ( x: number ): number => x, offsets, identity, identity ); // $ExpectError

	unaryBy.ndarray( arrays, shape, '10', offsets, identity, identity, {} ); // $ExpectError
	unaryBy.ndarray( arrays, shape, 5, offsets, identity, identity, {} ); // $ExpectError
	unaryBy.ndarray( arrays, shape, true, offsets, identity, identity, {} ); // $ExpectError
	unaryBy.ndarray( arrays, shape, false, offsets, identity, identity, {} ); // $ExpectError
	unaryBy.ndarray( arrays, shape, null, offsets, identity, identity, {} ); // $ExpectError
	unaryBy.ndarray( arrays, shape, undefined, offsets, identity, identity, {} ); // $ExpectError
	unaryBy.ndarray( arrays, shape, [ '1' ], offsets, identity, identity, {} ); // $ExpectError
	unaryBy.ndarray( arrays, shape, {}, offsets, identity, identity, {} ); // $ExpectError
	unaryBy.ndarray( arrays, shape, ( x: number ): number => x, offsets, identity, identity, {} ); // $ExpectError
}

// The compiler throws an error if the `ndarray` method is provided a fourth argument which is not an array-like object containing numbers...
{
	const x = new Float64Array( 10 );
	const y = new Float64Array( 10 );

	const arrays = [ x, y ];
	const shape = [ 10 ];
	const strides = [ 1, 1 ];

	unaryBy.ndarray( arrays, shape, strides, '10', identity, identity ); // $ExpectError
	unaryBy.ndarray( arrays, shape, strides, 5, identity, identity ); // $ExpectError
	unaryBy.ndarray( arrays, shape, strides, true, identity, identity ); // $ExpectError
	unaryBy.ndarray( arrays, shape, strides, false, identity, identity ); // $ExpectError
	unaryBy.ndarray( arrays, shape, strides, null, identity, identity ); // $ExpectError
	unaryBy.ndarray( arrays, shape, strides, undefined, identity, identity ); // $ExpectError
	unaryBy.ndarray( arrays, shape, strides, [ '1' ], identity, identity ); // $ExpectError
	unaryBy.ndarray( arrays, shape, strides, {}, identity, identity ); // $ExpectError
	unaryBy.ndarray( arrays, shape, strides, ( x: number ): number => x, identity, identity ); // $ExpectError

	unaryBy.ndarray( arrays, shape, strides, '10', identity, identity, {} ); // $ExpectError
	unaryBy.ndarray( arrays, shape, strides, 5, identity, identity, {} ); // $ExpectError
	unaryBy.ndarray( arrays, shape, strides, true, identity, identity, {} ); // $ExpectError
	unaryBy.ndarray( arrays, shape, strides, false, identity, identity, {} ); // $ExpectError
	unaryBy.ndarray( arrays, shape, strides, null, identity, identity, {} ); // $ExpectError
	unaryBy.ndarray( arrays, shape, strides, undefined, identity, identity, {} ); // $ExpectError
	unaryBy.ndarray( arrays, shape, strides, [ '1' ], identity, identity, {} ); // $ExpectError
	unaryBy.ndarray( arrays, shape, strides, {}, identity, identity, {} ); // $ExpectError
	unaryBy.ndarray( arrays, shape, strides, ( x: number ): number => x, identity, identity, {} ); // $ExpectError
}

// The compiler throws an error if the `ndarray` method is provided a fifth argument which is not a unary function...
{
	const x = new Float64Array( 10 );
	const y = new Float64Array( 10 );

	const arrays = [ x, y ];
	const shape = [ 10 ];
	const strides = [ 1, 1 ];
	const offsets = [ 0, 0 ];

	unaryBy.ndarray( arrays, shape, strides, offsets, '10', identity ); // $ExpectError
	unaryBy.ndarray( arrays, shape, strides, offsets, 5, identity ); // $ExpectError
	unaryBy.ndarray( arrays, shape, strides, offsets, true, identity ); // $ExpectError
	unaryBy.ndarray( arrays, shape, strides, offsets, false, identity ); // $ExpectError
	unaryBy.ndarray( arrays, shape, strides, offsets, null, identity ); // $ExpectError
	unaryBy.ndarray( arrays, shape, strides, offsets, undefined, identity ); // $ExpectError
	unaryBy.ndarray( arrays, shape, strides, offsets, [], identity ); // $ExpectError
	unaryBy.ndarray( arrays, shape, strides, offsets, {}, identity ); // $ExpectError

	unaryBy.ndarray( arrays, shape, strides, offsets, '10', identity, {} ); // $ExpectError
	unaryBy.ndarray( arrays, shape, strides, offsets, 5, identity, {} ); // $ExpectError
	unaryBy.ndarray( arrays, shape, strides, offsets, true, identity, {} ); // $ExpectError
	unaryBy.ndarray( arrays, shape, strides, offsets, false, identity, {} ); // $ExpectError
	unaryBy.ndarray( arrays, shape, strides, offsets, null, identity, {} ); // $ExpectError
	unaryBy.ndarray( arrays, shape, strides, offsets, undefined, identity, {} ); // $ExpectError
	unaryBy.ndarray( arrays, shape, strides, offsets, [], identity, {} ); // $ExpectError
	unaryBy.ndarray( arrays, shape, strides, offsets, {}, identity, {} ); // $ExpectError
}

// The compiler throws an error if the `ndarray` method is provided a sixth argument which is not a function...
{
	const x = new Float64Array( 10 );
	const y = new Float64Array( 10 );

	const arrays = [ x, y ];
	const shape = [ 10 ];
	const strides = [ 1, 1 ];
	const offsets = [ 0, 0 ];

	unaryBy.ndarray( arrays, shape, strides, offsets, identity, '10' ); // $ExpectError
	unaryBy.ndarray( arrays, shape, strides, offsets, identity, 5 ); // $ExpectError
	unaryBy.ndarray( arrays, shape, strides, offsets, identity, true ); // $ExpectError
	unaryBy.ndarray( arrays, shape, strides, offsets, identity, false ); // $ExpectError
	unaryBy.ndarray( arrays, shape, strides, offsets, identity, null ); // $ExpectError
	unaryBy.ndarray( arrays, shape, strides, offsets, identity, undefined ); // $ExpectError
	unaryBy.ndarray( arrays, shape, strides, offsets, identity, [] ); // $ExpectError
	unaryBy.ndarray( arrays, shape, strides, offsets, identity, {} ); // $ExpectError

	unaryBy.ndarray( arrays, shape, strides, offsets, identity, '10', {} ); // $ExpectError
	unaryBy.ndarray( arrays, shape, strides, offsets, identity, 5, {} ); // $ExpectError
	unaryBy.ndarray( arrays, shape, strides, offsets, identity, true, {} ); // $ExpectError
	unaryBy.ndarray( arrays, shape, strides, offsets, identity, false, {} ); // $ExpectError
	unaryBy.ndarray( arrays, shape, strides, offsets, identity, null, {} ); // $ExpectError
	unaryBy.ndarray( arrays, shape, strides, offsets, identity, undefined, {} ); // $ExpectError
	unaryBy.ndarray( arrays, shape, strides, offsets, identity, [], {} ); // $ExpectError
	unaryBy.ndarray( arrays, shape, strides, offsets, identity, {}, {} ); // $ExpectError
}

// The compiler throws an error if the `ndarray` method is provided an unsupported number of arguments...
{
	const x = new Float64Array( 10 );
	const y = new Float64Array( 10 );

	const arrays = [ x, y ];
	const shape = [ 10 ];
	const strides = [ 1, 1 ];
	const offsets = [ 0, 0 ];

	unaryBy.ndarray(); // $ExpectError
	unaryBy.ndarray( arrays ); // $ExpectError
	unaryBy.ndarray( arrays, shape ); // $ExpectError
	unaryBy.ndarray( arrays, shape, strides ); // $ExpectError
	unaryBy.ndarray( arrays, shape, strides, offsets ); // $ExpectError
	unaryBy.ndarray( arrays, shape, strides, offsets, identity ); // $ExpectError
	unaryBy.ndarray( arrays, shape, strides, offsets, identity, identity, identity, 10 ); // $ExpectError
}


text:
package commands

import (
	"fmt"
	"regexp"

	"github.com/github/hub/github"
	"github.com/github/hub/utils"
)

var cmdCheckout = &Command{
	Run:          checkout,
	GitExtension: true,
	Usage:        "checkout PULLREQ-URL [BRANCH]",
	Short:        "Switch the active branch to another branch",
	Long: `Checks out the head of the pull request as a local branch, to allow for
reviewing, rebasing and otherwise cleaning up the commits in the pull
request before merging. The name of the local branch can explicitly be
set with BRANCH.
`,
}

func init() {
	CmdRunner.Use(cmdCheckout)
}

/**
  $ gh checkout https://github.com/jingweno/gh/pull/73
  > git remote add -f -t feature git://github:com/foo/gh.git
  > git checkout --track -B foo-feature foo/feature

  $ gh checkout https://github.com/jingweno/gh/pull/73 custom-branch-name
**/
func checkout(command *Command, args *Args) {
	if !args.IsParamsEmpty() {
		err := transformCheckoutArgs(args)
		utils.Check(err)
	}
}

func transformCheckoutArgs(args *Args) error {
	words := args.Words()

	if len(words) == 0 {
		return nil
	}

	checkoutURL := words[0]
	var newBranchName string
	if len(words) > 1 {
		newBranchName = words[1]
	}

	url, err := github.ParseURL(checkoutURL)
	if err != nil {
		// not a valid GitHub URL
		return nil
	}

	pullURLRegex := regexp.MustCompile("^pull/(\\d+)")
	projectPath := url.ProjectPath()
	if !pullURLRegex.MatchString(projectPath) {
		// not a valid PR URL
		return nil
	}

	id := pullURLRegex.FindStringSubmatch(projectPath)[1]
	gh := github.NewClient(url.Project.Host)
	pullRequest, err := gh.PullRequest(url.Project, id)
	if err != nil {
		return err
	}

	if idx := args.IndexOfParam(newBranchName); idx >= 0 {
		args.RemoveParam(idx)
	}

	user, branch := parseUserBranchFromPR(pullRequest)
	if pullRequest.Head.Repo == nil {
		return fmt.Errorf("Error: %s's fork is not available anymore", user)
	}

	if newBranchName == "" {
		newBranchName = fmt.Sprintf("%s-%s", user, branch)
	}

	repo, err := github.LocalRepo()
	utils.Check(err)

	_, err = repo.RemoteByName(user)
	if err == nil {
		args.Before("git", "remote", "set-branches", "--add", user, branch)
		remoteURL := fmt.Sprintf("+refs/heads/%s:refs/remotes/%s/%s", branch, user, branch)
		args.Before("git", "fetch", user, remoteURL)
	} else {
		u := url.Project.GitURL(pullRequest.Head.Repo.Name, user, pullRequest.Head.Repo.Private)
		args.Before("git", "remote", "add", "-f", "-t", branch, user, u)
	}

	idx := args.IndexOfParam(checkoutURL)
	args.RemoveParam(idx)
	args.InsertParam(idx, "--track", "-B", newBranchName, fmt.Sprintf("%s/%s", user, branch))

	return nil
}


text:
.x-menu {
  border-color: #222;
  background-color: #414551;
  background-image: url(../images/access/menu/menu.gif); }

.x-menu-nosep {
  background-image: none; }

.x-menu-list-item {
  font: normal 14px tahoma,arial, sans-serif; }

.x-menu-item-arrow {
  background-image: url(../images/access/menu/menu-parent.gif); }

.x-menu-sep {
  background-color: #223;
  border-bottom-color: #666; }

a.x-menu-item {
  color: #fffff6; }

.x-menu-item-active {
  background-color: #f09134;
  background-image: none;
  border-color: #b36427; }

.x-menu-item-active a.x-menu-item {
  border-color: #b36427; }

.x-menu-check-item .x-menu-item-icon {
  background-image: url(../images/default/menu/unchecked.gif); }

.x-menu-item-checked .x-menu-item-icon {
  background-image: url(../images/default/menu/checked.gif); }

.x-menu-item-checked .x-menu-group-item .x-menu-item-icon {
  background-image: url(../images/access/menu/group-checked.gif); }

.x-menu-group-item .x-menu-item-icon {
  background-image: none; }

.x-menu-plain {
  background-color: #fff !important; }

.x-menu .x-date-picker {
  border-color: #a3bad9; }

.x-cycle-menu .x-menu-item-checked {
  border-color: #a3bae9 !important;
  background-color: #def8f6; }

.x-menu-scroller-top {
  background-image: url(../images/default/layout/mini-top.gif); }

.x-menu-scroller-bottom {
  background-image: url(../images/default/layout/mini-bottom.gif); }


text:
export const DOCICONURL_XLSX = 'https://static2.sharepointonline.com/files/fabric/assets/item-types/96/xlsx.png';
export const DOCICONURL_DOCX = 'https://static2.sharepointonline.com/files/fabric/assets/item-types/96/docx.png';
export const DOCICONURL_PPTX = 'https://static2.sharepointonline.com/files/fabric/assets/item-types/96/pptx.png';
export const DOCICONURL_MPPX = 'https://static2.sharepointonline.com/files/fabric/assets/item-types/96/mpp.png';
export const DOCICONURL_PHOTO = 'https://static2.sharepointonline.com/files/fabric/assets/item-types/96/photo.png';
export const DOCICONURL_PDF = 'https://static2.sharepointonline.com/files/fabric/assets/item-types/96/pdf.png';
export const DOCICONURL_TXT = 'https://static2.sharepointonline.com/files/fabric/assets/item-types/96/txt.png';
export const DOCICONURL_EMAIL = 'https://static2.sharepointonline.com/files/fabric/assets/item-types/96/email.png';
export const DOCICONURL_CSV = 'https://static2.sharepointonline.com/files/fabric/assets/item-types/96/csv.png';
export const DOCICONURL_ONE = 'https://static2.sharepointonline.com/files/fabric/assets/item-types/96/one.png';
export const DOCICONURL_VSDX = 'https://static2.sharepointonline.com/files/fabric/assets/item-types/96/vsdx.png';
export const DOCICONURL_VSSX = 'https://static2.sharepointonline.com/files/fabric/assets/item-types/96/vssx.png';
export const DOCICONURL_PUB = 'https://static2.sharepointonline.com/files/fabric/assets/item-types/96/pub.png';
export const DOCICONURL_ACCDB = 'https://static2.sharepointonline.com/files/fabric/assets/item-types/96/accdb.png';
export const DOCICONURL_ZIP = 'https://static2.sharepointonline.com/files/fabric/assets/item-types/96/zip.png';
export const DOCICONURL_GENERIC = 'https://static2.sharepointonline.com/files/fabric/assets/item-types/96/genericfile.png';
export const DOCICONURL_CODE = 'https://static2.sharepointonline.com/files/fabric/assets/item-types/96/code.png';
export const DOCICONURL_HTML = 'https://static2.sharepointonline.com/files/fabric/assets/item-types/96/html.png';
export const DOCICONURL_XML = 'https://static2.sharepointonline.com/files/fabric/assets/item-types/96/xml.png';
export const DOCICONURL_SPO = 'https://static2.sharepointonline.com/files/fabric/assets/item-types/96/spo.png';
export const DOCICONURL_VIDEO = 'https://static2.sharepointonline.com/files/fabric/assets/item-types/96/video.png';
const defaultLinkImg: string = require('./../../assets/mbri-link.svg');

export class utilities {
	constructor() {}

	/**
   * GetFileImageUrl
   */
	public GetFileImageUrl(_file: string): Promise<string> {

    _file = _file.replace('?web=1','');
    let _fileImageUrl: string = defaultLinkImg;

    try {
      const url = new URL(_file);
      _fileImageUrl  = `${url.origin}/favicon.ico`;
    } catch (error) {
       _fileImageUrl= defaultLinkImg;
    }
		const _fileTypes = _file.split('.');
		const fileType = _fileTypes[_fileTypes.length - 1];
		if (!fileType) {
			return Promise.resolve(_fileImageUrl);
		}
		switch (fileType.toLowerCase()) {
			case 'xlsx':
				_fileImageUrl = DOCICONURL_XLSX;
				break;
			case 'xls':
				_fileImageUrl = DOCICONURL_XLSX;
				break;
			case 'docx':
				_fileImageUrl = DOCICONURL_DOCX;
				break;
			case 'doc':
				_fileImageUrl = DOCICONURL_DOCX;
				break;
			case 'pptx':
				_fileImageUrl = DOCICONURL_PPTX;
				break;
			case 'ppt':
				_fileImageUrl = DOCICONURL_PPTX;
				break;
			case 'mppx':
				_fileImageUrl = DOCICONURL_MPPX;
				break;
			case 'mpp':
				_fileImageUrl = DOCICONURL_MPPX;
				break;
			case 'csv':
				_fileImageUrl = DOCICONURL_CSV;
				break;
			case 'pdf':
				_fileImageUrl = DOCICONURL_PDF;
				break;
			case 'txt':
				_fileImageUrl = DOCICONURL_TXT;
				break;
			case 'jpg':
				_fileImageUrl = DOCICONURL_PHOTO;
				break;
			case 'msg':
				_fileImageUrl = DOCICONURL_EMAIL;
				break;
			case 'jpeg':
				_fileImageUrl = DOCICONURL_PHOTO;
				break;
			case 'png':
				_fileImageUrl = DOCICONURL_PHOTO;
				break;
			case 'ico':
				_fileImageUrl = DOCICONURL_PHOTO;
				break;
			case 'tiff':
				_fileImageUrl = DOCICONURL_PHOTO;
				break;
			case 'eml':
				_fileImageUrl = DOCICONURL_EMAIL;
				break;
			case 'pub':
				_fileImageUrl = DOCICONURL_PUB;
				break;
			case 'accdb':
				_fileImageUrl = DOCICONURL_ACCDB;
				break;
			case 'zip':
				_fileImageUrl = DOCICONURL_ZIP;
				break;
			case '7z':
				_fileImageUrl = DOCICONURL_ZIP;
				break;
			case 'tar':
				_fileImageUrl = DOCICONURL_ZIP;
				break;
			case 'js':
				_fileImageUrl = DOCICONURL_CODE;
				break;
			case 'html':
				_fileImageUrl = DOCICONURL_HTML;
				break;
			case 'xml':
				_fileImageUrl = DOCICONURL_XML;
				break;
			case 'aspx':
				_fileImageUrl = DOCICONURL_SPO;
				break;
			case 'mp4':
				_fileImageUrl = DOCICONURL_VIDEO;
				break;
			case 'mov':
				_fileImageUrl = DOCICONURL_VIDEO;
				break;
			case 'wmv':
				_fileImageUrl = DOCICONURL_VIDEO;
				break;
			case 'ogg':
				_fileImageUrl = DOCICONURL_VIDEO;
				break;
			case 'webm':
				_fileImageUrl = DOCICONURL_VIDEO;
        break;
      case 'pkg':
        	_fileImageUrl = DOCICONURL_ZIP;
          break;
			default:

				break;
		}
		return Promise.resolve(_fileImageUrl);
	}

	public getFileType(_file: string): Promise<string> {
		let _fileType: string = 'Other';
    _file = _file.replace('?web=1','');
		const _fileTypes = _file.split('.');
		const fileType = _fileTypes[_fileTypes.length - 1];
		if (!fileType) {
			return Promise.resolve(_fileType);
		}
		switch (fileType.toLowerCase()) {
			case 'xlsx':
				_fileType = 'Excel';
				break;
			case 'xls':
				_fileType = 'Excel';
				break;
			case 'docx':
				_fileType = 'Word';
				break;
			case 'doc':
				_fileType = 'Word';
				break;
			case 'pptx':
				_fileType = 'PowerPoint';
				break;
			case 'ppt':
				_fileType = 'PowerPoint';
				break;
			case 'pdf':
				_fileType = 'Pdf';
				break;
			case 'one':
				_fileType = 'OneNote';
				break;
			case 'mppx':
				_fileType = 'Project';
				break;
			case 'mpp':
				_fileType = 'Project';
				break;
			case 'vsdx':
				_fileType = 'Visio';
				break;
			case 'vsd':
				_fileType = 'Visio';
				break;
			case 'vdx':
				_fileType = 'Visio';
				break;

			default:
				_fileType = 'Other';
				break;
		}
		return Promise.resolve(_fileType);
	}
}


text:
var str = 'sample';

var result = str.split('').reverse().join('');

console.log(result);


text:
<?php

namespace BitsTheater\costumes ;
use BitsTheater\costumes\Wardrobe\AuthPasswordReset as BaseCostume ;
{ // begin namespace

/**
 * Provides helper functions for dealing with password reset requests.
 */
class AuthPasswordReset extends BaseCostume
{

	//nothing to override, yet

} // end AuthPasswordReset class

} // end namespace


text:
module Adhd_Osx
	class Adhd_Osx::Notification

		# Displays a notification in OS X Notification Center
		#
		def self.notify(**hash)
			command = 'osascript -e \'display notification "%s"' % hash[:body]
			command += 'with title "%s"' % hash[:title] if hash[:title]
			command += 'subtitle "%s"' % hash[:subtitle] if hash[:subtitle]
			command += 'sound name "%s"' % hash[:sound] if hash[:sound]
			command += "\'"
			exec command
		end

	end

end


text:
<?php
namespace Stdlib\tests\units;

use \mageekguy\atoum;

class SplVectorIterator extends atoum\test
{
    public function testAppendValid()
    {
        $vector = new \Stdlib\SplVectorIterator('string');

        $this->assert
             ->exception(function () use ($vector) {
                    $vector->append(1);
                }
             )
             ->isInstanceOf('\UnexpectedValueException');
    }
}