text:
package org.lwjgl.vulkan;

import org.lwjgl.*;

import static org.lwjgl.system.Checks.*;
import static org.lwjgl.system.JNI.*;
import static org.lwjgl.system.MemoryUtil.*;

/** Applications may wish to export memory to other Vulkan instances or other APIs, or import memory from other Vulkan instances or other APIs to enable Vulkan workloads to be split up across application module, process, or API boundaries. This extension enables win32 applications to export win32 handles from Vulkan memory objects such that the underlying resources can be referenced outside the Vulkan instance that created them, and import win32 handles created in the Direct3D API to Vulkan memory objects. */
public class NVExternalMemoryWin32 {

	/** The extension specification version. */
	public static final int VK_NV_EXTERNAL_MEMORY_WIN32_SPEC_VERSION = 1;

	/** The extension name. */
	public static final String VK_NV_EXTERNAL_MEMORY_WIN32_EXTENSION_NAME = "VK_NV_external_memory_win32";

	/**
	 * Extends {@code VkStructureType}.
	 *
	 *
Enum values:

	 *
	 *

	 *
{@link #VK_STRUCTURE_TYPE_IMPORT_MEMORY_WIN32_HANDLE_INFO_NV STRUCTURE_TYPE_IMPORT_MEMORY_WIN32_HANDLE_INFO_NV}

	 *
{@link #VK_STRUCTURE_TYPE_EXPORT_MEMORY_WIN32_HANDLE_INFO_NV STRUCTURE_TYPE_EXPORT_MEMORY_WIN32_HANDLE_INFO_NV}

	 *

	 */
	public static final int
		VK_STRUCTURE_TYPE_IMPORT_MEMORY_WIN32_HANDLE_INFO_NV = 1000057000,
		VK_STRUCTURE_TYPE_EXPORT_MEMORY_WIN32_HANDLE_INFO_NV = 1000057001;

	protected NVExternalMemoryWin32() {
		throw new UnsupportedOperationException();
	}

	static boolean isAvailable(VKCapabilities caps) {
		return checkFunctions(
			caps.vkGetMemoryWin32HandleNV
		);
	}

	// --- [ vkGetMemoryWin32HandleNV ] ---

	/** Unsafe version of: {@link #vkGetMemoryWin32HandleNV GetMemoryWin32HandleNV} */
	public static int nvkGetMemoryWin32HandleNV(VkDevice device, long memory, int handleType, long pHandle) {
		long __functionAddress = device.getCapabilities().vkGetMemoryWin32HandleNV;
		if ( CHECKS )
			checkFunctionAddress(__functionAddress);
		return callPJPI(__functionAddress, device.address(), memory, handleType, pHandle);
	}

	/**
	 * retrieve Win32 handle to a device memory object.
	 *
	 *
C Specification

	 *
	 *
To retrieve the handle corresponding to a device memory object created with {@link VkExportMemoryAllocateInfoNV}{@code ::handleTypes} set to include {@link NVExternalMemoryCapabilities#VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_BIT_NV EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_BIT_NV} or {@link NVExternalMemoryCapabilities#VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_KMT_BIT_NV EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_KMT_BIT_NV}, call:

	 *
	 *
VkResult vkGetMemoryWin32HandleNV(
    VkDevice                                    device,
    VkDeviceMemory                              memory,
    VkExternalMemoryHandleTypeFlagsNV           handleType,
    HANDLE*                                     pHandle);

	 *
	 *
Valid Usage

	 *
	 *

	 *
{@code handleType} must be a flag specified in {@link VkExportMemoryAllocateInfoNV}{@code ::handleTypes} when allocating {@code memory}

	 *

	 *
	 *
Valid Usage (Implicit)

	 *
	 *

	 *
{@code device} must be a valid {@code VkDevice} handle

	 *
{@code memory} must be a valid {@code VkDeviceMemory} handle

	 *
{@code handleType} must be a valid combination of {@code VkExternalMemoryHandleTypeFlagBitsNV} values

	 *
{@code handleType} must not be 0

	 *
{@code pHandle} must be a pointer to a {@code HANDLE} value

	 *
{@code memory} must have been created, allocated, or retrieved from {@code device}

	 *

	 *
	 *
Return Codes

	 *
	 *

	 *
On success, this command returns

	 *

	 *
{@link VK10#VK_SUCCESS SUCCESS}

	 *

	 *
On failure, this command returns

	 *

	 *
{@link VK10#VK_ERROR_TOO_MANY_OBJECTS ERROR_TOO_MANY_OBJECTS}

	 *
{@link VK10#VK_ERROR_OUT_OF_HOST_MEMORY ERROR_OUT_OF_HOST_MEMORY}

	 *

	 *

	 *
	 * @param device     the logical device that owns the memory.
	 * @param memory     the {@code VkDeviceMemory} object.
	 * @param handleType a bitmask of {@code VkExternalMemoryHandleTypeFlagBitsNV} containing a single bit specifying the type of handle requested.
	 * @param pHandle
	 */
	public static int vkGetMemoryWin32HandleNV(VkDevice device, long memory, int handleType, PointerBuffer pHandle) {
		return nvkGetMemoryWin32HandleNV(device, memory, handleType, memAddress(pHandle));
	}

}


text:
namespace brightray {

namespace {

class TCPServerSocketFactory
    : public devtools_http_handler::DevToolsHttpHandler::ServerSocketFactory {
 public:
  TCPServerSocketFactory(const std::string& address, int port)
      : address_(address), port_(port) {
  }

 private:
  // content::DevToolsHttpHandler::ServerSocketFactory.
  scoped_ptr<net::ServerSocket> CreateForHttpServer() override {
    scoped_ptr<net::ServerSocket> socket(
        new net::TCPServerSocket(nullptr, net::NetLog::Source()));
    if (socket->ListenWithAddressAndPort(address_, port_, 10) != net::OK)
      return scoped_ptr<net::ServerSocket>();

    return socket;
  }

  std::string address_;
  uint16_t port_;

  DISALLOW_COPY_AND_ASSIGN(TCPServerSocketFactory);
};

scoped_ptr<devtools_http_handler::DevToolsHttpHandler::ServerSocketFactory>
CreateSocketFactory() {
  auto& command_line = *base::CommandLine::ForCurrentProcess();
  // See if the user specified a port on the command line (useful for
  // automation). If not, use an ephemeral port by specifying 0.
  int port = 0;
  if (command_line.HasSwitch(switches::kRemoteDebuggingPort)) {
    int temp_port;
    std::string port_str =
        command_line.GetSwitchValueASCII(switches::kRemoteDebuggingPort);
    if (base::StringToInt(port_str, &temp_port) &&
        temp_port > 0 && temp_port < 65535) {
      port = temp_port;
    } else {
      DLOG(WARNING) << "Invalid http debugger port number " << temp_port;
    }
  }
  return scoped_ptr<
      devtools_http_handler::DevToolsHttpHandler::ServerSocketFactory>(
          new TCPServerSocketFactory("127.0.0.1", port));
}

// DevToolsDelegate --------------------------------------------------------

class DevToolsDelegate :
    public devtools_http_handler::DevToolsHttpHandlerDelegate {
 public:
  DevToolsDelegate();
  virtual ~DevToolsDelegate();

  // devtools_http_handler::DevToolsHttpHandlerDelegate.
  std::string GetDiscoveryPageHTML() override;
  std::string GetFrontendResource(const std::string& path) override;
  std::string GetPageThumbnailData(const GURL& url) override;
  content::DevToolsExternalAgentProxyDelegate* HandleWebSocketConnection(
      const std::string& path) override;

 private:
  DISALLOW_COPY_AND_ASSIGN(DevToolsDelegate);
};

DevToolsDelegate::DevToolsDelegate() {
}

DevToolsDelegate::~DevToolsDelegate() {
}

std::string DevToolsDelegate::GetDiscoveryPageHTML() {
  return ResourceBundle::GetSharedInstance().GetRawDataResource(
      IDR_CONTENT_SHELL_DEVTOOLS_DISCOVERY_PAGE).as_string();
}

std::string DevToolsDelegate::GetFrontendResource(
  const std::string& path) {
  return content::DevToolsFrontendHost::GetFrontendResource(path).as_string();
}

std::string DevToolsDelegate::GetPageThumbnailData(const GURL& url) {
  return std::string();
}

content::DevToolsExternalAgentProxyDelegate*
DevToolsDelegate::HandleWebSocketConnection(const std::string& path) {
  return nullptr;
}

}  // namespace

// DevToolsManagerDelegate ---------------------------------------------------

// static
devtools_http_handler::DevToolsHttpHandler*
DevToolsManagerDelegate::CreateHttpHandler() {
  return new devtools_http_handler::DevToolsHttpHandler(
      CreateSocketFactory(),
      std::string(),
      new DevToolsDelegate,
      base::FilePath(),
      base::FilePath(),
      std::string(),
      GetBrightrayUserAgent());
}

DevToolsManagerDelegate::DevToolsManagerDelegate()
    : handler_(new DevToolsNetworkProtocolHandler) {
  // NB(zcbenz): This call does nothing, the only purpose is to make sure the
  // devtools_discovery module is linked into the final executable on Linux.
  // Though it is possible to achieve this by modifying the gyp settings, it
  // would greatly increase gyp file's complexity, so I chose to instead do
  // this hack.
  devtools_discovery::DevToolsDiscoveryManager::GetInstance();
}

DevToolsManagerDelegate::~DevToolsManagerDelegate() {
}

void DevToolsManagerDelegate::DevToolsAgentStateChanged(
    content::DevToolsAgentHost* agent_host,
    bool attached) {
  handler_->DevToolsAgentStateChanged(agent_host, attached);
}

base::DictionaryValue* DevToolsManagerDelegate::HandleCommand(
    content::DevToolsAgentHost* agent_host,
    base::DictionaryValue* command) {
  return handler_->HandleCommand(agent_host, command);
}

}  // namespace brightray

redpajama_set_name: RedPajamaGithub


text:
Looking to contribute something? Here's how you can help.

## Bugs reports

A bug is a _demonstrable problem_ that is caused by the code in the
repository. Good bug reports are extremely helpful - thank you!

Guidelines for bug reports:

1. **Use the GitHub issue search** - check if the issue has already been
   reported.

2. **Check if the issue has been fixed** - try to reproduce it using the
   latest `master` or development branch in the repository.

3. **Isolate the problem** - ideally create a reduced test case and a live
   example.

4. Please try to be as detailed as possible in your report. Include specific
   information about the environment - operating system and version, versions
   of libraries and steps required to reproduce the issue.

## Feature requests & contribution enquiries

Feature requests are welcome. But take a moment to find out whether your idea
fits with the scope and aims of the project. It's up to *you* to make a strong
case for the inclusion of your feature. Please provide as much detail and
context as possible.

Contribution enquiries should take place before any significant pull request,
otherwise you risk spending a lot of time working on something that we might
have good reasons for rejecting.

## Pull requests

Good pull requests - patches, improvements, new features - are a fantastic
help. They should remain focused in scope and avoid containing unrelated
commits.

Make sure to adhere to the coding conventions used throughout the codebase
(indentation, accurate comments, etc.) and any other requirements (such as test
coverage).

Please follow this process; it's the best way to get your work included in the
project:

1. Create a new topic branch to contain your feature, change, or fix:

2. Commit your changes in logical chunks. Provide clear and explanatory commit
   messages. Use git's [interactive rebase](https://help.github.com/articles/interactive-rebase)
   feature to tidy up your commits before making them public.

3. Locally merge (or rebase) the upstream development branch into your topic branch:

4. Push your topic branch up to your fork:

