text:
var config = require("./config");

/**
 * Loads the routes for the API from the route collection in the mongo database
 */
function route_table_request() {
  var MongoClient = require('mongodb').MongoClient, format = require('util').format;
  MongoClient.connect(require('util').format('mongodb://%s:%s/%s', config.mongodb.host, config.mongodb.port, config.mongodb.database), function (err, db) {
    if (err) throw err;
    var collection = db.collection('routes');
    collection.count(function (err, count) {
      console.log("Loaded " + count + " routes from the collection.");
    });
    // Locate all the entries using find
    collection.find().toArray(function (err, results) {
      exports.routes = results;
      // Let's close the db
      db.close();
    });
  })
}
exports.route_table_request = route_table_request;


text:
package org.apache.camel.management;

import java.util.List;

import javax.management.Attribute;
import javax.management.MBeanServer;
import javax.management.ObjectName;

import org.apache.camel.Exchange;
import org.apache.camel.api.management.mbean.BacklogTracerEventMessage;
import org.apache.camel.builder.RouteBuilder;
import org.junit.jupiter.api.Test;

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

public class BacklogTracerFilterTest extends ManagementTestSupport {

    @SuppressWarnings("unchecked")
    @Test
    public void testBacklogTracerFilter() throws Exception {
        MBeanServer mbeanServer = getMBeanServer();
        ObjectName on
                = new ObjectName("org.apache.camel:context=" + context.getManagementName() + ",type=tracer,name=BacklogTracer");
        assertNotNull(on);
        mbeanServer.isRegistered(on);

        Boolean enabled = (Boolean) mbeanServer.getAttribute(on, "Enabled");
        assertEquals(Boolean.FALSE, enabled, "Should not be enabled");

        Integer size = (Integer) mbeanServer.getAttribute(on, "BacklogSize");
        assertEquals(1000, size.intValue(), "Should be 1000");

        // set the filter to match only if header foo exists
        mbeanServer.setAttribute(on, new Attribute("TraceFilter", "${header.foo} != null"));

        // enable it
        mbeanServer.setAttribute(on, new Attribute("Enabled", Boolean.TRUE));

        getMockEndpoint("mock:foo").expectedMessageCount(2);
        getMockEndpoint("mock:bar").expectedMessageCount(2);

        template.sendBody("direct:start", "Hello World");
        template.sendBodyAndHeader("direct:start", "Bye World", "foo", 123);

        assertMockEndpointsSatisfied();

        List<Exchange> exchanges = getMockEndpoint("mock:foo").getReceivedExchanges();

        List<BacklogTracerEventMessage> events
                = (List<BacklogTracerEventMessage>) mbeanServer.invoke(on, "dumpAllTracedMessages", null, null);

        assertNotNull(events);
        assertEquals(3, events.size());

        BacklogTracerEventMessage event = events.get(0);
        assertEquals(null, event.getToNode());
        assertEquals("    <message exchangeId=\"" + exchanges.get(1).getExchangeId() + "\">\n"
                     + "      <headers>\n"
                     + "        123\n"
                     + "      </headers>\n"
                     + "      Bye World\n"
                     + "    </message>",
                event.getMessageAsXml());

        BacklogTracerEventMessage event1 = events.get(1);
        assertEquals("foo", event1.getToNode());
        assertEquals("    <message exchangeId=\"" + exchanges.get(1).getExchangeId() + "\">\n"
                     + "      <headers>\n"
                     + "        123\n"
                     + "      </headers>\n"
                     + "      Bye World\n"
                     + "    </message>",
                event1.getMessageAsXml());

        BacklogTracerEventMessage event2 = events.get(2);
        assertEquals("bar", event2.getToNode());
        assertEquals("    <message exchangeId=\"" + exchanges.get(1).getExchangeId() + "\">\n"
                     + "      <headers>\n"
                     + "        123\n"
                     + "      </headers>\n"
                     + "      Bye World\n"
                     + "    </message>",
                event2.getMessageAsXml());
    }

    @Override
    protected RouteBuilder createRouteBuilder() throws Exception {
        return new RouteBuilder() {
            @Override
            public void configure() throws Exception {
                context.setUseBreadcrumb(false);
                context.setBacklogTracing(true);

                from("direct:start")
                        .to("mock:foo").id("foo")
                        .to("mock:bar").id("bar");

            }
        };
    }

}

redpajama_set_name: RedPajamaGithub


text:
> Generate text meme

## Install

```
$ npm install --save text-meme
```

## Usage

```js
const textMeme = require('text-meme');

textMeme('unicorns ❤').then(function (filename) {
    console.log(filename);
});
//=> 'generated text-meme > filename.gif'

textMeme(input, {delay: 600, filename: 'quote.gif', background: '#4f656d'}).then(function (filename) {
    console.log(filename);
});
//=> 'generated text-meme > quote.gif'
```

## API

### textMeme(input, [options])

#### input

Type: `string`

Don't forget to be awesome.

#### options

##### delay

Type: `integer`
Default: 500

Frame delay.

##### background

Type: `string`
Default: #000000

Image's background color in hex.

##### fontcolor

Type: `string`
Default: #ffffff

Font's color in hex.

##### filename

Type: `string`
Default: meme-randomInt

Expected name of the file (with file extension - .gif).

##### fontsize

Type: `integer`
Default: 50

Font's size.

##### imagesize

Type: `integer`
Default: 600

Image's size in px (Height = Width = imagesize).

##### dest

Type: `string`
Default: ''

Destination path where you want image to be generated.

#### Related

