text:
<?hh // strict
namespace traitorous\option;

use traitorous\algebraic\Alternative;
use traitorous\algebraic\Applicative;
use traitorous\algebraic\Monad;
use traitorous\algebraic\MonadOps;
use traitorous\algebraic\MonadPlus;
use traitorous\Option;
use traitorous\outlaw\Add;
use traitorous\outlaw\Eq;
use traitorous\outlaw\Ord;
use traitorous\Either;
use traitorous\either\Left;
use traitorous\either\Right;
use traitorous\Validation;
use traitorous\validation\Success;
use traitorous\validation\Failure;

final class None<T> implements Option<T> {

    public function getEnumKey(): int {
        return Option::NONE;
    }

    public function add(Option<T> $other): Option<T> {
        return $other;
    }

    public function zero(): Option<T> {
        return $this;
    }

    public function map<Tb>((function(T): Tb) $f): Option<Tb> {
        // UNSAFE
        return $this;
    }

    public function ap<Tb, Tc>(Applicative<Tb> $other): Option<Tc> {
        // UNSAFE
        return $this;
    }

    public function orThis(Alternative<T> $other): Option<T> {
        invariant($other instanceof Option, "Expected Option<T>");
        return $other;
    }

    public function orElse((function(): Alternative<T>) $other): Option<T> {
        $result = $other();
        invariant($result instanceof Option, "Expected Option<T>");
        return $result;
    }

    public function flatMap<Tb>((function(T): Monad<Tb>) $f): Option<Tb> {
        // UNSAFE
        return $this;
    }

    public function mplus(MonadPlus<T> $other): Option<T> {
        invariant($other instanceof Option, "Expected an Option<T>");
        return $other;
    }

    public function toRight<Ta>((function():Ta) $left): Either<Ta, T> {
        return new Left($left());
    }

    public function toLeft<Ta>((function():Ta) $right): Either<T, Ta> {
        return new Right($right());
    }

    public function toSuccess<Ta>((function():Ta) $failure): Validation<Ta, T> {
        return new Failure($failure());
    }

    public function toFailure<Ta>((function():Ta) $success): Validation<T, Ta> {
        return new Success($success());
    }

    public function show(): string {
        return "None";
    }

    public function length(): int {
        return 0;
    }

    public function isEmpty(): bool {
        return true;
    }

    public function nonEmpty(): bool {
        return false;
    }

    public function getOrElse((function(): T) $f): T {
        return $f();
    }

    public function getOrDefault(T $default): T {
        return $default;
    }

    public function filter((function(T): bool) $predicate): Option<T> {
        return $this;
    }

    public function equals(Option<T> $other): bool {
        return $other->cata(
            (  ) ==> true,
            ($n) ==> false
        );
    }

    public function compare(Option<T> $other): int {
        return $other->cata(
            (  ) ==> Ord::EQUAL,
            ($_) ==> Ord::LESS
        );
    }

    public function cata<Tb>((function(): Tb) $none, (function(T): Tb) $some): Tb {
        return $none();
    }
}


text:
/**
 * Tests for UnitePackageConfiguration.
 */
import * as Chai from "chai";
import { UnitePackageConfiguration } from "../../../../../../src/configuration/models/unitePackages/unitePackageConfiguration";

describe("UnitePackageConfiguration", () => {
    it("can be created", async() => {
        const obj = new UnitePackageConfiguration();
        Chai.should().exist(obj);
    });
});

redpajama_set_name: RedPajamaGithub


text:
class LCadException(Exception):
    def __init__(self, message):
        message = "!Error, " + message
        Exception.__init__(self, message)

class BooleanException(LCadException):
    def __init__(self):
        LCadException.__init__(self, "value must be 't' or 'nil'.")

class CannotOverrideBuiltIn(LCadException):
    def __init__(self):
        LCadException.__init__(self, "cannot override builtin symbol.")

class CannotSetException(LCadException):
    def __init__(self, item_type):
        LCadException.__init__(self, "type '" + str(item_type.__name__) + "' is not settable.")

class FileNotFoundException(LCadException):
    def __init__(self, filename):
        LCadException.__init__(self, filename + " not found.")

class GroupExistsException(LCadException):
    def __init__(self, name):
        LCadException.__init__(self, "A group with the name '" + name + "' already exists.")

class IllegalArgumentTypeException(LCadException):
    def __init__(self):
        LCadException.__init__(self, "arguments in function definition must be symbols.")

class KeywordException(LCadException):
    def __init__(self, item):
        LCadException.__init__(self, str(item) + " is not a keyword.")

class KeywordValueException(LCadException):
    def __init__(self):
        LCadException.__init__(self, "Keyword with no corresponding value")

class NotAFunctionException(LCadException):
    def __init__(self, name):
        LCadException.__init__(self, "'" + str(name) + "' is not a function. The first element of a form must be a function.")

class NumberArgumentsException(LCadException):
    def __init__(self, expected, got):
        LCadException.__init__(self, "wrong number of standard arguments, got " + str(got) + " expected " + str(expected))

class OutOfRangeException(LCadException):
    def __init__(self, high, val):
        LCadException.__init__(self, "value out of range, got " + str(val) + ", range is 0 - " + str(high))

class SymbolAlreadyExists(LCadException):
    def __init__(self, symbol_name):
        LCadException.__init__(self, "symbol '" + symbol_name + "' already exists.")

class SymbolNotDefined(LCadException):
    def __init__(self, symbol_name):
        LCadException.__init__(self, "symbol '" + symbol_name + "' not defined.")

class UnknownKeywordException(LCadException):
    def __init__(self, item):
        LCadException.__init__(self, str(item) + " is not a valid keyword.")

class VariableNotSetException(LCadException):
    def __init__(self, variable_name):
        LCadException.__init__(self, "variable '" + variable_name + "' used before initialization.")

class WrongTypeException(LCadException):
    def __init__(self, expected, got):
        LCadException.__init__(self, "wrong type, got '" + str(got) + "' expected '" + str(expected) + "'.")

#
# The MIT License
#
# Copyright (c) 2014 Hazen Babcock
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
#


text:
<?php

namespace UthandoNewsletter\Service;

use UthandoCommon\Service\AbstractMapperService;
use UthandoNewsletter\Form\NewsletterForm;
use UthandoNewsletter\Hydrator\NewsletterHydrator;
use UthandoNewsletter\InputFilter\NewsletterInputFilter;
use UthandoNewsletter\Mapper\NewsletterMapper;
use UthandoNewsletter\Model\NewsletterModel;

/**
 * Class Newsletter
 *
 * @package UthandoNewsletter\Service
 * @method NewsletterModel|array|null getById($id, $col = null)
 * @method NewsletterMapper getMapper($mapperClass = null, array $options = [])
 */
class NewsletterService extends AbstractMapperService
{
    protected $form         = NewsletterForm::class;
    protected $hydrator     = NewsletterHydrator::class;
    protected $inputFilter  = NewsletterInputFilter::class;
    protected $mapper       = NewsletterMapper::class;
    protected $model        = NewsletterModel::class;

    /**
     * @return \Zend\Db\ResultSet\HydratingResultSet|\Zend\Db\ResultSet\ResultSet|\Zend\Paginator\Paginator
     */
    public function fetchVisibleNewsletters()
    {
        $models = $this->getMapper()->fetchAllVisible();
        return $models;
    }

    /**
     * @param NewsletterModel $model
     * @return int
     * @throws \UthandoCommon\Service\ServiceException
     */
    public function toggleVisible(NewsletterModel $model)
    {
        $this->removeCacheItem($model->getNewsletterId());

        $visible = (true === $model->isVisible()) ? false : true;

        $model->setVisible($visible);

        return parent::save($model);
    }
}


text:
使用您的 AccessKeyID 和 SecretAccessKey 初始化 Qingstor 对象。

```python
from qingstor.sdk.service.qingstor import QingStor
from qingstor.sdk.config import Config

config = Config('ACCESS_KEY_ID_EXAMPLE', 'SECRET_ACCESS_KEY_EXAMPLE')
qingstor = QingStor(config)
```

然后根据要操作的 bucket 信息(zone, bucket name)来初始化 Bucket。

```python
bucket_name = "your-bucket-name"
zone_name = "pek3b"
bucket_srv = qingstor.Bucket(bucket_name, zone_name)
```

对象创建完毕后,我们需要执行真正的删除 Bucket 操作:

```python
resp = bucket_srv.delete()
if resp.status_code != 204:
    print("Delete bucket({}) in zone:{} failed with given message: {}".format(
        bucket_name,
        zone,
        str(resp.content, 'utf-8')))
else:
    print("Delete bucket successfully.")
```

上面代码中出现的函数:
- `bucket_srv.delete()` 在 `pek3b` 区域删除一个名为 `your-bucket-name` 的 Bucket。

上面代码中出现的对象:
- `resp` 对象是 `bucket_srv.delete()` 方法的返回值。
- `resp.status_code` 存储了 api 操作的 http 状态码。


text:
import { Response } from 'oma/http'
import { Agent, Job, Story } from 'oma/theater'
import { Deployment, NavigateRequest, NavigatorInfo } from 'oma/type'

import { Role } from 'oma/theater/play'

const { parse, stringify } = JSON

import * as React from 'react'
import * as ReactDOM from 'react-dom'

import constants from 'oma/constants'

const { addNavigator, navigatorElement, navigatorKey, resetElement, serviceHome } = constants

import * as http from 'oma/http'

const { createURI, send } = http

import Switcher, { SwitcherProps } from 'oma/dom/switcher'

import * as management from 'oma/theater/management'
import * as play from 'oma/theater/play'

const { loose } = management
const { spawn } = play

class Navigator extends Role<Agent> {

  private info: NavigatorInfo

  private *obtainInfo() {
    const storedNavigatorInfo = sessionStorage.getItem(navigatorKey)
    if (storedNavigatorInfo) {
      return parse(storedNavigatorInfo)
    }
    const { body: fetchedNavigatorInfo }: Response = yield send({
      method: 'POST',
      uri: createURI({ path: [serviceHome, addNavigator] }),
      headers: [['Accept', 'application/json'], ['Content-Type', 'application/json']],
      body: stringify({
        referrer: String(location),
        timezoneOffset: new Date().getTimezoneOffset()
      } as NavigateRequest)
    })
    sessionStorage.setItem(navigatorKey, fetchedNavigatorInfo as string)
    return parse(fetchedNavigatorInfo as string)
  }

  public *initialize(): Story<void> {
    const info: NavigatorInfo = this.info = yield* this.obtainInfo()
    console.log(info)
    window.addEventListener('popstate', event => {
      console.log(event)
      console.log(event.state)
    })
    const resetNode = document.getElementById(resetElement) as HTMLLinkElement
    const props: SwitcherProps = {
      base: document.baseURI as string,
      resetStylePath: resetNode.getAttribute('href') as string,
      terminalStylePath: info.terminalStylePath
    }
    ReactDOM.render(React.createElement(Switcher, props), document.getElementById(navigatorElement))
  }

}

export default spawn<Agent>(loose, Navigator)


text:
package com.hubspot.mesos;

import java.util.List;
import java.util.Objects;

import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.google.common.base.Optional;
import com.wordnik.swagger.annotations.ApiModelProperty;

public class SingularityContainerInfo {
  private final SingularityContainerType type;
  private final Optional<List<SingularityVolume>> volumes;
  private final Optional<SingularityDockerInfo> docker;

