text:
<!DOCTYPE html>
<script src="../../../resources/testharness.js"></script>
<script src="../../../resources/testharnessreport.js"></script>
<script src="wasm_response_apis.js"></script>
<script src="../wasm/resources/wasm-module-builder.js"></script>
<script>
  promise_test(TestStreamedCompile, "test compileStreaming");

  promise_test(TestCompileOkStatusIsChecked, "test HTTP status is verified (compileStreaming)");
  promise_test(TestInstantiateOkStatusIsChecked, "test HTTP status is verified (instantiateStreaming)");
  promise_test(TestCompileMimeTypeIsChecked, "test MIME type is verified (compileStreaming)");
  promise_test(TestInstantiateMimeTypeIsChecked, "test MIME type is verified (instantiateStreaming)");
  promise_test(TestShortFormStreamedCompile, "test compileStreaming with promise parameter");
  promise_test(NegativeTestStreamedCompilePromise, "promise must produce a Response");
  promise_test(CompileBlankResponse, "compileStreaming blank response");
  promise_test(InstantiateBlankResponse, "instantiateStreaming blank response");
  promise_test(CompileEmpty, "compileStreaming - no parameters");
  promise_test(InstantiateEmpty, "instantiateStreaming - no parameters");
  promise_test(CompileFromArrayBuffer, "compileStreaming from array buffer");
  promise_test(CompileFromInvalidArrayBuffer, "compileStreaming from an invalid array buffer");
  promise_test(TestStreamedInstantiate, "test instantiateStreaming");
  promise_test(InstantiateFromArrayBuffer, "test instantiateStreaming from array buffer");
  promise_test(InstantiateFromInvalidArrayBuffer, "test instantiateStreaming from invalid buffer");
  promise_test(TestShortFormStreamedInstantiate, "test instantiateStreaming with promise parameter");
  promise_test(TestInstantiateComplexModule, "instantiateStreaming locally built module");
  promise_test(CompileFromInvalidDownload, "compile from invalid download");
  promise_test(InstantiateFromInvalidDownload, "instantiate from invalid download");
  promise_test(TestStreamingCompileExistsInWorker, "test compileStreaming exists in Worker");
  promise_test(TestStreamingInstantiateExistsInWorker, "test instantiateStreaming exists in Worker");
</script>


text:
class Mailchimp::WebHook < Mailchimp::Base

  #"data[action]": "unsub",
  #"data[reason]": "manual",
  #"data[id]": "8a25ff1d98",
  #"data[list_id]": "a6b5da1054",
  #"data[email]": "api+unsub@mailchimp.com",
  #"data[email_type]": "html",
  #"data[reason]": "hard"
  def self.unsubscribe(params)
    return unless enabled? && valid?(params)

    logger.debug "[Mailchimp::WebHook.unsubscribe] mark unsubscribe user '#{params[:email]}'"
    user = ::User.find_by_email(params[:email])
    return false unless user

    user.skip_mailchimp_callbacks = true
    user.unsubscribe!
  end

  private

  def self.valid?(params)
    params && params[:list_id] == config[:list_id] && params[:email]
  end

end

redpajama_set_name: RedPajamaGithub


text:
\documentclass{article}

\usepackage{hcar}

\begin{document}

\include{hcar2009-05}

\end{document}


text:
#ifndef SHADERC_H_HEADER_GUARD
#define SHADERC_H_HEADER_GUARD