- [text-meme-cli](https://github.com/beatfreaker/text-meme-cli) - CLI for this module

#### Note

This module uses [canvas](https://www.npmjs.com/package/canvas) module as dependency which requires `Cairo` check [here](https://www.npmjs.com/package/canvas#installation) how to install it.

## License

MIT © [beatfreaker](https://beatfreaker.github.io)


text:
// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "third_party/blink/renderer/modules/mediastream/media_stream_renderer_factory_impl.h"

#include <utility>

#include "third_party/blink/public/platform/modules/webrtc/webrtc_logging.h"
#include "third_party/blink/public/platform/platform.h"
#include "third_party/blink/public/platform/web_media_stream.h"
#include "third_party/blink/public/web/modules/mediastream/media_stream_video_track.h"
#include "third_party/blink/public/web/web_local_frame.h"
#include "third_party/blink/renderer/modules/mediastream/media_stream_video_renderer_sink.h"
#include "third_party/blink/renderer/modules/mediastream/track_audio_renderer.h"
#include "third_party/blink/renderer/modules/peerconnection/peer_connection_dependency_factory.h"
#include "third_party/blink/renderer/modules/webrtc/webrtc_audio_device_impl.h"
#include "third_party/blink/renderer/modules/webrtc/webrtc_audio_renderer.h"
#include "third_party/blink/renderer/platform/mediastream/media_stream_audio_track.h"
#include "third_party/blink/renderer/platform/webrtc/peer_connection_remote_audio_source.h"
#include "third_party/blink/renderer/platform/wtf/text/wtf_string.h"
#include "third_party/webrtc/api/media_stream_interface.h"

namespace blink {

namespace {

// Returns a valid session id if a single WebRTC capture device is currently
// open (and then the matching session_id), otherwise 0.
// This is used to pass on a session id to an audio renderer, so that audio will
// be rendered to a matching output device, should one exist.
// Note that if there are more than one open capture devices the function
// will not be able to pick an appropriate device and return 0.
base::UnguessableToken GetSessionIdForWebRtcAudioRenderer() {
  WebRtcAudioDeviceImpl* audio_device =
      PeerConnectionDependencyFactory::GetInstance()->GetWebRtcAudioDevice();
  return audio_device
             ? audio_device->GetAuthorizedDeviceSessionIdForAudioRenderer()
             : base::UnguessableToken();
}

void SendLogMessage(const WTF::String& message) {
  WebRtcLogMessage("MSRFI::" + message.Utf8());
}

}  // namespace

std::unique_ptr<WebMediaStreamRendererFactory>
CreateWebMediaStreamRendererFactory() {
  return std::make_unique<MediaStreamRendererFactoryImpl>();
}

MediaStreamRendererFactoryImpl::MediaStreamRendererFactoryImpl() {}

MediaStreamRendererFactoryImpl::~MediaStreamRendererFactoryImpl() {}

scoped_refptr<WebMediaStreamVideoRenderer>
MediaStreamRendererFactoryImpl::GetVideoRenderer(
    const WebMediaStream& web_stream,
    const WebMediaStreamVideoRenderer::RepaintCB& repaint_cb,
    scoped_refptr<base::SingleThreadTaskRunner> io_task_runner,
    scoped_refptr<base::SingleThreadTaskRunner> main_render_task_runner) {
  DCHECK(!web_stream.IsNull());

  DVLOG(1) << "MediaStreamRendererFactoryImpl::GetVideoRenderer stream:"
           << web_stream.Id().Utf8();

  WebVector<WebMediaStreamTrack> video_tracks = web_stream.VideoTracks();
  if (video_tracks.empty() ||
      !MediaStreamVideoTrack::GetTrack(video_tracks[0])) {
    return nullptr;
  }

  return new MediaStreamVideoRendererSink(video_tracks[0], repaint_cb,
                                          std::move(io_task_runner),
                                          std::move(main_render_task_runner));
}

scoped_refptr<WebMediaStreamAudioRenderer>
MediaStreamRendererFactoryImpl::GetAudioRenderer(
    const WebMediaStream& web_stream,
    WebLocalFrame* web_frame,
    const WebString& device_id,
    base::RepeatingCallback<void()> on_render_error_callback) {
  DCHECK(!web_stream.IsNull());
  SendLogMessage(String::Format("%s({web_stream_id=%s}, {device_id=%s})",
                                __func__, web_stream.Id().Utf8().c_str(),
                                device_id.Utf8().c_str()));
  WebVector<WebMediaStreamTrack> audio_tracks = web_stream.AudioTracks();
  if (audio_tracks.empty()) {
    // The stream contains no audio tracks. Log error message if the stream
    // contains no video tracks either. Without this extra check, video-only
    // streams would generate error messages at this stage and we want to
    // avoid that.
    WebVector<WebMediaStreamTrack> video_tracks = web_stream.VideoTracks();
    if (video_tracks.empty()) {
      SendLogMessage(String::Format(
          "%s => (ERROR: no audio tracks in media stream)", __func__));
    }
    return nullptr;
  }

  // TODO(tommi): We need to fix the data flow so that
  // it works the same way for all track implementations, local, remote or what
  // have you.
  // In this function, we should simply create a renderer object that receives
  // and mixes audio from all the tracks that belong to the media stream.
  // For now, we have separate renderers depending on if the first audio track
  // in the stream is local or remote.
  MediaStreamAudioTrack* audio_track =
      MediaStreamAudioTrack::From(audio_tracks[0]);
  if (!audio_track) {
    // This can happen if the track was cloned.
    // TODO(tommi, perkj): Fix cloning of tracks to handle extra data too.
    SendLogMessage(String::Format(
        "%s => (ERROR: no native track for WebMediaStreamTrack)", __func__));
    return nullptr;
  }

  // If the track has a local source, or is a remote track that does not use the
  // WebRTC audio pipeline, return a new TrackAudioRenderer instance.
  if (!PeerConnectionRemoteAudioTrack::From(audio_track)) {
    // TODO(xians): Add support for the case where the media stream contains
    // multiple audio tracks.
    SendLogMessage(String::Format(
        "%s => (creating TrackAudioRenderer for %s audio track)", __func__,
        audio_track->is_local_track() ? "local" : "remote"));

    return new TrackAudioRenderer(audio_tracks[0], web_frame,
                                  /*session_id=*/base::UnguessableToken(),
                                  String(device_id),
                                  std::move(on_render_error_callback));
  }

  // This is a remote WebRTC media stream.
  WebRtcAudioDeviceImpl* audio_device =
      PeerConnectionDependencyFactory::GetInstance()->GetWebRtcAudioDevice();
  DCHECK(audio_device);
  SendLogMessage(String::Format(
      "%s => (media stream is a remote WebRTC stream)", __func__));
  // Share the existing renderer if any, otherwise create a new one.
  scoped_refptr<WebRtcAudioRenderer> renderer(audio_device->renderer());

  if (renderer) {
    SendLogMessage(String::Format(
        "%s => (using existing WebRtcAudioRenderer for remote stream)",
        __func__));
  } else {
    SendLogMessage(String::Format(
        "%s => (creating new WebRtcAudioRenderer for remote stream)",
        __func__));

    renderer = new WebRtcAudioRenderer(
        PeerConnectionDependencyFactory::GetInstance()
            ->GetWebRtcSignalingTaskRunner(),
        web_stream, web_frame, GetSessionIdForWebRtcAudioRenderer(),
        device_id.Utf8(), std::move(on_render_error_callback));

    if (!audio_device->SetAudioRenderer(renderer.get())) {
      SendLogMessage(String::Format(
          "%s => (ERROR: WRADI::SetAudioRenderer failed)", __func__));
      return nullptr;
    }
  }

  auto ret = renderer->CreateSharedAudioRendererProxy(web_stream);
  if (!ret) {
    SendLogMessage(String::Format(
        "%s => (ERROR: CreateSharedAudioRendererProxy failed)", __func__));
  }
  return ret;
}

}  // namespace blink


text:
require "test_helper"

class ApplicationSystemTestCase < ActionDispatch::SystemTestCase
  # driven_by :selenium, using: :chrome, screen_size: [1400, 1400]
  driven_by :selenium, using: :headless_chrome

  ActionController::Base.allow_forgery_protection = true

  include Devise::Test::IntegrationHelpers
  include Support::Helpers::CapybaraHelpers

  def find_by_testid(test_id)
    find("[data-testid='#{test_id}'")
  end
end


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Navigation;
using Microsoft.Phone.Controls;
using Microsoft.Phone.Shell;
using Microsoft.Phone.Tasks;
using System.Diagnostics;
using System.IO.IsolatedStorage;
using InsectoidDefenseComp;
using Coding4Fun.Toolkit.Controls;
using System.Windows.Media.Imaging;

namespace InsectoidDefense
{
    public partial class GamePage : PhoneApplicationPage
    {
        private Direct3DInterop m_d3dInterop = new Direct3DInterop();
        private object m_d3dContentProvider;
        private int levelIndex = 0;
        private int difficulty = 1;

        public GamePage()
        {
            InitializeComponent();
        }

        protected override void OnNavigatedTo(System.Windows.Navigation.NavigationEventArgs e)
        {
            base.OnNavigatedTo(e);

            string str_levelIndex;
            if (NavigationContext.QueryString.TryGetValue("levelIndex", out str_levelIndex))
            {
                Console.WriteLine("str_levelIndex = " + str_levelIndex);
                levelIndex = Convert.ToInt32(str_levelIndex);
            }

            string str_difficulty;
            if (NavigationContext.QueryString.TryGetValue("difficulty", out str_difficulty))
            {
                Console.WriteLine("str_difficulty = " + str_difficulty);
                difficulty = Convert.ToInt32(str_difficulty);
            }
        }

        protected override void OnNavigatedFrom(NavigationEventArgs e)
        {
            base.OnNavigatedFrom(e);

            saveHighScore();
        }

        protected override void OnBackKeyPress(System.ComponentModel.CancelEventArgs e)
        {
            base.OnBackKeyPress(e);

            if (m_d3dInterop.onBackPressed())
            {
                e.Cancel = true;
            }
        }

        private void DrawingSurface_Loaded(object sender, RoutedEventArgs e)
        {
            // Set window bounds in dips
            m_d3dInterop.WindowBounds = new Windows.Foundation.Size((float)DrawingSurface.ActualWidth, (float)DrawingSurface.ActualHeight);

            // Set native resolution in pixels
            m_d3dInterop.NativeResolution = new Windows.Foundation.Size((float)Math.Floor(DrawingSurface.ActualWidth * Application.Current.Host.Content.ScaleFactor / 100.0f + 0.5f), (float)Math.Floor(DrawingSurface.ActualHeight * Application.Current.Host.Content.ScaleFactor / 100.0f + 0.5f));

            // Set render resolution to the full native resolution
            m_d3dInterop.RenderResolution = m_d3dInterop.NativeResolution;

            if (m_d3dContentProvider == null)
            {
                m_d3dContentProvider = m_d3dInterop.CreateContentProvider(levelIndex, difficulty, SaveData.getHighWaveForDifficultyLevelAndLevelIndex(difficulty, levelIndex) >= LevelWaveRequirementMapper.getWaveRequirementForLevelIndex(levelIndex));
            }

            // Hook-up native component to DrawingSurface
            DrawingSurface.SetContentProvider(m_d3dContentProvider);
            DrawingSurface.SetManipulationHandler(m_d3dInterop);

            m_d3dInterop.setWinRtCallback(new WinRtCallback(ProcessCallback));
        }

        private void ProcessCallback(String command, String param)
        {
            if (command.Equals("EXIT"))
            {
                Deployment.Current.Dispatcher.BeginInvoke(() =>
                {
                    NavigationService.GoBack();
                });
            }
            else if (command.Equals("DISPLAY_TOAST"))
            {
                Deployment.Current.Dispatcher.BeginInvoke(() =>
                {
                    ToastPrompt toast = new ToastPrompt();
                    toast.FontSize = 30;
                    toast.Title = param;
                    toast.TextOrientation = System.Windows.Controls.Orientation.Horizontal;

                    toast.Show();
                });
            }
            else if (command.Equals("GAME_OVER"))
            {
                saveHighScore();
            }
        }

        private void saveHighScore()
        {
            int highScore = m_d3dInterop.getScore();
            int highWave = m_d3dInterop.getWave();

            SaveData.saveHighScoreForLevel(highScore, highWave, difficulty, levelIndex);
        }
    }
}


text:
var React = require('react');
var TaskListComponent = require('../components/TaskListComponent');
var changeCase = require('change-case');

var TasksComponent = React.createClass({
  displayName: "TasksComponent",

  _prettyName: function( name ) {
    name = changeCase.sentenceCase(name);
    name = changeCase.titleCase(name);
    return name;
  },

  render: function () {

    var taskTypes = [];
    var keys = [];
    // gather the keys, so task lists can be sorted
    for (var key in this.props.tasks) {
      if (this.props.tasks.hasOwnProperty(key)) {
        keys.push(key);
      }
    }
    keys.sort();
    for (var ii=0; ii<keys.length; ii++) {
       var key = keys[ii];
       taskTypes.push( <TaskListComponent key={key} name={this._prettyName(key)} taskNames={this.props.tasks[key]} /> );
       taskTypes.push(
 );
    }

    return (
{taskTypes}
);

   }

});

module.exports = TasksComponent;


text:
class Level;
class StateGame;
class lua_State;

const int tilewidth = 16;

class Enemy : public GejbEngine::Sprite{
private:
	GejbEngine::Timer reloadTimer;
	GejbEngine::Vector3 startPos;
	bool readyToFire;
	double rotationToPlayer;
	bool playerFound;
	double speed;
	double yVel, xVel;
	double Enemy::radToDeg(double rad);
	Level *const level;
	GejbEngine::Texture *bulletTexture;
	const double bulletSpeed;
	StateGame *game;
	lua_State *lua;
	int state;
	int steps;

	int enemyId;

	struct TileState{
		GejbEngine::Vector3 position;
		std::shared_ptr<TileState> parentState;
		double g = 0;
		double h = 0;
		double f = 0;
	};
	TileState startPosition;
	std::vector<std::shared_ptr<TileState>> open;
	std::vector<std::shared_ptr<TileState>> visited;

	std::list<GejbEngine::Vector3>path;

	void checkSurrounding(std::shared_ptr<TileState> state);
	void testDirection(GejbEngine::Vector3 direction, std::shared_ptr<TileState> state);
	double lengthToGoal(GejbEngine::Vector3 position);

	static bool tileSorter(std::shared_ptr<TileState> const lhs, std::shared_ptr<TileState> const rhs);

public:
	Enemy(Level *const l, StateGame *g, int eId);
	~Enemy();
	void Init(const GejbEngine::Texture *enemyTexture, double x, double y);
	void Update();
	void Collide(int objectType);
	bool Move() override;
	bool checkWallCollision(void);
	void CollideWithWall();
	void move();

	void chase();
	void pathFind();

	void nextTile();

	void checkForPlayer(Player *player);

	int getSteps()const { return steps; }
	void ResetSteps(){ steps = 0; }

	int getEnemyId(){ return enemyId; }
	bool getPlayerFound(){ return playerFound; }

	void setState(int s){ state = s; }

	bool atStartPos();
};

#endif


text:
<?php

namespace Oro\Bundle\HelpBundle\Provider;

use Doctrine\Common\Cache\CacheProvider;
use Oro\Bundle\HelpBundle\Annotation\Help;
use Oro\Bundle\HelpBundle\Configuration\ConfigurationProvider;
use Oro\Bundle\PlatformBundle\Composer\VersionHelper;
use Oro\Bundle\UIBundle\Provider\ControllerClassProvider;
use Symfony\Bundle\FrameworkBundle\Controller\ControllerNameParser;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\RequestStack;

/**
 * The help link URL provider.
 */
class HelpLinkProvider
{
    private const FORMAT          = '%server%/%vendor%/%bundle%/%controller%_%action%';
    private const GROUP_SEPARATOR = '/';

    /** @var array */
    private $defaultConfig;

    /** @var ConfigurationProvider */
    private $configProvider;

    /** @var RequestStack */
    private $requestStack;

    /** @var ControllerClassProvider */
    private $controllerClassProvider;

    /** @var ControllerNameParser */
    private $parser;

    /** @var VersionHelper */
    private $helper;

    /** @var array */
    private $parserCache = [];

    /** @var string */
    private $requestRoute;

    /** @var Request */
    private $request;

    /** @var Help[]|null */
    private $helpAnnotation;

    /** @var CacheProvider */
    private $cache;

    /**
     * @param array $defaultConfig
     * @param ConfigurationProvider $configProvider
     * @param RequestStack $requestStack
     * @param ControllerClassProvider $controllerClassProvider
     * @param ControllerNameParser $parser
     * @param VersionHelper $helper
     * @param CacheProvider $cache
     */
    public function __construct(
        array $defaultConfig,
        ConfigurationProvider $configProvider,
        RequestStack $requestStack,
        ControllerClassProvider $controllerClassProvider,
        ControllerNameParser $parser,
        VersionHelper $helper,
        CacheProvider $cache
    ) {
        $this->defaultConfig = $defaultConfig;
        $this->configProvider = $configProvider;
        $this->requestStack = $requestStack;
        $this->controllerClassProvider = $controllerClassProvider;
        $this->parser = $parser;
        $this->helper = $helper;
        $this->cache = $cache;
    }

    /**
     * Get help link URL.
     *
     * @return string
     */
    public function getHelpLinkUrl()
    {
        $this->ensureRequestSet();

        $helpLink = false;
        if ($this->requestRoute) {
            $helpLink = $this->cache->fetch($this->requestRoute);
        }
        if (false === $helpLink) {
            $helpLink = $this->constructedHelpLinkUrl();

            if ($this->requestRoute) {
                $this->cache->save($this->requestRoute, $helpLink);
            }
        }

        return $helpLink;
    }

    /**
     * Makes sure that request depended properties are set.
     */
    private function ensureRequestSet()
    {
        if (null === $this->request) {
            $request = $this->requestStack->getMasterRequest();
            if (null !== $request) {
                $this->requestRoute = $request->get('_route');
                $this->helpAnnotation = null;
                $this->request = $request;
            }
        }
    }

    /**
     * Construct help link URL based on route.
     *
     * @return string
     */
    private function constructedHelpLinkUrl()
    {
        $config = $this->getConfiguration();
        if (isset($config['link'])) {
            return $config['link'];
        }

        $config['server'] = rtrim($config['server'], '/');
        if (isset($config['prefix'], $config['vendor'])) {
            $config['vendor'] = $config['prefix'] . self::GROUP_SEPARATOR . $config['vendor'];
        }

        $keys = ['server', 'vendor', 'bundle', 'controller', 'action', 'uri'];
        $replaceParams = [];
        foreach ($keys as $key) {
            $replaceParams['%' . $key . '%'] = $config[$key] ?? '';
        }

        if (isset($config['uri'])) {
            $link = strtr('%server%/%uri%', $replaceParams);
        } elseif (isset($config['vendor'], $config['bundle'], $config['controller'], $config['action'])) {
            $link = strtr(self::FORMAT, $replaceParams);
        } else {
            $link = $config['server'];
        }

        $request = $this->request;
        $link = preg_replace_callback(
            '/{(\w+)}/',
            function ($matches) use ($request) {
                if (count($matches) > 1) {
                    return $request->get($matches[1]);
                }

                return '';
            },
            $link
        );

        return $this->appendVersion(preg_replace('/(^:)\/+/', '/', $link));
    }

    /**
     * Append Platform version to URL
     *
     * @param string $url
     * @return string
     */
    private function appendVersion($url)
    {
        $delimiter = false === strpos($url, '?') ? '?' : '&';

        return $url . $delimiter . 'v=' . $this->helper->getVersion();
    }

    /**
     * Get merged flat configuration for requested controller.
     *
     * @return array
     */
    private function getConfiguration()
    {
        $result = $this->defaultConfig;

        $controllerData = $this->getRequestControllerData();
        if ($controllerData) {
            $this->mergeRequestControllerConfig($result, $controllerData);
        }
        $this->mergeAnnotationConfig($result);
        $this->mergeRoutesConfig($result);
        if ($controllerData) {
            $this->mergeVendorsAndResourcesConfig($result, $controllerData);
        }

        return $result;
    }

    /**
     * Apply configuration from annotations
     *
     * @param array $resultConfig
     */
    private function mergeAnnotationConfig(array &$resultConfig)
    {
        if (null === $this->helpAnnotation && null !== $this->request) {
            $helpAnnotation = $this->request->get('_' . Help::ALIAS);
            if (!$helpAnnotation) {
                $helpAnnotation = [];
            } elseif (!is_array($helpAnnotation)) {
                $helpAnnotation = [$helpAnnotation];
            }
            $this->helpAnnotation = $helpAnnotation;
        }
        if (!$this->helpAnnotation) {
            return;
        }

        foreach ($this->helpAnnotation as $help) {
            if ($help instanceof Help) {
                $resultConfig = array_merge($resultConfig, $help->getConfigurationArray());
            }
        }
    }

    /**
     * Apply configuration from "routes" section of configuration
     *
     * @param array $resultConfig
     */
    private function mergeRoutesConfig(array &$resultConfig)
    {
        if (!$this->requestRoute) {
            return;
        }

        $config = $this->configProvider->getConfiguration();
        if (isset($config['routes'][$this->requestRoute])) {
            $resultConfig = array_merge($resultConfig, $config['routes'][$this->requestRoute]);
        }
    }

    /**
     * Apply configuration from request controller name
     *
     * @param array $resultConfig
     * @param array $controllerData
     */
    private function mergeRequestControllerConfig(array &$resultConfig, array $controllerData)
    {
        $resultConfig = array_merge($resultConfig, $controllerData);
    }

    /**
     * Apply configuration from "vendors" and "resources" section of configuration
     *
     * @param array $resultConfig
     * @param array $controllerData
     */
    private function mergeVendorsAndResourcesConfig(array &$resultConfig, array $controllerData)
    {
        $vendor = $controllerData['vendor'];
        $bundle = $controllerData['bundle'];
        $controller = $controllerData['controller'];
        $action = $controllerData['action'];

        $configData[] = [
            'id' => $vendor,
            'section' => 'vendors',
            'key' => 'vendor'
        ];
        $configData[] = [
            'id' => $bundle,
            'section' => 'resources',
            'key' => 'bundle'
        ];
        $configData[] = [
            'id' => $bundle . ':' . $controller,
            'section' => 'resources',
            'key' => 'controller'
        ];
        $configData[] = [
            'id' => sprintf('%s:%s:%s', $bundle, $controller, $action),
            'section' => 'resources',
            'key' => 'action'
        ];

        $config = $this->configProvider->getConfiguration();
        foreach ($configData as $searchData) {
            $id = $searchData['id'];
            $section = $searchData['section'];
            if (isset($config[$section][$id])) {
                $rawConfiguration = $config[$section][$id];
                if (isset($rawConfiguration['alias'])) {
                    $rawConfiguration[$searchData['key']] = $rawConfiguration['alias'];
                    unset($rawConfiguration['alias']);
                }
                $resultConfig = array_merge($resultConfig, $rawConfiguration);
            }
        }
    }

    /**
     * @return array
     */
    private function getRequestControllerData()
    {
        $requestController = null;
        if ($this->requestRoute) {
            $controllers = $this->controllerClassProvider->getControllers();
            if (isset($controllers[$this->requestRoute])) {
                $controller = $controllers[$this->requestRoute];
                $requestController = sprintf('%s::%s', $controller[0], $controller[1]);
            }
        }

        return $this->parseRequestController($requestController);
    }

    /**
     * Parses request controller and returns vendor, bundle, controller, action
     *
     * @param string $controller
     * @return array
     */
    private function parseRequestController($controller)
    {
        if (!is_string($controller)) {
            return [];
        }

        if (array_key_exists($controller, $this->parserCache)) {
            return $this->parserCache[$controller];
        }

        $controllerActionKey = $this->parser->build($controller);
        $controllerNameParts = explode('::', $controller);
        $vendorName = current(explode('\\', $controllerNameParts[0]));
        list($bundleName, $controllerName, $actionName) = explode(':', $controllerActionKey);

        return $this->parserCache[$controller] = [
            'vendor' => $vendorName,
            'bundle' => $bundleName,
            'controller' => $controllerName,
            'action' => $actionName,
        ];
    }
}


text:
import random
import string

from ..func import Func, TestData

digs = string.digits + string.ascii_letters

class TwoOrThree(object):
    def __eq__(self, other):
        if other == 2:
            return True
        if other == 3:
            return True
        return False

    def __ne__(self, other):
        if other == 2:
            return False
        if other == 3:
            return False
        return True

class ThreeOrFour(object):
    def __eq__(self, other):
        if other == 3:
            return True
        if other == 4:
            return True
        return False

    def __ne__(self, other):
        if other == 3:
            return False
        if other == 4:
            return False
        return True

class FourOrFive(object):
    def __eq__(self, other):
        if other == 4:
            return True
        if other == 5:
            return True
        return False

    def __ne__(self, other):
        if other == 4:
            return False
        if other == 5:
            return False
        return True

class int2str(Func):
    def __init__(self):
        super(int2str, self).__init__()
        self.is_signed = False

    def rand_str(self, length, byte_list=None): #pylint disable=no-self-use
        if byte_list is None:
            return "".join(chr(random.randint(0, 255)) for _ in range(length))
        return "".join(random.choice(byte_list) for _ in range(length))

    def num_args(self):
        return 3

    def args(self): #pylint disable=no-self-use
        return ["buf", "len", "val"]

    def get_name(self):
        if self.is_signed:
            return "int2str"
        return "uint2str"

    def gen_input_output_pair(self):
        num = random.randint(-(2 ** 26), 2 ** 26 - 1)
        if not self.is_signed:
            num = abs(num)
        s = str(num)
        test_input = ["A"*15, 15, num]
        test_output = [s, None, None]
        return_val = None
        max_steps = 10
        test = TestData(test_input, test_output, return_val, max_steps)
        return test

    def pre_test(self, func, runner):
        num = random.randint(-(2 ** 26), 2 ** 26 - 1)
        num = abs(num)
        s = str(num)
        test_input = ["A"*15, 15, num]
        test_output = [s, None, None]
        return_val = None
        max_steps = 10
        test = TestData(test_input, test_output, return_val, max_steps)
        if not runner.test(func, test):
            return False

        num = random.randint(-(2 ** 26), 2 ** 26 - 1)
        num = -abs(num)
        s = str(num)
        test_input = ["A"*15, 15, num]
        test_output = [s, None, None]
        return_val = None
        max_steps = 10
        test = TestData(test_input, test_output, return_val, max_steps)
        if not runner.test(func, test):
            self.is_signed = False
        else:
            self.is_signed = True

        return True

class int2str_v2(Func):
    def __init__(self):
        super(int2str_v2, self).__init__()
        self.is_signed = False

    def rand_str(self, length, byte_list=None): #pylint disable=no-self-use
        if byte_list is None:
            return "".join(chr(random.randint(0, 255)) for _ in range(length))
        return "".join(random.choice(byte_list) for _ in range(length))

    def num_args(self):
        return TwoOrThree()

    def args(self): #pylint disable=no-self-use
        return ["val", "buf", "max"]

    def get_name(self):
        if self.is_signed:
            return "int2str_v2"
        return "uint2str_v2"

    def gen_input_output_pair(self):
        num = random.randint(-(2 ** 26), 2 ** 26 - 1)
        if not self.is_signed:
            num = abs(num)
        s = str(num)
        test_input = [num, "A"*15, 12]
        test_output = [None, s, None]
        return_val = None
        max_steps = 10
        test = TestData(test_input, test_output, return_val, max_steps)
        return test

    def pre_test(self, func, runner):
        num = random.randint(-(2 ** 26), 2 ** 26 - 1)
        num = abs(num)
        s = str(num)
        test_input = [num, "A"*15, 12]
        test_output = [None, s, None]
        return_val = None
        max_steps = 10
        test = TestData(test_input, test_output, return_val, max_steps)
        if not runner.test(func, test):
            return False

        num = random.randint(-(2 ** 26), 2 ** 26 - 1)
        num = -abs(num)
        s = str(num)
        test_input = [num, "A"*15, 12]
        test_output = [None, s, None]
        return_val = None
        max_steps = 10
        test = TestData(test_input, test_output, return_val, max_steps)
        if not runner.test(func, test):
            self.is_signed = False
        else:
            self.is_signed = True

        return True

class int2str_v3(Func):
    def __init__(self):
        super(int2str_v3, self).__init__()
        self.is_signed = False

    def rand_str(self, length, byte_list=None): #pylint disable=no-self-use
        if byte_list is None:
            return "".join(chr(random.randint(0, 255)) for _ in range(length))
        return "".join(random.choice(byte_list) for _ in range(length))

    def num_args(self):
        return TwoOrThree()

    def args(self): #pylint disable=no-self-use
        return ["buf", "val", "max"]

    def get_name(self):
        if self.is_signed:
            return "int2str_v3"
        return "uint2str_v3"

    def gen_input_output_pair(self):
        num = random.randint(-(2 ** 26), 2 ** 26 - 1)
        if not self.is_signed:
            num = abs(num)
        s = str(num)
        test_input = ["A"*15, num, 12]
        test_output = [s, None, None]
        return_val = None
        max_steps = 10
        test = TestData(test_input, test_output, return_val, max_steps)
        return test

    def pre_test(self, func, runner):
        num = random.randint(-(2 ** 26), 2 ** 26 - 1)
        num = abs(num)
        s = str(num)
        test_input = ["A"*15, num, 12]
        test_output = [s, None, None]
        return_val = None
        max_steps = 10
        test = TestData(test_input, test_output, return_val, max_steps)
        if not runner.test(func, test):
            return False

        num = random.randint(-(2 ** 26), 2 ** 26 - 1)
        num = -abs(num)
        s = str(num)
        test_input = [num, "A"*15, 12]
        test_output = [s, None, None]
        return_val = None
        max_steps = 10
        test = TestData(test_input, test_output, return_val, max_steps)
        if not runner.test(func, test):
            self.is_signed = False
        else:
            self.is_signed = True

        return True

class int2str_v4(Func):
    def __init__(self):
        super(int2str_v4, self).__init__()
        self.is_signed = False

    def rand_str(self, length, byte_list=None): #pylint disable=no-self-use
        if byte_list is None:
            return "".join(chr(random.randint(0, 255)) for _ in range(length))
        return "".join(random.choice(byte_list) for _ in range(length))

    def num_args(self):
        return ThreeOrFour()

    def args(self): #pylint disable=no-self-use
        return ["buf", "val", "base"]

    def get_name(self):
        if self.is_signed:
            return "int2str_v4"
        return "uint2str_v4"

    def gen_input_output_pair(self):
        num = random.randint(-(2 ** 26), 2 ** 26 - 1)
        if not self.is_signed:
            num = abs(num)
        s = str(num)
        test_input = ["A"*15, num, 10]
        test_output = [s, None, None]
        return_val = None
        max_steps = 10
        test = TestData(test_input, test_output, return_val, max_steps)
        return test

    def pre_test(self, func, runner):
        num = random.randint(-(2 ** 26), 2 ** 26 - 1)
        num = abs(num)
        s = hex(num).replace("0x", "").replace("L", "").lower()
        s2 = hex(num).replace("0x", "").replace("L", "").upper()
        test_input = ["A"*15, num, 16]
        test_output = [s, None, None]
        return_val = None
        max_steps = 10
        test = TestData(test_input, test_output, return_val, max_steps)
        test_output2 = [s2, None, None]
        test2 = TestData(test_input, test_output2, return_val, max_steps)
        if not runner.test(func, test) and not runner.test(func, test2):
            return False

        num = random.randint(-(2 ** 26), 2 ** 26 - 1)
        num = -abs(num)
        s = str(num)
        test_input = [num, "A"*15, 10]
        test_output = [s, None, None]
        return_val = None
        max_steps = 10
        test = TestData(test_input, test_output, return_val, max_steps)
        if not runner.test(func, test):
            self.is_signed = False
        else:
            self.is_signed = True

        return True


text:
package com.noveogroup.clap.model.auth;

import javax.validation.constraints.NotNull;

/**
 * @author Andrey Sokolov
 */
public class ApkAuthentication {
    @NotNull
    private String projectId;
    @NotNull
    private String revisionHash;
    @NotNull
    private String variantHash;
    @NotNull
    private String random;

    public String getProjectId() {
        return projectId;
    }

    public void setProjectId(final String projectId) {
        this.projectId = projectId;
    }

    public String getRevisionHash() {
        return revisionHash;
    }

    public void setRevisionHash(final String revisionHash) {
        this.revisionHash = revisionHash;
    }

    public String getVariantHash() {
        return variantHash;
    }

    public void setVariantHash(final String variantHash) {
        this.variantHash = variantHash;
    }

    public String getRandom() {
        return random;
    }

    public void setRandom(final String random) {
        this.random = random;
    }
}


text:
require 'spec_helper'
require 'tmpdir'
require 'fileutils'
require 'prj/finder'

describe "Prj::Finder" do
  around(:each) do |example|
    Dir.mktmpdir("projects") do |root|
      @root = root
      example.run
    end
  end

  it "finds directories containing .git/ scoped to given root and returns their relative paths" do
    make_directories(root, "/foo/.git", "/bar/qux", "/baz/.git")
    finder(:vcs_directories => [".git"]).find_project_directories.should =~ ["/foo", "/baz"]
  end

  it "does not find nested repos unless :search_nested_repositories" do
    make_directories(root, "/foo/.git", "/foo/bar", "/foo/baz/.git")
    finder(:vcs_directories => [".git"]).find_project_directories.should =~ ["/foo"]
  end

  it "finds nested repos if :search_nested_repositories option is true" do
    make_directories(root, "/foo/.git", "/foo/bar", "/foo/baz/.git")
    finder(:vcs_directories => [".git"], :search_nested_repositories => true).find_project_directories.should =~ ["/foo", "/foo/baz"]
  end

  it "does support other vcs repos" do
    make_directories(root, "/foo/.git", "/bar/.svn", "/foo/baz/.unknown")
    finder(:vcs_directories => [".git", ".svn"]).find_project_directories.should =~ ["/foo", "/bar"]
  end

  def make_directories(root, *directories)
    directories.each { |d| FileUtils.mkdir_p(File.join(root, d)) }
  end

  def finder(options = {})
    Prj::Finder.new(root, options)
  end

  def root
    @root
  end
end


text:
@class NSMapTable, NSMutableDictionary, NSMutableOrderedSet;

@interface IBLayoutRuleManager : NSObject
{
    NSMutableDictionary *sharedLayoutRules;
    NSMutableOrderedSet *fallbackWidgetTypes;
    NSMapTable *widgetCodes;
    NSMapTable *compactLayoutRules;
    BOOL maxRuleDistanceIsValid;
    double maxRuleDistance;
}

+ (id)sharedInstance;
- (void).cxx_destruct;
- (long long)uniqueRuleSubKeyForWidgetType:(id)arg1;
- (id)ruleForView:(long long)arg1 comparedToView:(long long)arg2 withRuleEdge:(unsigned long long)arg3 viewFallbackKey:(long long)arg4;
- (id)ruleForView:(long long)arg1 comparedToContainer:(long long)arg2 withRuleEdge:(unsigned long long)arg3 viewFallbackKey:(long long)arg4 containerFallbackKey:(long long)arg5;
- (id)zeroRule;
- (void)validateTextualRules:(id)arg1;
- (id)invertRules:(id)arg1;
- (BOOL)shouldValidateTextualRules;
- (double)maxRuleDistance;
- (void)invalidateCompactLayoutRules;
- (id)compactLayoutRules;
- (id)compactRules:(id)arg1;
- (void)declareWidgetTypes:(id)arg1;
- (void)removeLayoutRules:(id)arg1;
- (void)addLayoutRules:(id)arg1;
- (void)declareFallbackWidgetType:(id)arg1;
- (id)fallbackWidgetTypes;
- (id)sharedLayoutRules;
- (BOOL)addLayoutRulesFromFile:(id)arg1 error:(id *)arg2;

@end


text:
<?php

/**
 * SalesRule Coupon Model
 *
 * @method Mage_SalesRule_Model_Resource_Coupon _getResource()
 * @method Mage_SalesRule_Model_Resource_Coupon getResource()
 * @method int getRuleId()
 * @method Mage_SalesRule_Model_Coupon setRuleId(int $value)
 * @method string getCode()
 * @method Mage_SalesRule_Model_Coupon setCode(string $value)
 * @method int getUsageLimit()
 * @method Mage_SalesRule_Model_Coupon setUsageLimit(int $value)
 * @method int getUsagePerCustomer()
 * @method Mage_SalesRule_Model_Coupon setUsagePerCustomer(int $value)
 * @method int getTimesUsed()
 * @method Mage_SalesRule_Model_Coupon setTimesUsed(int $value)
 * @method string getExpirationDate()
 * @method Mage_SalesRule_Model_Coupon setExpirationDate(string $value)
 * @method int getIsPrimary()
 * @method Mage_SalesRule_Model_Coupon setIsPrimary(int $value)
 * @method int getType()
 * @method Mage_SalesRule_Model_Coupon setType(int $value)
 *
 * @category    Mage
 * @package     Mage_SalesRule
 * @author      Magento Core Team <core@magentocommerce.com>
 */
class Mage_SalesRule_Model_Coupon extends Mage_Core_Model_Abstract
{
    /**
     * Coupon's owner rule instance
     *
     * @var Mage_SalesRule_Model_Rule
     */
    protected $_rule;

    protected function _construct()
    {
        parent::_construct();
        $this->_init('salesrule/coupon');
    }

    /**
     * Processing object before save data
     *
     * @return Mage_Core_Model_Abstract
     */
    protected function _beforeSave()
    {
        if (!$this->getRuleId() && $this->_rule instanceof Mage_SalesRule_Model_Rule) {
            $this->setRuleId($this->_rule->getId());
        }
        return parent::_beforeSave();
    }

    /**
     * Set rule instance
     *
     * @param  Mage_SalesRule_Model_Rule
     * @return Mage_SalesRule_Model_Coupon
     */
    public function setRule(Mage_SalesRule_Model_Rule $rule)
    {
        $this->_rule = $rule;
        return $this;
    }

    /**
     * Load primary coupon for specified rule
     *
     * @param Mage_SalesRule_Model_Rule|int $rule
     * @return Mage_SalesRule_Model_Coupon
     */
    public function loadPrimaryByRule($rule)
    {
        $this->getResource()->loadPrimaryByRule($this, $rule);
        return $this;
    }

    /**
     * Load Shopping Cart Price Rule by coupon code
     *
     * @param string $couponCode
     * @return Mage_SalesRule_Model_Coupon
     */
    public function loadByCode($couponCode)
    {
        $this->load($couponCode, 'code');
        return $this;
    }
}


text:
var MyFrame = function MyFrame() {
    var self = this;

    self.init();

    return this;
};

MyFrame.prototype.init = function() {
    var self = this;

    self._div                 = document.createElement('div');
    self._div.id              = 'ancShutterFrame_' + Date.now().toString();
    self._div.style.width     = '0px';
    self._div.style.height    = '0px';
    self._div.style.top       = '-1px';
    self._div.style.left      = '-1px';
    self._div.style.position  = 'absolute';
    self._div.style.border    = 'red solid 5px';
    self._div.style.zIndex    = '2000000000';
    self._div.style.padding   = '0px';
    self._div.style.margin    = '0px';
    self._div.style.display   = 'none';

    document.body.appendChild(self._div);

    return self;
};

MyFrame.prototype.set = function(left, top, width, height, radius) {
    var self = this;

    self._div.style.left    = left.toString() + 'px';
    self._div.style.top     = top.toString() + 'px';
    self._div.style.width   = width.toString() + 'px';
    self._div.style.height  = height.toString() + 'px';
    self._div.style.borderRadius = ((radius === undefined) ? 0 : radius).toString() + 'px';
    self._div.innerHTML     = '';

    return self;
};

MyFrame.prototype.show = function(flag) {
    var self = this;

    self._div.style.display = (flag === true) ? 'block' : 'none';

    return self;
};

MyFrame.prototype.setMask = function(masks) {
    var self = this;

    for (var i = 0; i < masks.length; i++) {
        if (masks[i].hidden !== true) {
            var data  = {
                x:      0,
                y:      0,
                w:      masks[i].w,
                h:      masks[i].h,
                mode:   'draw',
                color:  'red',
            };

            var canvas = new MyCanvas().init(data.w, data.h).setMask([data]).getCanvas();
            canvas.style.zIndex     = 2000000001;
            canvas.style.position   = 'absolute';
            canvas.style.left       = masks[i].x.toString() + 'px';
            canvas.style.top        = masks[i].y.toString() + 'px';
            canvas.style.width      = masks[i].w.toString() + 'px';
            canvas.style.height     = masks[i].h.toString() + 'px';

            self._div.appendChild(canvas);
        };
    };

    return self;
};


text:
import React from 'react';
import { default as LayerManager } from './LayerManager';
import { shallow, mount } from 'enzyme';
import { Col } from 'reactstrap';
import { panel } from './TestPanel.json';
import cloneDeep from 'lodash.clonedeep';
describe('(Component) LayerManager', () => {
  let _panel;
  const emptyFunc = () => { /* intentionally left empty */ };
  const empytObj = { /* intentionally left empty */ };
  beforeEach(() => {
    _panel = cloneDeep(panel);
  });
  it('Renders an empty div without layers', () => {
    const _component = mount(<LayerManager dispatch={emptyFunc} actions={empytObj} />);
    expect(_component.type()).to.eql(LayerManager);
  });

  it('Renders renders with layers', () => {
    const _component = shallow(<LayerManager dispatch={emptyFunc} actions={empytObj} panel={_panel} />);
    expect(_component.type()).to.eql(Col);
    const _deepComponent = mount(<LayerManager dispatch={emptyFunc} actions={empytObj} panel={_panel} />);
    expect(_deepComponent.type()).to.eql(LayerManager);
    const overlays = _component.children().get(0).props.data;
    const datalayers = _component.children().get(1).props.data;
    const maplayers = _component.children().get(2).props.data;
    expect(overlays).to.have.lengthOf(1);
    expect(datalayers).to.have.lengthOf(1);
    expect(maplayers).to.have.lengthOf(1);
  });
});


text:
import { extractEmbed } from "../lib/extractEmbed"

describe("extractEmbed", () => {
  it("extracts a vimeo embed", () => {
    expect(extractEmbed("https://vimeo.com/143024721")).toEqual(
      ''
    )
  })

  it("extracts a vimeo embed (2)", () => {
    expect(extractEmbed("https://www.vimeo.com/143024721?foo=bar")).toEqual(
      ''
    )
  })

  it("extracts a youtube embed", () => {
    expect(extractEmbed("https://www.youtube.com/watch?v=QWtsV50_-p4")).toEqual(
      ''
    )
  })

  it("extracts a youtube embed (2)", () => {
    expect(
      extractEmbed("https://youtube.com/watch?v=QWtsV50_-p4&foo=bar")
    ).toEqual(
      ''
    )
  })

  it("extracts a youtube embed (3)", () => {
    expect(extractEmbed("https://youtu.be/QWtsV50_-p4")).toEqual(
      ''
    )
  })

  it("adds the autoplay param", () => {
    expect(
      extractEmbed("https://www.youtube.com/watch?v=QWtsV50_-p4", {
        autolay: 1,
      })
    ).toEqual(
      ''
    )
  })
})


text:
from datetime import timedelta, time

from django.db.models import Count
from django.utils import timezone

from bluebottle.test.factory_models.accounts import BlueBottleUserFactory
from bluebottle.test.factory_models.projects import ProjectFactory, ProjectPhaseFactory
from bluebottle.utils.utils import StatusDefinition
from bluebottle.projects.models import Project, ProjectPhaseLog
from bluebottle.projects.admin import mark_as_plan_new
from bluebottle.donations.models import Donation
from bluebottle.orders.models import Order
from bluebottle.test.utils import BluebottleTestCase
from bluebottle.bb_projects.models import ProjectPhase
from bluebottle.test.factory_models.orders import OrderFactory
from bluebottle.test.factory_models.votes import VoteFactory
from bluebottle.test.factory_models.tasks import TaskFactory, TaskMemberFactory
from bluebottle.test.factory_models.donations import DonationFactory
from bluebottle.test.factory_models.suggestions import SuggestionFactory
from bluebottle.suggestions.models import Suggestion

class TestProjectStatusUpdate(BluebottleTestCase):
    """
        save() automatically updates some fields, specifically
        the status field. Make sure it picks the right one
    """

    def setUp(self):
        super(TestProjectStatusUpdate, self).setUp()

        self.init_projects()

        now = timezone.now()

        self.incomplete = ProjectPhase.objects.get(slug="done-incomplete")
        self.complete = ProjectPhase.objects.get(slug="done-complete")
        self.campaign = ProjectPhase.objects.get(slug="campaign")

        some_days_ago = now - timezone.timedelta(days=15)
        self.expired_project = ProjectFactory.create(
            amount_asked=5000, campaign_started=some_days_ago,
            status=self.campaign)

        self.expired_project.deadline = timezone.now() - timedelta(days=1)

    def test_deadline_end_of_day(self):
        self.expired_project.save()

        self.assertTrue(
            self.expired_project.deadline.time() == time(23, 59, 59),
            'Project deadlines are always at the end of the day'
        )

    def test_expired_too_little(self):
        """ Not enough donated - status done incomplete """
        order = OrderFactory.create()

        donation = DonationFactory.create(
            project=self.expired_project,
            order=order,
            amount=4999
        )
        donation.save()

        order.locked()
        order.save()
        order.success()
        order.save()

        self.expired_project.save()
        self.failUnless(self.expired_project.status == self.incomplete)

    def test_expired_exact(self):
        """ Exactly the amount requested - status done complete """
        order = OrderFactory.create()

        donation = DonationFactory.create(
            project=self.expired_project,
            order=order,
            amount=5000
        )
        donation.save()

        order.locked()
        order.save()
        order.success()
        order.save()

        self.expired_project.save()
        self.failUnless(self.expired_project.status == self.complete)

    def test_expired_more_than_enough(self):
        """ More donated than requested - status done complete """
        order = OrderFactory.create()

        donation = DonationFactory.create(
            project=self.expired_project,
            order=order,
            amount=5001
        )
        donation.save()

        order.locked()
        order.save()
        order.success()
        order.save()
        self.expired_project.save()
        self.failUnless(self.expired_project.status == self.complete)

class TestProjectPhaseLog(BluebottleTestCase):
    def setUp(self):
        super(TestProjectPhaseLog, self).setUp()
        self.init_projects()

    def test_create_phase_log(self):
        phase1 = ProjectPhaseFactory.create()
        phase2 = ProjectPhaseFactory.create()

        project = ProjectFactory.create(status=phase1)

        phase_logs = ProjectPhaseLog.objects.all()
        self.assertEquals(len(phase_logs), 1)
        self.assertEquals(phase_logs[0].status, project.status)

        project.status = phase2
        project.save()

        phase_logs = ProjectPhaseLog.objects.all().order_by("-start")
        self.assertEquals(len(phase_logs), 2)
        self.assertEquals(phase_logs[0].status, project.status)

class SupporterCountTest(BluebottleTestCase):
    def setUp(self):
        super(SupporterCountTest, self).setUp()

        # Required by Project model save method
        self.init_projects()

        self.some_project = ProjectFactory.create(amount_asked=5000)
        self.another_project = ProjectFactory.create(amount_asked=5000)

        self.some_user = BlueBottleUserFactory.create()
        self.another_user = BlueBottleUserFactory.create()

    def test_supporter_count_new(self):
        self.assertEqual(self.some_project.supporter_count(), 0)

        self._create_donation(user=self.some_user, status=StatusDefinition.NEW)

        self.assertEqual(self.some_project.supporter_count(), 0)

    def test_supporter_count_success(self):
        self._create_donation(user=self.some_user,
                              status=StatusDefinition.SUCCESS)

        self.assertEqual(self.some_project.supporter_count(), 1)

    def test_supporter_count_pending(self):
        self._create_donation(user=self.some_user,
                              status=StatusDefinition.PENDING)

        self.assertEqual(self.some_project.supporter_count(), 1)

    def test_supporter_count_unique(self):
        self._create_donation(user=self.some_user,
                              status=StatusDefinition.SUCCESS)
        self._create_donation(user=self.some_user,
                              status=StatusDefinition.SUCCESS)

        self.assertEqual(self.some_project.supporter_count(), 1)

        self._create_donation(user=self.another_user,
                              status=StatusDefinition.SUCCESS)

        self.assertEqual(self.some_project.supporter_count(), 2)

    def test_supporter_count_anonymous(self):
        self._create_donation(status=StatusDefinition.SUCCESS)
        self.assertEqual(self.some_project.supporter_count(), 1)

    def test_supporter_count_anonymous_not_unique(self):
        self._create_donation(status=StatusDefinition.SUCCESS)
        self._create_donation(status=StatusDefinition.SUCCESS)
        self.assertEqual(self.some_project.supporter_count(), 2)

    def test_supporter_count_anonymous_and_user(self):
        self._create_donation(user=self.some_user,
                              status=StatusDefinition.SUCCESS)
        self._create_donation(user=self.some_user,
                              status=StatusDefinition.SUCCESS)

        self._create_donation(user=self.another_user,
                              status=StatusDefinition.SUCCESS)

        self._create_donation(status=StatusDefinition.SUCCESS)
        self._create_donation(status=StatusDefinition.SUCCESS)
        self.assertEqual(self.some_project.supporter_count(), 4)

    def _create_donation(self, user=None, status=StatusDefinition.NEW):
        """ Helper method for creating donations."""
        order = Order.objects.create(status=status, user=user)
        donation = Donation.objects.create(amount=100,
                                           project=self.some_project,
                                           order=order)

        return donation

class TestProjectStatusChangeSuggestionUpdate(BluebottleTestCase):
    def setUp(self):
        super(TestProjectStatusChangeSuggestionUpdate, self).setUp()

        self.init_projects()

        self.new = ProjectPhase.objects.get(slug="plan-new")
        self.needs_work = ProjectPhase.objects.get(slug="plan-needs-work")
        self.submitted = ProjectPhase.objects.get(slug="plan-submitted")

    def test_project_submitted_suggestion_submitted(self):
        """
        Test that suggestion has status submitted if a project status
        changes to submitted
        """
        project = ProjectFactory.create(status=self.new)
        suggestion = SuggestionFactory.create(project=project,
                                              token='xxx',
                                              status='in_progress')

        project.status = self.submitted
        project.save()

        suggestion = Suggestion.objects.get(project=project)

        self.assertEquals(suggestion.status, 'submitted')

    def test_project_needs_work_suggestion_in_progress(self):
        """
        Test that suggestion has status in-progress if a project status
        changes to needs-work
        """
        project = ProjectFactory.create(status=self.submitted)
        suggestion = SuggestionFactory.create(project=project,
                                              token='xxx',
                                              status='submitted')

        project.status = self.needs_work
        project.save()

        suggestion = Suggestion.objects.get(project=project)

        self.assertEquals(suggestion.status, 'in_progress')

class TestProjectPopularity(BluebottleTestCase):
    def setUp(self):
        super(TestProjectPopularity, self).setUp()
        self.init_projects()

        self.project = ProjectFactory.create()

        VoteFactory.create(project=self.project)
        task = TaskFactory.create(project=self.project)
        TaskMemberFactory.create(task=task)

        order = OrderFactory.create(status=StatusDefinition.SUCCESS)

        DonationFactory(order=order, project=self.project)

    def test_update_popularity(self):
        Project.update_popularity()

        self.assertEqual(Project.objects.get(id=self.project.id).popularity, 11)

class TestProjectBulkActions(BluebottleTestCase):
    def setUp(self):
        super(TestProjectBulkActions, self).setUp()
        self.init_projects()

        self.projects = [ProjectFactory.create(title='test {}'.format(i)) for i in range(10)]

    def test_mark_as_plan_new(self):
        mark_as_plan_new(None, None, Project.objects)

        for project in Project.objects.all():
            self.assertEqual(project.status.slug, 'plan-new')

    def test_mark_annotated(self):
        queryset = Project.objects.annotate(
            admin_vote_count=Count('vote', distinct=True)
        )
        mark_as_plan_new(None, None, queryset)

        for project in Project.objects.all():
            self.assertEqual(project.status.slug, 'plan-new')


text:
layout: post
title: Cross-origin resource sharing
category: javascript
---


text:
<link rel="import" href="../../bower_components/polymer/polymer.html">
<link rel="import" href="../helpers/removable.html">

<dom-module id="simple-chorus">
  <template>
    <style>
      :host {
        display: block;
        margin: 0 5px;
        height: 100%;
        background: #eee;
      }
      .chorus {
        width: 120px;
        height: 100%;
        border: 1px solid black;
      }
      .chorus-param-row {
        height: 20px;
        line-height: 20px;
        margin: 8px 0;
        font-size: 0.6rem;
      }
    </style>

    <connector-input
        audio-node="{{chorusModel}}"
        connection-bus="{{connectionInput}}">>
    </connector-input>

    <div class="chorus">

      <element-header label="Chorus" removable="{{removable}}"></element-header>

      <!-- <parameter-display
        class="chorus-param-row"
        model="{{chorusModel.delayNode.delayTime.value}}"
        label="Delay"
        lower-bound="0.01"
        upper-bound="3">
      </parameter-display> -->

      <parameter-display
        class="chorus-param-row"
        model="{{chorusModel.feedbackGain.gain.value}}"
        label="Fdbck"
        lower-bound="0"
        upper-bound="0.5">
      </parameter-display>

      <parameter-display
        class="chorus-param-row"
        model="{{chorusModel.lfo.frequency.value}}"
        label="Speed"
        lower-bound="0.01"
        upper-bound="10">
      </parameter-display>

      <!-- <parameter-display
        class="chorus-param-row"
        model="{{chorusModel.chorus.delayTime.value}}"
        label="Delay"
        lower-bound="0.005"
        upper-bound="0.055">
      </parameter-display> -->

      <parameter-display
        class="chorus-param-row"
        model="{{chorusModel.lfoGain.gain.value}}"
        label="Depth"
        lower-bound="0.0005"
        upper-bound="0.005">
      </parameter-display>

    </div>

    <connector-output
        audio-node="{{chorusModel}}"
        connection-bus="{{connectionOutput}}">>
    </connector-output>

  </template>

  <script>
    (function() {
      'use strict';

      class SimpleChorus {

        beforeRegister() {
          this.is = 'simple-chorus';

          this.properties = {
            chorusModel: {
              type: Object
            },
            connectionInput: {
              type: Object
            },
            connectionOutput: {
              type: Object
            }
          };

          this.listeners = {};
        }

        ready() {}
        attached() {
          this.removable = importRemovable.call(this, this.chorusModel);
        }
        detached() {}
        attributeChanged() {}
      }

      Polymer(SimpleChorus);
    })();
  </script>

</dom-module>


text:
<!DOCTYPE html>

	<title>

            Long View Systems Corporation -

    Complete profile - Canadian Company Capabilities - Industries and Business - Industry Canada
  </title>

<meta charset="utf-8" />
<meta name="dcterms.language" title="ISO639-2" content="eng" />
<meta name="dcterms.title" content="" />
<meta name="description" content="" />
<meta name="dcterms.description" content="" />
<meta name="dcterms.type" content="report, data set" />
<meta name="dcterms.subject" content="businesses, industry" />
<meta name="dcterms.subject" content="businesses, industry" />
<meta name="dcterms.issued" title="W3CDTF" content="" />
<meta name="dcterms.modified" title="W3CDTF" content="" />
<meta name="keywords" content="" />

<meta name="dcterms.creator" content="" />
<meta name="author" content="" />
<meta name="dcterms.created" title="W3CDTF" content="" />
<meta name="dcterms.publisher" content="" />
<meta name="dcterms.audience" title="icaudience" content="" />
<meta name="dcterms.spatial" title="ISO3166-1" content="" />
<meta name="dcterms.spatial" title="gcgeonames" content="" />
<meta name="dcterms.format" content="HTML" />
<meta name="dcterms.identifier" title="ICsiteProduct" content="536" />

<meta http-equiv="X-UA-Compatible" content="IE=edge">

<meta content="width=device-width,initial-scale=1" name="viewport">

<meta name = "format-detection" content = "telephone=no">

<meta name="robots" content="noarchive">

<link href="/utils/scripts/_WET_4-0/apps/themes-dist/gcweb/assets/favicon.ico" rel="icon" type="image/x-icon">
<link rel="stylesheet" href="/utils/scripts/_WET_4-0/apps/themes-dist/gcweb/css/wet-boew.min.css">

<link rel="stylesheet" href="/utils/scripts/_WET_4-0/apps/themes-dist/gcweb/css/theme.min.css">

<link rel="stylesheet" href="/utils/scripts/_WET_4-0/apps/themes-dist/gcweb/css/noscript.min.css" />

<link rel="stylesheet" href="/eic/home.nsf/css/add_WET_4-0_Canada_Apps.css">

  	<link href="//netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.css" rel="stylesheet">
  	<link href="/app/ccc/srch/css/print.css" media="print" rel="stylesheet" type="text/css" />

<meta property="legalName" content="Department_of_Industry">

Skip to main content

Skip to "About this site"

Language selection

Français

<object type="image/svg+xml" tabindex="-1" data="/utils/scripts/_WET_4-0/apps/themes-dist/gcweb/assets/sig-blk-en.svg"></object> Government of Canada

Search and menus

Search and menus

Topics menu

Jobs

Immigration

Travel

Business

Benefits

Health

Taxes

More services

You are here:

Home

Industries and Business

Canadian Company Capabilities

<input id="showMore" type="hidden" value='more'/>
<input id="showLess" type="hidden" value='less'/>

 Company profile - Canadian Company Capabilities

New Search |

<form name="searchForm" method="post" action="/app/ccc/srch/bscSrch.do">

          <input type="hidden" name="lang" value="eng" />
          <input type="hidden" name="profileId" value="" />
          <input type="hidden" name="prtl" value="1" />
          <input type="hidden" name="searchPage" value="%2Fapp%2Fccc%2Fsrch%2FcccBscSrch.do%3Flang%3Deng%26amp%3Bprtl%3D1%26amp%3Btagid%3D"  />

          <input type="hidden" name="V_SEARCH.scopeCategory" value="CCC.Root" />

          <input type="hidden" name="V_SEARCH.depth" value="1" />
          <input type="hidden" name="V_SEARCH.showStricts" value="false" />
          <input id="repeatSearchBtn" class="btn btn-link" type="submit" value="Return to search results" />

  </form>

| Previous Company

| Next Company

      Third-Party Information Liability Disclaimer

Some of the information on this Web page has been provided by external sources. The Government of Canada is not responsible for the accuracy, reliability or currency of the information supplied by external sources. Users wishing to rely upon this information should consult directly with the source of the information. Content provided by external sources is not subject to official languages, privacy and accessibility requirements.

      Long View Systems Corporation

Legal/Operating Name:

Long View Systems Corporation

http://www.longviewsystems.com

info@lvs1.com

Mailing Address:

              	<address class="mrgn-bttm-md">

                   2100-250 2nd St SW

                    CALGARY,

                    Alberta

                  T2P 0C1

                </address>

Location Address:

              	         <address class="mrgn-bttm-md">

                   2100-250 2nd St SW

                    CALGARY,

                    Alberta

                  T2P 0C1

                         </address>

Tel.:
		      (403) 515-6900

Tel.:
			      (866) 515-6900

Fax:
		      (403) 515-6919

Logo

Company Profile

            Long View is one of the most powerful IT solutions and services companies in North America with offices across the continent. With a clear focus on combining business and technology in key areas such as Cloud, data center infrastructure, user support, and IT outsourcing, Long View is able to define and customize what the future of IT looks like. Innovative, flexible, cost-effective, and business focused… that's Long View.

				Full profile

				Full profile

				Contact information

                Jacky
                Leung

                  Title:

                Administrator

                    Area of Responsibility:

                    Domestic Sales & Marketing.

                  Telephone:

                (403) 515-5954

                    Email:

                  jacky.leung@lvs1.com

                Helen
                Dickson

                  Title:

                Administrator

                  Telephone:

                (403) 515-6900

  top of page

				Company description

            Country of Ownership:

              Canada

              Year Established:

            1999

            Exporting:

              No

                Primary Industry (NAICS):

				541510 - Computer Systems Design and Related Services

            Primary Business Activity:

            Services

              Total Sales ($CDN):

            $50,000,000 +

              Number of Employees:

            1000

				Product / Service / Licensing

                              Service Name:

                            IT Consulting & Solution Architecture

                            As IT infrastructure specialists, Long View Systems understands current and emerging technologies and how they impact your business environment – from the desktop to the data center.

In today's changing business environment, it is often more cost effective and time efficient to bring in certified consultants to plan and deploy projects. Long View not only leverages our industry experience and expertise, but uses our strong industry partnerships to offer customers value. Our IT Consulting and Solution Architecture solutions help our customers with business planning, architecture and procurement.

Long View offers integrated solutions addressing every part of your IT infrastructure:

Microsoft Technologies

Collaboration

Data Center

Virtualization

Networking

Storage

Project & Business Solutions

                              Service Name:

                            IT Project Delivery

                            Long View's team has the necessary depth and breadth of experience with current and emerging technologies to help your organization successfully implement your IT projects.

Exposure to numerous industries and technologies not only assists us in understanding your business challenges but allows us to identify new opportunities.  With a focus on creating client value and building long term trusted business relationships, Long View has been the partner of choice for implementing hundreds of IT projects.

Long View provides IT Project Delivery in the following areas:

Microsoft Technologies

Collaboration

Data Center

Virtualization

Networking

Storage

Project & Business Solutions

                              Service Name:

                            Managed Services & Outsourcing

                            The key to delivering successful outsourcing projects is people, which is why we

offer the best technicians and consultants in the industry. We look beyond just

providing front line support to end users to delivering exceptional service at

every level of a business technology environment.

Our unique managed services and outsourcing solutions are competitively priced

and tailored to meet the distinct requirements of each of our clients. Part of gaining

this deeper understanding includes giving our clients immediate access to our

management team and ensuring effective knowledge transfer using industry

best practices. Long View is a company committed to innovation and providing

ongoing value to our clients as a trusted business partner, with a focus on

reducing costs and improving risk management with the shared expertise

required to ensure greater business efficiency.

We provide services to the following areas:

IT Outsourcing

Managed Services

Staff Augmentation

Service Desk

                              Service Name:

                            Cloud Computing

                            Long View offers complete Cloud OnDemand solutions to our clients as Cloud Builders, Providers, and Aggregators. We're focused on providing practical solutions leveraging both Cloud computing and traditional IT technology.

We provide the following Cloud OnDemand Solutions:

OnDemand Microsoft Lync

OnDemand Infrastructure

OnDemand Mobility

OnDemand Backup

OnDemand Disaster Recovery

Remedy as a Service

                              Service Name:

                            IT Procurement Services

                            Long View maintains a uniquely transparent business model and comprehensive line card with top manufacturers, giving us access to a large supply chain at top tier pricing. We offer a range of mature services capabilities to support product purchases throughout North America. Our suite of creative, service-based procurement solutions is implemented by a highly experienced team of procurement professionals.

As added value, we offer our clients renewal management services and access to an automated buying system, allowing them to quickly identify the best product price and available inventory. With specialized resources for complex situations (vendor specific or multi-vendor), Long View can address the procurement needs of any environment with a unique focus on reducing a customer's overall cost of acquisition and ownership.

Our IT Procurement Services includes:

Procurement as a Service

Licensing

Hardware Support Services

  top of page

					Technology profile

            Our People are the Heart of IT.

Long View is one of the most powerful IT solutions and services companies in North America with offices across the continent. With a clear focus on combining business and technology in key areas such as Cloud, data center infrastructure, user support, and IT outsourcing, Long View is able to define and customize what the future of IT looks like. Innovative, flexible, cost-effective, and business focused… that's Long View.

					Market profile

                        Alliances:

Sales/Marketing

Technology

                          Industry sector market interests:

Information Technology and Telecommunications

Manufacturing

Medical/Biotechnology/Chemical

Mining/Petroleum/Gas

Aerospace

Defence

  top of page

					Sector information

                Key / Major clients:

              Intrawest

Alliance Pipeline

Vancouver Airport

Anadarko

Denver International Airport

Shell

ATB Financial

Impark

EnCana

HSBC

Albrta

Ledcor

Halliburton

Enbridge

Lululemon

Waste Management

Frontier

ConocoPHillips

Weatherford

Toyota

TranCanada

Calgary Health Region

Crocs

Carnival

WestJet

Markwest

EFW Radiology

St. Joseph's General Hospital

Precision Drilling

Canadian Natural Gas Ltd.

Corporate Express

Delta-Q Technologies

First Wester Trust Bank

Secure Energy Services

SemCAMS

Unity Builders Group

Vancouver Coastal Health

National Holdings

Rentech

					Third-Party Information Liability Disclaimer

					Some of the information on this Web page has been provided by external sources. The Government of Canada is not responsible for the accuracy, reliability or currency of the information supplied by external sources. Users wishing to rely upon this information should consult directly with the source of the information. Content provided by external sources is not subject to official languages, privacy and accessibility requirements.

				Contacts

				Contact information

                Jacky
                Leung

                  Title:

                Administrator

                    Area of Responsibility:

                    Domestic Sales & Marketing.

                  Telephone:

                (403) 515-5954

                    Email:

                  jacky.leung@lvs1.com

                Helen
                Dickson

                  Title:

                Administrator

                  Telephone:

                (403) 515-6900

				Description

				Company description

            Country of Ownership:

              Canada

              Year Established:

            1999

            Exporting:

              No

                Primary Industry (NAICS):

				541510 - Computer Systems Design and Related Services

            Primary Business Activity:

            Services

              Total Sales ($CDN):

            $50,000,000 +

              Number of Employees:

            1000

				Products, services and licensing

				Product / Service / Licensing

                              Service Name:

                            IT Consulting & Solution Architecture

                            As IT infrastructure specialists, Long View Systems understands current and emerging technologies and how they impact your business environment – from the desktop to the data center.

In today's changing business environment, it is often more cost effective and time efficient to bring in certified consultants to plan and deploy projects. Long View not only leverages our industry experience and expertise, but uses our strong industry partnerships to offer customers value. Our IT Consulting and Solution Architecture solutions help our customers with business planning, architecture and procurement.

Long View offers integrated solutions addressing every part of your IT infrastructure:

Microsoft Technologies

Collaboration

Data Center

Virtualization

Networking

Storage

Project & Business Solutions

                              Service Name:

                            IT Project Delivery

                            Long View's team has the necessary depth and breadth of experience with current and emerging technologies to help your organization successfully implement your IT projects.

Exposure to numerous industries and technologies not only assists us in understanding your business challenges but allows us to identify new opportunities.  With a focus on creating client value and building long term trusted business relationships, Long View has been the partner of choice for implementing hundreds of IT projects.

Long View provides IT Project Delivery in the following areas:

Microsoft Technologies

Collaboration

Data Center

Virtualization

Networking

Storage

Project & Business Solutions

                              Service Name:

                            Managed Services & Outsourcing

                            The key to delivering successful outsourcing projects is people, which is why we

offer the best technicians and consultants in the industry. We look beyond just

providing front line support to end users to delivering exceptional service at

every level of a business technology environment.

Our unique managed services and outsourcing solutions are competitively priced

and tailored to meet the distinct requirements of each of our clients. Part of gaining

this deeper understanding includes giving our clients immediate access to our

management team and ensuring effective knowledge transfer using industry

best practices. Long View is a company committed to innovation and providing

ongoing value to our clients as a trusted business partner, with a focus on

reducing costs and improving risk management with the shared expertise

required to ensure greater business efficiency.

We provide services to the following areas:

IT Outsourcing

Managed Services

Staff Augmentation

Service Desk

                              Service Name:

                            Cloud Computing

                            Long View offers complete Cloud OnDemand solutions to our clients as Cloud Builders, Providers, and Aggregators. We're focused on providing practical solutions leveraging both Cloud computing and traditional IT technology.

We provide the following Cloud OnDemand Solutions:

OnDemand Microsoft Lync

OnDemand Infrastructure

OnDemand Mobility

OnDemand Backup

OnDemand Disaster Recovery

Remedy as a Service

                              Service Name:

                            IT Procurement Services

                            Long View maintains a uniquely transparent business model and comprehensive line card with top manufacturers, giving us access to a large supply chain at top tier pricing. We offer a range of mature services capabilities to support product purchases throughout North America. Our suite of creative, service-based procurement solutions is implemented by a highly experienced team of procurement professionals.

As added value, we offer our clients renewal management services and access to an automated buying system, allowing them to quickly identify the best product price and available inventory. With specialized resources for complex situations (vendor specific or multi-vendor), Long View can address the procurement needs of any environment with a unique focus on reducing a customer's overall cost of acquisition and ownership.

Our IT Procurement Services includes:

Procurement as a Service

Licensing

Hardware Support Services

							Technology

							Technology profile

            Our People are the Heart of IT.

Long View is one of the most powerful IT solutions and services companies in North America with offices across the continent. With a clear focus on combining business and technology in key areas such as Cloud, data center infrastructure, user support, and IT outsourcing, Long View is able to define and customize what the future of IT looks like. Innovative, flexible, cost-effective, and business focused… that's Long View.

					Market

					Market profile

                        Alliances:

Sales/Marketing

Technology

                          Industry sector market interests:

Information Technology and Telecommunications

Manufacturing

Medical/Biotechnology/Chemical

Mining/Petroleum/Gas

Aerospace

Defence

					Sector

					Sector information

                Key / Major clients:

              Intrawest

Alliance Pipeline

Vancouver Airport

Anadarko

Denver International Airport

Shell

ATB Financial

Impark

EnCana

HSBC

Albrta

Ledcor

Halliburton

Enbridge

Lululemon

Waste Management

Frontier

ConocoPHillips

Weatherford

Toyota

TranCanada

Calgary Health Region

Crocs

Carnival

WestJet

Markwest

EFW Radiology

St. Joseph's General Hospital

Precision Drilling

Canadian Natural Gas Ltd.

Corporate Express

Delta-Q Technologies

First Wester Trust Bank

Secure Energy Services

SemCAMS

Unity Builders Group

Vancouver Coastal Health

National Holdings

Rentech

    Last Update Date 2015-12-02

Date Modified:

      <time>2017-03-02</time>

About government

Contact us

Departments and agencies

Public service and military

News

Treaties, laws and regulations

Government-wide reporting

Prime Minister

How government works

Open government

About this site

Social media

Mobile applications

About Canada.ca

Terms and conditions

Privacy

Top of Page

<object type="image/svg+xml" tabindex="-1" role="img" data="/utils/scripts/_WET_4-0/apps/themes-dist/gcweb/assets/wmms-blk.svg" aria-label="Symbol of the Government of Canada"></object>


text:
module NameDotComApi
  VERSION = "0.4"
end


text:
using Cake.Common.Diagnostics;
using Cake.Common.IO;
using Cake.Common.Solution;
using Cake.Common.Tools.DotNetCore;
using Cake.Common.Tools.DotNetCore.Test;
using Cake.Common.Tools.NUnit;
using Cake.Core.IO;
using CK.Text;
using Newtonsoft.Json.Linq;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Xml.Linq;

namespace CodeCake
{
    public partial class Build
    {
        /// <summary>
        ///
        /// </summary>
        /// <param name="globalInfo"></param>
        /// <param name="testProjects"></param>
        /// <param name="useNUnit264ForNet461">Will use nunit 264 for Net461 project if true.</param>
        void StandardUnitTests( StandardGlobalInfo globalInfo, IEnumerable<SolutionProject> testProjects )
        {
            string memoryFilePath = $"CodeCakeBuilder/UnitTestsDone.{globalInfo.GitInfo.CommitSha}.txt";

            void WriteTestDone( Cake.Core.IO.FilePath test )
            {
                if( globalInfo.GitInfo.IsValid ) File.AppendAllLines( memoryFilePath, new[] { test.ToString() } );
            }

            bool CheckTestDone( Cake.Core.IO.FilePath test )
            {
                bool done = File.Exists( memoryFilePath )
                            ? File.ReadAllLines( memoryFilePath ).Contains( test.ToString() )
                            : false;
                if( done )
                {
                    if( !globalInfo.GitInfo.IsValid )
                    {
                        Cake.Information( "Dirty commit: tests are run again (base commit tests were successful)." );
                        done = false;
                    }
                    else
                    {
                        Cake.Information( "Test already successful on this commit." );
                    }
                }
                return done;
            }

            foreach( SolutionProject project in testProjects )
            {
                NormalizedPath projectPath = project.Path.GetDirectory().FullPath;
                NormalizedPath binDir = projectPath.AppendPart( "bin" ).AppendPart( globalInfo.BuildConfiguration );
                NormalizedPath objDir = projectPath.AppendPart( "obj" );
                string assetsJson = File.ReadAllText( objDir.AppendPart( "project.assets.json" ) );
                bool isNunitLite = assetsJson.Contains( "NUnitLite" );
                bool isVSTest = assetsJson.Contains( "Microsoft.NET.Test.Sdk" );
                foreach( NormalizedPath buildDir in Directory.GetDirectories( binDir ) )
                {
                    string framework = buildDir.LastPart;
                    string fileWithoutExtension = buildDir.AppendPart( project.Name );
                    string testBinariesPath = "";
                    if( isNunitLite )
                    {
                        //we are with nunitLite
                        testBinariesPath = fileWithoutExtension + ".exe";
                        if( File.Exists( testBinariesPath ) )
                        {
                            Cake.Information( $"Testing via NUnitLite ({framework}): {testBinariesPath}" );
                            if( CheckTestDone( testBinariesPath ) ) return;
                            Cake.NUnit3( new[] { testBinariesPath }, new NUnit3Settings
                            {
                                Results = new[] { new NUnit3Result() { FileName = FilePath.FromString( projectPath.AppendPart( "TestResult.Net461.xml" ) ) } }
                            } );
                        }
                        else
                        {
                            testBinariesPath = fileWithoutExtension + ".dll";
                            Cake.Information( $"Testing via NUnitLite ({framework}): {testBinariesPath}" );
                            if( CheckTestDone( testBinariesPath ) ) return;
                            Cake.DotNetCoreExecute( testBinariesPath );
                        }
                    }
                    if(isVSTest)
                    {
                        testBinariesPath = fileWithoutExtension + ".dll";
                        //VS Tests
                        Cake.Information( $"Testing via VSTest ({framework}): {testBinariesPath}" );
                        if( CheckTestDone( testBinariesPath ) ) return;
                        Cake.DotNetCoreTest( projectPath, new DotNetCoreTestSettings()
                        {
                            Configuration = globalInfo.BuildConfiguration,
                            Framework = framework,
                            NoRestore = true,
                            NoBuild = true,
                            Logger = "trx"
                        } );
                    }

                    if(!isVSTest && !isNunitLite)
                    {
                        testBinariesPath = fileWithoutExtension + ".dll";
                        Cake.Information( "Testing via NUnit: {0}", testBinariesPath );
                        Cake.NUnit( new[] { testBinariesPath }, new NUnitSettings()
                        {
                            Framework = "v4.5",
                            ResultsFile = FilePath.FromString(projectPath.AppendPart( "TestResult.Net461.xml" ))
                        } );

                    }
                    WriteTestDone( testBinariesPath );
                }
            }
        }
    }
}


text:
mouse-chase-drop-down-menu
==========================

A persistent drop-down menu that chases your mouse to other dom elements who have sub-navigation properties


text:
A simple Photo gallery that pulls images from the Dropbox API (V2)

## Makes use of
- PhotoSwipe: http://photoswipe.com/documentation/getting-started.html
- Dropbox V2 PHP: https://github.com/Alorel/dropbox-v2-php
- phpFastCache: https://github.com/PHPSocialNetwork/phpfastcache


text:
//*********************************************************
//
// Copyright (c) Microsoft. All rights reserved.
// THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
// ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
// IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
// PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
//
//*********************************************************

//
// Scenario2.xaml.h
// Declaration of the Scenario2 class
//

#pragma once

#include "pch.h"
#include "Scenario2.g.h"
#include "MainPage.xaml.h"

namespace SDKTemplate
{
    /// <summary>
    /// An empty page that can be used on its own or navigated to within a Frame.
    /// </summary>
    public ref class Scenario2 sealed
    {
    public:
        Scenario2();

    private:
        SDKTemplate::MainPage^ rootPage;

        Windows::Foundation::Rect Scenario2::GetTextboxSelectionRect(Windows::UI::Xaml::Controls::TextBox^ textbox);
        void ReadOnlyTextBox_ContextMenuOpening(Platform::Object^ sender, Windows::UI::Xaml::Controls::ContextMenuEventArgs^ e);
    };
}


text:
orthogami
=========

Turn voxel models into foldable origami!  For example, you can turn this mario model:

Into this foldable model:

[If you want to try making a Mario yourself, here is a PDF in A4 format.](https://mikolalysenko.github.io/orthogami/example/mario.pdf)

This module works in any reasonable CommonJS environment (includes node.js and browserify).  You can also use it with the [voxel critter creator](http://voxelbuilder.com/edit.html) (select "Export Orthogami").

## Example usage

```javascript
//First create a voxel set
//  0 = empty
var voxels = require('ndarray-pack')([
  [[0, 1],
   [2, 3]],
  [[0, 0],
   [0, 4]]
])

//Require the module (works with browserify)
var orthogami = require('orthogami')

//Set up options (can skip this if you like)
var options = {
  units: 'mm',            //Units
  bounds: [210, 297],     //Page size
  scale: 10,              //Size of voxel
  lineWidth: 0.1          //Size of dashed line
}

//Then run orthogami
var svgs = orthogami(voxels, options)

//Print out the result
var fs = require('fs')
svgs.forEach(function(svg, idx) {
  fs.writeFileSync('page' + idx + '.svg', svg)
})
```

### Output

#### Page 1:

#### Page 2:

## Install

```
npm install orthogami
```

## API

### `require('orthogami')(voxels[, options])`

Generates an origami template for folding a model from the given voxel object.

* `voxels` is a 3D ndarray of integer values.  `0` values indicate empty voxels.
* `options` is an optional object containing any of the following extra parameters:

    + `colorMap` a function mapping color values in the voxels to SVG color names, or alternatively an array of SVG color names.
    + `bounds` a 2D array representing the size of each page (default `[Infinity, Infinity]`)
    + `scale` a number giving the size of each voxel (default `64`)
    + `convexColor` the color of the convex creases (default `'black'`)
    + `concaveColor` the color of the concave creases (default `'white'`)
    + `tabColor` the color of the tab lines (default `'black'`)
    + `lineWidth` the width of the crease lines (default `1`)
    + `units` the units for the coordinate system (default `'px'`)

**Returns** An array of SVG files encoding the pages of the origami printout

# Credits
(c) 2014 Mikola Lysenko. MIT License