  @JsonCreator
  public SingularityContainerInfo(
      @JsonProperty("type") SingularityContainerType type,
      @JsonProperty("volumes") Optional<List<SingularityVolume>> volumes,
      @JsonProperty("docker") Optional<SingularityDockerInfo> docker) {
    this.type = type;
    this.volumes = volumes;
    this.docker = docker;
  }

  @ApiModelProperty(required=true, value="Container type, can be MESOS or DOCKER. Default is MESOS")
  public SingularityContainerType getType() {
    return type;
  }

  @ApiModelProperty(required=false, value="List of volumes to mount. Applicable only to DOCKER container type")
  public Optional<List<SingularityVolume>> getVolumes() {
    return volumes;
  }

  @ApiModelProperty(required=false, value="Information specific to docker runtime settings")
  public Optional<SingularityDockerInfo> getDocker() {
    return docker;
  }

  @Override
  public boolean equals(Object o) {
    if (this == o) {
      return true;
    }
    if (o == null || getClass() != o.getClass()) {
      return false;
    }
    SingularityContainerInfo that = (SingularityContainerInfo) o;
    return type == that.type &&
        Objects.equals(volumes, that.volumes) &&
        Objects.equals(docker, that.docker);
  }

  @Override
  public int hashCode() {
    return Objects.hash(type, volumes, docker);
  }

  @Override
  public String toString() {
    return "SingularityContainerInfo{" +
        "type=" + type +
        ", volumes=" + volumes +
        ", docker=" + docker +
        '}';
  }
}


text:
<?php

include("assets/core/config/part_set_timezone.php");
include("connectDatabase.inc");
include("part_session.php");
include("part_admin_check.php");
include("requestVariableSanitizer.inc");
include("class_category_user_group_validator.php");
include("class_config_reader.php");

$id = sanitize_string($_REQUEST['id']);
$imageId = sanitize_string($_REQUEST['imageId']);

if (trim($id) == "" || trim($imageId) == "") {exit;}

$result = mysql_query("SELECT category FROM documents WHERE id = '{$id}' LIMIT 1");
$row = mysql_fetch_object($result);

//exit if the category has user groups assigned to it and the current user is not a member of any of those groups
$userGroup = new CategoryUserGroupValidator();
$userGroup->loadCategoryUserGroups(sanitize_string($row->category));
if (!$userGroup->allowEditing()) {exit;}

$totalRows = mysql_result(mysql_query("SELECT COUNT(*) AS totalRows FROM imagesDocuments WHERE parentId = '{$id}'"), 0, "totalRows");
$result = mysql_query("SELECT weight FROM imagesDocuments WHERE parentId = '{$id}' AND id = '{$imageId}' ORDER BY weight ASC");

if (mysql_num_rows($result) > 0) {

	$row = mysql_fetch_object($result);
	$weight = $row->weight;

	mysql_query("DELETE FROM imagesDocuments WHERE parentId = '{$id}' AND id = '{$imageId}'");

	for ($x = $weight + 1; $x <= $totalRows; $x++) {

		mysql_query("UPDATE imagesDocuments SET weight = (weight-1) WHERE parentId = '{$id}' AND weight = '{$x}'");

	}

}

//delete the document's image gallery comments and any votes associated to each image gallery comment
mysql_query("DELETE commentsImages, documentVotes FROM commentsImages LEFT JOIN documentVotes ON documentVotes.parentId = commentsImages.id AND documentVotes.type = 'documentImageComment' WHERE commentsImages.imageId = '{$imageId}' AND commentsImages.type = 'documentImageComment'");

//delete versioning information
mysql_query("DELETE FROM documentVersioning WHERE parentId = '{$imageId}' AND documentType = 'documentImage'");

?>


text:
package XrefMapper::ixodes_scapularis;

use  XrefMapper::BasicMapper;

use vars '@ISA';

@ISA = qw{ XrefMapper::BasicMapper };

sub get_set_lists {
  return [["ExonerateGappedBest1_agam", ["ixodes_scapularis","*"]]];  #use same parameters as Anoph. and Culex
}

#Reverse order: second one has higher priority!
sub gene_description_sources {
  return ("Uniprot/SWISSPROT",
	  "Ixodes_ManualAnnotation",
  ) ;
}

#Reverse order: second one has higher priority!
sub transcript_display_xref_sources {
  my $self     = shift;
  my $fullmode = shift;

  my @list = qw(Uniprot/SWISSPROT
		Ixodes_ManualAnnotation
                );

  my %ignore;
  if(!$fullmode){
    $ignore{"EntrezGene"}= 'FROM:RefSeq_[pd][en][pa].*_predicted';
  }
  else{
    $ignore{"EntrezGene"} = 'select ox.object_xref_id from object_xref ox, dependent_xref dx, source s1, xref x1, source s2, xref x2 where ox.object_xref_id = dx.object_xref_id and dx.dependent_xref_id = x1.xref_id and x1.source_id = s1.source_id and s1.name = "EntrezGene" and x2.xref_id = dx.master_xref_id and x2.source_id = s2.source_id and (s2.name like "Refseq_dna_predicted" or s2.name like "RefSeq_peptide_predicted") and ox.ox_status = "DUMP_OUT"';

  }

  return [\@list,\%ignore];

}

# regexps to match any descriptons we want to filter out
sub gene_description_filter_regexps {
  return ();
}1;


text:
#pragma once

#include "../visualizationbase_api.h"

#include "View.h"
#include "MiniMap.h"

namespace Visualization {

class Scene;

class VISUALIZATIONBASE_API MainView: public View
{
	public:
		MainView(Scene *scene);
		virtual ~MainView();

		void setMiniMapSize(int width, int height);

		static const int MINIMAP_DEFAULT_WIDTH = 200;
		static const int MINIMAP_DEFAULT_HEIGHT = 200;
		static const int PNG_SCREENSHOT_SCALE = 8;

		qreal scaleFactor() const;

	protected:
		virtual bool event(QEvent* event) override;
		virtual void resizeEvent(QResizeEvent* event) override;
		virtual void wheelEvent(QWheelEvent* event) override;
		virtual void scrollContentsBy(int dx, int dy) override;
		virtual void keyPressEvent(QKeyEvent* event) override;
		virtual void paintEvent(QPaintEvent* event) override;

		// Used for panning
		virtual void mouseMoveEvent(QMouseEvent *event) override;
		virtual void mousePressEvent(QMouseEvent *event) override;
		virtual void mouseReleaseEvent(QMouseEvent *event) override;

	private:
		MiniMap* miniMap;

		static const int SCALING_FACTOR = 2;
		int scaleLevel;

		bool showTimers_{false};
		QList<QLabel*> infoLabels_; ///< Information text displayed in the top left corner

		bool isPanning_{};
		QPoint panStartPos_{};

		void updateInfoLabels();
		bool setCursorAndOwnerIgnoreScaleForScreenShot(bool ignore, bool modifyOwner);
};

}


text:
class CListView : public Control
{

public:
    enum ViewType
    {
        LISTVIEW_ICON       = LVS_ICON,
        LISTVIEW_SMALL_ICON = LVS_SMALLICON,
        LISTVIEW_LIST       = LVS_LIST,
        LISTVIEW_REPORT     = LVS_REPORT
    };

    CListView();
    void SetView(ViewType view);
    BOOL AddColumn(TCHAR *sText, int width);
    BOOL AddItem(TCHAR *sText, LPARAM lParam, int *pIndex);
    BOOL AddSubItem(unsigned int iItem, unsigned int iCol, TCHAR *sText);

    int  GetSelectedItem();
    BOOL GetItemData(int index, LPARAM *pData);

    void DeleteAllItems();

private:
    ULONG m_cNumColumns;
    ULONG m_cNumItems;
};


text:
using System.Globalization;
using System.IO;
using System.Threading.Tasks;
using Gate.Utils;
using Owin;
using System;
using System.Collections.Generic;
using Gate.Middleware;
using Gate.Middleware.Utils;

namespace Owin
{
    internal static class ContentLengthExtensions
    {
        public static IAppBuilder UseContentLength(this IAppBuilder builder)
        {
            return builder.UseType<ContentLength>();
        }
    }
}

namespace Gate.Middleware
{
    using AppFunc = Func<IDictionary<string, object>, Task>;

    // This middleware defaults to Content-Length if the app does not specify Content-Length
    // or Transfer-Encoding.  The Content-Length is determined by buffering the response body.
    internal class ContentLength
    {
        private readonly AppFunc nextApp;

        public ContentLength(AppFunc nextApp)
        {
            this.nextApp = nextApp;
        }

        public Task Invoke(IDictionary<string, object> env)
        {
            Response response = new Response(env);
            Stream orriginalStream = response.OutputStream;
            TriggerStream triggerStream = new TriggerStream(orriginalStream);
            response.OutputStream = triggerStream;
            MemoryStream buffer = null;
            triggerStream.OnFirstWrite = () =>
            {
                if (IsStatusWithNoNoEntityBody(response.StatusCode)
                    || response.Headers.ContainsKey("Content-Length")
                    || response.Headers.ContainsKey("Transfer-Encoding"))
                {
                    return;
                }

                // Buffer
                buffer = new MemoryStream();
                triggerStream.InnerStream = buffer;
            };

            env[OwinConstants.ResponseBody] = triggerStream;

            return nextApp(env).Then(() =>
            {
                if (buffer != null)
                {
                    if (buffer.Length == 0)
                    {
                        response.Headers.SetHeader("Content-Length", "0");
                    }
                    else
                    {
                        response.Headers.SetHeader("Content-Length", buffer.Length.ToString(CultureInfo.InvariantCulture));
                        buffer.Seek(0, SeekOrigin.Begin);
                        return buffer.CopyToAsync(orriginalStream);
                    }
                }
                else if (!IsStatusWithNoNoEntityBody(response.StatusCode)
                    && !response.Headers.ContainsKey("Content-Length")
                    && !response.Headers.ContainsKey("Transfer-Encoding"))
                {
                    // There were no Writes.
                    response.Headers.SetHeader("Content-Length", "0");
                }
                return TaskHelpers.Completed();
            });
        }

        private static bool IsStatusWithNoNoEntityBody(int status)
        {
            return (status >= 100 && status < 200) ||
                status == 204 ||
                status == 205 ||
                status == 304;
        }
    }
}