#define _BX_TRACE(_format, ...) \
				BX_MACRO_BLOCK_BEGIN \
					if (g_verbose) \
					{ \
						fprintf(stderr, BX_FILE_LINE_LITERAL "" _format "\n", ##__VA_ARGS__); \
					} \
				BX_MACRO_BLOCK_END

#define _BX_WARN(_condition, _format, ...) \
				BX_MACRO_BLOCK_BEGIN \
					if (!(_condition) ) \
					{ \
						BX_TRACE("WARN " _format, ##__VA_ARGS__); \
					} \
				BX_MACRO_BLOCK_END

#define _BX_CHECK(_condition, _format, ...) \
				BX_MACRO_BLOCK_BEGIN \
					if (!(_condition) ) \
					{ \
						BX_TRACE("CHECK " _format, ##__VA_ARGS__); \
						bx::debugBreak(); \
					} \
				BX_MACRO_BLOCK_END

#define BX_TRACE _BX_TRACE
#define BX_WARN  _BX_WARN
#define BX_CHECK _BX_CHECK

#ifndef SHADERC_CONFIG_HLSL
#	define SHADERC_CONFIG_HLSL BX_PLATFORM_WINDOWS
#endif // SHADERC_CONFIG_HLSL

extern bool g_verbose;

#include <alloca.h>
#include <stdio.h>
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
#include <algorithm>
#include <string>
#include <vector>
#include <unordered_map>

#include <bx/bx.h>
#include <bx/debug.h>
#include <bx/commandline.h>
#include <bx/endian.h>
#include <bx/uint32_t.h>
#include <bx/readerwriter.h>
#include <bx/string.h>
#include <bx/hash.h>
#include "../../src/vertexdecl.h"

class LineReader
{
public:
	LineReader(const char* _str)
		: m_str(_str)
		, m_pos(0)
		, m_size((uint32_t)strlen(_str))
	{
	}

	std::string getLine()
	{
		const char* str = &m_str[m_pos];
		skipLine();

		const char* eol = &m_str[m_pos];

		std::string tmp;
		tmp.assign(str, eol - str);
		return tmp;
	}

	bool isEof() const
	{
		return m_str[m_pos] == '\0';
	}

	void skipLine()
	{
		const char* str = &m_str[m_pos];
		const char* nl = bx::strnl(str);
		m_pos += (uint32_t)(nl - str);
	}

	const char* m_str;
	uint32_t m_pos;
	uint32_t m_size;
};

struct UniformType
{
	enum Enum
	{
		Int1,
		End,

		Vec4,
		Mat3,
		Mat4,

		Count
	};
};

#define BGFX_UNIFORM_FRAGMENTBIT UINT8_C(0x10)
#define BGFX_UNIFORM_SAMPLERBIT  UINT8_C(0x20)

const char* getUniformTypeName(UniformType::Enum _enum);
UniformType::Enum nameToUniformTypeEnum(const char* _name);

struct Uniform
{
	std::string name;
	UniformType::Enum type;
	uint8_t num;
	uint16_t regIndex;
	uint16_t regCount;
};

typedef std::vector<Uniform> UniformArray;

void printCode(const char* _code, int32_t _line = 0, int32_t _start = 0, int32_t _end = INT32_MAX);
void strReplace(char* _str, const char* _find, const char* _replace);
int32_t writef(bx::WriterI* _writer, const char* _format, ...);
void writeFile(const char* _filePath, const void* _data, int32_t _size);

bool compileHLSLShader(bx::CommandLine& _cmdLine, uint32_t _d3d, const std::string& _code, bx::WriterI* _writer, bool firstPass = true);
bool compileGLSLShader(bx::CommandLine& _cmdLine, uint32_t _gles, const std::string& _code, bx::WriterI* _writer);

// andrewmac:
// -----------
void compilerError(const char *_format, ...);
#define fprintf(target, format, ...) compilerError(format, ##__VA_ARGS__)

namespace bgfx
{
   int compileShader(uint64_t _flags,
                     const char* _filePath,
                     const char* _outFilePath,
                     const char* _type,
                     const char* _platform,
                     const char* _profile,
                     const char* _bin2c,
                     const char* _includeDir,
                     const char* _varyingdef,
                     char* _outputText,
                     uint16_t& _outputSize);
}

#endif // SHADERC_H_HEADER_GUARD


text: mysql.server stop


text:
require_relative '../bootstrap'

require 'champion_estimator'
require 'brier'

bs = Brier.new

xs = []
ys = []
@accuracy = { correct: 0, count: 0 }

Match.all.each do |m|
  blue_gold = m.blue_participants.map { |e| e.stats['goldEarned'] }.reduce(:+)
  red_gold = m.red_participants.map { |e| e.stats['goldEarned'] }.reduce(:+)

  ## boolean predictor
  # prediction = blue_gold > red_gold ? 1.0 : 0.0
  ## relative predictor
  prediction = blue_gold.to_f / ( blue_gold + red_gold)
  correct = (m.winner == :blue) ? 1 : 0
  @accuracy[:correct] += correct
  @accuracy[:count] += 1

  bs.observe(prediction, correct)

  ys << prediction
  xs << correct

end

puts "accuracy = #{@accuracy[:correct].to_f / @accuracy[:count] }"
lr = SimpleLinearRegression.new(xs, ys)
puts "m=#{lr.slope}"

puts "bs = #{bs.score}"


text:
using System;
using System.Collections.Generic;
using System.Text;
using System.Net.Sockets;
using System.Net;

class TestSocketSocketPairFactory : ISocketPairFactory
{
    ITestSocketPair ISocketPairFactory.CreateSocketPair()
    {
        return new TestSocketPair();
    }

    bool ISocketPairFactory.SocketSupportsCloseInt32 { get { return true; } }
    bool ISocketPairFactory.SocketSupportsShutdown { get { return true; } }
}

class TestSocketPair : ITestSocketPair
{
    Socket m_svr;
    ISocketWrapper m_cli;

    public TestSocketPair()
    {
        Create();
    }

    public ISocketWrapper SocketA
    {
        get { return m_cli; }
    }

    public NetworkStream StreamA
    {
        get
        {
            return m_cli.GetStream();
        }
    }

    public Socket SocketB
    {
        get { return m_svr; }
    }

    void ITestSocketPair.PeerSendsData(byte[] data)
    {
        Socket peer = SocketB;
        peer.Send(data);
    }

    void ITestSocketPair.PeerCloses()
    {
        Socket peer = SocketB;
        peer.Close();
    }

    //----
    [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes")]
    internal void Create()
    {
        try {
            Create(AddressFamily.InterNetworkV6);
        } catch {
            Create(AddressFamily.InterNetwork);
        }
    }

    private void Create(AddressFamily af)
    {
        using (Socket lstnr = new Socket(af, SocketType.Stream, ProtocolType.Unspecified)) {
            lstnr.Bind(new IPEndPoint(
                af == AddressFamily.InterNetworkV6 ? IPAddress.IPv6Loopback : IPAddress.Loopback, 0));
            lstnr.Listen(1);
            EndPoint svrEp = lstnr.LocalEndPoint;
            Socket cli = new Socket(svrEp.AddressFamily, lstnr.SocketType, lstnr.ProtocolType);
            cli.Connect(svrEp);
            m_cli = new SocketWrapper(cli);
            m_svr = lstnr.Accept();
        }
    }

    public void Dispose()
    {
        Dispose(true);
    }

    private void Dispose(bool disposing)
    {
        if (disposing) {
            m_cli.Close();
            m_svr.Close();
        }
    }
}

class SocketWrapper : ISocketWrapper
{
    Socket m_sock;
    NetworkStream m_strm;

    public SocketWrapper(Socket sock)
    {
        m_sock = sock;
    }

    //----
    bool ISocketWrapper.Connected
    {
        get { return m_sock.Connected; }
    }

    NetworkStream ISocketWrapper.GetStream()
    {
        if (m_strm == null) {
            m_strm = new NetworkStream(m_sock, true);
        }
        return m_strm;
    }

    //----

    void ISocketWrapper.Close()
    {
        m_sock.Close();
    }

    void ISocketWrapper.Close(int timeout)
    {
        m_sock.Close(timeout);
    }

    void ISocketWrapper.Shutdown(SocketShutdown how)
    {
        m_sock.Shutdown(how);
    }
}


text:
package org.objectstyle.graphql.cayenne.it;

import com.fasterxml.jackson.databind.ObjectMapper;
import graphql.GraphQL;
import org.junit.AfterClass;
import org.objectstyle.graphql.cayenne.orm.DefaultSchemaTranslator;
import org.objectstyle.graphql.cayenne.orm.SchemaTranslator;
import org.objectstyle.graphql.test.TestFactory;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.io.IOException;
import java.util.HashMap;

class GraphQLTestFactory {
    private static GraphQL graphQL;
    private static TestFactory testFactory = new TestFactory();
    private static final Logger LOGGER = LoggerFactory.getLogger(GraphQLTestFactory.class);

    GraphQLTestFactory() {
        graphQL = createGraphQL(createSchemaTranslator());
    }

    @AfterClass
    public static void tearDownClass() {
        testFactory.stopServerRuntime();
    }

    private static GraphQL createGraphQL(SchemaTranslator translator) {
        return new GraphQL(translator.toGraphQL());
    }

    private static SchemaTranslator createSchemaTranslator() {
        return new DefaultSchemaTranslator(testFactory.getObjectContext());
    }

    String post_graphql_request(String request) {
        LOGGER.info(request);
        Object r = graphQL.execute("query " + request).getData();
        return r == null ? "" : r.toString();
    }

    String post_graphql_request(String request, String variables) {
        HashMap variables_map = new HashMap<>();

        try {
            variables_map = new ObjectMapper().readValue(variables, HashMap.class);
        } catch (IOException e) {
            e.printStackTrace();
        }

        LOGGER.info(request);
        Object r = graphQL.execute("query " + request, (Object)null, variables_map).getData();
        return r == null ? "" : r.toString();
    }
}


text:
class CreateAddresses < ActiveRecord::Migration
  def change
    create_table :addresses do |t|
      t.string :venue_name
      t.string :first_line
      t.string :second_line
      t.string :city
      t.string :state
      t.string :zipcode

      t.timestamps
    end
  end
end


text:
using CSharpDiscriminatedUnion.Attributes;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace CSharpDiscriminatedUnion.Generator.Tests.UnionTypes
{
    [GenerateDiscriminatedUnion]
    public partial class TrafficLights
    {
        partial class Cases
        {
            partial class Red : TrafficLights { }
            partial class Orange : TrafficLights { }
            partial class Green : TrafficLights { }
        }
    }

    [GenerateDiscriminatedUnion]
    public partial class Value
    {
        partial class Cases
        {
            partial class Boolean : Value
            {
                readonly bool boolValue;
            }
            partial class Integer : Value
            {
                readonly int intValue;
            }
            partial class String : Value
            {
                readonly string stringValue;
            }
        }
    }

    [GenerateDiscriminatedUnion]
    public partial class Employee
    {
        partial class Cases
        {
            partial class Manager : Employee
            {
                readonly string name;
            }
            partial class Engineer : Employee
            {
                readonly string name;
            }
            partial class TestEngineer : Employee
            {
                readonly string name;
            }
        }
    }

    [GenerateDiscriminatedUnion]
    public partial class Media
    {
        partial class Cases
        {
            partial class Book : Media
            {
                readonly string author;
                readonly int pages;
                readonly string title;
            }
            partial class Movie : Media
            {
                readonly string director;
                readonly TimeSpan duration;
                readonly string title;
            }
            partial class TvSeries : Media
            {
                readonly string title;
                readonly int episodes;
            }
        }
    }
}


text:
using System;
using System.Collections.Generic;
using System.Linq;
using PholioVisualisation.DataAccess;
using PholioVisualisation.DataConstruction;
using PholioVisualisation.DataSorting;
using PholioVisualisation.PholioObjects;

namespace PholioVisualisation.Services
{
    public class JsonBuilderGroupDataAtDataPointBySearch
    {
        private GroupDataBuilderBase _groupDataBuilder;

        public JsonBuilderGroupDataAtDataPointBySearch(GroupDataBuilderBase groupDataBuilder)
        {
            _groupDataBuilder = groupDataBuilder;
        }

        public IList<GroupRoot> GetGroupRoots()
        {
            var data = _groupDataBuilder.Build();

            var targetComparerProvider = new TargetComparerProvider(ReaderFactory.GetGroupDataReader(), ReaderFactory.GetAreasReader());
            new GroupDataProcessor(targetComparerProvider).Process(data);

            if (data.IsDataOk)
            {
                var groupDataReader = ReaderFactory.GetGroupDataReader();
                data.GroupRoots = new GroupRootFilter(groupDataReader).RemoveRootsWithoutChildAreaData(data.GroupRoots);
            }

            return data.GroupRoots ?? new List<GroupRoot>();
        }
    }
}


text:
package rs

import (
	. "github.com/qiniu/api.v6/conf"
	"github.com/qiniu/rpc"
)

// ----------------------------------------------------------

func (rs Client) Batch(l rpc.Logger, ret interface{}, op []string) (err error) {
	return rs.Conn.CallWithForm(l, ret, RS_HOST+"/batch", map[string][]string{"op": op})
}

// ----------------------------------------------------------

// @gist batchStatItemRet
type BatchStatItemRet struct {
	Data  Entry  `json:"data"`
	Error string `json:"error"`
	Code  int    `json:"code"`
}

// @endgist

// @gist entryPath
type EntryPath struct {
	Bucket string
	Key    string
}

// @endgist

func (rs Client) BatchStat(l rpc.Logger, entries []EntryPath) (ret []BatchStatItemRet, err error) {

	b := make([]string, len(entries))
	for i, e := range entries {
		b[i] = URIStat(e.Bucket, e.Key)
	}
	err = rs.Batch(l, &ret, b)
	return
}

// ----------------------------------------------------------

// @gist batchItemRet
type BatchItemRet struct {
	Error string `json:"error"`
	Code  int    `json:"code"`
}

// @endgist

func (rs Client) BatchDelete(l rpc.Logger, entries []EntryPath) (ret []BatchItemRet, err error) {

	b := make([]string, len(entries))
	for i, e := range entries {
		b[i] = URIDelete(e.Bucket, e.Key)
	}
	err = rs.Batch(l, &ret, b)
	return
}

// ----------------------------------------------------------

// @gist entryPathPair
type EntryPathPair struct {
	Src  EntryPath
	Dest EntryPath
}

// @endgist

func (rs Client) BatchMove(l rpc.Logger, entries []EntryPathPair) (ret []BatchItemRet, err error) {

	b := make([]string, len(entries))
	for i, e := range entries {
		b[i] = URIMove(e.Src.Bucket, e.Src.Key, e.Dest.Bucket, e.Dest.Key)
	}
	err = rs.Batch(l, &ret, b)
	return
}

func (rs Client) BatchCopy(l rpc.Logger, entries []EntryPathPair) (ret []BatchItemRet, err error) {

	b := make([]string, len(entries))
	for i, e := range entries {
		b[i] = URICopy(e.Src.Bucket, e.Src.Key, e.Dest.Bucket, e.Dest.Key)
	}
	err = rs.Batch(l, &ret, b)
	return
}

// ----------------------------------------------------------


text:
package org.saucistophe.patterns;

import java.util.ArrayList;
import java.util.List;
import java.util.function.DoubleConsumer;

/**
 A class that can be used to perform long tasks. When it is the case, it will fire progress listeners.
 */
public class MonitorableTask
{
	/**
	 Listeners that will be fired every time there's a progress change in this lengthy task.
	 The passed double will be typically used for progress bars, and will range between 0 (no progress) and 1 (done).
	 */
	public List<DoubleConsumer> progressMonitors = new ArrayList<>();

	/**
	 Sets the progress via the registered monitors.

	 @param progress The progress value, ranging between 0 (no progress) and 1 (done).
	 */
	public void setProgress(double progress)
	{
		progressMonitors.stream().forEach(c ->c.accept(progress));
	}
}


text:
function parseMarkdown(text) {
    var converter = new showdown.Converter(),
        html      = converter.makeHtml(text);
    return html;
}

// parse usernames into Markdown links to github
function parseUsernames(text) {
    var words = text.split(' ');
    for (var i = 0; i < words.length; i++) {
        if (words[i][0] == '@') {
            words[i] = '['+ words[i] + ']' + '(https://github.com/' + words[i].substring(1) + ')';
        }
    }
    return words.join(' ');
}

// Load issue list at page 1
function loadIssueList(url) {
    var repoPath = url.substring('https://github.com/'.length),
        issuesUrl = 'https://api.github.com/repos/'+ repoPath + '/issues?page=1';
    listRequestStream.onNext(issuesUrl);
}

// Return to issue list
function returnToIssueList(url) {
    listRequestStream.onNext(url + '/issues');
}

// map url on requestStream to JSON responses
function mapToJSON(requestStream) {
    return requestStream.flatMap(function(requestUrl) {
        console.log("Request: " + requestUrl);
        return Rx.Observable.create(function (observer) {
            jQuery.getJSON(requestUrl)
            .done(function(response, status, jqXHR) { observer.onNext(jqXHR); })
            .fail(function(jqXHR, status, error) { observer.onError(error); })
            .always(function() { observer.onCompleted(); });
        });
    });
}

// Publish sourceUrl to request stream when selector is clicked
function bindClickableRequest(selector, sourceUrl, stream) {
    Rx.Observable.create(function(observer) {
        $(selector).on('click', function() {
            observer.onNext(sourceUrl);
        });
    }).subscribe(function(url) {
        stream.onNext(url);
    });
}

// Style labels with their custom colors
function styleLabel(label) {
    return $('
', {
             'class' : 'ui basic label',
             style   : 'box-shadow: 0 0 0.05em black;' +
                       'border-color: #' + label.color + '!important;">',
             text    : label.name
    });
}

// Shorten text to 140 characters or next full word
function shorten(text, limit) {
    var words = text.split(' '),
        short = ' ';
    for (var i = 0, chars = 0; i < words.length && chars < limit; i++) {
        short += words[i];
        chars += words[i].length;
        if (chars < limit) short += ' ';
        else short += '...';
    }
    return short;
}

// Make pagination menu from issue list response headers
function makePageMenu(headers) {
    var headerLines = headers.split("\n");
    if (headerLines[6].substring(0, 4) === "Link") {
        var tokens = headerLines[6].split(" ");
        var first, prev, current, next, last;
        if (tokens[2] === 'rel="next",') {
            // In case of a first or middle page
            var nextUrl = tokens[1].substring(1, tokens[1].length - 2);
            var nextIdx = nextUrl.split("=")[1];
            next = '' + nextIdx + '';
            var lastUrl = tokens[3].substring(1, tokens[3].length - 2);
            var lastIdx = lastUrl.split("=")[1];
            if (nextIdx != lastIdx) {
                last = '' + lastIdx + '';
            }
            var index = Number(nextIdx) - 1;
            current = '
' + index + '
';
        } else if (tokens[2] === 'rel="first",') {
            // In case of a last page
            var firstUrl = tokens[1].substring(1, tokens[1].length - 2);
            var firstIdx = firstUrl.split("=")[1];
            first = '' + firstIdx + '';
            var prevUrl = tokens[3].substring(1, tokens[3].length - 2);
            var prevIdx = prevUrl.split("=")[1];
            prev = '' + prevIdx + '';
            var index = Number(prevIdx) + 1;
            current = '
' + index + '
';
        }

        // In case of a middle page
        if (tokens.length > 5) {
            // Get first and prev
            var firstUrl = tokens[5].substring(1, tokens[5].length - 2);
            var firstIdx = firstUrl.split("=")[1];
            first = '' + firstIdx + '';
            var prevUrl = tokens[7].substring(1, tokens[7].length - 2);
            var prevIdx = prevUrl.split("=")[1];
            // check that this is not the 2nd element
            if (firstIdx != prevIdx) {
                prev = '' + prevIdx + '';
            }
        }

        if (first) {
            $('#issues_pages').append(first);
            bindClickableRequest('#first_page', firstUrl, listRequestStream);
        }
        if (prev) {
            $('#issues_pages').append(prev);
            bindClickableRequest('#prev_page', prevUrl, listRequestStream);
        }
        $('#issues_pages').append(current);
        if (next) {
            $('#issues_pages').append(next);
            bindClickableRequest('#next_page', nextUrl, listRequestStream);
        }
        if (last) {
            $('#issues_pages').append(last);
            bindClickableRequest('#last_page', lastUrl, listRequestStream);
        }
    }
}
// ====================================================================================

// ============== Github API Communication ============================================
var listRequestStream = new Rx.Subject();
var detailRequestStream = new Rx.Subject();
var commentRequestStream = new Rx.Subject();

// Map requests url on commentRequestStream to JSON ajax request
var commentStream = mapToJSON(commentRequestStream);

// Map requests url on detailRequestStream to JSON ajax request
var detailStream = mapToJSON(detailRequestStream);

// Map requests url on listRequestStream to JSON ajax request
var issueListStream = mapToJSON(listRequestStream);

// Handle the search bar communication with github repository search
$('.search.ui').search({
    apiSettings: {
        url: '//api.github.com/search/repositories?q={query}',
        onResponse: function(githubResponse) {
            var response = {results : []};
            // translate GitHub API response to call a function instead of link to repository
            githubResponse.items.forEach(function(item) {
                var js_url = "javascript:void loadIssueList('" + item.html_url + "')";
                response.results.push({
                    title       : item.name,
                    description : item.description,
                    url         : js_url
                });
            });
            return response;
        },
        fields: {
            results : 'results',
            title   : 'title',
            url     : 'url',
        },
        minCharacters : 3,
        searchDelay   : 500
    }
});

// Render issue in detail
detailStream.subscribe(function(response) {
    // Clear previous content on the page
    $('#issues_list').empty().hide();
    $('#issues_pages').empty();
    $('#issue_detail').show();

    var issue = response.responseJSON;
    // document.title =

    var issueSection = $('#issue_detail');
    var issueTitle = $('
', {
        'class' : 'ui center aligned header',
        text    : issue.title
    });
    var issueAuthor = $('
', {
        'class' : 'ui header',
    }).append($('', {
        'class' : 'ui circular image',
        src     : issue.user.avatar_url
    })).append(' ' + issue.user.login);
    var issueDescription = $('
', { html : parseMarkdown(issue.body) });
    var listLink = $('', {
        href: 'javascript:void returnToIssueList(\"' + issue.repository_url + '")',
        text: '<< Back to issues list'
    });
    issueSection.append([issueTitle, issueAuthor, issueDescription, $('
'), listLink]);

    var rightRail = $('
', { 'class' : 'ui right rail' });
    var issueStatus = $('
', {text : 'Status: '});
    // Make label according to status
    if (issue.state === 'open') {
        issueStatus.append($('
', {
            'class' : 'ui green label',
            text    : 'open'
        }));
    } else if (issue.state === 'closed') {
        issueStatus.append($('
', {
            'class' : 'ui red label',
            text    : 'closed'
        }));
    } else if (issue.state === 'all') {
        issueStatus.append($('
', {
            'class' : 'ui orange label',
            text    : 'all'
        }));
    }

    // Add labels to right rail
    var railSection = $('
', {
        'class' : 'ui segment'
    }).append(issueStatus);
    if (issue.labels.length > 0) {
        metaDiv = $('
', { 'class' : 'meta' });
        metaDiv.append('Labels: ');
        issue.labels.forEach(function(label) {
            metaDiv.append(styleLabel(label));
        });
        railSection.append(metaDiv);
    }
    rightRail.append(railSection);
    issueSection.append(rightRail);

    // Load comments
    if (issue.comments > 0 ) {
        commentRequestStream.onNext(issue.comments_url);
    }
});

// Render comment list
commentStream.subscribe(function(response) {
    $('#comment_list').empty()

    // Set up comment section and title
    var commentSection = $('
', {
        'class' : 'ui comments',
        'id'    : 'comment_list'
    }).append($('
', {
        'class' : 'ui diving header',
        text : 'Comments'
    }));

    response.responseJSON.map(function(comment) {
        var commentDiv = $('
', { 'class' : 'comment' });
        var authorAvatar = $('
', {
            'class' : 'avatar'
        }).append($('', {
            src : comment.user.avatar_url
        }));
        var content = $('
', { 'class' : 'content' });
        var author = $('', {
            'class' : 'author',
            text    : comment.user.login,
            href    : comment.user.html_url
        });

        // Add a timestamp in a metadata tag?

        var commentText = $('
', {
            'class' : 'text',
            html    : parseMarkdown(parseUsernames(comment.body))
        });
        content.append([author, commentText]);
        commentDiv.append([authorAvatar, content]);
        commentSection.append(commentDiv);
    });
    $('#issue_detail').append(commentSection);
});

// Render issue list
issueListStream.subscribe(function(response) {
    $('#issue_detail').empty().hide();
    $('#issues_list').empty().show();
    $('#issues_pages').empty();
    var headers = response.getAllResponseHeaders();
    makePageMenu(headers);

    response.responseJSON.map(function(issue) {
        var issueItem = $('
', { 'class' : 'item' });
        var contentDiv = $('
', { 'class' : 'content' });
        var issueLabel = $('
', {
            'class' : 'ui ribbon label issue_number',
            text : '# ' + issue.number
        });
        var issueTitle = $('', {
            'class' : 'header',
            'id' : issue.number,
            text : issue.title
        });

        contentDiv.append([issueLabel, issueTitle]);

        if (issue.labels.length > 0) {
            metaDiv = $('
', { 'class' : 'meta' });
            issue.labels.forEach(function(label) {
                metaDiv.append(styleLabel(label));
            });
            contentDiv.append(metaDiv);
        }

        var issueDescription = $('
', {
            'class' : 'description',
            text : shorten(issue.body, 140)
        });
        var extra = $('
', {
            'class' : 'extra'
        }).append($('', {
            'class' : 'ui circular avatar image',
            src : issue.user.avatar_url
        })).append(issue.user.login);
        if (issue.comments > 0) {
            extra.append($('
', {
                'class' : 'ui right floated label',
                text    : issue.comments + ' '
            }).append($('', { 'class' : 'comment icon' })));
        }

        contentDiv.append([issueDescription, extra]);
        issueItem.append(contentDiv);
        $('#issues_list').append(issueItem);
        bindClickableRequest('#' + issue.number, issue.url, detailRequestStream);
    });
});

// listRequestStream.onNext('https://api.github.com/repos/npm/npm/issues?page=2');


text:
namespace chainerx {
namespace internal {

class ArrayBody;
class ArrayNode;

// Reference to the gradient array corresponding to an array node, which is valid during backward computation at most.
//
// It points to the original gradient array held by the array node's owner array body if the array body is still alive.
// Otherwise, it points to a temporary gradient array which is only valid during lifetime of this class (which means until the end of
// backward computation at most, because BackwardImpl owns instances of this class).
class GradRef {
public:
    // Initialize with alive array node.
    // The array node may or may not have gradient. If not, a temporary gradient without value will be initialized.
    explicit GradRef(ArrayNode& array_node);

    // Initialize with a temporary grad without value.
    explicit GradRef(absl::nullopt_t nullopt);

    explicit GradRef(absl::optional<Array>* grad);

    ~GradRef() = default;

    GradRef(const GradRef&) = delete;
    GradRef(GradRef&&) = default;
    GradRef& operator=(const GradRef&) = delete;
    GradRef& operator=(GradRef&&) = delete;

    // Returns the reference to the gradient.
    absl::optional<Array>& get();

private:
    // Pointer to the original gradient held by the original input array body.
    // If the array body is gone, this pointer will be nullptr.
    absl::optional<Array>* original_grad_ptr_{nullptr};

    // The array body which owns the original gradient, if alive.
    // This is a keeper to prevent the gradient from being released after retrieval of the pointer.
    std::shared_ptr<ArrayBody> original_grad_owner_body_{nullptr};

    // Temporary gradient instantiated only when the original array body is gone.
    std::unique_ptr<absl::optional<Array>> temporary_grad_;
};

}  // namespace internal

// A class that holds the context information for a backward operation such as the upstream gradients.
// An instance of this class is passed to the actual backward definition and the backward definition is responsible for updating the context
// by i.e. setting the input gradients.
//
// This class is not thread safe.
class BackwardContext {
public:
    // Ctor
    //
    // `input_grads` is where input gradients returned by backward functions will be stored.
    // Its size must be equal to the number of input arrays whose gradients are to be returned in this single backward function (1 in most
    // ordinary functions).
    BackwardContext(
            const std::shared_ptr<internal::OpNode>& op_node,
            const internal::OpNodeBackwardEntry& backward_entry,
            absl::Span<std::shared_ptr<internal::ArrayNode>> output_array_nodes,
            absl::Span<internal::GradRef*> output_grads,
            std::vector<Array>& input_grads,
            DoubleBackpropOption double_backprop_option);

    size_t input_count() const { return input_grads_.size(); }

    size_t output_count() const { return output_grads_.size(); }

    // Indicates whether the next order of backward is required. It reflects DoubleBackpropOption.
    bool next_required() const { return double_backprop_option_ == DoubleBackpropOption::kEnable; }

    // Returns whether the output has a propagated gradient.
    // If there is only one output, the output always has the propagated gradient, therefore you do not have to call this function in that
    // case.
    bool HasOutputGrad(size_t output_index) const;

    // Returns whether the input gradient is expected to be computed in the backward function.
    bool is_input_grad_required(size_t input_index) const;

    // Returns the reference to an output gradient array if it has a propagated value.
    // Otherwise, an zero-filled array is allocated and a reference to it is returned.
    const absl::optional<Array>& output_grad(size_t output_index) const;

    // Returns the reference to an output gradient array if it has a propagated value.
    // Otherwise, an zero-filled array is allocated and a reference to it is returned.
    const absl::optional<Array>& output_grad() const {
        CHAINERX_ASSERT(output_array_nodes_.size() == 1);
        return output_grad(0);
    }

    // Returns the reference to the input gradient.
    Array& input_grad();

    // Returns the reference to the input gradient.
    Array& input_grad(size_t index);

    // TODO(hvy): Write comment.
    Array GetRetainedInput(const RetainedInputToken& token);

    // Returns the retained output array.
    // The resulting array has the same value but different array body as the actual output array.
    // It has the array node of the graph for current backward computation if and only if the double backprop option is enabled, but always
    // retains array nodes for other graphs.
    Array GetRetainedOutput(const RetainedOutputToken& token);

private:
    std::shared_ptr<internal::ArrayBody> GetFabricatedArrayBodyWithNodes(const RetainedOutputToken& token) const;

    const std::shared_ptr<internal::OpNode>& op_node_;  // never be nullptr

    const internal::OpNodeBackwardEntry& backward_entry_;

    // Output array nodes of the op node.
    // Null if the array node is gone (the weak pointer is dead).
    absl::Span<std::shared_ptr<internal::ArrayNode>> output_array_nodes_;

    absl::Span<internal::GradRef*> output_grads_;

    // A reference to the storage of input gradient arrays.
    // Gradient passed in input_grad() will be put into this storage.
    // Unset gradients will have null array body.
    std::vector<Array>& input_grads_;

    std::vector<std::shared_ptr<internal::ArrayBody>> retained_input_array_bodies_;

    // Array bodies for retained outputs.
    // Initialized by nullptrs and populated as queried by calling GetRetainedOutput().
    std::vector<std::shared_ptr<internal::ArrayBody>> retained_output_array_bodies_;

    DoubleBackpropOption double_backprop_option_;

    // Be introduced to avoid the return value of output_grad() being destroyed at the end of the function.
    const absl::optional<Array> zero_grad_ = absl::nullopt;
};

}  // namespace chainerx


text:
import os, sys; sys.path.insert(0, os.path.join("..",".."))

from nodebox.graphics import *

# Blend modes are used to combine the pixels of two images,
# in different ways than standard transparency.
# NodeBox supports the most common blend modes as filters:
# add(), subtract(), darken(), lighten(), multiply(), screen(), overlay(), hue().
# These can be used to adjust the lighting in an image
# (by blending it with a copy of itself),
# or to obtain many creative texturing effects.

img1 = Image("creature.png")
img2 = Image("creature.png")

def draw(canvas):

    canvas.clear()

    # Press the mouse to compare the blend to normal ("source over") mode:
    if not canvas.mouse.pressed:
        image(
            # Try changing this to another blend filter:
            multiply(img1, img2,
            # All blend modes (and mask()) have optional dx and dy parameters
            # that define the offset of the blend layer.
                dx = canvas.mouse.x - img1.width/2,
                dy = canvas.mouse.y - img1.height/2))
    else:
        image(img1)
        image(img2,
            x = canvas.mouse.x - img1.width/2,
            y = canvas.mouse.y - img1.height/2)

# Start the application:
canvas.fps  = 30
canvas.size = 500, 500
canvas.run(draw)


text:
import * as pl from "@akashic/playlog";
import { PointDownEvent, PointMoveEvent, PointUpEvent } from "../entities/E";
import { FilledRect } from "../entities/FilledRect";
import { JoinEvent, MessageEvent, OperationEvent, TimestampEvent, LeaveEvent, PlayerInfoEvent } from "../Event";
import { EventConverter } from "../EventConverter";
import { EventPriority } from "../EventPriority";
import type { Player } from "../Player";
import { StorageRegion, StorageValueStore } from "../Storage";
import { Game, skeletonRuntime } from "./helpers";

describe("EventConverter", () => {
	it("can be instantiated", () => {
		const game = new Game({
			width: 320,
			height: 320,
			fps: 30,
			main: "",
			assets: {}
		});
		const self = new EventConverter({ game, playerId: "dummyPlayerId" });
		expect(self._game).toBe(game);
		expect(self._playerId).toBe("dummyPlayerId");
		expect(self._playerTable).toEqual({});
	});

	it("encode/decode events", () => {
		const runtime = skeletonRuntime();
		const game = runtime.game;
		const scene = runtime.scene;
		const player: Player = { id: "dummyPlayerId", name: "dummyName" };
		const self = new EventConverter({ game, playerId: player.id });

		const sds = [{ readKey: { region: StorageRegion.Slots, regionKey: "reg-key" }, values: [{ data: 100 }] }];
		const pjoin: pl.JoinEvent = [pl.EventCode.Join, EventPriority.System, player.id!, player.name!, sds];
		const join = new JoinEvent(player, new StorageValueStore([sds[0].readKey], [sds[0].values]), EventPriority.System);
		const join2 = self.toGameEvent(pjoin);
		expect(join).toEqual(join2);
		expect(() => {
			self.toPlaylogEvent(join2);
		}).toThrow();

		const rect = new FilledRect({
			scene,
			cssColor: "red",
			x: 100,
			y: 100,
			width: 100,
			height: 100,
			touchable: true
		});
		scene.append(rect);

		// エンティティが存在する位置
		const source = game.findPointSource({ x: 110, y: 120 })!;
		expect(source.target!.id).toBeGreaterThan(0);
		expect(source.point).toEqual({ x: 10, y: 20 });

		const pd = new PointDownEvent(1, source.target, source.point!, player, false, EventPriority.Joined);
		const pd2 = self.toGameEvent(self.toPlaylogEvent(pd));
		expect(pd).toEqual(pd2);
		const pm = new PointMoveEvent(1, source.target, source.point!, { x: 2, y: 3 }, { x: 2, y: 3 }, player, false, EventPriority.Lowest);
		const pm2 = self.toGameEvent(self.toPlaylogEvent(pm));
		expect(pm).toEqual(pm2);
		const pu = new PointUpEvent(1, source.target, source.point!, { x: 4, y: 1 }, { x: 6, y: 4 }, player, false, EventPriority.Joined);
		const pu2 = self.toGameEvent(self.toPlaylogEvent(pu));
		expect(pu).toEqual(pu2);

		// エンティティが存在する位置
		const point = { x: 10, y: 10 };
		const nonJoinedPlayer: Player = { id: "nonjoined-dummy-id" };
		const source2 = game.findPointSource(point)!;
		expect(source2.target).toBe(undefined);
		expect(source2.point).toEqual(undefined);
		expect(source2.local).toEqual(false);
		const lpd = new PointDownEvent(1, source2.target, point, nonJoinedPlayer, false, EventPriority.System);
		const lpd2 = self.toGameEvent(self.toPlaylogEvent(lpd, true));
		expect(lpd).toEqual(lpd2);
		const lpm = new PointMoveEvent(
			1,
			source2.target,
			point,
			{ x: 2, y: 3 },
			{ x: 2, y: 3 },
			nonJoinedPlayer,
			false,
			EventPriority.Unjoined
		);
		const lpm2 = self.toGameEvent(self.toPlaylogEvent(lpm, true));
		expect(lpm).toEqual(lpm2);
		const lpu = new PointUpEvent(1, source2.target, point, { x: 4, y: 1 }, { x: 6, y: 4 }, nonJoinedPlayer, false);
		const lpu2 = self.toGameEvent(self.toPlaylogEvent(lpu, true));
		expect(lpu).toEqual(lpu2);

		const msg = new MessageEvent({ value: "data" }, player, true, EventPriority.Joined);
		const msg2 = self.toGameEvent(self.toPlaylogEvent(msg));
		expect(msg).toEqual(msg2);

		const op = new OperationEvent(42, { value: "op" }, player, false, EventPriority.Joined);
		const op2 = self.toGameEvent(self.toPlaylogEvent(op));
		expect(op).toEqual(op2);

		// Timestamp: Code, Priority, PlayerId, Timestamp
		const timestamp = new TimestampEvent(4201, player, EventPriority.System);
		const timestamp2 = self.toGameEvent(self.toPlaylogEvent(timestamp));
		expect(timestamp).toEqual(timestamp2);

		// Leave: Code, Priority, PlayerId
		const pleave: pl.LeaveEvent = [pl.EventCode.Leave, EventPriority.System, "dummyPlayerId"];
		const leave = new LeaveEvent(player, EventPriority.System);
		const leave2 = self.toGameEvent(pleave);
		expect(leave).toEqual(leave2);
		expect(() => {
			self.toPlaylogEvent(leave2);
		}).toThrow();

		// PlayerInfo: Code, Priority, PlayerId, PlayerName, UserData
		const pPlayerInfo: pl.PlayerInfoEvent = [
			pl.EventCode.PlayerInfo,
			EventPriority.System,
			"dummyPlayerId",
			"dummyName",
			{ userDataProp: "dummy" }
		];
		const playerInfo = new PlayerInfoEvent(
			{ id: "dummyPlayerId", name: "dummyName", userData: { userDataProp: "dummy" } },
			EventPriority.System
		);
		const playerInfo2 = self.toGameEvent(pPlayerInfo);
		expect(playerInfo).toEqual(playerInfo2);

		// PlayerInfoEvent 送信後にプレイヤー情報が取得できていることを確認
		const pdown: pl.PointDownEvent = [pl.EventCode.PointDown, EventPriority.System, "dummyPlayerId", 0, 110, 120];
		const pointDown = self.toGameEvent(pdown) as PointDownEvent;
		expect(pointDown.player!.id).toBe("dummyPlayerId");
		expect(pointDown.player!.name).toBe("dummyName");
		expect(pointDown.player!.userData).toEqual({ userDataProp: "dummy" });

		// JoinEvent 送信後にユーザデータが上書きされていないことを確認
		const pjoin2: pl.JoinEvent = [pl.EventCode.Join, EventPriority.System, player.id!, player.name!, sds];
		self.toGameEvent(pjoin2);
		const pdown2: pl.PointDownEvent = [pl.EventCode.PointDown, EventPriority.System, "dummyPlayerId", 0, 110, 120];
		const pointDown2 = self.toGameEvent(pdown2) as PointDownEvent;
		expect(pointDown2.player!.id).toBe("dummyPlayerId");
		expect(pointDown2.player!.name).toBe("dummyName");
		expect(pointDown2.player!.userData).toEqual({ userDataProp: "dummy" });
	});
});


text:
<?php
Layout::extend('layouts/metric');
$title = 'Details of metric #' . $metric->id ;
?>

<?php Part::draw('metric/details', $metric) ?>

<?php echo Html::anchor(Url::action('metricController::index'), 'Back to list of metrics') ?>
<hr />


text:
import os
import sys
import exifread
from os import path

TAGS = [
    'GPS GPSLatitude',
    'GPS GPSLongitude',
    'GPS GPSDate',
    'GPS GPSImgDirection',
    'Image DateTime',
    'Image Orientation',
    'Image Software',
    'Image Model',
    'Image Make',
    'Image XResolution',
    'Image YResolution',
    'EXIF ExifVersion',
    'EXIF ExifImageLength',
    'EXIF ExifImageWidth',
    'EXIF LensMake',
    'EXIF LensModel',
    'EXIF FocalLength',
    'EXIF WhiteBalance',
    'EXIF ISOSpeedRatings',
    'EXIF ExposureMode',
    'EXIF ExposureTime',
    'EXIF ExposureProgram',
    'EXIF DateTimeOriginal',
    'EXIF DateTimeDigitized',
]

if len(sys.argv) < 2:
    print 'Usage: python %s some_directory' % sys.argv[0]
    sys.exit(1)

top = path.normcase(sys.argv[1])
log = open(path.join(top, 'log.txt'), 'w')
for root, dirs, files in os.walk(top):
    for name in files:
        _, ext = path.splitext(name)
        if not ext or ext.lower() not in ['.jpg', '.png']:
            continue
        print "process file: ", path.abspath(path.join(root,name))
        f = open(path.join(root, name), 'rb')
        tags = exifread.process_file(f)
        f.close()
        log.write("File: %s\n" % path.basename(name))
        for tag in tags:
            if tag in TAGS:
                log.write('\t%s=%s\n' % (tag.split()[1], tags[tag]))

log.close()


text:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <groupId>net.sourceforge.tess4j</groupId>
    <artifactId>tess4j</artifactId>
    <version>3.0.0-SNAPSHOT</version>
    <packaging>jar</packaging>

    <name>Tess4J - Tesseract for Java</name>
    <url>http://tess4j.sourceforge.net</url>
    <description>
        # Tess4J

        ## Description:

        A Java JNA wrapper for Tesseract OCR API.

        Tess4J is released and distributed under the Apache License, v2.0.

        ## Features:

        The library provides optical character recognition (OCR) support for:

        TIFF, JPEG, GIF, PNG, and BMP image formats
        Multi-page TIFF images
        PDF document format
    </description>

    <parent>
        <groupId>org.sonatype.oss</groupId>
        <artifactId>oss-parent</artifactId>
        <version>7</version>
    </parent>

    <licenses>
        <license>
            <name>Apache License 2.0</name>
            <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
            <distribution>repo</distribution>
        </license>
    </licenses>

    <organization>
        <name>Tess4J</name>
        <url>http://tess4j.sourceforge.net</url>
    </organization>

    <scm>
        <connection>scm:svn:https://github.com/nguyenq/tess4j/trunk/</connection>
        <developerConnection>scm:svn:https://github.com/nguyenq/tess4j/trunk/</developerConnection>
        <url>https://github.com/nguyenq/tess4j/trunk/</url>
    </scm>

    <developers>
        <developer>
            <name>Quan Nguyen</name>
            <email>nguyenq@users.sf.net</email>
        </developer>
    </developers>

    <contributors>
        <contributor>
            <name>O.J. Sousa Rodrigues</name>
            <email>osoriojaques@gmail.com</email>
            <roles>
                <role>developer</role>
                <role>contributor</role>
            </roles>
            <timezone>+1</timezone>
        </contributor>
        <contributor>
            <name>Dmitry Katsubo</name>
            <email>dma_k@users.sf.net</email>
            <roles>
                <role>developer</role>
                <role>contributor</role>
            </roles>
        </contributor>
    </contributors>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <manifest.implementation.vendor>Tess4J</manifest.implementation.vendor>
        <manifest.url>http://tess4j.sourceforge.net/</manifest.url>
        <manifest.implementation.title>${project.groupId}:${project.artifactId}</manifest.implementation.title>
        <manifest.implementation.version>${project.version}</manifest.implementation.version>
        <manifest.implementation.vendor>Tess4J</manifest.implementation.vendor>
    </properties>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.1</version>
                <configuration>
                    <source>1.7</source>
                    <target>1.7</target>
                    <debug>false</debug>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-resources-plugin</artifactId>
                <version>2.7</version>
                <configuration>
                    <includeEmptyDirs>true</includeEmptyDirs>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
                <version>2.5</version>
                <configuration>
                    <archive>
                        <addMavenDescriptor>true</addMavenDescriptor>
                        <compress>true</compress>
                        <forced>true</forced>
                        <index>true</index>
                        <manifest>
                            <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
                            <addDefaultSpecificationEntries>true</addDefaultSpecificationEntries>
                        </manifest>
                        <manifestEntries>
                            <Implementation-URL>${project.url}</Implementation-URL>
                        </manifestEntries>
                        <manifestSections>
                            <manifestSection>
                                <name>Build-Information</name>
                                <manifestEntries>
                                    <Maven-Version>${maven.version}</Maven-Version>
                                    <Java-Version>${java.version}</Java-Version>
                                    <Java-Vendor>${java.vendor}</Java-Vendor>
                                    <Os-Name>${os.name}</Os-Name>
                                </manifestEntries>
                            </manifestSection>
                        </manifestSections>
                    </archive>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-shade-plugin</artifactId>
                <version>2.3</version>
                <executions>
                    <execution>
                        <id>make-shaded-jar</id>
                        <phase>package</phase>
                        <goals>
                            <goal>shade</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <shadedClassifierName>all</shadedClassifierName>
                    <shadedArtifactAttached>true</shadedArtifactAttached>
                    <filters>
                        <filter>
                            <artifact>*:*</artifact>
                            <excludes>
                                <exclude>META-INF/*.SF</exclude>
                                <exclude>META-INF/*.DSA</exclude>
                                <exclude>META-INF/*.RSA</exclude>
                            </excludes>
                        </filter>
                    </filters>
                </configuration>
            </plugin>
        </plugins>
    </build>

    <repositories>
        <!-- PDFBox Snaphot Repo -> 2.0.0 Version will be released soon to Maven Central-->
        <repository>
            <id>ApacheSnapshot</id>
            <name>Apache Repository</name>
            <url>https://repository.apache.org/content/groups/snapshots/</url>
            <snapshots>
                <enabled>true</enabled>
            </snapshots>
        </repository>
        <!-- Repo for PDFBox Dependency, no Maven Central Release yet or in plan.-->
        <repository>
            <id>jbig2.googlecode</id>
            <name>JBIG2 ImageIO-Plugin repository at googlecode.com</name>
            <url>http://jbig2-imageio.googlecode.com/svn/maven-repository</url>
        </repository>
    </repositories>

    <dependencies>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>4.11</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.mockito</groupId>
            <artifactId>mockito-all</artifactId>
            <version>1.9.5</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.hamcrest</groupId>
            <artifactId>hamcrest-integration</artifactId>
            <version>1.3</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>net.avh4.util</groupId>
            <artifactId>imagecomparison</artifactId>
            <version>0.0.2</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>net.java.dev.jna</groupId>
            <artifactId>jna</artifactId>
            <version>4.1.0</version>
        </dependency>
        <dependency>
            <groupId>com.github.jai-imageio</groupId>
            <artifactId>jai-imageio-core</artifactId>
            <version>1.2.1</version>
        </dependency>
        <!-- PDFBox and it's dependencies -->
        <dependency>
            <groupId>org.apache.pdfbox</groupId>
            <artifactId>pdfbox</artifactId>
            <version>2.0.0-SNAPSHOT</version>
        </dependency>
        <dependency>
            <groupId>org.verapdf.pdfbox</groupId>
            <artifactId>pdfbox-tools</artifactId>
            <version>2.0.0-SNAPSHOT</version>
        </dependency>
        <dependency>
            <groupId>com.levigo.jbig2</groupId>
            <artifactId>levigo-jbig2-imageio</artifactId>
            <version>1.6.1</version>
        </dependency>
        <dependency>
            <groupId>commons-io</groupId>
            <artifactId>commons-io</artifactId>
            <version>2.4</version>
        </dependency>
        <dependency>
            <groupId>net.sourceforge.lept4j</groupId>
            <artifactId>lept4j</artifactId>
            <version>1.0.0-SNAPSHOT</version>
        </dependency>
        <dependency>
            <groupId>ch.qos.logback</groupId>
            <artifactId>logback-classic</artifactId>
            <version>1.0.13</version>
        </dependency>
    </dependencies>

</project>


text:
<!DOCTYPE html>

    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="description" content="">
    <meta name="author" content="">

    <title>BotCast - Weekly insights with Pete & David </title>
    <link rel="icon" href="favicon.png" type="image/png" />

    <link href="vendor/bootstrap/css/bootstrap.min.css" rel="stylesheet">

    <link href="css/clean-blog.min.css" rel="stylesheet">

    <link href="vendor/font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css">
    <link href='https://fonts.googleapis.com/css?family=Lora:400,700,400italic,700italic' rel='stylesheet' type='text/css'>
    <link href='https://fonts.googleapis.com/css?family=Open+Sans:300italic,400italic,600italic,700italic,800italic,400,300,600,700,800' rel='stylesheet' type='text/css'>

    <meta property="og:title" content="BotCast.wtf">
    <meta property="og:description" content="Weekly insights from the bots and messaging space with Pete and David">
    <meta property="og:image" content="https://botcast.wtf/botcast-og.png">
    <meta property="og:image:url_secure" content="https://botcast.wtf/botcast-og.png">

🤖 BotCast.wtf

Weekly insights from the bots and messaging space

with

Pete & David

    <?php
        $env = json_decode(file_get_contents('.env'), true);
        $server = $env['db']['host'];
        if(array_key_exists('port', $env['db'])) $server .= ':'.$env['db']['port'];
        $conn = mysqli_connect($server,
            $env['db']['username'], $env['db']['password']);
        if (!$conn) {
            die("Connection failed: " . mysqli_connect_error());
        }
        mysqli_select_db($conn, $env['db']['name']);

        $page = array_key_exists('page', $_GET) ? $_GET['page'] : 1;
        $offset = ($page-1)*10;

        $sql = "SELECT * FROM records ORDER BY date DESC LIMIT $offset, 10";
        $result = $conn->query($sql);
        $records = [];
        if ($result->num_rows > 0) {
            while($row = $result->fetch_assoc()) {
                $records[] = $row;
            }
        }

        $sql = "SELECT count(*) as count FROM records";
        $result = $conn->query($sql);
        $count = $result->fetch_assoc()['count'];

        $conn->close();
    ?>

                <link href="//cdn-images.mailchimp.com/embedcode/horizontal-slim-10_7.css" rel="stylesheet" type="text/css">

                <form action="//wtf.us14.list-manage.com/subscribe/post?u=4aad06aa3bd6cb978794bce16&id=960dfdb9a4" method="post" id="mc-embedded-subscribe-form" name="mc-embedded-subscribe-form" class="validate" target="_blank" novalidate>

                	Get the weekly BotCast directly into your inbox!
                	<input type="email" value="" name="EMAIL" class="email" id="mce-EMAIL" placeholder="email address" required>

<input type="text" name="b_4aad06aa3bd6cb978794bce16_960dfdb9a4" tabindex="-1" value="">

<input type="submit" value="Subscribe" name="subscribe" id="mc-embedded-subscribe" class="button">

                </form>

                <?php
                    foreach($records as $record) {
                        echo '
';
                        echo '
';
                        echo $record['title'];
                        echo '
';
                        echo '
';
                        echo $record['description'];
                        echo '
';

                        echo '
';
                        if(array_key_exists('facebook', $record) && $record['facebook']) {
                            echo '';
                            echo ' Facebook Live Video';
                            echo '';
                        }

                        if(array_key_exists('youtube', $record) && $record['youtube']) {
                            echo '';
                            echo ' Youtube';
                            echo '';
                        }

                        if(array_key_exists('soundcloud', $record) && $record['soundcloud']) {
                            echo '';
                            echo ' Soundcloud';
                            echo '';
                        }
                        echo '
';

                        echo '
';
                        echo $record['date'];
                        echo '
';

                        echo '

';
                    }
                ?>

                <?php
                    $pager = '';
                    $prev = '';
                    $older = '';
                    if($page >= 2) {
                        $prev .= '← Previous Posts ';
                        $pager .= $prev;
                    }
                    if($count > ($offset+10)) {
                        $older .= 'Older Posts →';
                        $pager .= $older;
                    }

                    echo $pager;
                ?>

Copyright © BotCast.wtf 2016


text:
/*
core/numeric - numeric type traits
Part of Stardazed
(c) 2015-Present by @zenmumbler
https://github.com/stardazed/stardazed
*/

/**
 * Interface describing a binary representation of a number including its
 * limits, storage requirements and associated TypedArray constructor.
 */
export interface NumericTypeTraits {
	/** The lowest value this type is capable of representing */
	readonly min: number;
	/** The highest value this type is capable of representing */
	readonly max: number;
	/** The lowest integer value this type is capable of representing without precision loss */
	readonly minSafeInt: number;
	/** The highest integer value this type is capable of representing without precision loss */
	readonly maxSafeInt: number;
	/** Is this type signed, i.e. capable of represnting negative numbers */
	readonly signed: boolean;
	/** Is this an integer type, i.e. only capable of representing non-fractional numbers */
	readonly integer: boolean;

	/** The number of bytes it takes to store a single instance of this type */
	readonly byteLength: number;
	/** The typed array that is the exact or best fit to store numbers of this type */
	readonly arrayType: TypedArrayConstructor;
}

/** Traits of unsigned 8-bit integer numbers. */
export const UInt8: NumericTypeTraits = {
	min: 0,
	max: 255,
	minSafeInt: 0,
	maxSafeInt: 255,
	signed: false,
	integer: true,
	byteLength: 1,
	arrayType: Uint8Array
};

/** Traits of signed 8-bit integer numbers. */
export const Int8: NumericTypeTraits = {
	min: -128,
	max: 127,
	minSafeInt: -128,
	maxSafeInt: 127,
	signed: true,
	integer: true,
	byteLength: 1,
	arrayType: Int8Array
};

/** Traits of unsigned 16-bit integer numbers. */
export const UInt16: NumericTypeTraits = {
	min: 0,
	max: 65535,
	minSafeInt: 0,
	maxSafeInt: 65535,
	signed: false,
	integer: true,
	byteLength: 2,
	arrayType: Uint16Array
};

/** Traits of signed 16-bit integer numbers. */
export const Int16: NumericTypeTraits = {
	min: -32768,
	max: 32767,
	minSafeInt: -32768,
	maxSafeInt: 32767,
	signed: true,
	integer: true,
	byteLength: 2,
	arrayType: Int16Array
};

/** Traits of unsigned 32-bit integer numbers. */
export const UInt32: NumericTypeTraits = {
	min: 0,
	max: 4294967295,
	minSafeInt: 0,
	maxSafeInt: 4294967295,
	signed: false,
	integer: true,
	byteLength: 4,
	arrayType: Uint32Array
};

/** Traits of signed 32-bit integer numbers. */
export const Int32: NumericTypeTraits = {
	min: -2147483648,
	max: 2147483647,
	minSafeInt: -2147483648,
	maxSafeInt: 2147483647,
	signed: true,
	integer: true,
	byteLength: 4,
	arrayType: Int32Array
};

/** Traits of 16-bit floating point numbers. */
export const Half: NumericTypeTraits = {
	min: -65504.0,
	max: 65504.0,
	minSafeInt: -2048, // -2^11
	maxSafeInt: 2048, // 2^11
	signed: true,
	integer: false,
	byteLength: 2,
	arrayType: Uint16Array // size match only
};

/** Traits of 32-bit floating point numbers. */
export const Float: NumericTypeTraits = {
	min: -340282346638528859811704183484516925440.0,
	max: 340282346638528859811704183484516925440.0,
	minSafeInt: -16777216, // -2^24
	maxSafeInt: 16777216, // 2^24
	signed: true,
	integer: false,
	byteLength: 4,
	arrayType: Float32Array
};

/** Traits of 64-bit floating point numbers. */
export const Double: NumericTypeTraits = {
	min: Number.MIN_VALUE,
	max: Number.MAX_VALUE,
	minSafeInt: Number.MIN_SAFE_INTEGER, // -2^53 + 1
	maxSafeInt: Number.MAX_SAFE_INTEGER, // 2^53 - 1
	signed: true,
	integer: false,
	byteLength: 8,
	arrayType: Float64Array
};

/** Standard names of numeric types */
export type NumericTypeName = "uint8" | "int8" | "uint16" | "int16" | "uint32" | "int32" | "half" | "float" | "double";

/** Access numeric type traits by type name */
const TypeNameTraitsMap: Readonly<Record<NumericTypeName, NumericTypeTraits>> = {
	uint8: UInt8,
	int8: Int8,
	uint16: UInt16,
	int16: Int16,
	uint32: UInt32,
	int32: Int32,
	half: Half,
	float: Float,
	double: Double
};

/** Either a numeric type name type or a traits object */
export type NumericTypeRef = NumericTypeName | NumericTypeTraits;

/** Get numeric type traits from traits object or name reference */
export function numericTraits(tn: NumericTypeName | NumericTypeTraits): NumericTypeTraits {
	if (typeof tn === "string") {
		return TypeNameTraitsMap[tn];
	}
	return tn;
}


text:
#region Header
// --------------------------------------------------------------------------
// Tethys.Silverlight
// ==========================================================================
//
// This library contains common code for WPF, Silverlight, Windows Phone and
// Windows 8 projects.
//
// ===========================================================================
//
// <copyright file="CRC16Test.cs" company="Tethys">
// Copyright  2010-2015 by Thomas Graf
//            All rights reserved.
//            Licensed under the Apache License, Version 2.0.
//            Unless required by applicable law or agreed to in writing,
//            software distributed under the License is distributed on an
//            "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
//            either express or implied.
// </copyright>
//
// System ... Microsoft .Net Framework 4.5
// Tools .... Microsoft Visual Studio 2012
//
// ---------------------------------------------------------------------------
#endregion

namespace Tethys.Silverlight.WinRt.Test
{
  using Microsoft.VisualStudio.TestPlatform.UnitTestFramework;

  using Tethys.Silverlight.Cryptography;
  using Tethys.Silverlight.TestSupport;

  /// <summary>
  /// Unit tests for <see cref="CRC16"/> class.
  /// </summary>
  [TestClass]
  public class CRC16Test
  {
    /// <summary>
    /// Test for <see cref="CRC16"/>.
    /// </summary>
    [TestMethod]
    public void Crc16Test1()
    {
      var hash = new CRC16();

      // test Initialize()
      hash.Initialize();

      // check default settings
      Assert.AreEqual(0x0000, hash.InitValue);
      Assert.AreEqual(0x0000, hash.XorValue);
      Assert.AreEqual("CRC16", hash.AlgorithmName);
      Assert.AreEqual(2, hash.HashLength);

      // CRC16 ("") = 00000000
      var testData = ByteArrayConversion.StringToByteArray(string.Empty);
      var result = hash.HashData(testData, 0, testData.Length);
      Assert.AreEqual(2, result.Length);
      TestSupport.CheckResult(result, "0000");

      // CRC16 ("abc") = 9738
      testData = ByteArrayConversion.StringToByteArray("abc");
      result = hash.HashData(testData, 0, testData.Length);
      Assert.AreEqual(2, result.Length);
      TestSupport.CheckResult(result, "9738");

      // CRC32 ("ABC") = 4521
      testData = ByteArrayConversion.StringToByteArray("ABC");
      result = hash.HashData(testData, 0, testData.Length);
      Assert.AreEqual(2, result.Length);
      TestSupport.CheckResult(result, "4521");

      // CRC16 ("CBA") = 4401
      testData = ByteArrayConversion.StringToByteArray("CBA");
      result = hash.HashData(testData, 0, testData.Length);
      Assert.AreEqual(2, result.Length);
      TestSupport.CheckResult(result, "4401");

      // CRC16 ("12345678") = 3C9D
      testData = ByteArrayConversion.StringToByteArray("12345678");
      result = hash.HashData(testData, 0, testData.Length);
      Assert.AreEqual(2, result.Length);
      TestSupport.CheckResult(result, "3C9D");
    }
  } // CRC16Test
} // Tethys.WinRt.Test


text:
package main

import (
	"encoding/json"
	"encoding/xml"
	"fmt"
	"os"
	"text/template"

	"github.com/umschlag/umschlag-go/umschlag"
	"gopkg.in/urfave/cli.v2"
)

// tmplUserList represents a row within user listing.
var tmplUserList = "Slug: \x1b[33m{{ .Slug }} \x1b[0m" + `
ID: {{ .ID }}
Username: {{ .Username }}
`

// tmplUserShow represents a user within details view.
var tmplUserShow = "Slug: \x1b[33m{{ .Slug }} \x1b[0m" + `
ID: {{ .ID }}
Username: {{ .Username }}
Email: {{ .Email }}
Active: {{ .Active }}
Admin: {{ .Admin }}{{with .Teams}}
Teams: {{ teamlist . }}{{end}}{{with .Orgs}}
Orgs: {{ orglist . }}{{end}}
Created: {{ .CreatedAt.Format "Mon Jan _2 15:04:05 MST 2006" }}
Updated: {{ .UpdatedAt.Format "Mon Jan _2 15:04:05 MST 2006" }}
`

// tmplUserTeamList represents a row within user team listing.
var tmplUserTeamList = "Slug: \x1b[33m{{ .User.Slug }} \x1b[0m" + `
ID: {{ .User.ID }}
Name: {{ .User.Name }}
Permission: {{ .Perm }}
`

// tmplUserOrgList represents a row within user org listing.
var tmplUserOrgList = "Slug: \x1b[33m{{ .Org.Slug }} \x1b[0m" + `
ID: {{ .Org.ID }}
Name: {{ .Org.Name }}
Permission: {{ .Perm }}
`

// User provides the sub-command for the user API.
func User() *cli.Command {
	return &cli.Command{
		Name:  "user",
		Usage: "User related sub-commands",
		Subcommands: []*cli.Command{
			{
				Name:      "list",
				Aliases:   []string{"ls"},
				Usage:     "List all users",
				ArgsUsage: " ",
				Flags: []cli.Flag{
					&cli.StringFlag{
						Name:  "format",
						Value: tmplUserList,
						Usage: "Custom output format",
					},
					&cli.BoolFlag{
						Name:  "json",
						Value: false,
						Usage: "Print in JSON format",
					},
					&cli.BoolFlag{
						Name:  "xml",
						Value: false,
						Usage: "Print in XML format",
					},
				},
				Action: func(c *cli.Context) error {
					return Handle(c, UserList)
				},
			},
			{
				Name:      "show",
				Usage:     "Display a user",
				ArgsUsage: " ",
				Flags: []cli.Flag{
					&cli.StringFlag{
						Name:  "id, i",
						Value: "",
						Usage: "User ID or slug to show",
					},
					&cli.StringFlag{
						Name:  "format",
						Value: tmplUserShow,
						Usage: "Custom output format",
					},
					&cli.BoolFlag{
						Name:  "json",
						Value: false,
						Usage: "Print in JSON format",
					},
					&cli.BoolFlag{
						Name:  "xml",
						Value: false,
						Usage: "Print in XML format",
					},
				},
				Action: func(c *cli.Context) error {
					return Handle(c, UserShow)
				},
			},
			{
				Name:      "delete",
				Aliases:   []string{"rm"},
				Usage:     "Delete a user",
				ArgsUsage: " ",
				Flags: []cli.Flag{
					&cli.StringFlag{
						Name:  "id, i",
						Value: "",
						Usage: "User ID or slug to show",
					},
				},
				Action: func(c *cli.Context) error {
					return Handle(c, UserDelete)
				},
			},
			{
				Name:      "update",
				Usage:     "Update a user",
				ArgsUsage: " ",
				Flags: []cli.Flag{
					&cli.StringFlag{
						Name:  "id, i",
						Value: "",
						Usage: "User ID or slug to update",
					},
					&cli.StringFlag{
						Name:  "slug",
						Value: "",
						Usage: "Provide a slug",
					},
					&cli.StringFlag{
						Name:  "username",
						Value: "",
						Usage: "Provide an username",
					},
					&cli.StringFlag{
						Name:  "email",
						Value: "",
						Usage: "Provide an email",
					},
					&cli.StringFlag{
						Name:  "password",
						Value: "",
						Usage: "Provide a password",
					},
					&cli.BoolFlag{
						Name:  "active",
						Usage: "Mark user as active",
					},
					&cli.BoolFlag{
						Name:  "blocked",
						Usage: "Mark user as blocked",
					},
					&cli.BoolFlag{
						Name:  "admin",
						Usage: "Mark user as admin",
					},
					&cli.BoolFlag{
						Name:  "user",
						Usage: "Mark user as user",
					},
				},
				Action: func(c *cli.Context) error {
					return Handle(c, UserUpdate)
				},
			},
			{
				Name:      "create",
				Usage:     "Create a user",
				ArgsUsage: " ",
				Flags: []cli.Flag{
					&cli.StringFlag{
						Name:  "slug",
						Value: "",
						Usage: "Provide a slug",
					},
					&cli.StringFlag{
						Name:  "username",
						Value: "",
						Usage: "Provide an username",
					},
					&cli.StringFlag{
						Name:  "email",
						Value: "",
						Usage: "Provide an email",
					},
					&cli.StringFlag{
						Name:  "password",
						Value: "",
						Usage: "Provide a password",
					},
					&cli.BoolFlag{
						Name:  "active",
						Usage: "Mark user as active",
					},
					&cli.BoolFlag{
						Name:  "blocked",
						Usage: "Mark user as blocked",
					},
					&cli.BoolFlag{
						Name:  "admin",
						Usage: "Mark user as admin",
					},
					&cli.BoolFlag{
						Name:  "user",
						Usage: "Mark user as user",
					},
				},
				Action: func(c *cli.Context) error {
					return Handle(c, UserCreate)
				},
			},
			{
				Name:  "team",
				Usage: "Team assignments",
				Subcommands: []*cli.Command{
					{
						Name:      "list",
						Aliases:   []string{"ls"},
						Usage:     "List assigned teams",
						ArgsUsage: " ",
						Flags: []cli.Flag{
							&cli.StringFlag{
								Name:  "id, i",
								Value: "",
								Usage: "User ID or slug to list teams",
							},
							&cli.StringFlag{
								Name:  "format",
								Value: tmplUserTeamList,
								Usage: "Custom output format",
							},
							&cli.BoolFlag{
								Name:  "json",
								Value: false,
								Usage: "Print in JSON format",
							},
							&cli.BoolFlag{
								Name:  "xml",
								Value: false,
								Usage: "Print in XML format",
							},
						},
						Action: func(c *cli.Context) error {
							return Handle(c, UserTeamList)
						},
					},
					{
						Name:      "append",
						Usage:     "Append a team to user",
						ArgsUsage: " ",
						Flags: []cli.Flag{
							&cli.StringFlag{
								Name:  "id, i",
								Value: "",
								Usage: "User ID or slug to append to",
							},
							&cli.StringFlag{
								Name:  "team, t",
								Value: "",
								Usage: "Team ID or slug to append",
							},
							&cli.StringFlag{
								Name:  "perm",
								Value: "user",
								Usage: "Permission for the user, can be user, admin or owner",
							},
						},
						Action: func(c *cli.Context) error {
							return Handle(c, UserTeamAppend)
						},
					},
					{
						Name:      "perm",
						Usage:     "Update user team permissions",
						ArgsUsage: " ",
						Flags: []cli.Flag{
							&cli.StringFlag{
								Name:  "id, i",
								Value: "",
								Usage: "User ID or slug to update",
							},
							&cli.StringFlag{
								Name:  "team, t",
								Value: "",
								Usage: "Team ID or slug to update",
							},
							&cli.StringFlag{
								Name:  "perm",
								Value: "user",
								Usage: "Permission for the user, can be user, admin or owner",
							},
						},
						Action: func(c *cli.Context) error {
							return Handle(c, UserTeamPerm)
						},
					},
					{
						Name:      "remove",
						Aliases:   []string{"rm"},
						Usage:     "Remove a team from user",
						ArgsUsage: " ",
						Flags: []cli.Flag{
							&cli.StringFlag{
								Name:  "id, i",
								Value: "",
								Usage: "User ID or slug to remove from",
							},
							&cli.StringFlag{
								Name:  "team, t",
								Value: "",
								Usage: "Team ID or slug to remove",
							},
						},
						Action: func(c *cli.Context) error {
							return Handle(c, UserTeamRemove)
						},
					},
				},
			},
			{
				Name:  "org",
				Usage: "Org assignments",
				Subcommands: []*cli.Command{
					{
						Name:      "list",
						Aliases:   []string{"ls"},
						Usage:     "List assigned orgs",
						ArgsUsage: " ",
						Flags: []cli.Flag{
							&cli.StringFlag{
								Name:  "id, i",
								Value: "",
								Usage: "User ID or slug to list orgs",
							},
							&cli.StringFlag{
								Name:  "format",
								Value: tmplUserOrgList,
								Usage: "Custom output format",
							},
							&cli.BoolFlag{
								Name:  "json",
								Value: false,
								Usage: "Print in JSON format",
							},
							&cli.BoolFlag{
								Name:  "xml",
								Value: false,
								Usage: "Print in XML format",
							},
						},
						Action: func(c *cli.Context) error {
							return Handle(c, UserOrgList)
						},
					},
					{
						Name:      "append",
						Usage:     "Append a org to user",
						ArgsUsage: " ",
						Flags: []cli.Flag{
							&cli.StringFlag{
								Name:  "id, i",
								Value: "",
								Usage: "User ID or slug to append to",
							},
							&cli.StringFlag{
								Name:  "org, t",
								Value: "",
								Usage: "Org ID or slug to append",
							},
							&cli.StringFlag{
								Name:  "perm",
								Value: "user",
								Usage: "Permission for the user, can be user, admin or owner",
							},
						},
						Action: func(c *cli.Context) error {
							return Handle(c, UserOrgAppend)
						},
					},
					{
						Name:      "perm",
						Usage:     "Update user org permissions",
						ArgsUsage: " ",
						Flags: []cli.Flag{
							&cli.StringFlag{
								Name:  "id, i",
								Value: "",
								Usage: "User ID or slug to update",
							},
							&cli.StringFlag{
								Name:  "org, o",
								Value: "",
								Usage: "Org ID or slug to update",
							},
							&cli.StringFlag{
								Name:  "perm",
								Value: "user",
								Usage: "Permission for the user, can be user, admin or owner",
							},
						},
						Action: func(c *cli.Context) error {
							return Handle(c, UserOrgPerm)
						},
					},
					{
						Name:      "remove",
						Aliases:   []string{"rm"},
						Usage:     "Remove a org from user",
						ArgsUsage: " ",
						Flags: []cli.Flag{
							&cli.StringFlag{
								Name:  "id, i",
								Value: "",
								Usage: "User ID or slug to remove from",
							},
							&cli.StringFlag{
								Name:  "org, t",
								Value: "",
								Usage: "Org ID or slug to remove",
							},
						},
						Action: func(c *cli.Context) error {
							return Handle(c, UserOrgRemove)
						},
					},
				},
			},
		},
	}
}

// UserList provides the sub-command to list all users.
func UserList(c *cli.Context, client umschlag.ClientAPI) error {
	records, err := client.UserList()

	if err != nil {
		return err
	}

	if c.IsSet("json") && c.IsSet("xml") {
		return fmt.Errorf("conflict, you can only use json or xml at once")
	}

	if c.Bool("xml") {
		res, err := xml.MarshalIndent(records, "", "  ")

		if err != nil {
			return err
		}

		fmt.Fprintf(os.Stdout, "%s\n", res)
		return nil
	}

	if c.Bool("json") {
		res, err := json.MarshalIndent(records, "", "  ")

		if err != nil {
			return err
		}

		fmt.Fprintf(os.Stdout, "%s\n", res)
		return nil
	}

	if len(records) == 0 {
		fmt.Fprintf(os.Stderr, "Empty result\n")
		return nil
	}

	tmpl, err := template.New(
		"_",
	).Funcs(
		globalFuncMap,
	).Funcs(
		sprigFuncMap,
	).Parse(
		fmt.Sprintf("%s\n", c.String("format")),
	)

	if err != nil {
		return err
	}

	for _, record := range records {
		err := tmpl.Execute(os.Stdout, record)

		if err != nil {
			return err
		}
	}

	return nil
}

// UserShow provides the sub-command to show user details.
func UserShow(c *cli.Context, client umschlag.ClientAPI) error {
	record, err := client.UserGet(
		GetIdentifierParam(c),
	)

	if err != nil {
		return err
	}

	if c.IsSet("json") && c.IsSet("xml") {
		return fmt.Errorf("conflict, you can only use json or xml at once")
	}

	if c.Bool("xml") {
		res, err := xml.MarshalIndent(record, "", "  ")

		if err != nil {
			return err
		}

		fmt.Fprintf(os.Stdout, "%s\n", res)
		return nil
	}

	if c.Bool("json") {
		res, err := json.MarshalIndent(record, "", "  ")

		if err != nil {
			return err
		}

		fmt.Fprintf(os.Stdout, "%s\n", res)
		return nil
	}

	tmpl, err := template.New(
		"_",
	).Funcs(
		globalFuncMap,
	).Funcs(
		sprigFuncMap,
	).Parse(
		fmt.Sprintf("%s\n", c.String("format")),
	)

	if err != nil {
		return err
	}

	return tmpl.Execute(os.Stdout, record)
}

// UserDelete provides the sub-command to delete a user.
func UserDelete(c *cli.Context, client umschlag.ClientAPI) error {
	err := client.UserDelete(
		GetIdentifierParam(c),
	)

	if err != nil {
		return err
	}

	fmt.Fprintf(os.Stderr, "Successfully delete\n")
	return nil
}

// UserUpdate provides the sub-command to update a user.
func UserUpdate(c *cli.Context, client umschlag.ClientAPI) error {
	record, err := client.UserGet(
		GetIdentifierParam(c),
	)

	if err != nil {
		return err
	}

	changed := false

	if val := c.String("slug"); c.IsSet("slug") && val != record.Slug {
		record.Slug = val
		changed = true
	}

	if val := c.String("username"); c.IsSet("username") && val != record.Username {
		record.Username = val
		changed = true
	}

	if val := c.String("email"); c.IsSet("email") && val != record.Email {
		record.Email = val
		changed = true
	}

	if val := c.String("password"); c.IsSet("password") {
		record.Password = val
		changed = true
	}

	if c.IsSet("active") && c.IsSet("blocked") {
		return fmt.Errorf("conflict, you can mark it only active or blocked")
	}

	if c.IsSet("active") {
		record.Active = true
		changed = true
	}

	if c.IsSet("blocked") {
		record.Active = false
		changed = true
	}

	if c.IsSet("admin") && c.IsSet("user") {
		return fmt.Errorf("conflict, you can mark it only admin or user")
	}

	if c.IsSet("admin") {
		record.Admin = true
		changed = true
	}

	if c.IsSet("user") {
		record.Admin = false
		changed = true
	}

	if changed {
		_, patch := client.UserPatch(
			record,
		)

		if patch != nil {
			return patch
		}

		fmt.Fprintf(os.Stderr, "Successfully updated\n")
	} else {
		fmt.Fprintf(os.Stderr, "Nothing to update...\n")
	}

	return nil
}

// UserCreate provides the sub-command to create a user.
func UserCreate(c *cli.Context, client umschlag.ClientAPI) error {
	record := &umschlag.User{}

	if val := c.String("slug"); c.IsSet("slug") && val != "" {
		record.Slug = val
	}

	if val := c.String("username"); c.IsSet("username") && val != "" {
		record.Username = val
	} else {
		return fmt.Errorf("you must provide an username")
	}

	if val := c.String("email"); c.IsSet("email") && val != "" {
		record.Email = val
	} else {
		return fmt.Errorf("you must provide an email")
	}

	if val := c.String("password"); c.IsSet("password") && val != "" {
		record.Password = val
	} else {
		return fmt.Errorf("you must provide a password")
	}

	if c.IsSet("active") && c.IsSet("blocked") {
		return fmt.Errorf("conflict, you can mark it only active or blocked")
	}

	if c.IsSet("active") {
		record.Active = true
	}

	if c.IsSet("blocked") {
		record.Active = false
	}

	if c.IsSet("admin") && c.IsSet("user") {
		return fmt.Errorf("conflict, you can mark it only admin or user")
	}

	if c.IsSet("admin") {
		record.Admin = true
	}

	if c.IsSet("user") {
		record.Admin = false
	}

	_, err := client.UserPost(
		record,
	)

	if err != nil {
		return err
	}

	fmt.Fprintf(os.Stderr, "Successfully created\n")
	return nil
}

// UserTeamList provides the sub-command to list teams of the user.
func UserTeamList(c *cli.Context, client umschlag.ClientAPI) error {
	records, err := client.UserTeamList(
		umschlag.UserTeamParams{
			User: GetIdentifierParam(c),
		},
	)

	if err != nil {
		return err
	}

	if c.IsSet("json") && c.IsSet("xml") {
		return fmt.Errorf("conflict, you can only use json or xml at once")
	}

	if c.Bool("xml") {
		res, err := xml.MarshalIndent(records, "", "  ")

		if err != nil {
			return err
		}

		fmt.Fprintf(os.Stdout, "%s\n", res)
		return nil
	}

	if c.Bool("json") {
		res, err := json.MarshalIndent(records, "", "  ")

		if err != nil {
			return err
		}

		fmt.Fprintf(os.Stdout, "%s\n", res)
		return nil
	}

	if len(records) == 0 {
		fmt.Fprintf(os.Stderr, "Empty result\n")
		return nil
	}

	tmpl, err := template.New(
		"_",
	).Funcs(
		globalFuncMap,
	).Funcs(
		sprigFuncMap,
	).Parse(
		fmt.Sprintf("%s\n", c.String("format")),
	)

	if err != nil {
		return err
	}

	for _, record := range records {
		err := tmpl.Execute(os.Stdout, record)

		if err != nil {
			return err
		}
	}

	return nil
}

// UserTeamAppend provides the sub-command to append a team to the user.
func UserTeamAppend(c *cli.Context, client umschlag.ClientAPI) error {
	err := client.UserTeamAppend(
		umschlag.UserTeamParams{
			User: GetIdentifierParam(c),
			Team: GetTeamParam(c),
			Perm: GetPermParam(c),
		},
	)

	if err != nil {
		return err
	}

	fmt.Fprintf(os.Stderr, "Successfully appended to team\n")
	return nil
}

// UserTeamPerm provides the sub-command to update user team permissions.
func UserTeamPerm(c *cli.Context, client umschlag.ClientAPI) error {
	err := client.UserTeamPerm(
		umschlag.UserTeamParams{
			User: GetIdentifierParam(c),
			Team: GetTeamParam(c),
			Perm: GetPermParam(c),
		},
	)

	if err != nil {
		return err
	}

	fmt.Fprintf(os.Stderr, "Successfully updated permissions\n")
	return nil
}

// UserTeamRemove provides the sub-command to remove a team from the user.
func UserTeamRemove(c *cli.Context, client umschlag.ClientAPI) error {
	err := client.UserTeamDelete(
		umschlag.UserTeamParams{
			User: GetIdentifierParam(c),
			Team: GetTeamParam(c),
		},
	)

	if err != nil {
		return err
	}

	fmt.Fprintf(os.Stderr, "Successfully removed from team\n")
	return nil
}

// UserOrgList provides the sub-command to list orgs of the user.
func UserOrgList(c *cli.Context, client umschlag.ClientAPI) error {
	records, err := client.UserOrgList(
		umschlag.UserOrgParams{
			User: GetIdentifierParam(c),
		},
	)

	if err != nil {
		return err
	}

	if c.IsSet("json") && c.IsSet("xml") {
		return fmt.Errorf("conflict, you can only use json or xml at once")
	}

	if c.Bool("xml") {
		res, err := xml.MarshalIndent(records, "", "  ")

		if err != nil {
			return err
		}

		fmt.Fprintf(os.Stdout, "%s\n", res)
		return nil
	}

	if c.Bool("json") {
		res, err := json.MarshalIndent(records, "", "  ")

		if err != nil {
			return err
		}

		fmt.Fprintf(os.Stdout, "%s\n", res)
		return nil
	}

	if len(records) == 0 {
		fmt.Fprintf(os.Stderr, "Empty result\n")
		return nil
	}

	tmpl, err := template.New(
		"_",
	).Funcs(
		globalFuncMap,
	).Funcs(
		sprigFuncMap,
	).Parse(
		fmt.Sprintf("%s\n", c.String("format")),
	)

	if err != nil {
		return err
	}

	for _, record := range records {
		err := tmpl.Execute(os.Stdout, record)

		if err != nil {
			return err
		}
	}

	return nil
}

// UserOrgAppend provides the sub-command to append a org to the user.
func UserOrgAppend(c *cli.Context, client umschlag.ClientAPI) error {
	err := client.UserOrgAppend(
		umschlag.UserOrgParams{
			User: GetIdentifierParam(c),
			Org:  GetOrgParam(c),
			Perm: GetPermParam(c),
		},
	)

	if err != nil {
		return err
	}

	fmt.Fprintf(os.Stderr, "Successfully appended to org\n")
	return nil
}

// UserOrgPerm provides the sub-command to update user org permissions.
func UserOrgPerm(c *cli.Context, client umschlag.ClientAPI) error {
	err := client.UserOrgPerm(
		umschlag.UserOrgParams{
			User: GetIdentifierParam(c),
			Org:  GetOrgParam(c),
			Perm: GetPermParam(c),
		},
	)

	if err != nil {
		return err
	}

	fmt.Fprintf(os.Stderr, "Successfully updated permissions\n")
	return nil
}

// UserOrgRemove provides the sub-command to remove a org from the user.
func UserOrgRemove(c *cli.Context, client umschlag.ClientAPI) error {
	err := client.UserOrgDelete(
		umschlag.UserOrgParams{
			User: GetIdentifierParam(c),
			Org:  GetOrgParam(c),
		},
	)

	if err != nil {
		return err
	}

	fmt.Fprintf(os.Stderr, "Successfully removed from org\n")
	return nil
}


text:
//------------------------------------------------------------------------------
// <auto-generated>
//     Este código fue generado por una herramienta.
//     Versión de runtime:4.0.30319.17929
//
//     Los cambios en este archivo podrían causar un comportamiento incorrecto y se perderán si
//     se vuelve a generar el código.
// </auto-generated>
//------------------------------------------------------------------------------

namespace Sistema.Properties {
    using System;

    /// <summary>
    ///   Clase de recurso fuertemente tipado, para buscar cadenas traducidas, etc.
    /// </summary>
    // StronglyTypedResourceBuilder generó automáticamente esta clase
    // a través de una herramienta como ResGen o Visual Studio.
    // Para agregar o quitar un miembro, edite el archivo .ResX y, a continuación, vuelva a ejecutar ResGen
    // con la opción /str o recompile su proyecto de VS.
    [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
    [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
    [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
    internal class Resources {

        private static global::System.Resources.ResourceManager resourceMan;

        private static global::System.Globalization.CultureInfo resourceCulture;

        [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
        internal Resources() {
        }

        /// <summary>
        ///   Devuelve la instancia de ResourceManager almacenada en caché utilizada por esta clase.
        /// </summary>
        [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
        internal static global::System.Resources.ResourceManager ResourceManager {
            get {
                if (object.ReferenceEquals(resourceMan, null)) {
                    global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Sistema.Properties.Resources", typeof(Resources).Assembly);
                    resourceMan = temp;
                }
                return resourceMan;
            }
        }

        /// <summary>
        ///   Reemplaza la propiedad CurrentUICulture del subproceso actual para todas las
        ///   búsquedas de recursos mediante esta clase de recurso fuertemente tipado.
        /// </summary>
        [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
        internal static global::System.Globalization.CultureInfo Culture {
            get {
                return resourceCulture;
            }
            set {
                resourceCulture = value;
            }
        }

        /// <summary>
        ///   Busca un recurso adaptado de tipo System.Drawing.Bitmap.
        /// </summary>
        internal static System.Drawing.Bitmap Abrir {
            get {
                object obj = ResourceManager.GetObject("Abrir", resourceCulture);
                return ((System.Drawing.Bitmap)(obj));
            }
        }

        /// <summary>
        ///   Busca un recurso adaptado de tipo System.Drawing.Bitmap.
        /// </summary>
        internal static System.Drawing.Bitmap Buscar {
            get {
                object obj = ResourceManager.GetObject("Buscar", resourceCulture);
                return ((System.Drawing.Bitmap)(obj));
            }
        }

        /// <summary>
        ///   Busca un recurso adaptado de tipo System.Drawing.Bitmap.
        /// </summary>
        internal static System.Drawing.Bitmap Checkmark {
            get {
                object obj = ResourceManager.GetObject("Checkmark", resourceCulture);
                return ((System.Drawing.Bitmap)(obj));
            }
        }

        /// <summary>
        ///   Busca un recurso adaptado de tipo System.Drawing.Bitmap.
        /// </summary>
        internal static System.Drawing.Bitmap Guardar {
            get {
                object obj = ResourceManager.GetObject("Guardar", resourceCulture);
                return ((System.Drawing.Bitmap)(obj));
            }
        }

        /// <summary>
        ///   Busca un recurso adaptado de tipo System.Drawing.Bitmap.
        /// </summary>
        internal static System.Drawing.Bitmap Nuevo {
            get {
                object obj = ResourceManager.GetObject("Nuevo", resourceCulture);
                return ((System.Drawing.Bitmap)(obj));
            }
        }
    }
}


text:
angular.module('phonertcdemo')
  .factory('ContactsService', function (signaling) {
    var onlineUsers = [];

    signaling.on('online', function (name) {
      if (onlineUsers.indexOf(name) === -1) {
        onlineUsers.push(name);
      }
    });

    signaling.on('offline', function (name) {
      var index = onlineUsers.indexOf(name);
      if (index !== -1) {
        onlineUsers.splice(index, 1);
      }
    });

    return {
      onlineUsers: onlineUsers,
      setOnlineUsers: function (users, currentName) {
        this.currentName = currentName;

        onlineUsers.length = 0;
        users.forEach(function (user) {
          if (user !== currentName) {
            onlineUsers.push(user);
          }
        });
      }
    }
  });


text: export { default } from './RailsPlainWordmark'