5. [Open a Pull Request](https://help.github.com/send-pull-requests/) with a
   clear title and description.

## License

By contributing your code,

You agree to license your contribution under the terms of the Apache Public License 2.0
https://github.com/twitter/spitball/blob/master/LICENSE


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

This repository is a boilerplate for an [ORO Platform Application](https://github.com/orocrm/platform).

Derived from  [webplates/symfony-standard](https://github.com/webplates/symfony-standard).


text:
package ru.yelton.android.GUI.Manage;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.support.design.widget.FloatingActionButton;
import android.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.AdapterView;
import android.widget.ListView;

import ru.yelton.android.Core.CoreCategories;
import ru.yelton.android.Core.CoreCategory;
import ru.yelton.android.Core.CoreProduct;
import ru.yelton.android.Core.CoreProducts;
import ru.yelton.android.GUI.New.NewProduct;
import ru.yelton.android.R;

import java.util.ArrayList;

public class Products extends Fragment
{
    private final static int NEW_PRODUCT_RC = 3;
    private ListView    mListView;

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
    {
        View rootView = inflater.inflate(R.layout.manage_products_fragment, container, false);
        mListView = (ListView) rootView.findViewById(R.id.listViewProducts);

        FloatingActionButton addButton = (FloatingActionButton) rootView.findViewById(R.id.ManageProductsFragment_AddButton);
        addButton.setOnClickListener(new addButtonClickListener());

        loadList();
        initListener();

        return rootView;
    }

    // Перегружаем список  если создание/редактирование прошло успешно
    @Override
    public void onActivityResult(int requestCode, int resultCode, Intent data)
    {
        super.onActivityResult(requestCode, resultCode, data);

        if (requestCode == NEW_PRODUCT_RC) {
            if (resultCode == Activity.RESULT_OK) {
                loadList();
            }
        }
    }

    /**
     * Загружает / обновляет список товаров
     * public, потому что может использоваться из класса Sync
     */
    public void loadList()
    {
        ProductsListAdapter adapter = new ProductsListAdapter(getActivity());
        ArrayList<CoreCategory> categories = new CoreCategories(getActivity()).getCategoriesWithProducts();
        for (int catID = 0; catID < categories.size(); catID++) {
            adapter.addSectionHeaderItem(categories.get(catID).name);
            ArrayList<CoreProduct> products = new CoreProducts(getActivity()).getList(categories.get(catID).id, categories.get(catID).clientID);
            for (int prodID = 0; prodID < products.size(); prodID++) {
                CoreProduct product = new CoreProduct();
                // если бы у метода Products.getList была перегрузка в виде ProductsExtended, можно было все это сделать проще (сразу отдавать элемент списка)
                product.id = products.get(prodID).id;
                product.clientID = products.get(prodID).clientID;
                product.name = products.get(prodID).name;
                product.categoryID = categories.get(catID).id;
                product.categoryClientID = categories.get(catID).clientID;
                product.categoryName = categories.get(catID).name;
                product.unitID = products.get(prodID).unitID;
                product.unitClientID = products.get(prodID).unitClientID;
                product.unitShortName = products.get(prodID).unitShortName;
                product.barcode = products.get(prodID).barcode;
                product.manufacturer = products.get(prodID).manufacturer;
                adapter.addItem(product);
            }
        }
        mListView.setAdapter(adapter);
    }

    private void initListener()
    {
        mListView.setOnItemClickListener(new AdapterView.OnItemClickListener()
        {
            @Override
            public void onItemClick(AdapterView<?> parent, View itemClicked, int position, long id)
            {
                CoreProduct product = (CoreProduct) parent.getItemAtPosition(position);
                Intent intent = new Intent(getActivity(), NewProduct.class);
                intent.putExtra(NewProduct.EDIT_ID, product.id);
                intent.putExtra(NewProduct.EDIT_CLIENT_ID, product.clientID);
                intent.putExtra(NewProduct.EDIT_NAME, product.name);
                intent.putExtra(NewProduct.EDIT_CATEGORY_ID, product.categoryID);
                intent.putExtra(NewProduct.EDIT_CATEGORY_CLIENT_ID, product.categoryClientID);
                intent.putExtra(NewProduct.EDIT_UNIT_ID, product.unitID);
                intent.putExtra(NewProduct.EDIT_UNIT_CLIENT_ID, product.unitClientID);
                intent.putExtra(NewProduct.EDIT_MANUFACTURER, product.manufacturer);
                if (product.barcode == null) {
                    intent.putExtra(NewProduct.EDIT_BARCODE, getString(R.string.scan_barcode));
                } else {
                    intent.putExtra(NewProduct.EDIT_BARCODE, product.barcode);
                }
                startActivityForResult(intent, NEW_PRODUCT_RC);
            }
        });
    }

    // листенер для кнопки нового товара
    private class addButtonClickListener implements View.OnClickListener
    {
        @Override
        public void onClick(View view)
        {
            Intent intent = new Intent(getActivity(), NewProduct.class);
            startActivityForResult(intent, NEW_PRODUCT_RC);
        }
    }
}


text:
'use strict';
var mi_charts_widget = require('../mi-chart-widget');
var model = function(){
    return {
      row: null,
      parsed: function(_,row){
         try{
          return {
               timestamp: Date.parse(row[0]),
               height: row[1]
          };
         }catch(e){
            return _;
         }
      },
      timestamp: function(parsed){
          return parsed.timestamp;
      },
      height: function(parsed){
        return parsed;
      }
  };
}

var widget = function(location,station,elid,options){
  options = options || {};
  options.components = options.components || ["location","title","latest","height"];
  var stockcomponents = {
    "height": {field: "height", title: "Tide Height", units: "m"}
  }
  var custom = [];
  var stockcharts = []
  var components = {};
  for(var i=0;i<options.components.length;i++){
    components[options.components[i]] = true;
    var wanted = stockcomponents[options.components[i]];
    if(wanted) stockcharts.push(wanted);
  }
  var d = new Date();
  d.setDate(d.getDate() - 2);
  var start_date = d.toISOString();
  d.setDate(d.getDate() + 3);
  var end_date = d.toISOString();
    var url = '//erddap.marine.ie/erddap/tabledap/IrishNationalTideGaugeNetwork.json?time,Water_Level&time>='+start_date+'&time<='+end_date+'&station_id="'+station+'"';
    return new mi_charts_widget(elid,{
                namespace: "tide-gauge-"+station.replace(/[\s_]+/g, '-').toLowerCase(),
                title: components.title?"Tide Gauge":false,
                location: components.location?location:false,
                model: model(),
                stockcharts: stockcharts,
                latest: components.latest?true:false,
                onModelReady: options.onModelReady,
                preload: {
                    url: url,
                    source: "table.rows",
                    target: "row"
                }
     });
};
exports.model = model;
exports.widget = widget;


text:
layout: post
date: 2018-02-17
title: "Creazioni Elena 1688 Sleeveless Chapel Train Mermaid/Trumpet"
category: Creazioni Elena
tags: [Creazioni Elena ,Creazioni Elena,Mermaid/Trumpet,Strapless,Chapel Train,Sleeveless]
---
### Creazioni Elena 1688
Just **$499.99**
###   Sleeveless Chapel Train Mermaid/Trumpet

BRANDS	Creazioni Elena

Silhouette	Mermaid/Trumpet

Neckline	Strapless

Hemline/Train	Chapel Train

Sleeve	Sleeveless

Buy it: [https://www.readybrides.com/en/creazioni-elena-/36483-creazioni-elena-1688.html](https://www.readybrides.com/en/creazioni-elena-/36483-creazioni-elena-1688.html)


text:
[View Code](index.html) | [Live Sample](https://esri.github.io/visualization-js/unique_conversion)

Style data with unique value renderer and field function conversion.

[![](thumbnail.png)](https://esri.github.io/visualization-js/unique_conversion)


text:
MALinkedIn
==========

This is a framework for working with the LinkedIn API native to iOS7. Currently previous versions of iOS are not supported, but this is a feature that is planned :). It is a work in progress and currently contains the following APIs:

**People**

-Profile API

-Connections API

-Search API

**Companies**

-Company Lookup API

**Share and Social Stream**

-Get Network Updates and Statistics API

**Groups**

-Groups API - GET only

**Jobs**

-Job Lookup API

-Job Search API

**Future plans are to include the following APIs:**

**Groups**

-Groups API - PUT, POST and DELETE

**Job Posting**

-Job Posting API

**Share and Social Stream**

-Share API

**Communications**

-Invitation API

-Messaging Between Connections API

The intention is also in improve documentation to ensure easier use.

In order to use this, you will first have to sign into http://developer.linkedin.com and create an application following their guidelines. After this the implementation is simple. Add the libxml2.dylib to your frameworks and drag the MALinkedIn.framework to your project.

In the header file import MALinkedIn/MALinkedIn.h

In the implementation file:

MALinkedInSession *session = [MALinkedInSession cachedSession];
	if (!session.token) {
		MALinkedInLogInView *login = [[MALinkedInLogInView alloc]initWithRedirectURL:<your redirect url> clientID:<your app id> clientSecret:<your client secret>];
		login.delegate = self;
		[self.view addSubview:login];
    	}else{
        	[self linkedInViewDidLogIn:session];
    	}

-(void)linkedInViewDidLogIn:(MALinkedInSession *)session{

}

Once the user has logged in, you are able to capture the session at any time by calling:

MALinkedInSession *session = [MALinkedInSession sharedSession]

or if the user has closed the application:

MALinkedInSession *session = [MALinkedInSession cachedSession];

The second call will automatically load the sharedSession method.


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

<meta http-equiv="Content-Type" content="text/html" charset="UTF-8">
<title>JsonPropertyOrder (Jackson-annotations 2.3.0 API)</title>
<meta name="date" content="2013-11-13">
<link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Package

Class

Use

Tree

Deprecated

Index

Help

Prev Class

Next Class

Frames

No Frames

All Classes

Summary:

Required |

Optional

Detail:

Element

com.fasterxml.jackson.annotation

Annotation Type JsonPropertyOrder

@Target(value={ANNOTATION_TYPE,TYPE})
@Retention(value=RUNTIME)
public @interface JsonPropertyOrder

Annotation that can be used to define ordering (possibly partial) to use
 when serializing object properties. Properties included in annotation
 declaration will be serialized first (in defined order), followed by
 any properties not included in the definition.
 Annotation definition will override any implicit orderings (such as
 guarantee that Creator-properties are serialized before non-creator
 properties)

 Examples:

  // ensure that "id" and "name" are output before other properties

@
JsonPropertyOrder({ "id", "name" })
  // order any properties that don't have explicit setting using alphabetic order

@
JsonPropertyOrder(alphabetic=true)

 This annotation may or may not have effect on deserialization: for basic JSON
 handling there is no effect, but for other supported data types (or structural
 conventions) there may be.

Optional Element Summary

Optional Elements

Modifier and Type
Optional Element and Description

boolean
alphabetic

Property that defines what to do regarding ordering of properties
 not explicitly included in annotation instance.

String[]
value

Order in which properties of annotated object are to be serialized in.

Element Detail

value

public abstract String[] value

Order in which properties of annotated object are to be serialized in.

Default:

{}

alphabetic

public abstract boolean alphabetic

Property that defines what to do regarding ordering of properties
 not explicitly included in annotation instance. If set to true,
 they will be alphabetically ordered; if false, order is
 undefined (default setting)

Default:

false

Package

Class

Use

Tree

Deprecated

Index

Help

Prev Class

Next Class

Frames

No Frames

All Classes

Summary:

Required |

Optional

Detail:

Element

Copyright © 2012-2013 FasterXML. All Rights Reserved.


text:
if Gitlab::Metrics.enabled?
  require 'pathname'
  require 'influxdb'
  require 'connection_pool'
  require 'method_source'

  # These are manually require'd so the classes are registered properly with
  # ActiveSupport.
  require 'gitlab/metrics/subscribers/action_view'
  require 'gitlab/metrics/subscribers/active_record'
  require 'gitlab/metrics/subscribers/rails_cache'

  Gitlab::Application.configure do |config|
    config.middleware.use(Gitlab::Metrics::RackMiddleware)
    config.middleware.use(Gitlab::Middleware::RailsQueueDuration)
  end

  Sidekiq.configure_server do |config|
    config.server_middleware do |chain|
      chain.add Gitlab::Metrics::SidekiqMiddleware
    end
  end

  # This instruments all methods residing in app/models that (appear to) use any
  # of the ActiveRecord methods. This has to take place _after_ initializing as
  # for some unknown reason calling eager_load! earlier breaks Devise.
  Gitlab::Application.config.after_initialize do
    Rails.application.eager_load!

    models = Rails.root.join('app', 'models').to_s

    regex = Regexp.union(
      ActiveRecord::Querying.public_instance_methods(false).map(&:to_s)
    )

    Gitlab::Metrics::Instrumentation.
      instrument_class_hierarchy(ActiveRecord::Base) do |klass, method|
        # Instrumenting the ApplicationSetting class can lead to an infinite
        # loop. Since the data is cached any way we don't really need to
        # instrument it.
        if klass == ApplicationSetting
          false
        else
          loc = method.source_location

          loc && loc[0].start_with?(models) && method.source =~ regex
        end
      end
  end

  Gitlab::Metrics::Instrumentation.configure do |config|
    config.instrument_instance_methods(Gitlab::Shell)

    config.instrument_methods(Gitlab::Git)

    Gitlab::Git.constants.each do |name|
      const = Gitlab::Git.const_get(name)

      next unless const.is_a?(Module)

      config.instrument_methods(const)
      config.instrument_instance_methods(const)
    end

    # Path to search => prefix to strip from constant
    paths_to_instrument = {
      ['app', 'finders']                    => ['app', 'finders'],
      ['app', 'mailers', 'emails']          => ['app', 'mailers'],
      ['app', 'services', '**']             => ['app', 'services'],
      ['lib', 'gitlab', 'diff']             => ['lib'],
      ['lib', 'gitlab', 'email', 'message'] => ['lib'],
      ['lib', 'gitlab', 'checks']           => ['lib']
    }

    paths_to_instrument.each do |(path, prefix)|
      prefix = Rails.root.join(*prefix)

      Dir[Rails.root.join(*path + ['*.rb'])].each do |file_path|
        path = Pathname.new(file_path).relative_path_from(prefix)
        const = path.to_s.sub('.rb', '').camelize.constantize

        config.instrument_methods(const)
        config.instrument_instance_methods(const)
      end
    end

    config.instrument_methods(Premailer::Adapter::Nokogiri)
    config.instrument_instance_methods(Premailer::Adapter::Nokogiri)

    [
      :Blame, :Branch, :BranchCollection, :Blob, :Commit, :Diff, :Repository,
      :Tag, :TagCollection, :Tree
    ].each do |name|
      const = Rugged.const_get(name)

      config.instrument_methods(const)
      config.instrument_instance_methods(const)
    end

    # Instruments all Banzai filters and reference parsers
    {
      Filter: Rails.root.join('lib', 'banzai', 'filter', '*.rb'),
      ReferenceParser: Rails.root.join('lib', 'banzai', 'reference_parser', '*.rb')
    }.each do |const_name, path|
      Dir[path].each do |file|
        klass = File.basename(file, File.extname(file)).camelize
        const = Banzai.const_get(const_name).const_get(klass)

        config.instrument_methods(const)
        config.instrument_instance_methods(const)
      end
    end

    config.instrument_methods(Banzai::Renderer)
    config.instrument_methods(Banzai::Querying)

    config.instrument_instance_methods(Banzai::ObjectRenderer)
    config.instrument_instance_methods(Banzai::Redactor)
    config.instrument_methods(Banzai::NoteRenderer)

    [Issuable, Mentionable, Participable].each do |klass|
      config.instrument_instance_methods(klass)
      config.instrument_instance_methods(klass::ClassMethods)
    end

    config.instrument_methods(Gitlab::ReferenceExtractor)
    config.instrument_instance_methods(Gitlab::ReferenceExtractor)

    # Instrument the classes used for checking if somebody has push access.
    config.instrument_instance_methods(Gitlab::GitAccess)
    config.instrument_instance_methods(Gitlab::GitAccessWiki)

    config.instrument_instance_methods(API::Helpers)

    config.instrument_instance_methods(RepositoryCheck::SingleRepositoryWorker)

    config.instrument_instance_methods(Rouge::Plugins::Redcarpet)
    config.instrument_instance_methods(Rouge::Formatters::HTMLGitlab)

    [:XML, :HTML].each do |namespace|
      namespace_mod = Nokogiri.const_get(namespace)

      config.instrument_methods(namespace_mod)
      config.instrument_methods(namespace_mod::Document)
    end

    config.instrument_methods(Rinku)
    config.instrument_instance_methods(Repository)

    config.instrument_methods(Gitlab::Highlight)
    config.instrument_instance_methods(Gitlab::Highlight)

    # This is a Rails scope so we have to instrument it manually.
    config.instrument_method(Project, :visible_to_user)
  end

  GC::Profiler.enable

  Gitlab::Metrics::Sampler.new.start

  module TrackNewRedisConnections
    def connect(*args)
      val = super

      if current_transaction = Gitlab::Metrics::Transaction.current
        current_transaction.increment(:new_redis_connections, 1)
      end

      val
    end
  end

  class ::Redis::Client
    prepend TrackNewRedisConnections
  end
end


text:
package com.foxrouter.api.model;

import java.util.ArrayList;
import java.util.List;

public class RouterNetworkSettingPPPoE extends RouterNetworkSetting {

	private String username;
	private String password;

	public RouterNetworkSettingPPPoE(String username, String password) {
		super.setProto("pppoe");
		this.setUsername(username);
		this.setPassword(password);
	}

	public String getUsername() {
		return username;
	}

	public void setUsername(String username) {
		this.username = username;
	}

	public String getPassword() {
		return password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	@Override
	public String[] toArray() {
		List<String> list = new ArrayList<String>();
		list.add(this.getProto());
		list.add(this.getUsername());
		list.add(this.getPassword());

		return (String[]) list.toArray();
	}
}


text:
import * as React from 'react';
import { createDriverFactory } from 'wix-ui-test-utils/driver-factory';
import { autocompleteDriverFactory } from './Autocomplete.driver';
import { Autocomplete } from '.';
import { autocompleteTestkitFactory } from '../../testkit';
import { autocompleteTestkitFactory as enzymeAutocompleteTestkitFactory } from '../../testkit/enzyme';
import { isEnzymeTestkitExists } from 'wix-ui-test-utils/enzyme';
import { isTestkitExists } from 'wix-ui-test-utils/vanilla';
import { mount } from 'enzyme';

describe('Autocomplete', () => {
  const createDriver = createDriverFactory(autocompleteDriverFactory);

  it('should render autocomplete', () => {
    const driver = createDriver(<Autocomplete options={[]} />);
    expect(driver.isTargetElementExists()).toBeTruthy();
    expect(driver.isContentElementExists()).toBeFalsy();
  });

  describe('testkit', () => {
    it('should exist', () => {
      expect(
        isTestkitExists(
          <Autocomplete options={[]} />,
          autocompleteTestkitFactory,
        ),
      ).toBe(true);
    });
  });

  describe('enzyme testkit', () => {
    it('should exist', () => {
      expect(
        isEnzymeTestkitExists(
          <Autocomplete options={[]} />,
          enzymeAutocompleteTestkitFactory,
          mount,
        ),
      ).toBe(true);
    });
  });
});


text:
using namespace llvm;
using namespace MachO;
using namespace object;

static constexpr StringLiteral ObjC1ClassNamePrefix = ".objc_class_name_";
static constexpr StringLiteral ObjC2ClassNamePrefix = "_OBJC_CLASS_$_";
static constexpr StringLiteral ObjC2MetaClassNamePrefix = "_OBJC_METACLASS_$_";
static constexpr StringLiteral ObjC2EHTypePrefix = "_OBJC_EHTYPE_$_";
static constexpr StringLiteral ObjC2IVarPrefix = "_OBJC_IVAR_$_";

static uint32_t getFlags(const Symbol *Sym) {
  uint32_t Flags = BasicSymbolRef::SF_Global;
  if (Sym->isUndefined())
    Flags |= BasicSymbolRef::SF_Undefined;
  else
    Flags |= BasicSymbolRef::SF_Exported;

  if (Sym->isWeakDefined() || Sym->isWeakReferenced())
    Flags |= BasicSymbolRef::SF_Weak;

  return Flags;
}

TapiFile::TapiFile(MemoryBufferRef Source, const InterfaceFile &interface,
                   Architecture Arch)
    : SymbolicFile(ID_TapiFile, Source) {
  for (const auto *Symbol : interface.symbols()) {
    if (!Symbol->getArchitectures().has(Arch))
      continue;

    switch (Symbol->getKind()) {
    case SymbolKind::GlobalSymbol:
      Symbols.emplace_back(StringRef(), Symbol->getName(), getFlags(Symbol));
      break;
    case SymbolKind::ObjectiveCClass:
      if (interface.getPlatforms().count(PlatformKind::macOS) &&
          Arch == AK_i386) {
        Symbols.emplace_back(ObjC1ClassNamePrefix, Symbol->getName(),
                             getFlags(Symbol));
      } else {
        Symbols.emplace_back(ObjC2ClassNamePrefix, Symbol->getName(),
                             getFlags(Symbol));
        Symbols.emplace_back(ObjC2MetaClassNamePrefix, Symbol->getName(),
                             getFlags(Symbol));
      }
      break;
    case SymbolKind::ObjectiveCClassEHType:
      Symbols.emplace_back(ObjC2EHTypePrefix, Symbol->getName(),
                           getFlags(Symbol));
      break;
    case SymbolKind::ObjectiveCInstanceVariable:
      Symbols.emplace_back(ObjC2IVarPrefix, Symbol->getName(),
                           getFlags(Symbol));
      break;
    }
  }
}

TapiFile::~TapiFile() = default;

void TapiFile::moveSymbolNext(DataRefImpl &DRI) const {
  const auto *Sym = reinterpret_cast<const Symbol *>(DRI.p);
  DRI.p = reinterpret_cast<uintptr_t>(++Sym);
}

Error TapiFile::printSymbolName(raw_ostream &OS, DataRefImpl DRI) const {
  const auto *Sym = reinterpret_cast<const Symbol *>(DRI.p);
  OS << Sym->Prefix << Sym->Name;
  return Error::success();
}

Expected<uint32_t> TapiFile::getSymbolFlags(DataRefImpl DRI) const {
  const auto *Sym = reinterpret_cast<const Symbol *>(DRI.p);
  return Sym->Flags;
}

basic_symbol_iterator TapiFile::symbol_begin() const {
  DataRefImpl DRI;
  DRI.p = reinterpret_cast<uintptr_t>(&*Symbols.begin());
  return BasicSymbolRef{DRI, this};
}

basic_symbol_iterator TapiFile::symbol_end() const {
  DataRefImpl DRI;
  DRI.p = reinterpret_cast<uintptr_t>(&*Symbols.end());
  return BasicSymbolRef{DRI, this};
}


text:
package com.iluwatar.masterworker;

import java.util.ArrayList;

/**
 * The abstract Input class, having 1 public field which contains input data, and abstract method
 * divideData.
 *
 * @param <T> T will be type of data.
 */

public abstract class Input<T> {

  public final T data;

  public Input(T data) {
    this.data = data;
  }

  public abstract ArrayList<Input> divideData(int num);
}


text:
set -ev

if [ ! "$TRAVIS" ]; then
    echo "Documentation can only be deployed by Travis CI"
    exit 0
fi

if [ "$TRAVIS_PULL_REQUEST" != "false" ]; then
    echo "Skipping documentation deployment"
    echo "Not applicable to pull requests"
    exit 0
fi

REPO=`git config remote.origin.url`
SSH_REPO=${REPO/https:\/\/github.com\//git@github.com:}
echo $REPO
echo $SSH_REPO

eval `ssh-agent -s`
ssh-add .deploy_key

git clone --branch=gh-pages $REPO gh-pages

cd gh-pages
rm -rf css favicon.png fonts index.html interface \
   js lists media module page proc program search.html \
   sourcefile src tipuesearch type
cp -r "$TRAVIS_BUILD_DIR"/docs/html/* .
git add *
git commit -am "Documentation updated by travis job $TRAVIS_JOB_NUMBER for commits $TRAVIS_COMMIT_RANGE"
git push $SSH_REPO gh-pages


text:
using System;
using FluentScheduler.Model;
using Moq;
using NUnit.Framework;

namespace FluentScheduler.Tests.ScheduleTests
{
	[TestFixture]
	public class MonthsOnTheSecondTests
	{
		[Test]
		public void Should_Default_To_00_00_If_At_Is_Not_Defined()
		{
			var task = new Mock<ITask>();
			var schedule = new Schedule(task.Object);
			schedule.ToRunEvery(2).Months().OnTheSecond(DayOfWeek.Monday);

			var input = new DateTime(2000, 1, 1, 1, 23, 25);
			var scheduledTime = schedule.CalculateNextRun(input);

			Assert.AreEqual(scheduledTime.Hour, 0);
			Assert.AreEqual(scheduledTime.Minute, 0);
			Assert.AreEqual(scheduledTime.Second, 0);
		}

		[Test]
		public void Should_Set_Specific_Hour_And_Minute_If_At_Method_Is_Called()
		{
			var task = new Mock<ITask>();
			var schedule = new Schedule(task.Object);
			schedule.ToRunEvery(2).Months().OnTheSecond(DayOfWeek.Monday).At(3, 15);

			var input = new DateTime(2000, 1, 16);
			var scheduledTime = schedule.CalculateNextRun(input);
			var expectedTime = new DateTime(2000, 3, 13);
			Assert.AreEqual(scheduledTime.Date, expectedTime.Date);

			Assert.AreEqual(scheduledTime.Hour, 3);
			Assert.AreEqual(scheduledTime.Minute, 15);
			Assert.AreEqual(scheduledTime.Second, 0);
		}

		[Test]
		public void Should_Override_Existing_Minutes_And_Seconds_If_At_Method_Is_Called()
		{
			var task = new Mock<ITask>();
			var schedule = new Schedule(task.Object);
			schedule.ToRunEvery(2).Months().OnTheSecond(DayOfWeek.Monday).At(3, 15);

			var input = new DateTime(2000, 1, 1, 1, 23, 25);
			var scheduledTime = schedule.CalculateNextRun(input);
			var expectedTime = new DateTime(2000, 1, 10);
			Assert.AreEqual(scheduledTime.Date, expectedTime.Date);

			Assert.AreEqual(scheduledTime.Hour, 3);
			Assert.AreEqual(scheduledTime.Minute, 15);
			Assert.AreEqual(scheduledTime.Second, 0);
		}

		[Test]
		public void Should_Select_The_Date_If_The_Next_Runtime_Falls_On_The_Specified_Day()
		{
			var task = new Mock<ITask>();
			var schedule = new Schedule(task.Object);
			schedule.ToRunEvery(2).Months().OnTheSecond(DayOfWeek.Wednesday);

			var input = new DateTime(2000, 1, 16);
			var scheduledTime = schedule.CalculateNextRun(input);

			var expectedTime = new DateTime(2000, 3, 8);
			Assert.AreEqual(scheduledTime, expectedTime);
		}

		[Test]
		public void Should_Ignore_The_Specified_Day()
		{
			var task = new Mock<ITask>();
			var schedule = new Schedule(task.Object);
			schedule.ToRunEvery(2).Months().OnTheSecond(DayOfWeek.Thursday);

			var input = new DateTime(2000, 1, 25);
			var scheduledTime = schedule.CalculateNextRun(input);

			var expectedTime = new DateTime(2000, 3, 9);
			Assert.AreEqual(scheduledTime, expectedTime);
		}

		[Test]
		public void Should_Pick_The_Day_Of_Week_Specified()
		{
			var task = new Mock<ITask>();
			var schedule = new Schedule(task.Object);
			schedule.ToRunEvery(2).Months().OnTheSecond(DayOfWeek.Friday);

			var input = new DateTime(2000, 1, 15);
			var scheduledTime = schedule.CalculateNextRun(input);

			var expectedTime = new DateTime(2000, 3, 10);
			Assert.AreEqual(scheduledTime, expectedTime);
		}

		[Test]
		public void Should_Pick_The_Next_Week_If_The_Day_Of_Week_Has_Passed()
		{
			var task = new Mock<ITask>();
			var schedule = new Schedule(task.Object);
			schedule.ToRunEvery(2).Months().OnTheSecond(DayOfWeek.Tuesday);

			var input = new DateTime(2000, 1, 15);
			var scheduledTime = schedule.CalculateNextRun(input);

			var expectedTime = new DateTime(2000, 3, 14);
			Assert.AreEqual(scheduledTime, expectedTime);
		}

		[Test]
		public void Should_Pick_The_Next_Week_If_The_Day_Of_Week_Has_Passed_For_New_Weeks()
		{
			var task = new Mock<ITask>();
			var schedule = new Schedule(task.Object);
			schedule.ToRunEvery(9).Months().OnTheSecond(DayOfWeek.Saturday);

			var input = new DateTime(2000, 1, 16);
			var scheduledTime = schedule.CalculateNextRun(input);

			var expectedTime = new DateTime(2000, 10, 14);
			Assert.AreEqual(scheduledTime, expectedTime);
		}

		[Test]
		public void Should_Pick_The_Next_Week_If_The_Day_Of_Week_Has_Passed_For_End_Of_Week()
		{
			var task = new Mock<ITask>();
			var schedule = new Schedule(task.Object);
			schedule.ToRunEvery(3).Months().OnTheSecond(DayOfWeek.Sunday);

			var input = new DateTime(2000, 1, 16);
			var scheduledTime = schedule.CalculateNextRun(input);

			var expectedTime = new DateTime(2000, 4, 9);
			Assert.AreEqual(scheduledTime, expectedTime);
		}
	}
}


text:
import React from 'react'
import styled from '../../lib/styled'
import { noteListIconColor } from '../../lib/styled/styleFunctions'

const StyledButton = styled.button<{ active: boolean }>`
  background: transparent;
  height: 32px;
  box-sizing: border-box;
  font-size: 16px;
  outline: none;
  border: none;
  ${noteListIconColor}
  &:first-child {
    margin-left: 0;
  }
  &:last-child {
    margin-right: 0;
  }
`

interface ToolbarButtonProps {
  icon: React.ReactNode
  active?: boolean
  className?: string
  onClick: React.MouseEventHandler
}

const ToolbarButton = ({
  icon,
  onClick,
  active = false,
  className
}: ToolbarButtonProps) => (
  <StyledButton onClick={onClick} active={active} className={className}>
    {icon}
  </StyledButton>
)

export default ToolbarButton


text:
"""Unit test for localdisk_service - Treadmill local disk service.
"""

from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals

import collections
import os
import shutil
import tempfile
import unittest

import mock
import six

if six.PY2 and os.name == 'posix':
    import subprocess32 as subprocess  # pylint: disable=import-error
else:
    import subprocess  # pylint: disable=wrong-import-order

import treadmill
from treadmill import localdiskutils
from treadmill.services import localdisk_service

class LocalDiskServiceTest(unittest.TestCase):
    """Unit tests for the local disk service implementation.
    """
    def setUp(self):
        self.root = tempfile.mkdtemp()

    def tearDown(self):
        if self.root and os.path.isdir(self.root):
            shutil.rmtree(self.root)

    def test_event_handlers(self):
        """Test event_handlers request.
        """
        svc = localdisk_service.LocalDiskResourceService(
            block_dev='/dev/block',
            read_bps='100M',
            write_bps='100M',
            read_iops=1000,
            write_iops=1000

        )

        self.assertEqual(
            svc.event_handlers(),
            []
        )

    @mock.patch('treadmill.lvm.vgdisplay', mock.Mock())
    def test_report_status(self):
        """Test service status reporting.
        """
        # Access to a protected member _vg_status
        # pylint: disable=W0212

        svc = localdisk_service.LocalDiskResourceService(
            block_dev='/dev/block',
            read_bps='100M',
            write_bps='100M',
            read_iops=1000,
            write_iops=1000
        )
        svc._vg_status = {'test': 'me'}

        status = svc.report_status()

        self.assertEqual(status, {
            'test': 'me',
            'read_bps': '100M',
            'write_bps': '100M',
            'read_iops': 1000,
            'write_iops': 1000
        })

    @mock.patch('treadmill.cgroups.create', mock.Mock())
    @mock.patch('treadmill.cgroups.set_value', mock.Mock())
    @mock.patch('treadmill.fs.create_filesystem', mock.Mock())
    @mock.patch('treadmill.lvm.lvcreate', mock.Mock())
    @mock.patch('treadmill.lvm.lvdisplay', mock.Mock())
    @mock.patch('treadmill.localdiskutils.refresh_vg_status',
                mock.Mock())
    def test_on_create_request(self):
        """Test processing of a localdisk create request.
        """
        # Access to a protected member _vg_status
        # pylint: disable=W0212

        svc = localdisk_service.LocalDiskResourceService(
            block_dev='/dev/block',
            read_bps='100M',
            write_bps='100M',
            read_iops=1000,
            write_iops=1000
        )
        svc._vg_status = {
            'extent_size': 4 * 1024**3,
            'extent_free': 512,
        }
        request = {
            'size': '100M',
        }
        request_id = 'myproid.test-0-ID1234'
        treadmill.lvm.lvdisplay.return_value = {
            'block_dev': '/dev/test',
            'dev_major': 42,
            'dev_minor': 43,
            'extent_size': 10,
            'name': 'ID1234',
        }

        localdisk = svc.on_create_request(request_id, request)

        treadmill.lvm.lvcreate.assert_called_with(
            volume='ID1234',
            group='treadmill',
            size_in_bytes=100 * 1024 * 1024,
        )
        self.assertTrue(
            treadmill.localdiskutils.refresh_vg_status.called
        )
        cgrp = os.path.join('treadmill/apps', request_id)
        treadmill.cgroups.create.assert_called_with(
            'blkio', cgrp
        )

        treadmill.cgroups.set_value.assert_has_calls(
            [
                mock.call('blkio', cgrp,
                          'blkio.throttle.read_bps_device',
                          '42:43 20971520'),
                mock.call('blkio', cgrp,
                          'blkio.throttle.read_iops_device',
                          '42:43 100'),
                mock.call('blkio', cgrp,
                          'blkio.throttle.write_bps_device',
                          '42:43 20971520'),
                mock.call('blkio', cgrp,
                          'blkio.throttle.write_iops_device',
                          '42:43 100'),
            ],
            any_order=True
        )
        self.assertEqual(
            localdisk,
            {
                'block_dev': '/dev/test',
                'dev_major': 42,
                'dev_minor': 43,
                'extent_size': 10,
                'name': 'ID1234',
            }
        )

    @mock.patch('treadmill.cgroups.create', mock.Mock())
    @mock.patch('treadmill.cgroups.set_value', mock.Mock())
    @mock.patch('treadmill.fs.create_filesystem', mock.Mock())
    @mock.patch('treadmill.lvm.lvcreate', mock.Mock())
    @mock.patch('treadmill.lvm.lvdisplay', mock.Mock())
    @mock.patch('treadmill.localdiskutils.refresh_vg_status',
                mock.Mock())
    def test_on_create_request_existing(self):
        """Test processing of a localdisk create request when volume already
        created.
        """
        # Access to a protected member _vg_status
        # pylint: disable=W0212

        svc = localdisk_service.LocalDiskResourceService(
            block_dev='/dev/block',
            read_bps='100M',
            write_bps='100M',
            read_iops=1000,
            write_iops=1000
        )
        svc._vg_status = {
            'extent_size': 4 * 1024**3,
            'extent_free': 512,
        }
        treadmill.lvm.lvdisplay.return_value = {
            'block_dev': '/dev/test',
            'dev_major': 42,
            'dev_minor': 43,
            'extent_size': 10,
            'name': 'ID1234',
        }
        request = {
            'size': '100M',
        }
        request_id = 'myproid.test-0-ID1234'
        localdisk = svc.on_create_request(request_id, request)
        # Reset all mocks
        treadmill.cgroups.create.reset_mock()
        treadmill.cgroups.set_value.reset_mock()
        treadmill.fs.create_filesystem.reset_mock()
        treadmill.lvm.lvcreate.reset_mock()
        treadmill.lvm.lvdisplay.reset_mock()
        treadmill.localdiskutils.refresh_vg_status.reset_mock()
        treadmill.lvm.lvdisplay.return_value = {
            'block_dev': '/dev/test',
            'dev_major': 24,
            'dev_minor': 34,
            'extent_size': 10,
            'name': 'ID1234',
        }
        # Issue a second request
        localdisk = svc.on_create_request(request_id, request)

        self.assertFalse(treadmill.lvm.lvcreate.called)
        self.assertFalse(
            treadmill.localdiskutils.refresh_vg_status.called
        )
        cgrp = os.path.join('treadmill/apps', request_id)
        treadmill.cgroups.create.assert_called_with(
            'blkio', cgrp
        )
        treadmill.cgroups.set_value.assert_has_calls(
            [
                mock.call('blkio', cgrp,
                          'blkio.throttle.read_bps_device',
                          '24:34 20971520'),
                mock.call('blkio', cgrp,
                          'blkio.throttle.read_iops_device',
                          '24:34 100'),
                mock.call('blkio', cgrp,
                          'blkio.throttle.write_bps_device',
                          '24:34 20971520'),
                mock.call('blkio', cgrp,
                          'blkio.throttle.write_iops_device',
                          '24:34 100'),
            ],
            any_order=True
        )
        self.assertEqual(
            localdisk,
            {
                'block_dev': '/dev/test',
                'dev_major': 24,
                'dev_minor': 34,
                'extent_size': 10,
                'name': 'ID1234',
            }
        )

    @mock.patch('treadmill.lvm.lvdisplay', mock.Mock())
    @mock.patch('treadmill.lvm.lvremove', mock.Mock())
    @mock.patch('treadmill.localdiskutils.refresh_vg_status',
                mock.Mock())
    def test_on_delete_request(self):
        """Test processing of a localdisk delete request.
        """
        # Access to a protected member
        # pylint: disable=W0212

        svc = localdisk_service.LocalDiskResourceService(
            block_dev='/dev/block',
            read_bps='100M',
            write_bps='100M',
            read_iops=1000,
            write_iops=1000
        )
        request_id = 'myproid.test-0-ID1234'

        svc.on_delete_request(request_id)

        treadmill.lvm.lvremove.assert_called_with('ID1234', group='treadmill')
        self.assertTrue(
            treadmill.localdiskutils.refresh_vg_status.called
        )

    @mock.patch('treadmill.lvm.vgdisplay', mock.Mock())
    def test__refresh_vg_status(self):
        """Test LVM volume group status querying.
        """
        # Access to a protected member
        # pylint: disable=W0212

        treadmill.lvm.vgdisplay.return_value = {
            'access': 'r/w',
            'extent_alloc': 0,
            'extent_free': 24,
            'extent_nb': 24,
            'extent_size': 4096,
            'lv_cur': 0,
            'lv_max': 0,
            'lv_open_count': 0,
            'max_size': -1,
            'name': 'test',
            'number': -1,
            'pv_actual': 1,
            'pv_cur': 1,
            'pv_max': 0,
            'size': 98304,
            'status': '772',
            'uuid': 'Vsj4xA-45Ad-v4Rp-VOOf-XzEf-Gxwr-erL7Zu',
        }

        status = localdiskutils.refresh_vg_status('FOO')

        treadmill.lvm.vgdisplay.assert_called_with(group='FOO')
        self.assertEqual(
            status,
            {
                'extent_free': 24,
                'extent_nb': 24,
                'extent_size': 4194304,
                'name': 'test',
                'size': 100663296,
            }
        )

    @mock.patch('treadmill.lvm.pvcreate', mock.Mock())
    @mock.patch('treadmill.lvm.vgactivate', mock.Mock())
    @mock.patch('treadmill.lvm.vgcreate', mock.Mock())
    def test__init_vg(self):
        """Test LVM volume group initialization.
        """
        # pylint: disable=W0212

        treadmill.lvm.vgactivate.side_effect = [
            subprocess.CalledProcessError(returncode=5, cmd='lvm'),
            0,
        ]

        localdiskutils.init_vg('test-group', '/dev/test')

        treadmill.lvm.pvcreate.assert_called_with(device='/dev/test')
        treadmill.lvm.vgcreate.assert_called_with(
            'test-group',
            device='/dev/test'
        )
        treadmill.lvm.vgactivate.assert_called_with('test-group')

    @mock.patch('treadmill.subproc.check_call', mock.Mock())
    @mock.patch('treadmill.localdiskutils.loop_dev_for',
                mock.Mock())
    @mock.patch('treadmill.localdiskutils.init_loopback_devices',
                mock.Mock())
    @mock.patch('treadmill.localdiskutils.create_image',
                mock.Mock())
    def test__init_block_dev(self):
        """Create a backing block device for LVM's Treadmill volume group.
        """
        # pylint: disable=W0212

        localdiskutils.loop_dev_for.side_effect = [
            subprocess.CalledProcessError(returncode=1, cmd='losetup'),
            '/dev/test'
        ]

        res = localdiskutils.init_block_dev('treadmill.img', '/bar', '2G')

        self.assertTrue(localdiskutils.init_loopback_devices.called)
        localdiskutils.create_image.assert_called_with(
            localdiskutils.TREADMILL_IMG,
            '/bar',
            '2G'
        )
        self.assertEqual(res, '/dev/test')

    @mock.patch('os.stat', mock.Mock())
    @mock.patch('os.unlink', mock.Mock())
    @mock.patch('treadmill.fs.create_excl', mock.Mock())
    @mock.patch('treadmill.fs.mkdir_safe', mock.Mock())
    @mock.patch('treadmill.sysinfo.disk_usage', mock.Mock(
        return_value=collections.namedtuple('struct', 'free')(10 * 1024**3)
    ))
    def test__create_image(self):
        """Test image file creation.
        """
        # pylint: disable=W0212

        localdiskutils.create_image('foo', '/bar', '-2G')

        treadmill.fs.mkdir_safe.assert_called_with('/bar')
        os.stat.assert_called_with('/bar/foo')
        os.unlink.assert_called_with('/bar/foo')
        treadmill.fs.create_excl.assert_called_with(
            '/bar/foo',
            (10 * 1024**3) - (2 * 1024**3),  # 10G free - 2G reserve
        )

if __name__ == '__main__':
    unittest.main()


text:
from gpiozero import TrafficLights
from time import sleep
from signal import pause

lights = TrafficLights(2, 3, 4)

def traffic_light_sequence():
    while True:
        yield (0, 0, 1) # green
        sleep(10)
        yield (0, 1, 0) # amber
        sleep(1)
        yield (1, 0, 0) # red
        sleep(10)
        yield (1, 1, 0) # red+amber
        sleep(1)

lights.source = traffic_light_sequence()

pause()


text:
package org.zstack.header.storage.primary;

import org.zstack.header.image.ImageBackupStorageRefInventory;
import org.zstack.header.image.ImageInventory;
import org.zstack.header.message.NeedReplyMessage;

/**
 * Created by mingjian.deng on 2018/1/12.
 */
public class GetInstallPathForDataVolumeDownloadMsg extends NeedReplyMessage implements PrimaryStorageMessage {
    private String primaryStorageUuid;
    private ImageBackupStorageRefInventory backupStorageRef;
    private ImageInventory image;
    private String volumeUuid;
    private String hostUuid;
    private String allocatedInstallUrl;

    public String getAllocatedInstallUrl() {
        return allocatedInstallUrl;
    }

    public void setAllocatedInstallUrl(String allocatedInstallUrl) {
        this.allocatedInstallUrl = allocatedInstallUrl;
    }

    public void setPrimaryStorageUuid(String primaryStorageUuid) {
        this.primaryStorageUuid = primaryStorageUuid;
    }

    public ImageBackupStorageRefInventory getBackupStorageRef() {
        return backupStorageRef;
    }

    public void setBackupStorageRef(ImageBackupStorageRefInventory backupStorageRef) {
        this.backupStorageRef = backupStorageRef;
    }

    public ImageInventory getImage() {
        return image;
    }

    public void setImage(ImageInventory image) {
        this.image = image;
    }

    public String getVolumeUuid() {
        return volumeUuid;
    }

    public void setVolumeUuid(String volumeUuid) {
        this.volumeUuid = volumeUuid;
    }

    public String getHostUuid() {
        return hostUuid;
    }

    public void setHostUuid(String hostUuid) {
        this.hostUuid = hostUuid;
    }

    @Override
    public String getPrimaryStorageUuid() {
        return primaryStorageUuid;
    }
}


text:
import { css } from 'styled-components';
import { hilite, lite, dark, borderAsymReverse } from 'style/lego'
export default css`
  background: ${dark};
  border: outset ${hilite};
  padding: 4px 10px;
  color: ${lite};
  ${borderAsymReverse};

  &:active {
    background: ${lite};
    color: black;
    border: inset ${hilite};
  }
`;


text:
'use strict';

angular.module('thrApp')
    .controller('NavbarController', function ($scope, $location, $state, Auth, Principal, ENV) {
        $scope.isAuthenticated = Principal.isAuthenticated;
        $scope.$state = $state;
        $scope.inProduction = ENV === 'prod';

        $scope.logout = function () {
            Auth.logout();
            $state.go('home');
        };
    });


text:
package org.rsna.server;

import org.apache.log4j.Logger;
import org.rsna.util.Base64;

import java.util.Hashtable;

/**
 * The standard authenticator singleton class for the server.
 */
public class Authenticator {

	static final Logger logger = Logger.getLogger(Authenticator.class);

	static Authenticator authenticator = null;

	protected Hashtable<String,Session> sessions = null;
	String ssoCookieName = null;
	long timeout = 1 * 60 * 60 * 1000; //default session timeout in ms = 1 hour

	/**
	 * The protected constructor to prevent instantiation of
	 * the class except through the getInstance() method.
	 */
	protected Authenticator() {
		sessions = new Hashtable<String,Session>();
	}

	/**
	 * Get the Authenticator instance, creating it if it does not exist.
	 */
	public static synchronized Authenticator getInstance() {
		if (authenticator == null) authenticator = new Authenticator();
		return authenticator;
	}

	/**
	 * Set the Session timeout.
	 * @param timeout the timeout in milliseconds
	 */
	public synchronized void setSessionTimeout(long timeout) {
		this.timeout = timeout;
	}

	/**
	 * Set the Single Sign On cookie name. This method must
	 * be called by Users implementations that use an external
	 * SSO server for authentication. When the ssoCookieName
	 * is set, the authenticator uses the cookie value as an
	 * index into the sessions table.
	 * @param ssoCookieName the Single Sign On cookie name.
	 */
	public synchronized void setSSOCookieName(String ssoCookieName) {
		if (ssoCookieName != null) {
			ssoCookieName = ssoCookieName.trim();
			if (ssoCookieName.equals("")) ssoCookieName = null;
		}
		this.ssoCookieName = ssoCookieName;
	}

	/**
	 * Get the Session timeout.
	 */
	public synchronized long getSessionTimeout() {
		return timeout;
	}

	/**
	 * Authenticate the user from an HttpRequest.
	 * This method tests for the session cookie.
	 * If the session cookie is present, it uses it to find
	 * the session. If the session exists and applies to the
	 * request (e.g., it is from the same IP address, and it
	 * hasn't timed out), it sets the User to the User of the
	 * session. In all other cases, it sets the User to null.
	 * @param req the request.
	 * @return the authenticated user, or null if the user cannot be authenticated.
	 */
    public User authenticate(HttpRequest req) {
		Session session;

		//First try the SSO session cookie
		if (ssoCookieName != null) {
			String id = req.getCookie(ssoCookieName);
			if (id != null) {
				if ( ((session=sessions.get(id)) != null) && session.appliesTo(req) ) {
					session.recordAccess();
					return session.user;
				}
				else {
					User user = Users.getInstance().validate(req);
					if (user != null) {
						try {
							session = new Session(user, req.getRemoteAddress());
							//Note: we don't use the id created by the session
							//because the SSO system has already set the cookie,
							//so we index on that.
							sessions.put(id, session);
							session.recordAccess();
							return session.user;
						}
						catch (Exception unable) { }
					}
				}
			}
		}

		//No joy, try the RSNA session cookie
		String id = req.getCookie("RSNASESSION");
		if ( (id != null) && ((session=sessions.get(id)) != null) && session.appliesTo(req) ) {
			session.recordAccess();
			return session.user;
		}

		//No session cookie, or cookie is not valid; check the headers.
		//First try the Authorization header.
		String credentials = req.getHeader("Authorization");
		if (credentials != null) {
			String type = "basic";
			credentials = credentials.trim();
			if (credentials.toLowerCase().startsWith(type)) {
				credentials = credentials.substring(type.length()).trim();
				try {
					credentials = new String(Base64.decode(credentials), "UTF-8");
					User user = getUserFromCredentials(credentials);
					if (user != null) return user;
				}
				catch (Exception ex) { }
			}
		}

		//Next try the RSNA header. This header is not encoded.
		credentials = req.getHeader("RSNA");
		if (credentials != null) {
			User user = getUserFromCredentials(credentials);
			if (user != null) return user;
		}

		//The user cannot be authenticated.
		return null;
	}

	private User getUserFromCredentials(String credentials) {
		Users users = Users.getInstance();
		String[] up = credentials.split(":");
		User user = null;
		if (up.length == 2) {
			user = users.authenticate(up[0], up[1]);
		}
		else if (up.length == 1) {
			user = users.authenticate(up[0], "");
		}
		return user;
	}

	/**
	 * Get the username for a session identified by a session ID.
	 * @param id the ID of the session.
	 * @return the username of the session owner, or null if the
	 * session does not exist.
	 */
    public String getUsernameForSession(String id) {
		if (id != null) {
			Session session = sessions.get(id);
			if (session != null) return session.user.getUsername();
		}
		return null;
	}

	/**
	 * Create a session for a User, storing the session
	 * cookie in the supplied HttpResponse as a Set-Cookie
	 * header.
	 * @param user the user for whom to create a session.
	 * @param req the response.
	 * @param res the response.
	 * @return true if the session was created; false otherwise.
	 */
    public boolean createSession(User user, HttpRequest req, HttpResponse res) {
		try {
			Session session = new Session(user, req.getRemoteAddress());
			sessions.put(session.id, session);
			res.setHeader("Set-Cookie", "RSNASESSION="+session.id);
			res.setHeader("Cache-Control", "no-cache=\"set-cookie\"");
			return true;
		}
		catch (Exception failed) {
			return false;
		}
	}

	/**
	 * Close a session if one is identified by a session
	 * cookie in the request. Closing a session deletes the
	 * session from the sessions hashtable, making the session
	 * unrecognizable by the authenticator. It also sets
	 * a dummy session cookie with Max-Age=0.
	 * @param req the request.
	 * @param res the response.
	 */
    public void closeSession(HttpRequest req, HttpResponse res) {
		//See if there is a cookie specifying an existing session.
		String id = req.getCookie("RSNASESSION");
		if (id != null) {
			//A session was specified. Remove it from the hashtable.
			sessions.remove(id);
			//Set a dummy session cookie that expires immediately.
			res.setHeader("Set-Cookie","RSNASESSION=NONE; Max-Age=0");
			res.setHeader("Cache-Control", "no-cache=\"set-cookie\"");
		}
	}

}


text:
//------------------------------------------------------------------------------
// <auto-generated>
//     This code was generated by a tool.
//     Runtime Version:2.0.50727.3082
//
//     Changes to this file may cause incorrect behavior and will be lost if
//     the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------

namespace FNHCustomProviders.SampleApp {

    public partial class ForgotPassword {

        /// <summary>
        /// form1 control.
        /// </summary>
        /// <remarks>
        /// Auto-generated field.
        /// To modify move field declaration from designer file to code-behind file.
        /// </remarks>
        protected global::System.Web.UI.HtmlControls.HtmlForm form1;

        /// <summary>
        /// UserInfo1 control.
        /// </summary>
        /// <remarks>
        /// Auto-generated field.
        /// To modify move field declaration from designer file to code-behind file.
        /// </remarks>
        protected global::FNHCustomProviders.SampleApp.StatusControl UserInfo1;

        /// <summary>
        /// Passwordrecovery1 control.
        /// </summary>
        /// <remarks>
        /// Auto-generated field.
        /// To modify move field declaration from designer file to code-behind file.
        /// </remarks>
        protected global::System.Web.UI.WebControls.PasswordRecovery Passwordrecovery1;

        /// <summary>
        /// copyright1 control.
        /// </summary>
        /// <remarks>
        /// Auto-generated field.
        /// To modify move field declaration from designer file to code-behind file.
        /// </remarks>
        protected global::FNHCustomProviders.SampleApp.copyrights copyright1;
    }
}


text:
import os
import pandas as pd
import numpy as np
import unicodedata
from tableaudocumentapi import Workbook
# from tableaudocumentapi import Connection
# from tableaudocumentapi import dbclass

# Setup
#sourceWB = Workbook('tableauworkbook.twb')
printDatasource = False
printWorksheet = False
saveExcel = False

def get_calc_resolved_calculation(fieldObj, allFieldsObj):
    """ returns calculation value of a field, with resolved nested calculations """
    if fieldObj.calculation is None:
        return None

    mappedField = fieldObj.calculation
    while mappedField.find('[Calculation_') >= 0:
            n = mappedField.find('[Calculation_')
            toMap = mappedField[n:mappedField.find(']', n)+1]
            mappedField = mappedField.replace(toMap, allFieldsObj[toMap].calculation)
    return mappedField.encode('utf-8').strip() #unicodedata.normalize('NFKD', mappedField)

def get_name_resolved_calculation(fieldObj, allFieldsObj):
    """ returns calculation caption of a field, with resolved nested calculations """
    if fieldObj.calculation is None:
        return None

    mappedField = fieldObj.calculation
    while mappedField.find('[Calculation_') >= 0:
            n = mappedField.find('[Calculation_')
            toMap = mappedField[n:mappedField.find(']', n)+1]
            mappedField = mappedField.replace(toMap, allFieldsObj[toMap].caption)
    return mappedField

def _resolve_calculation_parts(fieldObj, allFieldsObj, resolutionType):
    #TODO need to make this loop through Calculation_ and other fields that have names, but need to be resolved

    #this is the target field which we're resoliving calculation names to
    mappedField = fieldObj.calculation
    while mappedField.find('[') >= 0:
        n = mappedField.find('[') #starting point of calc
        toMap = mappedField[n:mappedField.find(']', n)+1] #find the end of the calc name

        #set output to the specified resolutionType
        if resolutionType is None or resolutionType == 'calc':
            rfield = allFieldsObj[toMap].calculation
        elif resolutionType == 'caption':
            rfield = allFieldsObj[toMap].caption
        elif resolutionType == 'calcwithref':
            rfield = '{[{}] {}}'.format(allFieldsObj[toMap].caption, allFieldsObj[toMap].calculation)
        else:
            rfield = 'could not resolve type'
            print ("invalid parameter [{}] passed for 'resolutionType' ".format(resolutionType))

        mappedField = mappedField.replace(toMap, rfield)
    return mappedField

def _get_calc_value(fieldObj, type):
    return getattr(fieldObj, type)

def _field_has_calculation(fieldObj):
    return fieldObj.calculation is not None

def get_resolved_calculation(fieldObj, allFieldsObj, resolutionType=None):
    """ returns calculation caption of a field, with resolved nested calculations """
    """ options: calc (default); caption; calcwithref """
    if not _field_has_calculation(fieldObj):
        return None

    print('checker: ', fieldObj.name, _field_has_calculation(fieldObj))

    ## Resolve non-named calculated fields
    # look for the fields with 'Calculation_' ids
    #TODO make the function call to resolve the names
    #this is the target field which we're resoliving calculation names to
    mappedField = fieldObj.calculation
    while mappedField.find('[') >= 0:
        n = mappedField.find('[') #starting point of calc
        toMap = mappedField[n:mappedField.find(']', n)+1] #find the end of the calc name

        #set output to the specified resolutionType
        #TODO need to check if the field is a calculation or just an attributes
        if resolutionType is None or resolutionType == 'calc':
            # if toMap == '[Returned]':
            #     print ('RETURN FOUND: PRINTING OBJECTS IN LIST')
            #     for x in allFieldsObj:
            #         print x, x[0]
            # print "GETTING: ", toMap, ' ,', allFieldsObj[toMap]," | RESULT: ", _get_calc_value(allFieldsObj[toMap], 'name')
            rfield = _get_calc_value(allFieldsObj[toMap], 'name')
            # rfield = allFieldsObj[toMap].calculation
        # elif resolutionType == 'caption':
        #     rfield = allFieldsObj[toMap].caption
        # elif resolutionType == 'calcwithref':
        #     rfield = '{[{}] {}}'.format(allFieldsObj[toMap].caption, allFieldsObj[toMap].calculation)
        # else:
        #     rfield = 'could not resolve type'
        #     print ("invalid parameter [{}] passed for 'resolutionType' ".format(resolutionType))
        # print toMap
        mappedField = mappedField.replace(toMap, 'rfield')
    return mappedField
    # return _resolve_calculation_parts(fieldObj, allFieldsObj, resolutionType)

# Loop through all files with the same file extension #
d = []
dw = []

##### TODO Re-enable this
path = ""
if path == "":
    path = os.path.realpath(os.getcwd())

for fname in os.listdir(path):
    # if fname == 'Sample Superstore Workbook ALT.twb':
    if fname == 'tableauworkbook.twb':
        if fname.endswith('twb') or fname.endswith('twbx') or fname.endswith('tds'):
            sourceWB = Workbook(fname)
            for sourceTDS in sourceWB.datasources:
                if sourceTDS.name != 'Parameters':
                    # for x in sourceTDS.fields:
                    #     print "RAISING 1: TDS Name: {}, Caption: {}, Value: {}".format(sourceTDS.name, sourceTDS.caption, x)

                    for count, field in enumerate(sourceTDS.fields.values()):
                        print("WORKBOOK: ", sourceWB.filename, " DATASOURCE: ", sourceTDS.name, " FIELD: ", field.name)
                        d.append({'Workbook': sourceWB.filename,
                                'Field': field.name,
                                'Type': field.datatype,
                                'Default Aggregation': field.default_aggregation,
                                'Field Calculation': get_resolved_calculation(field, sourceTDS.fields)
                                })

d = pd.DataFrame(d)

########################################
# De-Duplication Unique List of Fields #
########################################
#TODO Re-enable this
# d1 = d # Create a Copy
# d1['Field'] = d1['Field'].str.strip('[]') # Remove Brackets [] from field names
# d1 = d1.drop_duplicates(subset=['Default Aggregation', 'Field', 'Field Calculation','Type'])  # Ignore Workbook
# d1 = d1.sort_values('Field') # Sort for convenience
# d1['freq'] = d1.groupby('Field')['Field'].transform('count') # Add Frequency
# d1_1 = d1.query('freq > 1') # Partition Fields with duplicates
# d1_2 = d1.query('freq == 1') # Partition Fields without duplicates

# d1_1['Field_Calc_Count'] = d1_1.groupby(['Field'])['Field Calculation'].transform('count')

# d1_1_1 = d1_1.query('Field_Calc_Count > 1') # Multipe fields, diff calcs
# d1_1_1['Dup_Calc'] = 1

# d1_1_2 = d1_1.query('Field_Calc_Count <=1') # Non duplicate field calcs

# d1_1_2['Agg_Null'] = np.where(d1_1_2['Default Aggregation'].isnull(),1,0)
# d1_1_2 = d1_1_2.query('Agg_Null==0') # Non Duplicates

# # Join final partitions together #
# final = pd.concat([d1_2, d1_1_2, d1_1_1])

# # Check for Same Calc with different field names #
# final['calc_freq'] = final.groupby('Field Calculation')['Field Calculation'].transform('count')
# final['Dup_Field'] = np.where(final['calc_freq']>1,1,"")

# final.to_csv('Python Output File.csv'
#         , columns=[#'Workbook',
#         'Field', 'Type', 'Default Aggregation', 'Field Calculation',
#         'Dup_Calc','Dup_Field']
#         ) # Output File

#==============================================================================
# if printWorksheet:
#     for ws in sourceWB.datasources[2:3]:
#         for f in ws.fields.values():
#             print ('######### GETTING: {}'.format(f.name))
#             print (get_name_resolved_calculation(f, ws.fields))
#             # print (get_nested_calculation(ws.fields['CY Label (Percentage)'], ws.fields))
#
#             # print (f.worksheets)
#             # print (f.id, f.name, f.caption)
#             # print (f.calculation)
#
#
# if printDatasource:
#     for sourceTDS in sourceWB.datasources[2:3]:
#         ############################################################
#         # Print out all of the fields and what type they are
#         ############################################################
#         print('----------------------------------------------------------')
#         print('--- fields for {} [{}]'.format(sourceTDS.caption, sourceTDS.name))
#         print('--- {} total fields in this datasource'.format(len(sourceTDS.fields)))
#         print('----------------------------------------------------------')
#         for count, field in enumerate(sourceTDS.fields.values()):
#             print('{:>4}: {} is a {}'.format(count+1, field.name, field.datatype))
#             blank_line = False
#             if field.calculation:
#                 print('      the formula is {}'.format(field.calculation.encode('utf-8').strip()))
#                 blank_line = True
#             if field.default_aggregation:
#                 print('      the default aggregation is {}'.format(field.default_aggregation))
#                 blank_line = True
#             if field.description:
#                 print('      the description is {}'.format(field.description))
#
#             if blank_line:
#                 print('')
#         print('----------------------------------------------------------')
#
#
# if saveExcel:
#     book = xlsxwriter.Workbook('pythonexcel.xlsx')
#     sh = book.add_worksheet()
#     sh.set_column('A:A',20)
#     sh.write(0,0,'Calculation Name')
#     for ws in sourceWB.datasources[2:3]:
#         row = 1
#         for f in ws.fields.values():
#             sh.write(row,0,str(f.worksheets))
#             sh.write(row,1,f.name)
#             sh.write(row,2,f.caption)
#             sh.write(row,3,f.calculation)
#             row+=1
#
#     book.close()
#==============================================================================


text:
/*
 * This file is part of AirReceiver.
 *
 * AirReceiver is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.

 * AirReceiver is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.

 * You should have received a copy of the GNU General Public License
 * along with AirReceiver.  If not, see <http://www.gnu.org/licenses/>.
 */

package nz.co.iswe.android.airplay.network;

import java.util.logging.Level;
import java.util.logging.Logger;

import org.jboss.netty.channel.*;

/**
 * Logs exceptions thrown by other channel handlers
 */
public class ExceptionLoggingHandler extends SimpleChannelHandler {
	private static Logger LOG = Logger.getLogger(ExceptionLoggingHandler.class.getName());

	@Override
	public void exceptionCaught(final ChannelHandlerContext ctx, final ExceptionEvent evt) throws Exception {
		super.exceptionCaught(ctx, evt);
		LOG.log(Level.WARNING, "Handler raised exception", evt.getCause());
	}
}


text:
using System;
using UnityEngine;

namespace UnityStandardAssets.Characters.ThirdPerson
{
    [RequireComponent(typeof (NavMeshAgent))]
    [RequireComponent(typeof (ThirdPersonCharacter))]
    public class AICharacterControl : MonoBehaviour
    {
        public NavMeshAgent agent { get; private set; } // the navmesh agent required for the path finding
        public ThirdPersonCharacter character { get; private set; } // the character we are controlling
        public Transform target; // target to aim for

        // Use this for initialization
        private void Start()
        {
            // get the components on the object we need ( should not be null due to require component so no need to check )
            agent = GetComponentInChildren<NavMeshAgent>();
            character = GetComponent<ThirdPersonCharacter>();

	        agent.updateRotation = false;
	        agent.updatePosition = true;
        }

        // Update is called once per frame
        private void Update()
        {
            if (target != null)
            {
                agent.SetDestination(target.position);

                // use the values to move the character
                character.Move(agent.desiredVelocity, false, false);
            }
            else
            {
                // We still need to call the character's move function, but we send zeroed input as the move param.
                character.Move(Vector3.zero, false, false);
            }

        }

        public void SetTarget(Transform target)
        {
            this.target = target;
        }
    }
}


text:
var path   = require('path'),
    events = require('events'),
    assert = require('assert'),
    fs     = require('fs'),
    vows   = require('../lib/vows'),
    silent = require('../lib/vows/reporters/silent');

function doSomethingAsync(callback) {
  	var err = null;
  	var testValue = 'a';

  	process.nextTick(function() {
  		  callback(err, testValue);
  	});
}

function doSomethingAsyncWithError(callback) {
  	var err = true;
  	var testValue = 'a';

  	process.nextTick(function() {
  		  callback(err, testValue);
  	});
}

vows.describe('vows/error').addBatch({
	'Generate success response to async function': {
    		topic: function() {
    			  doSomethingAsync(this.callback)
    		},
    		'Validate success': function(err, testValue) {
    			  assert.ok(!err);
    		},
    		'Validate testValue': function(err, testValue) {
    			  assert.equal(testValue, 'a');
    		}
  	},

  	'Generate error response to async function': {
    		topic: function() {
    			  doSomethingAsyncWithError(this.callback)
    		},
    		'Validate error': function(err, testValue) {
    			  assert.ok(err);
    		},
    		'Validate testValue': function(err, testValue) {
    			  // This assertion fails. It shouldn't.
    			  assert.equal(testValue, 'a');
    		}
  	}
}).export(module)

vows.describe('Error Handling').addBatch({
    "A topic with a function that errors": {
        topic: function() {
            throw("Something wrong here");
        },
        "should return an error to a vow with two parameters": function(e, data) {
            assert.equal(e, "Something wrong here");
        }
    },
    "A topic with a built-in error": {
        topic: function() {
            bad.bad;
        },
        "should return an error to a vow with two parameters": function(e, data) {
            assert(e instanceof Error, "Return value " + e + " wasn't an Error.");
        }
    },
    "The previous two topics run in their own suite," : {
        "connected to two vows expecting one argument each" : {
            topic: function(){
                vows.describe().addBatch({
                    "A topic with a function that errors": {
                        topic: function() {
                            throw("Something wrong here");
                        },
                        "should record the error in the test results" : function(data) {
                            assert.ok(!data);
                        }
                        //» An unexpected error was caught: "Something wrong here"
                    },
                    "A topic with a built-in error": {
                        topic: function() {
                            bad.bad;
                        },
                        "should record the error in the test results" : function(data) {
                            assert.ok(!data);
                        }
                        //» An unexpected error was caught: ReferenceError: bad is not defined
                    }
                }).run({reporter : silent}, this.callback);
            },
            "should have an errored count of two" : function(results, unused) {
                assert.equal(results.errored, 2);
            },
            "should have a total count of two" : function(results, unused) {
                assert.equal(results.total, 2);
            },
            "should have an honored count of zero" : function(results, unused){
                assert.equal(results.honored, 0);
            }
        }
    },
    "A topic with an error in it" : {
        topic : function(){
            throw('awesome');
        },
        "should error" : function(error, result){
            assert.equal(error, 'awesome');
        },
        "containing a subtopic" : {
            topic : function(){
                return 52;
            },
            "should reach a vow in the subtopic" : function(){
            }
        }
    }
}).export(module);


text:
package com.lepotuli.layla.vogame;

import com.lepotuli.layla.model.UserRatingData;
import com.lepotuli.layla.vogame.R;

import android.annotation.SuppressLint;
import android.app.Fragment;
import android.os.Bundle;
import android.util.Log;
import android.view.GestureDetector;
import android.view.LayoutInflater;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.TextView;
import android.widget.Toast;
import android.widget.ViewFlipper;
import android.content.Context;
import android.content.Intent;
import android.gesture.Gesture;
import android.view.GestureDetector;
import android.view.MotionEvent;
import android.view.View.OnClickListener;
import android.view.animation.Animation;
import android.view.animation.AnimationUtils;
import android.view.animation.LinearInterpolator;
import android.view.animation.TranslateAnimation;

/*
 * @author Merkulov Maksim (DomenZero)
 * <wardomenmax@gmail.com>
 * lepotuli.com
 *
 *  Fragment UI-panel Settings
 *  Connecting with UserRatingData (there model of table for save & load players)
*/

@SuppressLint("Assert") public class FragmentGameSettings extends Fragment {

	private TextView mSettingsView = null;
	private int mCurrIdx = FragmentGameActivity.UNSELECTED;
	private int mSettingsArrLen = 0;
	//02/05/2015
	private ViewFlipper mFlipper;
	//public TextView mTextView1, mTextView2;
	private TextView mTextView1=null, mTextView2=null;
	private int mCurrentLayoutState=0, mCount=0;
	private GestureDetector mGestureDetector;
	//private Button butStart;
	private int huk=0;

	// Returns currently selected item
	public int getShownIndex() {
		return mCurrIdx;
	}

	// Return level
	public int wtisLevel(){
		return mCount;
	}

	// Show Settings at position newIndex
	public void showSettingsAtIndex(int newIndex) {
		if (newIndex < 0 || newIndex >= mSettingsArrLen)
			return;
		// Index

		mCurrIdx = newIndex;

		// Players info string
		mSettingsView.setText(getString(R.string.fragment_game_number)+(newIndex+1)+" "+getString(R.string.fragment_game_name)+" "+FragmentGameActivity.PlayersArray[mCurrIdx]);

		// Getting Integer level
		mCount=Integer.parseInt(FragmentGameActivity.SettingsArray[mCurrIdx]);

		//03/24 select true previous and next level

		mTextView1.setText(String.valueOf(mCount));

		//Der Fruhling 03/02

		mTextView1.setLayerType(View.LAYER_TYPE_SOFTWARE, null);
		mTextView2.setLayerType(View.LAYER_TYPE_SOFTWARE, null);

		// Slide level
		mGestureDetector = new GestureDetector(getActivity(),
				new GestureDetector.SimpleOnGestureListener() {
					@Override
					public boolean onDown(MotionEvent e){
						return true;
					}

					@Override
					public boolean onFling(MotionEvent e1, MotionEvent e2,
							float velocityX, float velocityY) {
						Log.i("gesture","onFling calling!!!");
						final int SWIPE_MIN_DISTANCE=120;
						final int SWIPE_MAX_OFF_PATH=250;
						final int SWIPE_THRESHOLD_VELOCITY=200;
//						try{
//							if(Math.abs(e1.getY()-e2.getY())>SWIPE_MAX_OFF_PATH)
//								return false;
							if(e1.getX()-e2.getX()>SWIPE_MIN_DISTANCE && Math.abs(velocityX)>SWIPE_THRESHOLD_VELOCITY){
								mCurrentLayoutState = mCurrentLayoutState == 0 ? 1
										: 0;
								switchLayoutStateTo(mCurrentLayoutState);
								Log.i("gesture","Right to Left!");
							}else if(e2.getX()-e1.getX()>SWIPE_MIN_DISTANCE && Math.abs(velocityX)>SWIPE_THRESHOLD_VELOCITY){
								mCurrentLayoutState = mCurrentLayoutState == 0 ? 1
										: 0;
								switchLayoutStateOut(mCurrentLayoutState);
								Log.i("gesture","Left to Right");
							}
//						} catch (Exception e){
//
//						}

						return true;//super.onFling(e1, e2, velocityX, velocityY);
					}
				});

		mFlipper.setOnTouchListener(new View.OnTouchListener() {

			@Override
			public boolean onTouch(View v, MotionEvent event) {
				// Touch-touch
				return mGestureDetector.onTouchEvent(event);

			}

		});

		mFlipper.post(new Runnable() {

			@Override
			public void run() {
				// TODO Auto-generated method stub
				if(mFlipper.getChildCount()<4)
					return;

				mFlipper.setInAnimation(null);
				mFlipper.setOutAnimation(null);

				while(mFlipper.getChildCount()>1)
					mFlipper.removeViewAt(0);

				mFlipper.setInAnimation(null);
				mFlipper.setOutAnimation(null);

				assert mFlipper.getChildCount()==1;
			}
		});
	}

	/***
	 *
	 * @param switchIn - current layout state
	 *
	 * Animation flip module
	 */

	public void switchLayoutStateIn(int mmm) {
		mFlipper.setInAnimation(inFromRightAnimation());
		mFlipper.setOutAnimation(outToLeftAnimation());
		mCount=Integer.parseInt(FragmentGameActivity.SettingsArray[mmm]);
		mTextView2.setText(String.valueOf(mCount));

		//!Test In Animation blink)
//		Animation outtoRight = new TranslateAnimation(
//				Animation.RELATIVE_TO_PARENT, 0.0f,
//				Animation.RELATIVE_TO_PARENT, +1.0f,
//				Animation.RELATIVE_TO_PARENT, 0.0f,
//				Animation.RELATIVE_TO_PARENT, 0.0f);
//		outtoRight.setDuration(500);
		//outtoRight.setStartOffset(20);
		//outtoRight.setRepeatMode(Animation.REVERSE);
		//outtoRight.setRepeatCount(Animation.INFINITE);//setInterpolator(new LinearInterpolator());

		//mFlipper.showNext();

//		mTextView1.startAnimation(outtoRight);

	}

	public void switchLayoutStateTo(int switchTo) {
		mCurrentLayoutState = switchTo;

		mCount++;

		//push Animation
		mFlipper.setInAnimation(inFromRightAnimation());
		mFlipper.setOutAnimation(outToLeftAnimation());

		if (switchTo == 0) {
			mTextView1.setText(String.valueOf(mCount));
		} else {
			mTextView2.setText(String.valueOf(mCount));
		}

		mFlipper.showNext();
	}

	public void switchLayoutStateOut(int switchOut) {
		mCurrentLayoutState = switchOut;

		mCount--;

		mFlipper.setInAnimation(inFromLeftAnimation());
		mFlipper.setOutAnimation(outToRightAnimation());

		if (switchOut == 0) {
			mTextView1.setText(String.valueOf(mCount));
		} else {
			mTextView2.setText(String.valueOf(mCount));
		}

		mFlipper.showPrevious();
	}

	private Animation inFromRightAnimation() {
		Animation inFromRight = new TranslateAnimation(
				Animation.RELATIVE_TO_PARENT, +1.0f,
				Animation.RELATIVE_TO_PARENT, 0.0f,
				Animation.RELATIVE_TO_PARENT, 0.0f,
				Animation.RELATIVE_TO_PARENT, 0.0f);
		inFromRight.setDuration(500);
		inFromRight.setInterpolator(new LinearInterpolator());
		return inFromRight;
	}

	private Animation outToLeftAnimation() {
		Animation outtoLeft = new TranslateAnimation(
				Animation.RELATIVE_TO_PARENT, 0.0f,
				Animation.RELATIVE_TO_PARENT, -1.0f,
				Animation.RELATIVE_TO_PARENT, 0.0f,
				Animation.RELATIVE_TO_PARENT, 0.0f);
		outtoLeft.setDuration(500);
		outtoLeft.setInterpolator(new LinearInterpolator());
		return outtoLeft;
	}

	//
	private Animation inFromLeftAnimation() {
		Animation inFromLeft = new TranslateAnimation(
				Animation.RELATIVE_TO_PARENT, -1.0f,
				Animation.RELATIVE_TO_PARENT, 0.0f,
				Animation.RELATIVE_TO_PARENT, 0.0f,
				Animation.RELATIVE_TO_PARENT, 0.0f);
		inFromLeft.setDuration(500);
		inFromLeft.setInterpolator(new LinearInterpolator());
		return inFromLeft;
	}

	private Animation outToRightAnimation() {
		Animation outtoRight = new TranslateAnimation(
				Animation.RELATIVE_TO_PARENT, 0.0f,
				Animation.RELATIVE_TO_PARENT, +1.0f,
				Animation.RELATIVE_TO_PARENT, 0.0f,
				Animation.RELATIVE_TO_PARENT, 0.0f);
		outtoRight.setDuration(500);
		outtoRight.setInterpolator(new LinearInterpolator());
		return outtoRight;
	}

	/*
	 *
	 * @ Ended Animation module
	 *
	 * Fragment create module, there managed FragmentGameSettings
	 *
	 */

	// Called to create the content view for this Fragment
	@Override
	public View onCreateView(LayoutInflater inflater, ViewGroup container,
			Bundle savedInstanceState) {

		// Inflate the layout defined in fragmentgame_settings.xml
		// !!!The last parameter is false because the returned view does not need to be attached to the container ViewGroup
		return inflater.inflate(R.layout.fragmentgame_settings, container, false);
	}

	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);

		// Don't destroy Fragment on reconfiguration
		setRetainInstance(true);

		// This Fragment adds options to the ActionBar
		setHasOptionsMenu(true);

		//02/24

//		switchLayoutStateIn(mCurrentLayoutState);
		//push Animation
		//mTextView2.setText(String.valueOf(mCount));
		//mTextView1.setText(String.valueOf(mCount));
//		switchLayoutStateTo(mCurrentLayoutState);
	}

	// Set information about the Settings
	@Override
	public void onActivityCreated(Bundle savedInstanceState) {
		super.onActivityCreated(savedInstanceState);
		mSettingsView = (TextView) getActivity().findViewById(R.id.playerFlipquoteView);
		mSettingsArrLen = FragmentGameActivity.SettingsArray.length;

		//butStart = (Button) getActivity().findViewById(R.id.playerFlipbutStart);
		mFlipper = (ViewFlipper) getActivity().findViewById(R.id.playerFlipview_flipper);
		mTextView1 = (TextView) getActivity().findViewById(R.id.playerFliptextView1);
		mTextView2 = (TextView) getActivity().findViewById(R.id.playerFliptextView2);

		//31.07.2015 Size
//				mTextView1.setTextSize(100);
//				mTextView2.setTextSize(100);
		// Cancelled mFlipper info
		mFlipper.invalidate();

	}

	@Override
	public void onDetach() {
		super.onDetach();
		mCurrIdx = FragmentGameActivity.UNSELECTED;
	}

	public void onMegadeath(int mmm) {
		super.onDetach();
		switchLayoutStateIn(mmm);
		mCurrIdx = FragmentGameActivity.UNSELECTED;
		mFlipper.invalidate();
		if(mFlipper.getChildCount()<4)
			return;

		mFlipper.setInAnimation(null);
		mFlipper.setOutAnimation(null);

		while(mFlipper.getChildCount()>1)
			mFlipper.removeViewAt(0);

		mFlipper.setInAnimation(null);
		mFlipper.setOutAnimation(null);

		assert mFlipper.getChildCount()==1;

	}

	@Override
	public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {

		// Inflate the options Menu settings_menu.xml
		inflater.inflate(R.menu.settings_menu, menu);

	}

	@Override
	public boolean onOptionsItemSelected(MenuItem item) {

		switch (item.getItemId()) {

		// Show Toast Messages.
		// Return value true indicates that the menu click has been handled

		case R.id.detail_menu_item_main:
			Toast.makeText(getActivity().getApplicationContext(),
					R.string.text_winner,
					Toast.LENGTH_SHORT).show();
			/*** Start open database ***/

			// GetPlayers
			// If Winner has in table, that +1, else create new Winner
			if ((DatabaseRating.getPlayerFromRating(FragmentGameActivity.PlayersArray[mCurrIdx]))!= null)
			{
				int level=DatabaseRating.getLevelFromRating(FragmentGameActivity.PlayersArray[mCurrIdx])+1;
				DatabaseRating.updateLevelData_byID(FragmentGameActivity.PlayersArray[mCurrIdx], level, "Winner");
				Log.d("Read: ", "Level= "+level);
			}
			else
			{
				Log.d("Insert: ", "Inserting... "+FragmentGameActivity.PlayersArray[mCurrIdx]);
				DatabaseRating.addUserData(new UserRatingData(FragmentGameActivity.PlayersArray[mCurrIdx], 1,"Winner"));
			}

    		/*** End Open Database ***/
    		return true;

    	// Rating Button - have action = start Activity
		case R.id.detail_menu_item_secondary:
//			Toast.makeText(getActivity().getApplicationContext(),
//					"This action is also provided by the SettingsFragment. Not action ",
//					Toast.LENGTH_SHORT).show();
			Intent intent=new Intent(getActivity(), RatingActivity.class);
			startActivity(intent);
			return true;

		default:
			return super.onOptionsItemSelected(item);
		}
	}
}


text:
<?php
namespace API\Factory;

use Interop\Container\ContainerInterface;
use API\Action\PasswordResetRequestAction;
use Application\Model\Database\ServiceInterface;
use QBonaventure\InnerCryptography\Service as CryptographyService;

class PasswordResetRequestFactory
{
    public function __invoke(ContainerInterface $container)
    {
        return new PasswordResetRequestAction(
                $container->get(ServiceInterface::class),
                $container->get(CryptographyService::class)
        );
    }
}


text:
'use strict';

var npmatchub    =  require('npmatchub')
  , concatStream =  require('concat-stream')
  , asyncreduce  =  require('asyncreduce')
  , xtend        =  require('xtend')
  , log          =  require('valuepack-core/util/log')
  , sublevels    =  require('valuepack-core/mine/sublevels')
  , map          =  require('valuepack-core/mine/map')
  , sep          =  require('valuepack-core').sep
  , nib          =  require('valuepack-core').nib
  , ghroot       =  'https://github.com/'
  ;

var setImmediate = setImmediate || function (fn) { setTimeout(fn, 0) };

function resolve (byGithubOwner, pack, logins, trust, cb) {
  var stabs = npmatchub.stabs(logins, pack.name);
  asyncreduce(
      stabs
    , null
    , function (match, stab, cb_) {
        // pass the match thru the function chain once we found one
        if (match) return setImmediate(cb_.bind(null, null, match))
        var login = stab.login;
        var repo = stab.repo;

        byGithubOwner.get(login + sep + repo, function (err, value) {
          return err
            ? cb_(null, null)
            : cb_(null, { repoUrl: ghroot + login + '/' + repo })
        });
      }
    , cb
  );
}

function updateFixedRepos (packages, fixed, cb) {
  var batch = fixed.map(function (f) { return { key: f.name, value: f, type: 'put' } });
  packages.batch(batch, cb);
}

/**
 * Matches up npm user to a github login and his packages to github repositories
 *
 * @name exports
 * @function
 * @param db {LevelDb} mining db
 * @param npmuser {String} npm user name
 * @param logins {String} github logins for the npm user
 * @param cb {Function} called back with an error or npm packages whose repoUrl was filled in where ever possible
 * */
var go = module.exports = function (db, npmuser, logins, cb) {
  var subs        =  sublevels(db)
    , subnpm      =  subs.npm
    , subgithub   =  subs.github
    ;

    map
      .npmUserToPackageInfoStream(subnpm.packages, subnpm.byOwner, npmuser)
      .pipe(concatStream(fixMissingUrls));

    function fixMissingUrls (packageData) {
      var packages = packageData.map(function (d) { return d.pack });
      var needFixing = packages.filter(function (p) { return !p.repoUrl || !p.repoUrl.length });

      if (!needFixing.length) return cb();

      log.verbose('fix-repo-urls', 'Attempting to fix %s repo urls for npm user %s', needFixing.length, npmuser);

      var opts = {
          packages :  packages
        , logins   :  logins[npmuser]
        , resolve  :  resolve.bind(null, subgithub.byOwner)
      };

      var fixingNames = needFixing
        .reduce(function (acc, p) {
          acc[p.name] = true;
          return acc;
        }, {});

      npmatchub.repos(opts, function (err, packs) {
        if (err) return cb(err);

        var stillNeedFixing = packs.filter(function (p) { return !p.repoUrl || !p.repoUrl.length });

        var fixed = packs.filter(function (p) {
          return fixingNames[p.name] && p.repoUrl && p.repoUrl.length;
        });

        if (!fixed.length) return cb();

        log.verbose('fix-repo-urls', 'Applying fixes to %s of these packages', fixed.length);
        updateFixedRepos(subnpm.packages, fixed, cb);
      });
    }
};

if (!module.parent) {
  var leveldb =  require('valuepack-core/mine/leveldb')
    , dump = require('level-dump')
    , tapStream = require('tap-stream')
    , clearDb = require('valuepack-core/util/clear-db')

  log.level = 'verbose';
  leveldb.open(function (err, db) {
    if (err) return console.error(err);

    var subs        =  sublevels(db)
      , subnpm      =  subs.npm
      , subgithub   =  subs.github

    var logins = {
      dominictarr: [ 'dominictarr' ],
      raynos: [ 'Raynos', 'termi' ],
      substack: [ 'substack' ],
      thlorenz: [ 'thlorenz' ],
      tjholowaychuk:
        [ 'visionmedia',
          'component',
          'learnboost' ] }

    function run () {
      go(db, 'dominictarr', logins, function () { db.close(); });
    }

    run()
  });

}


text:
<!DOCTYPE html>
<html>
  <head>
    <script>document.write('<base href="' + document.location + '" />');</script>
    <title>Angular Tour of Heroes</title>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">

    <link rel="stylesheet" href="styles.css">
    <!-- Polyfills for older browsers -->
    <script src="https://unpkg.com/core-js/client/shim.min.js"></script>

    <script src="https://unpkg.com/zone.js@0.7.4?main=browser"></script>
    <script src="https://unpkg.com/reflect-metadata@0.1.8"></script>
    <script src="https://unpkg.com/systemjs@0.19.39/dist/system.src.js"></script>

    <script src="https://cdn.rawgit.com/angular/angular.io/b3c65a9/public/docs/_examples/_boilerplate/systemjs.config.web.js"></script>
    <script>
      System.import('app').catch(function(err){ console.error(err); });
    </script>
  </head>

  <body>
    <my-app>Loading...</my-app>
  </body>
</html>


text:
jk is going to be a modal text editor with ideas from vi and acme.

For information about the design of jk, see design.txt

The library is based at the root of the repo. To build the editor, `go get github.com/millere/jk`.