text:
[![Build Status](https://travis-ci.org/activecollab/quickbooks.svg?branch=master)](https://travis-ci.org/activecollab/quickbooks)

## Usage

### Authentication

```php
$quickbooks = new ActiveCollab\Quickbooks\Quickbooks([
    'identifier'    => 'example-consumer-key',
    'secret'        => 'example-consumer-key-secret',
    'callback_uri'  => 'http://example.com'
]);
```

### Sandbox

```php
$sandbox = new ActiveCollab\Quickbooks\Sandbox(
    'example-consumer-key',
    'example-consumer-key-secret',
    'example-access-token',
    'example-access-token-secret',
    'example-realmId'
);
```

### Querying API

```php
$dataService = new ActiveCollab\Quickbooks\DataService(
    'example-consumer-key',
    'example-consumer-key-secret',
    'example-access-token',
    'example-access-token-secret',
    'example-realmId'
);
```


text:
#include "dglbusydialog.h"

#include <QProgressBar>

DGLbusyDialog::DGLbusyDialog(QWidget* _parent):QProgressDialog(
    "Starting debugging session (waiting for application to "
    "try "
    "use OpenGL)...",
    "Cancel", 0, 1, _parent) {

    setValue(0);

    QProgressBar *bar = new QProgressBar(this);
    setBar(bar);
    bar->setMaximum(0);
    bar->setMinimum(0);
    bar->setValue(-1);

    setWindowModality(Qt::WindowModal);
    reset();
}


text:
author: Advay Pal
date: 2016-09-30T21:02:22.000Z
title: 'Friday Hacks #119, September 30'
url: /2016/10/friday-hacks-119
---

This week, we have Benjamin from DSO and James from nuTonomy, both talking about Autonomous Vehicles. See you there!

Facebook event [here](https://www.facebook.com/events/800240806745171/).

{{< friday_hack_header venue="SR3, Town Plaza, University Town" date="September 30" >}}

### Autonomous Vehicles: Advances and Algorithms

#### Talk Description:

Autonomous vehicles (also known as self-driving cars) have begun taxi service trials in one-north and Pittsburgh, and are set to dramatically change the way we commute. How did AVs come about and what are the algorithms and advances in technology that have enabled autonomy? This talk introduces the history of AVs, the AI and robotics challenges involved, and some techniques that we use to tackle difficult problems in autonomy (especially in localisation and perception).

#### Speaker Profile

Ben develops and implements algorithms for autonomy in unmanned ground vehicles at DSO National Laboratories. He studied Computer Science at CMU and there first became acquainted with the joys and frustrations of working with robots. Although his work is now robotics-focused, he remains interested in parallel algorithms, compilers, machine learning, and software engineering that can serve society. He also enjoys teaching and mentoring (especially if it has anything to do with programming).

### Autonomous Vehicles for Mobility on Demand

#### Talk Description:

As the population of any city increases, so will the demand of basic infrastructure like transportation. In more affluent cities like Singapore, manpower shortage is major hindrance to maintaining the efficiency of the transportation system. We will explore how autonomous vehicles will address this, what some of the technical challenges are, and how autonomous vehicles will usher in the next generation of mobility.

#### Speaker Profile

James Fu is the Director of Singapore Operations at nuTonomy. He currently oversees the technological development at the Singapore office, which involves the technology and software required for autonomous vehicle driving and intelligent fleet management with the eventual goal of an autonomous mobility service. He was previously a Research Scientist at the Singapore-MIT Alliance for Research and Technology, where he led the Autonomous Vehicles Group under the Future Urban Mobility IRG. At SMART, he was involved and oversaw Singapore's first public trial of autonomous vehicles in Oct 2014, which involved two autonomous golf buggies at the Chinese and Japanese Gardens. He received his Ph.D and B.Eng degrees from the Department of Mechanical Engineering at the National University of Singapore in 2005 and 2013 respectively. His main research interests include multi-agent task allocation, fleet management, and swarm behaviour.


text:
module RGeo

  module Kml

    class << self

      # High-level convenience routine for encoding an object as Kml.
      # Pass the object, which may one of the geometry objects specified
      # in RGeo::Feature, or an appropriate Kml wrapper entity such
      # as RGeo::Kml::Feature or RGeo::Kml::FeatureCollection.
      #
      # The only option supported is <tt>:entity_factory</tt>, which lets
      # you override the types of Kml entities supported. See
      # RGeo::Kml::EntityFactory for more information. By default,
      # encode supports objects of type RGeo::Kml::Feature and
      # RGeo::Kml::FeatureCollection.

      def encode(object_, opts_={})
        Coder.new(opts_).encode(object_)
      end

      # High-level convenience routine for decoding an object from Kml.
      # The input may be a JSON hash, a String, or an IO object from which
      # to read the JSON string.
      #
      # Options include:
      #
      # [<tt>:geo_factory</tt>]
      #   Specifies the geo factory to use to create geometry objects.
      #   Defaults to the preferred cartesian factory.
      # [<tt>:entity_factory</tt>]
      #   Specifies an entity factory, which lets you override the types
      #   of Kml entities that are created. It defaults to the default
      #   RGeo::Kml::EntityFactory, which generates objects of type
      #   RGeo::Kml::Feature or RGeo::Kml::FeatureCollection.
      #   See RGeo::Kml::EntityFactory for more information.
      # [<tt>:json_parser</tt>]
      #   Specifies a JSON parser to use when decoding a String or IO
      #   object. The value may be a Proc object taking the string as the
      #   sole argument and returning the JSON hash, or it may be one of
      #   the special values <tt>:json</tt>, <tt>:yajl</tt>, or
      #   <tt>:active_support</tt>. Setting one of those special values
      #   will require the corresponding library to be available. Note
      #   that the <tt>:json</tt> library is present in the standard
      #   library in Ruby 1.9, but requires the "json" gem in Ruby 1.8.
      #   If a parser is not specified, then the decode method will not
      #   accept a String or IO object; it will require a Hash.

      def decode(input_, opts_={})
        Coder.new(opts_).decode(input_)
      end

      # Creates and returns a coder object of type RGeo::Kml::Coder
      # that encapsulates encoding and decoding settings (principally the
      # RGeo::Feature::Factory and the RGeo::Kml::EntityFactory to be
      # used).
      #
      # The geo factory is a required argument. Other options include:
      #
      # [<tt>:geo_factory</tt>]
      #   Specifies the geo factory to use to create geometry objects.
      #   Defaults to the preferred cartesian factory.
      # [<tt>:entity_factory</tt>]
      #   Specifies an entity factory, which lets you override the types
      #   of Kml entities that are created. It defaults to the default
      #   RGeo::Kml::EntityFactory, which generates objects of type
      #   RGeo::Kml::Feature or RGeo::Kml::FeatureCollection.
      #   See RGeo::Kml::EntityFactory for more information.
      # [<tt>:json_parser</tt>]
      #   Specifies a JSON parser to use when decoding a String or IO
      #   object. The value may be a Proc object taking the string as the
      #   sole argument and returning the JSON hash, or it may be one of
      #   the special values <tt>:json</tt>, <tt>:yajl</tt>, or
      #   <tt>:active_support</tt>. Setting one of those special values
      #   will require the corresponding library to be available. Note
      #   that the <tt>:json</tt> library is present in the standard
      #   library in Ruby 1.9, but requires the "json" gem in Ruby 1.8.
      #   If a parser is not specified, then the decode method will not
      #   accept a String or IO object; it will require a Hash.

      def coder(opts_={})
        Coder.new(opts_)
      end

    end

  end

end


text:
package com.yandex.money.api.net;

/**
 * API responses implement this interface.
 *
 * @author Slava Yasevich (vyasevich@yamoney.ru)
 */
public interface MethodResponse {
    String CODE_SUCCESS = "success";
    String CODE_REFUSED = "refused";
    String CODE_HOLD_FOR_PICKUP = "hold_for_pickup";
    String CODE_IN_PROGRESS = "in_progress";
    String CODE_EXT_AUTH_REQUIRED = "ext_auth_required";
    String CODE_UNKNOWN = "unknown";
}


text:
'use strict';

angular.module('videoEmbedApp.version', [
  'videoEmbedApp.version.interpolate-filter',
  'videoEmbedApp.version.version-directive'
])

.value('version', '0.1');


text:
import express from 'express'

import {userCan} from 'src/common/util'
import {LGNotAuthorizedError, LGBadRequestError} from 'src/server/util/error'
import logger from 'src/server/util/logger'

const app = new express.Router()

app.get('/reports/:reportName', requestHandler)

export default app

const SENSITIVE_REPORTS = [
  'projectTeams',
  'memberRetroFeedback',
]
const PUBLIC_REPORTS = [
]

function requestHandler(req, res, next) {
  const {reportName} = req.params

  assertReportNameIsValid(reportName)
  assertUserCanViewReport(req.user)

  const reportHandler = require(`./${reportName}`)
  const handleReport = typeof reportHandler === 'function' ? reportHandler : reportHandler.default

  res.set('Content-Type', 'text/csv')
  return handleReport(req, res).catch(err => {
    logger.error(err)
    next()
  })
}

function assertUserCanViewReport(user, reportName) {
  if (SENSITIVE_REPORTS.includes(reportName)) {
    if (!user || !userCan(user, 'viewSensitiveReports')) {
      throw new LGNotAuthorizedError()
    }
  }
}

function assertReportNameIsValid(name) {
  const validReportNames = SENSITIVE_REPORTS.concat(PUBLIC_REPORTS)
  if (!validReportNames.includes(name)) {
    throw new LGBadRequestError(`Invalid report name: "${name}". Valid reports are ${validReportNames.join(', ')}`)
  }
}


text:
      <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
        Toggle navigation

      </button>
      <a class="navbar-brand" href="<?php echo base_url(); ?>">rockEnroll

            <?php if ( $coach === TRUE ) : ?>
            <?php if (empty($coachteam)) {?>
            <?php echo
            '
Create a team
'; ?>
            <?php } else {?>
            <?php foreach ($coachteam as $row): ?>
            <?php echo
            '
' . $row['teamname'] . '
';?>
            <?php endforeach;
                if(count($coachteam) <= 2)
                {
                    echo '
Create a team
';
                }
            } ?>
            <?php else : ?>
            <?php if (empty($playerteam)) {?>
            <?php echo
            '
Join a team
';?>
            <?php } else {?>
            <?php foreach ($playerteam as $row): ?>
            <?php echo
            '
' .$row['teamname'] . '
';?>
            <?php endforeach;
                if(count($playerteam) <= 2)
                {
                    echo '
Join a team
';
                }
            } ?>
            <?php endif; ?>

                    <?php echo $userdata->username; ?>

<a href="<?php echo base_url(); ?>index.php/profile">My Profile

<a href="<?php echo base_url(); ?>index.php/auth/logout">Logout

                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>

Create team

                <form id="input_form" action="" method="POST">

                        Team Name:
                        <input type="text" class="form-control" id="create_teamname" value="<?php echo set_value('teamname'); ?>" name="teamname" placeholder="Team name" autofocus />

                        Sport:
                        <select class="form-control" name="sport" id="create_sport" value="">
                            <option value="0" name="choose" selected>Choose sport</option>
                            <option value="Football" name="Football">Football</option>
                            <option value="Badminton" name="Badminton">Badminton</option>
                            <option value="Bandy" name="Bandy">Bandy</option>
                            <option value="Baseball" name="Baseball">Baseball</option>
                            <option value="Basketball" name="Basketball">Basketball</option>
                            <option value="Biathlon" name="Biathlon">Biathlon</option>
                            <option value="Cross-country" name="Cross-country">Cross-country</option>
                            <option value="Cycling" name="Cycling">Cycling</option>
                            <option value="Field hockey" name="Field hockey">Field hockey</option>
                            <option value="Handball" name="Handball">Handball</option>
                            <option value="Ice hockey" name="Ice hockey">Ice hockey</option>
                            <option value="Lacrosse" name="Lacrosse">Lacrosse</option>
                            <option value="Rugby" name="Rugby">Rugby</option>
                            <option value="Track and field" name="Track and field">Track and field</option>
                            <option value="Volleyball" name="Volleyball">Volleyball</option>
                            <option value="Water polo" name="Water polo">Water polo</option>
                        </select>

                <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
                <button type="button" id="createteamsubmit" class="btn btn-info">Create team</button>

            </form>

                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>

Join team

                            <input rel="popover" class="check_all" id="selectall" type="hidden" />
                            Team Name
                            Sport
                            Coach

                    <?php $playerteamlist = array();
                    if (empty($playerteam))
                    {}
                    else
                    {
                        foreach ($playerteam as $pt)
                        {
                            $playerteamlist[] = $pt['team_id'];
                        }
                    } ?>
                    <?php foreach ($teams as $team):?>

                            <input form="team" type="checkbox" name="team[]" id="teamids" value="<?php echo $team['id'];?>" <?php if(in_array($team['id'], $playerteamlist)) {echo "disabled='disabled'";}?> >

<?php echo $team['teamname'];?>

<?php echo $team['sport'];?>

<?php echo $team['coach'];?>

                    <?php endforeach;?>

                <form id="team" action="" method="post">
                    <button class="btn btn-info" id="jointeamsubmit" type="button" disabled>Join team</button>
                </form>


text:
<?php

namespace App\Domain;

use Illuminate\Support\Facades\Log;

class IpnResponder
{
    private $ipnDataStore;

    private $verifier;

    public function __construct(
        \App\Domain\IpnDataStore $ipnDataStore,
        \App\Domain\IpnMessageVerifier $verifier
    ) {
        $this->ipnDataStore = $ipnDataStore;
        $this->verifier = $verifier;
    }

    public function verifyIpnMessage($ipnMessage)
    {
        if ($this->ipnMessageisNotFromPaypal($ipnMessage)) {
            return false;
        }

        if ($this->ipnMessageHasBeenReceivedBefore($ipnMessage)) {
            return false;
        }

        $this->saveIpnMessage($ipnMessage);

        Log::info(__METHOD__.":".__LINE__.": Verified IPN message {$this->get('txn_id', $ipnMessage)}.");

        return true;
    }

    private function hasBeenReceivedBefore($ipnMessage)
    {
        return $this->ipnDataStore->doesMessageExist($ipnMessage);
    }

    public function get($key, $ipnMessage)
    {
        return $ipnMessage[$key];
    }

    public function getItemsPurchased($ipnMessage)
    {
        $items = [];
        if (! is_array($ipnMessage)) {
            return $items;
        }
        $findItemKeys = function ($key, $value) {
            if (strpos($key, "item_number") !== false) {
                return $value;
            }
        };
        $items = array_filter(array_map($findItemKeys, array_keys($ipnMessage), array_values($ipnMessage)));

        return $items;
    }

    private function isVerified($ipnMessage)
    {
        return $this->verifier->compute($ipnMessage);
    }

    private function ipnMessageIsNotFromPaypal($ipnMessage)
    {
        if (! $this->isVerified($ipnMessage)) {

            Log::info(__METHOD__.":".__LINE__.": The IPN message couldn't be verified {$this->get('txn_id', $ipnMessage)}.");

            return true;
        } else {
            return false;
        }
    }

    private function ipnMessageHasBeenReceivedBefore($ipnMessage)
    {
        if ($this->hasBeenReceivedBefore($ipnMessage)) {

            Log::info(__METHOD__.":".__LINE__.": The IPN message has been received before {$this->get('txn_id', $ipnMessage)}.");

            return true;
        } else {
            return false;
        }
    }

    private function saveIpnMessage($ipnMessage)
    {
        return $this->ipnDataStore->storeMessage($ipnMessage);
    }
}


text:
module API
  module Entities
    class PackageVersion < Grape::Entity
      expose :id
      expose :version
      expose :created_at
      expose :tags

      expose :pipeline, if: ->(package) { package.build_info }, using: Package::Pipeline
    end
  end
end


text:
using System;
using SharepointCommon.Attributes;
using SharepointCommon.Test.ER.Entities;

namespace SharepointCommon.Test.ER.Receivers
{
    public class DeletingDocReceiver : ListEventReceiver<DeletingDoc>
    {
        [Async(false)]
        public override void ItemDeleting(DeletingDoc deleted)
        {
            try
            {
                DeletingDoc.IsDeleteCalled = true;
                DeletingDoc.Received = deleted;
            }
            catch (Exception e)
            {
                DeletingDoc.Exception = e;
            }
        }
    }
}


text:
Levels are defined by two files: metadata (a json file) and a layout (.map file).

## Metadata

Should be a json object with the following keys:

* `name` (a descriptive string)
* `layout` (filename of the layout file, described below)
* `music` (filename of the music file to be used)
* `tiles` (*optional*, filename of the tileset to be used if different from default)
* `background` (*optional*, filename of the background image to be used if different from default)

## Layout

.map files are plain text files containing characters that are arranged in the shape of the level. Different characters mean different things. Follow this key:

* `_` Solid ground
* `#` Solid tile, not ground-level
* `=` Solid tile but is not on the ground
* `^` Hazard ("spikes" - only contact from above does damage)
* `*` Hazard ("fire" - any contact does damage)
* `1` Enemy (AI type 1)
* `2` Enemy (AI type 2)
* `$` Coin/collectable pickup
* `R` Spawn point
* `E` Level exit

### Tilesets

Tiles in a tileset should be 64x64 in size. A tileset is an array of 64x64 pixel tiles in a single image. They should appear in this image in the following order from left to right.

1. Solid ground
2. Solid ground, variant
2. Solid tile
3. Solid tile, not on ground


text:
require 'colorize'
module Stylio
  module Generators
    class Component
      attr_reader :name

      def initialize(name)
        @name = name
      end

      def fullpath(extension)
        if extension == 'html.erb'
          "components/#{name}/_#{name}.#{extension}"
        else
          "components/#{name}/#{name}.#{extension}"
        end
      end

      def generate
        puts "Generating component with name #{name}".yellow
        FileUtils::mkdir_p "components/#{name}"
        puts "Created folder components/#{name}".green

        File.open(fullpath('yml'), 'w') do |f|
          f.write('')
        end
        puts "Created file #{fullpath('yml')}".green

        File.open(fullpath('html.erb'), 'w') do |f|
          f.write('')
        end
        puts "Created file #{fullpath('html.erb')}".green

        puts "Generated component with name #{name}".green
      end
    end
  end
end


text:
            <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
                Toggle navigation

            </button>
            elastic-erga

                <li class="dropdown <@yield('active_tab_alert_list')">
                    Dashboard

All alerts setup

Active percentage alerts

Active hit alerts

Active zero hit alerts

Errors with configuration

Create new alert

Terminal

System log

                    <li class="dropdown <@yield('active_tab_misc_list')">
                        Misc.

Check all now


text:
package org.apache.beam.runners.core.triggers;

import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.is;

import org.apache.beam.runners.core.triggers.TriggerStateMachineTester.SimpleTriggerStateMachineTester;
import org.apache.beam.sdk.transforms.windowing.BoundedWindow;
import org.apache.beam.sdk.transforms.windowing.FixedWindows;
import org.apache.beam.sdk.transforms.windowing.IntervalWindow;
import org.apache.beam.sdk.values.TimestampedValue;
import org.joda.time.Duration;
import org.joda.time.Instant;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.JUnit4;

/** Tests for {@link NeverStateMachine}. */
@RunWith(JUnit4.class)
public class NeverStateMachineTest {
  private SimpleTriggerStateMachineTester<IntervalWindow> triggerTester;

  @Before
  public void setup() throws Exception {
    triggerTester =
        TriggerStateMachineTester.forTrigger(
            NeverStateMachine.ever(), FixedWindows.of(Duration.standardMinutes(5)));
  }

  @Test
  public void falseAfterEndOfWindow() throws Exception {
    triggerTester.injectElements(TimestampedValue.of(1, new Instant(1)));
    IntervalWindow window =
        new IntervalWindow(new Instant(0), new Instant(0).plus(Duration.standardMinutes(5)));
    assertThat(triggerTester.shouldFire(window), is(false));
    triggerTester.advanceInputWatermark(BoundedWindow.TIMESTAMP_MAX_VALUE);
    assertThat(triggerTester.shouldFire(window), is(false));
  }
}


text:
/* v3conf.c */
/* Written by Dr Stephen N Henson (shenson@bigfoot.com) for the OpenSSL
 * project 1999.
 */
/* ====================================================================
 * Copyright (c) 1999 The OpenSSL Project.  All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 *
 * 1. Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 *
 * 2. Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in
 *    the documentation and/or other materials provided with the
 *    distribution.
 *
 * 3. All advertising materials mentioning features or use of this
 *    software must display the following acknowledgment:
 *    "This product includes software developed by the OpenSSL Project
 *    for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)"
 *
 * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
 *    endorse or promote products derived from this software without
 *    prior written permission. For written permission, please contact
 *    licensing@OpenSSL.org.
 *
 * 5. Products derived from this software may not be called "OpenSSL"
 *    nor may "OpenSSL" appear in their names without prior written
 *    permission of the OpenSSL Project.
 *
 * 6. Redistributions of any form whatsoever must retain the following
 *    acknowledgment:
 *    "This product includes software developed by the OpenSSL Project
 *    for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)"
 *
 * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
 * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE OpenSSL PROJECT OR
 * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
 * OF THE POSSIBILITY OF SUCH DAMAGE.
 * ====================================================================
 *
 * This product includes cryptographic software written by Eric Young
 * (eay@cryptsoft.com).  This product includes software written by Tim
 * Hudson (tjh@cryptsoft.com).
 *
 */

#include <stdio.h>
#include "cryptlib.h"
#include <openssl/asn1.h>
#include <openssl/conf.h>
#include <openssl/x509.h>
#include <openssl/x509v3.h>

/* Test application to add extensions from a config file */

int main(int argc, char **argv)
{
	LHASH *conf;
	X509 *cert;
	FILE *inf;
	char *conf_file;
	int i;
	int count;
	X509_EXTENSION *ext;
	X509V3_add_standard_extensions();
	ERR_load_crypto_strings();
	if(!argv[1]) {
		fprintf(stderr, "Usage: v3conf cert.pem [file.cnf]\n");
		exit(1);
	}
	conf_file = argv[2];
	if(!conf_file) conf_file = "test.cnf";
	conf = CONF_load(NULL, "test.cnf", NULL);
	if(!conf) {
		fprintf(stderr, "Error opening Config file %s\n", conf_file);
		ERR_print_errors_fp(stderr);
		exit(1);
	}

	inf = fopen(argv[1], "r");
	if(!inf) {
		fprintf(stderr, "Can't open certificate file %s\n", argv[1]);
		exit(1);
	}
	cert = PEM_read_X509(inf, NULL, NULL);
	if(!cert) {
		fprintf(stderr, "Error reading certificate file %s\n", argv[1]);
		exit(1);
	}
	fclose(inf);

	sk_pop_free(cert->cert_info->extensions, X509_EXTENSION_free);
	cert->cert_info->extensions = NULL;

	if(!X509V3_EXT_add_conf(conf, NULL, "test_section", cert)) {
		fprintf(stderr, "Error adding extensions\n");
		ERR_print_errors_fp(stderr);
		exit(1);
	}

	count = X509_get_ext_count(cert);
	printf("%d extensions\n", count);
	for(i = 0; i < count; i++) {
		ext = X509_get_ext(cert, i);
		printf("%s", OBJ_nid2ln(OBJ_obj2nid(ext->object)));
		if(ext->critical) printf(",critical:\n");
		else printf(":\n");
		X509V3_EXT_print_fp(stdout, ext, 0, 0);
		printf("\n");

	}
	return 0;
}


text:
<?php

namespace Trello\Model;

/**
 * @codeCoverageIgnore
 */
class Organization extends AbstractObject implements OrganizationInterface
{
    protected $apiName = 'organization';

    protected $loadParams = array(
        'fields' => 'all',
        'members' => 'all',
        'membersInvited' => 'all',
    );

    /**
     * {@inheritdoc}
     */
    public function setName($name)
    {
        $this->data['name'] = $name;

        return $this;
    }

    /**
     * {@inheritdoc}
     */
    public function getName()
    {
        return $this->data['name'];
    }

    /**
     * {@inheritdoc}
     */
    public function setDisplayName($displayName)
    {
        $this->data['displayName'] = $displayName;

        return $this;
    }

    /**
     * {@inheritdoc}
     */
    public function getDisplayName()
    {
        return $this->data['displayName'];
    }

    /**
     * {@inheritdoc}
     */
    public function setDescription($desc)
    {
        $this->data['desc'] = $desc;

        return $this;
    }

    /**
     * {@inheritdoc}
     */
    public function getDesciption()
    {
        return $this->data['desc'];
    }

    /**
     * {@inheritdoc}
     */
    public function setDescriptionData($descData)
    {
        $this->data['descData'] = $descData;

        return $this;
    }

    /**
     * {@inheritdoc}
     */
    public function getDescriptionData()
    {
        return $this->data['descData'];
    }

    /**
     * {@inheritdoc}
     */
    public function setBoardIds(array $boardIds)
    {
        $this->data['idBoards'] = $boardIds;

        return $this;
    }

    /**
     * {@inheritdoc}
     */
    public function getBoardIds()
    {
        return $this->data['idBoards'];
    }

    /**
     * {@inheritdoc}
     */
    public function getBoards()
    {
        $boards = array();

        foreach ($this->data['idBoards'] as $boardId) {
            $boards[] = new Board($this->client, $boardId);
        }

        return $boards;
    }

    /**
     * {@inheritdoc}
     */
    public function setInvited(array $invited)
    {
        $this->data['invited'] = $invited;

        return $this;
    }

    /**
     * {@inheritdoc}
     */
    public function getInvited()
    {
        return $this->data['invited'];
    }

    /**
     * {@inheritdoc}
     */
    public function setInvitations(array $invitations)
    {
        $this->data['invitations'] = $invitations;

        return $this;
    }

    /**
     * {@inheritdoc}
     */
    public function getInvitations()
    {
        return $this->data['invitations'];
    }

    /**
     * {@inheritdoc}
     */
    public function getMemberships()
    {
        return $this->data['memberships'];
    }

    /**
     * {@inheritdoc}
     */
    public function setPreferences(array $prefs)
    {
        $this->data['prefs'] = $prefs;

        return $this;
    }

    /**
     * {@inheritdoc}
     */
    public function getPreferences()
    {
        return $this->data['prefs'];
    }

    /**
     * {@inheritdoc}
     */
    public function setPowerUps(array $powerUps)
    {
        $this->data['powerUps'] = $powerUps;

        return $this;
    }

    /**
     * {@inheritdoc}
     */
    public function getPowerUps()
    {
        return $this->data['powerUps'];
    }

    /**
     * {@inheritdoc}
     */
    public function setProducts(array $products)
    {
        $this->data['products'] = $products;

        return $this;
    }

    /**
     * {@inheritdoc}
     */
    public function getProducts()
    {
        return $this->data['products'];
    }

    /**
     * {@inheritdoc}
     */
    public function getBillableMemberCount()
    {
        return $this->data['billableMemberCount'];
    }

    /**
     * {@inheritdoc}
     */
    public function setUrl($url)
    {
        $this->data['url'] = $url;

        return $this;
    }

    /**
     * {@inheritdoc}
     */
    public function getUrl()
    {
        return $this->data['url'];
    }

    /**
     * {@inheritdoc}
     */
    public function setWebsite($website)
    {
        $this->data['website'] = $website;

        return $this;
    }

    /**
     * {@inheritdoc}
     */
    public function getWebsite()
    {
        return $this->data['website'];
    }

    /**
     * {@inheritdoc}
     */
    public function setLogoHash($logoHash)
    {
        $this->data['logoHash'] = $logoHash;

        return $this;
    }

    /**
     * {@inheritdoc}
     */
    public function getLogoHash()
    {
        return $this->data['logoHash'];
    }

    /**
     * {@inheritdoc}
     */
    public function setPremiumFeatures(array $premiumFeatures)
    {
        $this->data['premiumFeatures'] = $premiumFeatures;

        return $this;
    }

    /**
     * {@inheritdoc}
     */
    public function getPremiumFeatures()
    {
        return $this->data['premiumFeatures'];
    }
}


text:
<!DOCTYPE HTML>

	<meta charset="utf-8">
	<title>Easy Tab Manager Help/Guide</title>

	<link rel="stylesheet" href="../css/option.css">

Easy Tab Manager

Help/Guide

Easy Tab Manager eases the management of tabs/windows, especially for those who like to keep a lot of tabs and windows opened.

						Please do the following after the install:

Go to the Extensions page (for example, with Ctrl+Shift+e or choose "Manage" in the Extensionbar's context menu) and check on "Enable in Private Mode". This is important for the proper working of Easy Tab Manager.

						How to use:

You can call actions with buttons from the sidebar or with context Menu.

After opening the popup with the toolbar button, the first thing to do (except at buttons with the word 'all' or at certain menu actions) is to select your chosen tabs or windows for a certain action.

The selection in the Window/Tab list is easy: just leftclick on an item to select it and do it again to unselect. You have to select tabs you can search for tabs in any of your Opera windows. You can also make actions with tabs from different windows at the same time.

						Notes:

You can select only windows or only tabs at the same time.

You don't need to select anything from the tablist if you'd like to change one certain item by the use of the context menus. On the other hand, please make sure that you've unselected all items before you intend to use Context Menus just on the clicked tab or window.

Finally, click on the command button you need or call context menu and click on your chosen action there.

Easy Tab Manager saves the browsing history into a list so you can reopen any recently loaded site into a separate tab by doubleclicking from the history list's context menu.

You can easily switch between the tablist and the history list by clicking on the upper buttons "Current" and "History".

Functions

Sidebar and its functions in the Context Menus

						Switch

You can switch to any window or tab by doubleclicking or rightclicking on it.

							New

You can open a new tab in any window, just select the right window and click New Tab to make it. If you don't select any windows, the new tab will appear in your active window. New Tab could only open 1 tab in a window but if you need tabs in separate windows it can open 1 in each of selected windows.

Also, you can call New Windows (Normal and Private).

You can also find "New" as "Create" in a window's context menu. Note: You only need to select for "Create tab" if you'd like to open tabs in more windows.

							Close

Using Close Selected, you can close any number of selected tabs OR windows.

Close All won't close Opera. It will keep one window with a new tab.

You'll also find Close Selected as "Close" in any Tab Context Menu and Window Context Menu.

							Reload

Select the chosen tabs OR windows to use Reload Selection or just simply Reload All.

You can also find Reload Selected in both Tab and Windows Context Menu.

							Pin

Select any normal tabs and so Pin Selected will pin them. You can do the reverse by the context menus.

You can also Pin All tabs or Unpin All of them.

You'll find Pin Selected as "Pin" in any Tab Context Menu and "Pin all tabs" in Windows Context Menus (it means pin all tabs in the contextual or in all the selected windows).

							Private

								Similar to Pin, you can use Private Selected to private or unprivate or even doing both of them at the same time by one click, but you have to select no tabs but windows here (private tabs aren't reintroduced in Opera yet). There are also All Private and All Normal commands available for your convenience.
								Please do note that, Selected button will toggle the window state between Private and Normal no matter how many windows are selected.

You'll find Private Selected as "Private" in the Window Context Menu. The menu's Private also toggle each selected window's state.

							Move

Click on Move Tabs after the selection. You'll get a message: "Please select target Window". Click OK and select a window: all selected tabs from any window will move into that window.

							Split

Using Split, you'll get a new window and the all selected tabs will move into it. You can also find Split in the Tab Context Menu.

							Merge

You can merge any number of selected windows into a single one.

							Clone

Use Clone to make copies for each of your selected tabs. You can also find Clone in both kind of context menus.

							Duplicates

This will remove all duplicate tabs (Pinned tabs are not removed).

							Functions

You can also find Sidebar actions here.

Please remember that there are two kind of use of the Context Menus in Easy Tab Manager.

-When you'd like to change only one tab or window. Then you needn't select this one if you find the action of your chose in its respective context menu.

-Howerver, if you'd like to change more of them then you need to select them similar to the use of the Sidebar buttons.

Tab Context Menu

							Pin

You can pin all of your chosen tabs with it.

							Unpin

You can undo any pin with it on tab(s) of your choice.

							Create Tab Before

It will create a new tab before your chosen (contextual or selected) one.

Create Tabs After will create the new one after your tab.

							Clone

Use Clone for duplicating any tabs.

							Split

You can split each of your chosen tabs into a separate window.

							Reload

Using Reload you can reload all of your chosen tabs.

							Close Tabs Above

It will close each tab above your chosen tab(s) but only in that window(s) where you've selected any tab or called context menu.

Close Tabs Below will do it to the reverse direction.

							Close

It will close all tabs of your choice.

							Window Context Menu

Each action in the menu affects all tabs in the contextual window or in all selected windows.

							Create

Create is a submenu: -You can Create Tab in the contextual window, you can Create a separate Window or call a Private Window.

							Reload

You can choose whole windows to be reloaded here.

							Close

You can close the contextual window, or select windows before clicking on Close.

							Private

Private will toggle the state of the chosen windows between Normal and Private mode.

							Clone

You can duplicate whole windows with Clone, but only what you've chosen by instant rightclicking or selecting window(s) and rightclicking them after.

							Remove Duplicates

Only the contextual or the selected windows will be scanned for duplicates.

							Pin all tabs

You can pin only all tabs in your chosen window(s) with it.

							Unpin all tabs

It will only unpin tabs in windows of your choice

							Reopen last closed tab

It will reopen only tabs that were closed in the contextual or in the selected windows.

							History Context Menu

You cannot select here.

						Open

It opens the contextual, early visited page in a new tab.

							Delete

You can remove history items by rightclicking on them and choosing Delete.

Info and Support page

Support page : Tab Manager Github

Contributed by Peter: PeterMinin

Documentation prepared by Szabó Csaba


text:
from __future__ import absolute_import
from __future__ import unicode_literals

import tempfile

from keg.utils import pymodule_fpaths_to_objects

class TestUtils(object):

    def test_pymodule_fpaths_to_objects(self):
        with tempfile.NamedTemporaryFile(delete=False) as fh:
            fpath1 = fh.name
            fh.write(b'foo1="bar"')

        with tempfile.NamedTemporaryFile(delete=False) as fh:
            fpath2 = fh.name
            fh.write(b'foo2="bar"')

        with tempfile.NamedTemporaryFile() as fh:
            fpath3 = fh.name

        result = pymodule_fpaths_to_objects([fpath1, fpath2, fpath3])

        fpath, fpath_objs = result.pop(0)
        assert fpath == fpath1
        assert fpath_objs['foo1'] == 'bar'

        fpath, fpath_objs = result.pop(0)
        assert fpath == fpath2
        assert fpath_objs['foo2'] == 'bar'

        # result should now be empty since fpath3 should get filtered out b/c it's not present
        assert len(result) == 0


text:
<?xml version="1.0" encoding="utf-8"?>
<ScrollView android:background="@color/CS_background" android:layout_width="fill_parent" android:layout_height="fill_parent"
  xmlns:android="http://schemas.android.com/apk/res/android">
    <LinearLayout android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="wrap_content">
        <TextView android:textAppearance="?android:textAppearanceMedium" android:textColor="@color/CS_black" android:autoLink="web" android:id="@id/text" android:layout_width="fill_parent" android:layout_height="wrap_content" />
    </LinearLayout>
</ScrollView>


text:
#include "third_party/blink/renderer/core/dom/sink_document.h"

#include "third_party/blink/renderer/core/dom/raw_data_document_parser.h"
#include "third_party/blink/renderer/platform/instrumentation/use_counter.h"

namespace blink {

class SinkDocumentParser : public RawDataDocumentParser {
 public:
  explicit SinkDocumentParser(SinkDocument* document)
      : RawDataDocumentParser(document) {}

 private:
  // Ignore all data.
  void AppendBytes(const char*, size_t) override {}
};

SinkDocument::SinkDocument(const DocumentInit& initializer)
    : HTMLDocument(initializer) {
  SetCompatibilityMode(kNoQuirksMode);
  LockCompatibilityMode();
}

DocumentParser* SinkDocument::CreateParser() {
  return MakeGarbageCollected<SinkDocumentParser>(this);
}

}  // namespace blink


text:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
	android:layout_width="match_parent" android:layout_height="match_parent"
	android:orientation="vertical">
	<!--
	  <TextView android:layout_height="wrap_content" android:id="@+id/main_intro"
		  android:text="@string/english_ime_name" android:layout_width="wrap_content"
		  android:textStyle="bold" android:textSize="25sp"></TextView>
	-->
	<TableLayout android:layout_width="match_parent"
		android:id="@+id/main_linear1" android:layout_height="wrap_content">
		<TableRow>
			<Button android:text="@string/main_setup_configure_imes"
				android:id="@+id/main_setup_btn_configure_imes"
				android:layout_width="wrap_content" android:layout_height="wrap_content"></Button>
			<Button android:text="@string/main_setup_input_lang"
				android:id="@+id/main_setup_btn_input_lang" android:layout_width="wrap_content"
				android:layout_height="wrap_content"></Button>
		</TableRow>
		<TableRow>
			<Button android:text="@string/main_setup_set_ime" android:id="@+id/main_setup_btn_set_ime"
				android:layout_width="wrap_content" android:layout_height="wrap_content"></Button>
			<Button android:text="@string/main_setup_get_dicts"
				android:id="@+id/main_setup_btn_get_dicts" android:layout_width="wrap_content"
				android:layout_height="wrap_content"></Button>
		</TableRow>
	</TableLayout>
	<TextView android:layout_height="wrap_content" android:id="@+id/main_description"
		android:layout_width="wrap_content"></TextView>
</LinearLayout>


text:
'use strict';

var postcss = require('postcss');
var assign = require('object-assign');
var t = require('tcomb');

var plugin = 'postcss-property-lookup';
var lookupPattern = /@\(?([a-z-]+)\)?\b/g;

var LogLevel = t.enums.of(['error', 'warn'], 'LogLevel');
var PluginOptions = t.struct({
  logLevel: LogLevel
}, 'PluginOptions');

var defaultOptions = {
  logLevel: 'warn'
};

module.exports = postcss.plugin(plugin, propertyLookup);

function propertyLookup(options) {
  var _this = this;

  var errorContext = { plugin: plugin };
  options = new PluginOptions(assign({}, defaultOptions, options));

  var log = ({
    warn: function warn(message, rule, result) {
      rule.warn(result, message);
    },
    error: function error(message, rule) {
      throw rule.error(message, errorContext);
    }
  })[options.logLevel];

  if (!log) {
    throw new Error('Invalid logLevel: ' + options.logLevel);
  }

  return function (root, result) {
    root.walkRules(function (rule) {
      eachDecl(rule, function (decl) {
        if (decl.value.indexOf('@') === -1) {
          return;
        }
        decl.value = decl.value.replace(lookupPattern, resolveLookup.bind(_this, rule));
      });
    });

    function resolveLookup(rule, orig, prop) {
      var resolvedValue = closest(rule, prop);

      if (!resolvedValue) {
        log('Unable to find property ' + orig + ' in ' + rule.selector, rule, result);
      }

      return resolvedValue;
    }

    function closest(container, prop) {
      if (!container) {
        return '';
      }
      var resolvedValue = undefined;

      eachDecl(container, function (decl) {
        if (decl.prop === prop) {
          resolvedValue = decl.value;
        }
      });

      if (!resolvedValue) {
        return closest(container.parent, prop);
      }

      if (resolvedValue.indexOf('@') === -1) {
        return resolvedValue;
      }

      return resolvedValue.replace(lookupPattern, resolveLookup.bind(this, container));
    }
  };
}

function eachDecl(container, callback) {
  container.each(function (node) {
    if (node.type === 'decl') {
      callback(node);
    }
    // Recurse through child declarations of a media rule
    if (node.type === 'atrule') {
      eachDecl(node, callback);
    }
  });
}


text:
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Contact extends CI_Controller
{

	public function __construct()
	{
		parent::__construct();

		if ($this->session->userdata('username') == "")
		{
			redirect('admin/auth');
		}

		$this->load->model('Model_user');
		$this->load->model('Model_contact');
		$this->load->helper('text');
	}

	public function index()
	{
		$id = '1';

		$admin 	 = $this->Model_user->get_admin();
		$contact = $this->Model_contact->get_by_id($id);

		$data['admin']			= $admin;
		$data['contact']		= $contact;
		$data['header']			= 'admin/header';
		$data['menu']			= 'admin/menu';
		$data['content']		= 'admin/contact';
		$data['title']			= 'Master';
		$data['sub_title']		= 'Contact & Footer';
		$data['username'] 		= $this->session->userdata('username');

		$this->load->view('admin/home', $data);
	}

	public function get_id($id)
    {
        $data = $this->Model_contact->get_by_id($id);
        echo json_encode($data);
    }

    public function update()
    {
    	$data = array(
            'contact_layout'      => $this->input->post('contact_layout'),
            'contact_title'    	  => $this->input->post('contact_title'),
            'contact_bgcolor'     => $this->input->post('contact_bgcolor'),
            'contact_content'     => $this->input->post('contact_content'),
        );

        if($this->input->post('remove_image'))
        {
            if(file_exists($this->input->post('remove_image')) && $this->input->post('remove_image'))
            {
                unlink($this->input->post('remove_image'));
            }

            $data['contact_bgimage'] = '';
        }

        $image = $_FILES['contact_bgimage']['name'];

        if(!empty($image))
        {
            $config =   [
                'upload_path'   => './assets/uploads/contact/',
                'allowed_types' => 'gif|jpg|png|jpeg',
                'max_size'      => 1000,
                'max_width'     => 0,
                'max_height'    => 0
            ];

            $this->load->library('upload', $config);
            $this->upload->do_upload('contact_bgimage');
            $file = $this->upload->data();
            $data_image = 'assets/uploads/contact/' . $file['file_name'];

            $contact = $this->Model_contact->get_by_id($this->input->post('contact_id'));

            if(file_exists($contact->contact_bgimage) && $contact->contact_bgimage)
            {
                unlink($contact->contact_bgimage);
            }

            $data['contact_bgimage'] = $data_image;
        }

        $this->Model_contact->update(array('contact_id' => $this->input->post('contact_id')), $data);
        echo json_encode(array("status" => TRUE));
    }

}


text:
'use strict'

var stringify = require('json-stringify-safe')
var shimmer = require('../shimmer')
var urltils = require('../util/urltils.js')
var logger = require('../logger').child({component : 'redis'})
var recordRedis = require('../metrics/recorders/redis.js')
var REDIS = require('../metrics/names').REDIS

module.exports = function initialize(agent, redis) {
  var tracer = agent.tracer

  shimmer.wrapMethod(
    redis && redis.RedisClient && redis.RedisClient.prototype,
    'redis.RedisClient.prototype',
    'send_command',
    function(original) {
      return tracer.wrapFunction(
        REDIS.OPERATION + 'Unknown',
        recordRedis,
        original,
        wrapper
      )
    }
  )

  function wrapper(segment, args, bind) {
    var transaction = segment.transaction
    var position = args.length - 1
    var keys = args[1]
    var last = args[position]

    segment.name = REDIS.OPERATION + (args[0] || 'unknown')

    if (keys && typeof keys !== 'function') {
      urltils.copyParameters(agent.config, {key: stringify(keys[0])}, segment.parameters)
    }

    // capture connection info for datastore instance metric
    segment.port = this.port
    segment.host = this.host

    if (typeof last === 'function') {
      args[position] = bind(last, true, true)
    } else if (Array.isArray(last) && typeof last[last.length - 1] === 'function') {
      last[last.length - 1] = bind(last[last.length - 1], true, true)
    } else { // let's shove a callback in there for fun
      args.push(bind(null, true, true))
    }

    return args
  }
}


text:
using System;
using System.Collections.Generic;
using System.Linq;
using AsyncGenerator.Core;
using AsyncGenerator.Core.Transformation;
using AsyncGenerator.Extensions.Internal;
using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.CSharp;
using Microsoft.CodeAnalysis.CSharp.Syntax;
using static Microsoft.CodeAnalysis.CSharp.SyntaxFactory;

namespace AsyncGenerator.Transformation.Internal
{
	internal partial class ProjectTransformer
	{
		internal FieldTransformationResult TransformField(
			BaseFieldDeclarationSyntax fieldNode,
			bool canCopy,
			FieldTransformationResult result,
			ITypeTransformationMetadata typeMetadata,
			INamespaceTransformationMetadata namespaceMetadata)
		{
			var analyzeResult = result.AnalyzationResult;
			var startRootSpan = analyzeResult.Node.SpanStart;

			// Calculate whitespace method trivias
			result.EndOfLineTrivia = fieldNode.GetEndOfLine();
			result.LeadingWhitespaceTrivia = fieldNode.GetLeadingWhitespace();
			result.IndentTrivia = fieldNode.GetIndent(result.LeadingWhitespaceTrivia, typeMetadata.LeadingWhitespaceTrivia);

			if (analyzeResult.Variables.All(o => o.Conversion == FieldVariableConversion.Ignore || o.Conversion == FieldVariableConversion.Copy && !canCopy))
			{
				return result;
			}

			fieldNode = fieldNode.WithAdditionalAnnotations(new SyntaxAnnotation(result.Annotation));
			startRootSpan -= fieldNode.SpanStart;

			// First we need to annotate nodes that will be modified in order to find them later on.
			// We cannot rely on spans after the first modification as they will change
			var typeReferencesAnnotations = new List<string>();
			foreach (var typeReference in analyzeResult.TypeReferences.Where(o => o.TypeAnalyzationResult.Conversion == TypeConversion.NewType))
			{
				var reference = typeReference.ReferenceLocation;
				var refSpanStart = reference.Location.SourceSpan.Start - startRootSpan;
				var nameNode = fieldNode.GetSimpleName(refSpanStart, reference.Location.SourceSpan.Length, typeReference.IsCref);
				var annotation = Guid.NewGuid().ToString();
				fieldNode = fieldNode.ReplaceNode(nameNode, nameNode.WithAdditionalAnnotations(new SyntaxAnnotation(annotation)));
				typeReferencesAnnotations.Add(annotation);
			}

			foreach (var variableResult in analyzeResult.Variables)
			{
				var spanStart = variableResult.Node.SpanStart - startRootSpan;
				var spanLength = variableResult.Node.Span.Length;
				var accessorNode = fieldNode.DescendantNodes()
					.First(o => o.SpanStart == spanStart && o.Span.Length == spanLength);
				var transformedNode = new FieldVariableTransformationResult(variableResult);
				result.TransformedVariables.Add(transformedNode);
				fieldNode = fieldNode.ReplaceNode(accessorNode, accessorNode.WithAdditionalAnnotations(new SyntaxAnnotation(transformedNode.Annotation)));
			}

			// Modify references
			foreach (var refAnnotation in typeReferencesAnnotations)
			{
				var nameNode = fieldNode.GetAnnotatedNodes(refAnnotation).OfType<SimpleNameSyntax>().First();
				fieldNode = fieldNode
					.ReplaceNode(nameNode, nameNode.WithIdentifier(Identifier(nameNode.Identifier.Value + "Async").WithTriviaFrom(nameNode.Identifier)));
			}

			foreach (var fieldVariableResult in result.TransformedVariables.OrderByDescending(o => o.OriginalStartSpan))
			{
				var variableNode = (VariableDeclaratorSyntax) fieldNode.GetAnnotatedNodes(fieldVariableResult.Annotation)
					.First();
				var variableTransformResult = TransformFieldVariable(variableNode, fieldVariableResult, canCopy);
				fieldNode = variableTransformResult.Transformed == null
					? fieldNode.RemoveNode(variableNode, SyntaxRemoveOptions.KeepUnbalancedDirectives)
					: fieldNode.ReplaceNode(variableNode, variableTransformResult.Transformed);
			}

			result.Transformed = fieldNode;
			return result;
		}

		private FieldVariableTransformationResult TransformFieldVariable(
			VariableDeclaratorSyntax variableNode,
			FieldVariableTransformationResult result,
			bool canCopy)
		{
			var variableResult = result.AnalyzationResult;
			var conversion = variableResult.Conversion;
			if (conversion == FieldVariableConversion.Ignore || !canCopy)
			{
				return result;
			}

			var startVariableSpan = variableResult.Node.Span.Start;
			variableNode = variableNode.WithAdditionalAnnotations(new SyntaxAnnotation(result.Annotation));
			startVariableSpan -= variableNode.SpanStart;

			// First we need to annotate nodes that will be modified in order to find them later on.
			// We cannot rely on spans after the first modification as they will change
			var typeReferencesAnnotations = new List<string>();
			foreach (var typeReference in variableResult.TypeReferences.Where(o => o.TypeAnalyzationResult.Conversion == TypeConversion.NewType))
			{
				var reference = typeReference.ReferenceLocation;
				var refSpanStart = reference.Location.SourceSpan.Start - startVariableSpan;
				var nameNode = variableNode.GetSimpleName(refSpanStart, reference.Location.SourceSpan.Length, typeReference.IsCref);
				var annotation = Guid.NewGuid().ToString();
				variableNode = variableNode.ReplaceNode(nameNode, nameNode.WithAdditionalAnnotations(new SyntaxAnnotation(annotation)));
				typeReferencesAnnotations.Add(annotation);
			}

			// Modify references
			foreach (var refAnnotation in typeReferencesAnnotations)
			{
				var nameNode = variableNode.GetAnnotatedNodes(refAnnotation).OfType<SimpleNameSyntax>().First();
				variableNode = variableNode
					.ReplaceNode(nameNode, nameNode.WithIdentifier(Identifier(nameNode.Identifier.Value + "Async").WithTriviaFrom(nameNode.Identifier)));
			}

			result.Transformed = variableNode;
			return result;
		}
	}
}


text:
/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package graphfinder3.network;

import java.io.Serializable;

/**
 *
 * @author damian
 */
public class OrderPriority implements Serializable {

	// nazwa
	private final String orderName;
	// priorytet
	private final int priority;

	/**
	 *
	 * @param orderName
	 * @param priority
	 */
	public OrderPriority(String orderName, int priority) {
		this.orderName = orderName;
		this.priority = priority;
	}

	public String getOrderName() {
		return orderName;
	}

	public int getPriority() {
		return priority;
	}

	@Override
	public String toString() {
		return "OrderPriority{" + "orderName=" + orderName + ", priority=" + priority + '}';
	}
}


text:
VULKAN_SDK_PATH = /home/jack/vulkan/VulkanSDK/1.0.49.0/x86_64

# Define a CFLAGS compiler flags:
CFLAGS = -std=c++11 -I$(VULKAN_SDK_PATH)/include

# Define Linker flags:
LDFLAGS = -L$(VULKAN_SDK_PATH)/lib `pkg-config --static --libs glfw3` -lvulkan

VulkanTest: main.cpp
	g++ $(CFLAGS) -o VulkanTest main.cpp $(LDFLAGS)

.PHONY: test clean

test: VulkanTest
	LD_LIBRARY_PATH=$(VULKAN_SDK_PATH)/lib VK_LAYER_PATH=$(VULKAN_SDK_PATH)/etc/explicit_layer.d ./VulkanTest

clean:
	rm -f VulkanTest


text:
class Config:
    SQLALCHEMY_TRACK_MODIFICATIONS = True

class DevelopmentConfig(Config):
    DEBUG = True
    SQLALCHEMY_ECHO = True

class ProductionConfig(Config):
    DEBUG = False

app_config = {
    'development': DevelopmentConfig,
    'production': ProductionConfig
}


text:
from __future__ import unicode_literals
from ..specialized import BRAINSABC

def test_BRAINSABC_inputs():
    input_map = dict(args=dict(argstr='%s',
    ),
    atlasDefinition=dict(argstr='--atlasDefinition %s',
    ),
    atlasToSubjectInitialTransform=dict(argstr='--atlasToSubjectInitialTransform %s',
    hash_files=False,
    ),
    atlasToSubjectTransform=dict(argstr='--atlasToSubjectTransform %s',
    hash_files=False,
    ),
    atlasToSubjectTransformType=dict(argstr='--atlasToSubjectTransformType %s',
    ),
    atlasWarpingOff=dict(argstr='--atlasWarpingOff ',
    ),
    debuglevel=dict(argstr='--debuglevel %d',
    ),
    defaultSuffix=dict(argstr='--defaultSuffix %s',
    ),
    environ=dict(nohash=True,
    usedefault=True,
    ),
    filterIteration=dict(argstr='--filterIteration %d',
    ),
    filterMethod=dict(argstr='--filterMethod %s',
    ),
    filterTimeStep=dict(argstr='--filterTimeStep %f',
    ),
    gridSize=dict(argstr='--gridSize %s',
    sep=',',
    ),
    ignore_exception=dict(nohash=True,
    usedefault=True,
    ),
    implicitOutputs=dict(argstr='--implicitOutputs %s...',
    hash_files=False,
    ),
    inputVolumeTypes=dict(argstr='--inputVolumeTypes %s',
    sep=',',
    ),
    inputVolumes=dict(argstr='--inputVolumes %s...',
    ),
    interpolationMode=dict(argstr='--interpolationMode %s',
    ),
    maxBiasDegree=dict(argstr='--maxBiasDegree %d',
    ),
    maxIterations=dict(argstr='--maxIterations %d',
    ),
    medianFilterSize=dict(argstr='--medianFilterSize %s',
    sep=',',
    ),
    numberOfSubSamplesInEachPlugArea=dict(argstr='--numberOfSubSamplesInEachPlugArea %s',
    sep=',',
    ),
    numberOfThreads=dict(argstr='--numberOfThreads %d',
    ),
    outputDir=dict(argstr='--outputDir %s',
    hash_files=False,
    ),
    outputDirtyLabels=dict(argstr='--outputDirtyLabels %s',
    hash_files=False,
    ),
    outputFormat=dict(argstr='--outputFormat %s',
    ),
    outputLabels=dict(argstr='--outputLabels %s',
    hash_files=False,
    ),
    outputVolumes=dict(argstr='--outputVolumes %s...',
    hash_files=False,
    ),
    posteriorTemplate=dict(argstr='--posteriorTemplate %s',
    ),
    purePlugsThreshold=dict(argstr='--purePlugsThreshold %f',
    ),
    restoreState=dict(argstr='--restoreState %s',
    ),
    saveState=dict(argstr='--saveState %s',
    hash_files=False,
    ),
    subjectIntermodeTransformType=dict(argstr='--subjectIntermodeTransformType %s',
    ),
    terminal_output=dict(deprecated='1.0.0',
    nohash=True,
    ),
    useKNN=dict(argstr='--useKNN ',
    ),
    writeLess=dict(argstr='--writeLess ',
    ),
    )
    inputs = BRAINSABC.input_spec()

    for key, metadata in list(input_map.items()):
        for metakey, value in list(metadata.items()):
            assert getattr(inputs.traits()[key], metakey) == value

def test_BRAINSABC_outputs():
    output_map = dict(atlasToSubjectInitialTransform=dict(),
    atlasToSubjectTransform=dict(),
    implicitOutputs=dict(),
    outputDir=dict(),
    outputDirtyLabels=dict(),
    outputLabels=dict(),
    outputVolumes=dict(),
    saveState=dict(),
    )
    outputs = BRAINSABC.output_spec()

    for key, metadata in list(output_map.items()):
        for metakey, value in list(metadata.items()):
            assert getattr(outputs.traits()[key], metakey) == value


text:
package net.faintedge.rube.examples;

import com.artemis.World;
import com.badlogic.gdx.Gdx;
import net.faintedge.rube.Context;
import net.faintedge.rube.components.Physics;
import net.faintedge.rube.components.Render;
import net.faintedge.rube.components.Transform;
import net.faintedge.rube.components.physics.Colliders;
import net.faintedge.rube.components.physics.RectangleCollider;
import net.faintedge.rube.screens.Scene;

/**
 * Uses {@link Scene} to load a map from JSON.
 */
public class JsonExample extends BaseExample {

  @Override
  public void show() {
    super.show();

    Context context = super.getContext();
    World world = context.getWorld();
    populate(world);
  }

  public void populate(World world) {
    Scene.Builder builder = new Scene.Builder();

    int cols = 5;
    float width = 1;
    float height = 1;
    float padding = width * 5;
    float x = -(cols * width) / 2 + width/2;
    for (int i = 0; i < cols; i++) {
      for (int j = 0; j < 5; j++) {
        builder.addEntity(
          new Render(crateTextureSpec, width, height),
          new Transform(x + i * width, j * (width + padding)),
          new Physics(),
          new Colliders(new RectangleCollider(width, height))
        );
      }
    }

    builder.addEntity(
      new Render(crateTextureSpec, 40, 1),
      new Transform(0, -5),
      new Physics(Physics.Type.STATIC),
      new Colliders(new RectangleCollider(40, 1))
    );

    Scene map = builder.build();
    String jsonString = map.toPrettyJson();
    Gdx.app.log("JsonExample", "Loading map from JSON:\n" + jsonString);
    Scene parsedMap = Scene.fromJson(jsonString);

    parsedMap.load(world);
  }

  public static void main(String[] args) {
    run(new JsonExample());
  }

}


text:
var group___r_t_c___exported___functions =
[
    [ "RTC_Exported_Functions_Group1", "group___r_t_c___exported___functions___group1.html", null ],
    [ "RTC_Exported_Functions_Group2", "group___r_t_c___exported___functions___group2.html", null ],
    [ "RTC_Exported_Functions_Group3", "group___r_t_c___exported___functions___group3.html", null ],
    [ "RTC_Exported_Functions_Group4", "group___r_t_c___exported___functions___group4.html", null ],
    [ "RTC_Exported_Functions_Group5", "group___r_t_c___exported___functions___group5.html", null ]
];


text:
GeekHub's files
6th season
http://geekhub.ck.ua/

certificate:
<img src="/Save0031.JPG" alt="certificate"/>


text:
var pagecache = {};

jQuery.ajaxPrefilter(function( options ) {
	if ( options.type === "GET" && options.cache && ( typeof options.cache === "string" ) ) {
		options.global = false;
		options._url = options.url;
		return "pagecache";
	}
});

jQuery.ajaxTransport( "pagecache", function( options, originalOptions, jqXHR ) {
	// Remove redirection dataType
	options.dataTypes.shift();

	var key, cached;
	return {
		send: function( headers, complete ) {
			key = options.cache + " " + options.url;
			cached = pagecache[ key ] || ( pagecache[ key ] = jQuery.ajax( jQuery.extend( originalOptions, {
				url: options._url,
				beforeSend: null,
				cache: true,
				dataType: options.cache,
				headers: headers,
				success: null,
				error: null,
				complete: null,
				timeout: 0
			}) ) );
			cached.always(function( success ) {
				if ( cached ) {
					var responses;
					if ( cached.state() === "resolved" ) {
						responses = {};
						responses[ options.cache ] = success;
					}
					complete( cached.status, cached.statusText, responses, cached.getAllResponseHeaders() );
				}
			});
		},
		abort: function() {
			cached = undefined;
		}
	};
});


text:
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (c) 2018-2019 The Gulden developers
Authored by: Malcolm MacLeod (mmacleod@gmx.com)
Distributed under the GULDEN software license, see the accompanying
file COPYING
!-->
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="90dp"
    android:layout_marginLeft="0dp"
    android:gravity="bottom"
    android:orientation="vertical"
    android:paddingLeft="0dp"
    android:paddingRight="0dp">

    <TextView
        android:id="@+id/transactionItemHeading"
        android:layout_width="match_parent"
        android:layout_height="40dp"
        android:gravity="bottom"
        android:paddingLeft="10dp"
        android:paddingRight="10dp"
        android:paddingBottom="10dp"
        android:text="Heading"
        android:textColor="@android:color/black"
        tools:ignore="HardcodedText" />

    <include
        layout="@layout/mutation_list_item"
        android:layout_width="match_parent"
        android:layout_height="30dp"/>
</LinearLayout>


text:
@interface THscores : NSObject
@property (nonatomic , copy) NSString * studentName;
@property (nonatomic , strong) NSNumber * studentId;
@property (nonatomic , strong) NSNumber * studentNo;
@property (nonatomic , strong) NSNumber * score;

- (instancetype)initWithDic:(NSDictionary *)dic;
+ (instancetype)scoresWithDic:(NSDictionary *)dic;

@end


text:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>

  <groupId>com.zakrywilson.astro.tle</groupId>
  <artifactId>tle</artifactId>
  <version>1.1.2</version>
  <name>TLE</name>
  <description>A package for parsing, formatting, and building TLEs</description>
  <url>https://github.com/zakrywilson/TLE</url>

  <developers>
    <developer>
      <name>Zach Wilson</name>
      <email>zakrywilson@gmail.com</email>
      <url>zakrywilson.com</url>
    </developer>
  </developers>

  <properties>
    <project.encoding>UTF-8</project.encoding>
    <project.java.version>1.8</project.java.version>
    <project.build.sourceEncoding>${project.encoding}</project.build.sourceEncoding>
    <maven.compiler.source>${project.java.version}</maven.compiler.source>
    <maven.compiler.target>${project.java.version}</maven.compiler.target>
  </properties>

  <build>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-jar-plugin</artifactId>
        <version>3.0.2</version>
        <configuration>
          <archive>
            <manifest>
              <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
              <addDefaultSpecificationEntries>true</addDefaultSpecificationEntries>
            </manifest>
          </archive>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-javadoc-plugin</artifactId>
        <version>2.10.4</version>
        <executions>
          <execution>
            <goals>
              <goal>jar</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-source-plugin</artifactId>
        <version>3.0.1</version>
        <executions>
          <execution>
            <goals>
              <goal>jar</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>

  <dependencies>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>4.11</version>
      <scope>test</scope>
    </dependency>
  </dependencies>

</project>


text:
package com.github.anba.es6draft.regexp;

import org.jcodings.ApplyAllCaseFoldFunction;
import org.jcodings.CaseFoldCodeItem;
import org.jcodings.IntHolder;
import org.mozilla.javascript.ConsString;

import com.github.anba.es6draft.parser.Characters;

/**
 * UCS-2 encoding with modified case-folding
 */
final class UCS2Encoding extends UEncoding {
    public static final UCS2Encoding INSTANCE = new UCS2Encoding();

    protected UCS2Encoding() {
        super("UCS-2", 2, 2);
    }

    @Override
    public byte[] toBytes(CharSequence cs) {
        if (cs instanceof ConsString) {
            return ((ConsString) cs).toByteArray(new byte[cs.length() * 2 + 2]);
        }
        return toBytes(cs.toString());
    }

    @Override
    public byte[] toBytes(String s) {
        char[] chars = s.toCharArray();
        byte[] bytes = new byte[chars.length * 2 + 2]; // null-terminated c-string
        for (int i = 0, j = 0, len = chars.length; i < len; ++i) {
            char c = chars[i];
            bytes[j++] = (byte) ((c >>> 8) & 0xff);
            bytes[j++] = (byte) ((c >>> 0) & 0xff);
        }
        return bytes;
    }

    @Override
    public int strLength(CharSequence cs, int startIndex, int count) {
        return count >> 1;
    }

    @Override
    public int length(CharSequence cs) {
        return cs.length() * 2;
    }

    @Override
    public int length(CharSequence cs, int start, int end) {
        assert 0 <= start && start <= end && end <= cs.length();
        return (end - start) * 2;
    }

    @Override
    public int length(CharSequence cs, int byteIndex) {
        return 2;
    }

    @Override
    public int length(byte c) {
        return 2;
    }

    @Override
    public int length(byte[] bytes, int p, int end) {
        return p + 1 < end ? 2 : missing(1);
    }

    @Override
    public int mbcToCode(byte[] bytes, int p, int end) {
        return ((bytes[p + 0] & 0xff) << 8) | (bytes[p + 1] & 0xff);
    }

    @Override
    public int codeToMbcLength(int code) {
        return 2;
    }

    @Override
    public int codeToMbc(int code, byte[] bytes, int p) {
        bytes[p + 0] = (byte) ((code >>> 8) & 0xff);
        bytes[p + 1] = (byte) ((code >>> 0) & 0xff);
        return 2;
    }

    @Override
    public int mbcCaseFold(int flag, byte[] bytes, IntHolder pp, int end, byte[] to) {
        int p = pp.value;
        pp.value += 2;
        int codePoint = mbcToCode(bytes, p, end);
        int caseFold;
        if (isAscii(codePoint)) {
            // Fast path for ASCII characters.
            caseFold = asciiToUpper(codePoint);
        } else {
            caseFold = CaseFoldDataBMP.caseFold(codePoint);
            if (caseFold < 0) {
                caseFold = codePoint;
            }
        }
        return codeToMbc(caseFold, to, 0);
    }

    @Override
    public void applyAllCaseFold(int flag, ApplyAllCaseFoldFunction fun, Object arg) {
        int[] unfoldFrom = CaseFoldDataBMP.caseUnfoldFrom();
        int[][] unfoldTo = CaseFoldDataBMP.caseUnfoldTo();
        applyAllCaseFold(fun, arg, unfoldFrom, unfoldTo);
    }

    @Override
    public CaseFoldCodeItem[] caseFoldCodesByString(int flag, byte[] bytes, int p, int end) {
        int codePoint = mbcToCode(bytes, p, end);
        if (isAscii(codePoint)) {
            // Fast path for ASCII characters.
            if (Characters.isASCIIAlpha(codePoint)) {
                return new CaseFoldCodeItem[] { new CaseFoldCodeItem(2, 1, new int[] { codePoint ^ 0x20 }) };
            }
            return EMPTY_FOLD_CODES;
        }
        int caseFold = CaseFoldDataBMP.caseFold(codePoint);
        if (caseFold >= 0) {
            int[] to = CaseFoldDataBMP.caseUnfold(caseFold);
            if (to != null) {
                return caseFoldCodesByString(codePoint, 2, caseFold, to);
            }
            return new CaseFoldCodeItem[] { new CaseFoldCodeItem(2, 1, new int[] { caseFold }) };
        }
        int[] to = CaseFoldDataBMP.caseUnfold(codePoint);
        if (to != null) {
            return caseFoldCodesByString(codePoint, 2, to);
        }
        return EMPTY_FOLD_CODES;
    }

    @Override
    public int leftAdjustCharHead(byte[] bytes, int p, int s, int end) {
        return s > p ? s - ((s - p) & 1) : s;
    }

    @Override
    public int strLength(byte[] bytes, int p, int end) {
        return p <= end ? (end - p) >>> 1 : 0;
    }

    @Override
    public int strCodeAt(byte[] bytes, int p, int end, int index) {
        int q = p + (index << 1);
        return q + 1 < end ? mbcToCode(bytes, q, end) : -1;
    }
}


text:
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Runtime.InteropServices.WindowsRuntime;
using PinkAlert.Services;
using Windows.Foundation;
using Windows.Foundation.Collections;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Controls.Primitives;
using Windows.UI.Xaml.Data;
using Windows.UI.Xaml.Input;
using Windows.UI.Xaml.Media;
using Windows.UI.Xaml.Navigation;
using Catel.IoC;
using PinkAlert.Areas.Game;

// "空白页"项模板在 http://go.microsoft.com/fwlink/?LinkId=234238 上提供

namespace PinkAlert.Areas.Campaign.Views
{
    /// <summary>
    /// 可用于自身或导航至 Frame 内部的空白页。
    /// </summary>
    public sealed partial class LoadCampaignPage : Catel.Windows.Controls.Page, ILoadCampaignViewService
    {
        public LoadCampaignPage()
        {
            this.InitializeComponent();
            Loaded += LoadCampaignPage_Loaded;
            Unloaded += LoadCampaignPage_Unloaded;
        }

        private void LoadCampaignPage_Unloaded(object sender, RoutedEventArgs e)
        {
            this.GetServiceLocator().RemoveType<ILoadCampaignViewService>();
        }

        public void NaviagteToGame()
        {
            Frame.Navigate(typeof(BattleControlPage));
        }

        private void LoadCampaignPage_Loaded(object sender, RoutedEventArgs e)
        {
            this.GetServiceLocator().RegisterInstance<ILoadCampaignViewService>(this);

            var themeService = this.GetServiceLocator().ResolveType<IThemeService>();
            themeService.Start(new Uri("ms-appx:///Assets/Theme/bully.ogg"));
        }
    }
}