text:
package org.apache.sshd.client.kex;

import java.io.ByteArrayOutputStream;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.PipedInputStream;
import java.io.PipedOutputStream;
import java.nio.charset.StandardCharsets;
import java.time.Duration;
import java.util.Collection;
import java.util.Collections;
import java.util.EnumSet;

import org.apache.sshd.client.ClientBuilder;
import org.apache.sshd.client.SshClient;
import org.apache.sshd.client.channel.ClientChannel;
import org.apache.sshd.client.channel.ClientChannelEvent;
import org.apache.sshd.client.session.ClientSession;
import org.apache.sshd.common.channel.Channel;
import org.apache.sshd.common.kex.BuiltinDHFactories;
import org.apache.sshd.common.kex.KeyExchangeFactory;
import org.apache.sshd.common.util.security.SecurityUtils;
import org.apache.sshd.server.SshServer;
import org.apache.sshd.util.test.BaseTestSupport;
import org.apache.sshd.util.test.CoreTestSupportUtils;
import org.apache.sshd.util.test.JUnit4ClassRunnerWithParametersFactory;
import org.apache.sshd.util.test.TeeOutputStream;
import org.junit.AfterClass;
import org.junit.Assume;
import org.junit.BeforeClass;
import org.junit.FixMethodOrder;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.MethodSorters;
import org.junit.runners.Parameterized;
import org.junit.runners.Parameterized.Parameters;
import org.junit.runners.Parameterized.UseParametersRunnerFactory;

/**
 * Test client key exchange algorithms.
 *
 * @author Apache MINA SSHD Project
 */
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
@RunWith(Parameterized.class) // see https://github.com/junit-team/junit/wiki/Parameterized-tests
@UseParametersRunnerFactory(JUnit4ClassRunnerWithParametersFactory.class)
public class KexTest extends BaseTestSupport {
    private static final Duration TIMEOUT = Duration.ofSeconds(15);
    private static SshServer sshd;
    private static int port;
    private static SshClient client;

    private final BuiltinDHFactories factory;

    public KexTest(BuiltinDHFactories factory) {
        this.factory = factory;
    }

    @Parameters(name = "Factory={0}")
    public static Collection<Object[]> parameters() {
        return parameterize(BuiltinDHFactories.VALUES);
    }

    @BeforeClass
    public static void setupClientAndServer() throws Exception {
        sshd = CoreTestSupportUtils.setupTestFullSupportServer(KexTest.class);
        sshd.start();
        port = sshd.getPort();

        client = CoreTestSupportUtils.setupTestFullSupportClient(KexTest.class);
        client.start();
    }

    @AfterClass
    public static void tearDownClientAndServer() throws Exception {
        if (sshd != null) {
            try {
                sshd.stop(true);
            } finally {
                sshd = null;
            }
        }

        if (client != null) {
            try {
                client.stop();
            } finally {
                client = null;
            }
        }
    }

    @Test
    public void testClientKeyExchange() throws Exception {
        if (factory.isGroupExchange()) {
            assertEquals(factory.getName() + " not supported even though DH group exchange supported",
                    SecurityUtils.isDHGroupExchangeSupported(), factory.isSupported());
        }

        Assume.assumeTrue(factory.getName() + " not supported", factory.isSupported());
        testClient(ClientBuilder.DH2KEX.apply(factory));
    }

    private void testClient(KeyExchangeFactory kex) throws Exception {
        try (ByteArrayOutputStream sent = new ByteArrayOutputStream();
             ByteArrayOutputStream out = new ByteArrayOutputStream()) {

            client.setKeyExchangeFactories(Collections.singletonList(kex));
            try (ClientSession session = client.connect(getCurrentTestName(), TEST_LOCALHOST, port)
                    .verify(CONNECT_TIMEOUT)
                    .getSession()) {
                session.addPasswordIdentity(getCurrentTestName());
                session.auth().verify(AUTH_TIMEOUT);

                try (ClientChannel channel = session.createChannel(Channel.CHANNEL_SHELL);
                     PipedOutputStream pipedIn = new PipedOutputStream();
                     InputStream inPipe = new PipedInputStream(pipedIn);
                     ByteArrayOutputStream err = new ByteArrayOutputStream();
                     OutputStream teeOut = new TeeOutputStream(sent, pipedIn)) {

                    channel.setIn(inPipe);
                    channel.setOut(out);
                    channel.setErr(err);
                    channel.open().verify(OPEN_TIMEOUT);

                    teeOut.write("this is my command\n".getBytes(StandardCharsets.UTF_8));
                    teeOut.flush();

                    StringBuilder sb = new StringBuilder();
                    for (int i = 0; i < 10; i++) {
                        sb.append("0123456789");
                    }
                    sb.append('\n');
                    teeOut.write(sb.toString().getBytes(StandardCharsets.UTF_8));

                    teeOut.write("exit\n".getBytes(StandardCharsets.UTF_8));
                    teeOut.flush();

                    Collection<ClientChannelEvent> result = channel.waitFor(EnumSet.of(ClientChannelEvent.CLOSED), TIMEOUT);
                    assertFalse("Timeout while waiting for channel closure", result.contains(ClientChannelEvent.TIMEOUT));
                }
            }

            assertArrayEquals(kex.getName(), sent.toByteArray(), out.toByteArray());
        }
    }
}


text:
var http = require('http')
  , connect = require('connect')
  , serveStatic = require('serve-static')
  , socketIO = require('socket.io')
  , db = require('../db');

exports.serve = function(config) {
  var app = connect();

  app.use(serveStatic(__dirname));

  var server = http.createServer(app);

  var io = socketIO(server);

  io.on('connection', function(socket) {
    socket.emit('connected');
  });

  db.changes(function(entry) {
    io.sockets.emit('change', entry);
  });

  server.listen(config.port, config.host, function() {
    console.log('Serving web on ' + config.host + ':' + config.port);
  });
};

redpajama_set_name: RedPajamaGithub


text:
import React from 'react';

import ShallowRenderer from 'react-test-renderer/shallow';

import PeopleListItem from './list-item';

const renderer = new ShallowRenderer();

describe('PeopleListItem component', () => {
  it('renders a local participant properly', () => {
    const participant = {
      displayName: 'Dr Dre',
      id: '1'
    };

    renderer.render(
      <PeopleListItem {...participant} />
    );
    const component = renderer.getRenderOutput();

    expect(component).toMatchSnapshot();
  });

  it('renders a local participant with email properly', () => {
    const participant = {
      displayName: 'Dr Dre',
      emailAddress: 'dreday@deathrowrecords.net',
      id: '1'
    };

    renderer.render(
      <PeopleListItem {...participant} />
    );
    const component = renderer.getRenderOutput();

    expect(component).toMatchSnapshot();
  });

  it('renders an external participant properly', () => {
    const participant = {
      displayName: 'Jimmy Iovine',
      isExternal: true,
      id: '2'
    };

    renderer.render(
      <PeopleListItem {...participant} />
    );
    const component = renderer.getRenderOutput();

    expect(component).toMatchSnapshot();
  });

  it('renders an editable participant properly', () => {
    const participant = {
      canEdit: true,
      displayName: 'Jimmy Iovine',
      id: '3'
    };

    renderer.render(
      <PeopleListItem {...participant} />
    );
    const component = renderer.getRenderOutput();

    expect(component).toMatchSnapshot();
  });
});


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
null

#### Original name
Guignardia phytolaccae J.V. Almeida & Sousa da Câmara

### Remarks
null


text:
package org.springframework.cloud.gateway.filter.factory.rewrite;

import java.util.List;
import java.util.function.Function;

import reactor.core.publisher.Flux;
import reactor.core.publisher.Mono;

import org.springframework.cloud.gateway.filter.GatewayFilter;
import org.springframework.cloud.gateway.filter.GatewayFilterChain;
import org.springframework.cloud.gateway.filter.factory.AbstractGatewayFilterFactory;
import org.springframework.cloud.gateway.support.BodyInserterContext;
import org.springframework.core.io.buffer.DataBuffer;
import org.springframework.core.io.buffer.DataBufferUtils;
import org.springframework.http.HttpHeaders;
import org.springframework.http.codec.HttpMessageReader;
import org.springframework.http.server.reactive.ServerHttpRequest;
import org.springframework.http.server.reactive.ServerHttpRequestDecorator;
import org.springframework.web.reactive.function.BodyInserter;
import org.springframework.web.reactive.function.BodyInserters;
import org.springframework.web.reactive.function.server.HandlerStrategies;
import org.springframework.web.reactive.function.server.ServerRequest;
import org.springframework.web.server.ServerWebExchange;

import static org.springframework.cloud.gateway.support.GatewayToStringStyler.filterToStringCreator;

/**
 * GatewayFilter that modifies the request body.
 */
public class ModifyRequestBodyGatewayFilterFactory
		extends AbstractGatewayFilterFactory<ModifyRequestBodyGatewayFilterFactory.Config> {

	private final List<HttpMessageReader<?>> messageReaders;

	public ModifyRequestBodyGatewayFilterFactory() {
		super(Config.class);
		this.messageReaders = HandlerStrategies.withDefaults().messageReaders();
	}

	public ModifyRequestBodyGatewayFilterFactory(List<HttpMessageReader<?>> messageReaders) {
		super(Config.class);
		this.messageReaders = messageReaders;
	}

	@Override
	@SuppressWarnings("unchecked")
	public GatewayFilter apply(Config config) {
		return new GatewayFilter() {
			@Override
			public Mono<Void> filter(ServerWebExchange exchange, GatewayFilterChain chain) {
				Class inClass = config.getInClass();
				ServerRequest serverRequest = ServerRequest.create(exchange, messageReaders);

				// TODO: flux or mono
				Mono<?> modifiedBody = serverRequest.bodyToMono(inClass)
						.flatMap(originalBody -> config.getRewriteFunction().apply(exchange, originalBody))
						.switchIfEmpty(Mono.defer(() -> (Mono) config.getRewriteFunction().apply(exchange, null)));

				BodyInserter bodyInserter = BodyInserters.fromPublisher(modifiedBody, config.getOutClass());
				HttpHeaders headers = new HttpHeaders();
				headers.putAll(exchange.getRequest().getHeaders());

				// the new content type will be computed by bodyInserter
				// and then set in the request decorator
				headers.remove(HttpHeaders.CONTENT_LENGTH);

				// if the body is changing content types, set it here, to the bodyInserter
				// will know about it
				if (config.getContentType() != null) {
					headers.set(HttpHeaders.CONTENT_TYPE, config.getContentType());
				}
				CachedBodyOutputMessage outputMessage = new CachedBodyOutputMessage(exchange, headers);
				return bodyInserter.insert(outputMessage, new BodyInserterContext())
						// .log("modify_request", Level.INFO)
						.then(Mono.defer(() -> {
							ServerHttpRequest decorator = decorate(exchange, headers, outputMessage);
							return chain.filter(exchange.mutate().request(decorator).build());
						})).onErrorResume((Function<Throwable, Mono<Void>>) throwable -> release(exchange,
								outputMessage, throwable));
			}

			@Override
			public String toString() {
				return filterToStringCreator(ModifyRequestBodyGatewayFilterFactory.this)
						.append("Content type", config.getContentType()).append("In class", config.getInClass())
						.append("Out class", config.getOutClass()).toString();
			}
		};
	}

	protected Mono<Void> release(ServerWebExchange exchange, CachedBodyOutputMessage outputMessage,
			Throwable throwable) {
		if (outputMessage.isCached()) {
			return outputMessage.getBody().map(DataBufferUtils::release).then(Mono.error(throwable));
		}
		return Mono.error(throwable);
	}

	ServerHttpRequestDecorator decorate(ServerWebExchange exchange, HttpHeaders headers,
			CachedBodyOutputMessage outputMessage) {
		return new ServerHttpRequestDecorator(exchange.getRequest()) {
			@Override
			public HttpHeaders getHeaders() {
				long contentLength = headers.getContentLength();
				HttpHeaders httpHeaders = new HttpHeaders();
				httpHeaders.putAll(headers);
				if (contentLength > 0) {
					httpHeaders.setContentLength(contentLength);
				}
				else {
					// TODO: this causes a 'HTTP/1.1 411 Length Required' // on
					// httpbin.org
					httpHeaders.set(HttpHeaders.TRANSFER_ENCODING, "chunked");
				}
				return httpHeaders;
			}

			@Override
			public Flux<DataBuffer> getBody() {
				return outputMessage.getBody();
			}
		};
	}

	public static class Config {

		private Class inClass;

		private Class outClass;

		private String contentType;

		private RewriteFunction rewriteFunction;

		public Class getInClass() {
			return inClass;
		}

		public Config setInClass(Class inClass) {
			this.inClass = inClass;
			return this;
		}

		public Class getOutClass() {
			return outClass;
		}

		public Config setOutClass(Class outClass) {
			this.outClass = outClass;
			return this;
		}

		public RewriteFunction getRewriteFunction() {
			return rewriteFunction;
		}

		public Config setRewriteFunction(RewriteFunction rewriteFunction) {
			this.rewriteFunction = rewriteFunction;
			return this;
		}

		public <T, R> Config setRewriteFunction(Class<T> inClass, Class<R> outClass,
				RewriteFunction<T, R> rewriteFunction) {
			setInClass(inClass);
			setOutClass(outClass);
			setRewriteFunction(rewriteFunction);
			return this;
		}

		public String getContentType() {
			return contentType;
		}

		public Config setContentType(String contentType) {
			this.contentType = contentType;
			return this;
		}

	}

}


text:
cask 'seamonkey' do
  version '2.40'
  sha256 '51eb9ebc5578e81692d8c03cd2e7723f2279a4462c2afd2779b38c29bf12bd75'

  # mozilla.org is the official download host per the vendor homepage
  url "https://download.mozilla.org/?product=seamonkey-#{version}&os=osx&lang=en-US"
  name 'SeaMonkey'
  homepage 'http://www.seamonkey-project.org/'
  license :oss

  app 'SeaMonkey.app'
end


text:
require 'test_helper'

class LocationsControllerTest < ActionDispatch::IntegrationTest
  test "should get index" do
    get locations_index_url
    assert_response :success
  end

  test "should get show" do
    get locations_show_url
    assert_response :success
  end

end


text:
class ChannelAddable : public PropObject
{
public:
	virtual void Highlight(bool bHighlight) = 0;
	virtual bool Accept(std::shared_ptr<ChannelOpened>, CPoint pointIn, CPoint & pointOut) = 0;
	virtual void RequestAddChannel(std::shared_ptr<ProcessOpened>, std::shared_ptr<ChannelOpened>, CPoint pointIn) = 0;
	void Clear();
};


text:
import os

from setuptools import setup, find_packages

here = os.path.abspath(os.path.dirname(__file__))
README = open(os.path.join(here, 'README.md')).read()
CHANGES = open(os.path.join(here, 'CHANGES.txt')).read()

requires = [
    'pyramid',
    'pyramid_debugtoolbar',
    'waitress',
    ]

setup(name='LR-Lite',
      version='0.0',
      description='LR-Lite',
      long_description=README + '\n\n' + CHANGES,
      classifiers=[
        "Programming Language :: Python",
        "Framework :: Pyramid",
        "Topic :: Internet :: WWW/HTTP",
        "Topic :: Internet :: WWW/HTTP :: WSGI :: Application",
        ],
      author='',
      author_email='',
      url='',
      keywords='web pyramid pylons',
      packages=find_packages(),
      include_package_data=True,
      zip_safe=False,
      install_requires=requires,
      tests_require=requires,
      test_suite="lrlite",
      entry_points="""\
      [paste.app_factory]
      main = lrlite:main
      """,
      )


text:
#include "gen.h"
#include <cstring>
#include <cassert>
#include <cstdio>
#include <queue>
#include <algorithm>
#include <set>
#include <tuple>
#include <vector>
#include <numeric>
#ifdef __clang__
#include "omp.h"
#else
#include <omp.h>
#endif
#include "vector.h"
using namespace std;

vid_t *comp;
weight_t taskResult;

#ifdef ON_NUMA
vid_t vertexesPerThread;
#else
#define vertexesPerThread #error numa_only
#endif
vid_t *vertexIds;

double times[kMaxThreads][kMaxIterations][40];

// temporary min-edge data
eid_t *bestEid; // TODO very temporary array
vid_t *bestComp; // component, which is our pointer is pointing to

/*
 *  FL data
 */
namespace FlData {
    struct ListElement {
        vid_t vertex;       // 4 bytes   0... 7
        eid_t startEdgeId;  // 8 bytes   8...15
        eid_t endEdgeId;    // 8 bytes  16...23
    };
    typedef Vector<ListElement, 10> SmallVector;
#ifdef USE_SMALL_VECTOR
    SmallVector *list;
#else
    std::vector<ListElement> *list;
#endif

#ifdef USE_BOUND
    const int kVertexBound = 100000;
    const int kBoundQueue = 100;

    std::vector<vid_t> parallelProcess[kMaxThreads];
    eid_t bestEidPerThread[kMaxThreads][kMaxThreads][kVertexBound]; // [owner thread][processing thread][vertex id]
#endif /* USE_BOUND */

    void allocFalData() {
#ifdef USE_SMALL_VECTOR
        list = new SmallVector[vertexCount];
#else
        list = new std::vector<ListElement>[vertexCount];
#endif
    }
}

bool doAll() {
    int updated = 0; // reduce stage
    weight_t tmpTaskResult = 0.0; // merge stage
    Eo(iterationNumber);

#pragma omp parallel reduction(+:updated) reduction(+:tmpTaskResult)
    {
        const int threadId = omp_get_thread_num();
        stickThisThreadToCore(threadId);

        //
        // find minimum edge
        //
        rdtsc.start(threadId);

#ifdef USE_BOUND
        FlData::parallelProcess[threadId].clear();
#endif /* USE_BOUND */
        const vid_t vto = vertexIds[threadId + 1];
        for (vid_t v = vertexIds[threadId]; v < vto; ++v) if (comp[v] == v) {
#ifdef USE_BOUND
            if (FlData::list[v].size() >= FlData::kVertexBound) {
                FlData::parallelProcess[threadId].push_back(v);
                continue;
            }
#endif /* USE_BOUND */
            weight_t curBestWeight = MAX_WEIGHT + 1e-3;
            eid_t curBestEid = -1;

#ifdef USE_SMALL_VECTOR
            auto& data = FlData::list[v];
#else
            vector<FlData::ListElement>& data = FlData::list[v];
#endif /* USE_SMALL_VECTOR */
            for (size_t i = 0; i < data.size(); ) {
                const vid_t curVertex = data[i].vertex;
                eid_t curEdgeId = data[i].startEdgeId;
                const eid_t endEdgeId = data[i].endEdgeId;
                while (curEdgeId < endEdgeId && comp[edges[curEdgeId].dest] == v) ++curEdgeId;
                if (curEdgeId == endEdgeId) {
                    // remove
#ifdef USE_SMALL_VECTOR
                    data.removeAt(i);
#else
                    data[i] = data.back();
                    data.pop_back();
#endif /* USE_SMALL_VECTOR */
                    continue;
                } else {
                    data[i].startEdgeId = curEdgeId; // ToDo omptimize: write only when changed
                }
                if (edges[curEdgeId].weight < curBestWeight) {
                    curBestWeight = edges[curEdgeId].weight;
                    curBestEid = curEdgeId;
                }
                ++i;
            }
            bestEid[v] = curBestEid;
            bestComp[v] = (curBestEid == -1 ? -1 : comp[edges[curBestEid].dest]);
        } else {
            bestEid[v] = -1;
        }
#ifdef USE_BOUND
        assert(FlData::parallelProcess[threadId].size() < FlData::kBoundQueue);
#endif /* USE_BOUND */

        times[iterationNumber][threadId][0] = rdtsc.end(threadId);
#pragma omp barrier
        rdtsc.start(threadId);

#ifdef USE_BOUND
        for (int t = 0; t < threadsCount; ++t) for (size_t vid = 0; vid < FlData::parallelProcess[t].size(); ++vid) {
            const vid_t v = FlData::parallelProcess[t][vid];
            weight_t curBestWeight = MAX_WEIGHT + 1e-3;
            eid_t curBestEid = -1;
#ifdef USE_SMALL_VECTOR
            auto& data = FlData::list[v];
#else
            vector<FlData::ListElement>& data = FlData::list[v];
#endif /* USE_SMALL_VECTOR */

            size_t ifrom = data.size() * (threadId + 0) / threadsCount;
            size_t ito   = data.size() * (threadId + 1) / threadsCount;
            for (size_t i = ifrom; i < ito; ++i) {
                const vid_t curVertex = data[i].vertex;
                eid_t curEdgeId = data[i].startEdgeId;
                const eid_t endEdgeId = data[i].endEdgeId;
                while (curEdgeId < endEdgeId && comp[edges[curEdgeId].dest] == v) ++curEdgeId;
                if (curEdgeId == endEdgeId) {
                    // skip (instead of remove)
                    // TODO: set startEdgeId
                    continue;
                } else {
                    data[i].startEdgeId = curEdgeId; // ToDo omptimize: write only when changed. or remove
                }
                if (edges[curEdgeId].weight < curBestWeight) {
                    curBestWeight = edges[curEdgeId].weight;
                    curBestEid = curEdgeId;
                }
            }
            FlData::bestEidPerThread[t][threadId][vid] = curBestEid;
        }
        times[iterationNumber][threadId][1] = rdtsc.end(threadId);
#pragma omp barrier
        rdtsc.start(threadId);

        for (size_t vid = 0; vid < FlData::parallelProcess[threadId].size(); ++vid) {
            const vid_t v= FlData::parallelProcess[threadId][vid];
            weight_t curBestWeight = MAX_WEIGHT + 1e-3;
            eid_t curBestEid = -1;
            for (int t = 0; t < threadsCount; ++t) {
                eid_t teid = FlData::bestEidPerThread[threadId][t][vid];
                if (teid != -1 && edges[teid].weight < curBestWeight) {
                    curBestWeight = edges[teid].weight;
                    curBestEid = teid;
                }
            }
            bestEid[v] = curBestEid;
            bestComp[v] = (curBestEid == -1 ? -1 : comp[edges[curBestEid].dest]);
        }
#endif /* USE_BOUND */

        times[iterationNumber][threadId][1] += rdtsc.end(threadId);

#pragma omp barrier

        //
        // recalc answer, add eges to MST ("merge")
        //
        rdtsc.start(threadId);

#pragma omp for nowait
        for (vid_t v = 0; v < vertexCount; ++v) if (bestEid[v] != -1) {
            comp[v] = bestComp[v];
        }

        times[iterationNumber][threadId][2] += rdtsc.end(threadId);
#pragma omp barrier
        rdtsc.start(threadId);

#pragma omp for nowait
        for (vid_t i = 0; i < vertexCount; ++i) {
            const eid_t edge = bestEid[i];
            if (edge == -1) continue;
            updated = 1;
            //Result best = bestResult[i];
            //if (best.weight > MAX_WEIGHT) continue;
            vid_t oc = bestComp[i]; // best.destComp;

            if (comp[oc] == i) {
                //if (i < oc) {
                bool crazeCond = ((i^oc)&1);
                if ((crazeCond && i < oc) || (!crazeCond && i > oc)) {
                    comp[i] = i;
                } else {
                    comp[i] = oc;
                    tmpTaskResult += edges[edge].weight;
                }
            } else {
                tmpTaskResult += edges[edge].weight;
                comp[i] = oc;
            }
            bestEid[i] = -1; // TODO remove ?
        }

        times[iterationNumber][threadId][2] += rdtsc.end(threadId);
    }

    //
    // pointer jumping
    //
    int changed = 100500;
    while (changed) {
        changed = 0;
#pragma omp parallel
        {
            const int threadId = omp_get_thread_num();
            stickThisThreadToCore(threadId);
            rdtsc.start(threadId);
#pragma omp for reduction(+:changed) nowait
            for (vid_t i = 0; i < vertexCount; ++i) {
                vid_t myComp = comp[i];
                if (myComp == i) continue;
                vid_t parentComp = comp[myComp];
                if (parentComp == i) {
#if 0
                    comp[i] = min(i, myComp);
#else
                    if (min(i, myComp)&1)
                        comp[i] = min(i, myComp);
                    else
                        comp[i] = max(i, myComp);
#endif
                    changed = 1;
                } else if (myComp != parentComp) {
                    comp[i] = parentComp;
                    changed = 1;
                }
            }
            times[iterationNumber][threadId][3] += rdtsc.end(threadId);
        }
    }

    //
    // merge vertexes lists
    //
#pragma omp parallel
    {
        const int threadId = omp_get_thread_num();
        stickThisThreadToCore(threadId);
        rdtsc.start(threadId);

        const vid_t myIdsFrom = vertexIds[threadId];
        const vid_t myIdsToto = vertexIds[threadId + 1];
        // TODO create bitvector readyForCopy ?
        if (iterationNumber == 0) {
            for (vid_t u = 0; u < vertexCount; ++u) {
                const vid_t v = comp[u];
                if (v == u || v < myIdsFrom || v >= myIdsToto) continue;
#ifdef USE_SMALL_VECTOR
                FlData::list[v].push_back(FlData::list[u].onStack[0]);
#else
                FlData::list[v].push_back(FlData::list[u][0]);
                FlData::list[u].clear();
#endif /* USE_SMALL_VECTOR */
            }
        } else {
            for (vid_t u = 0; u < vertexCount; ++u) { // iterate over all vertexes
                const vid_t v = comp[u];
                if (v == u) continue;
                //if (v / vertexesPerThread != threadId) continue; // check if this vertex points to our thread
                if (v < myIdsFrom || v >= myIdsToto) continue;
                if (FlData::list[u].empty()) continue;

                // merge vectors
#ifdef USE_SMALL_VECTOR
                // TODO implement swap for vector
                FlData::list[v].append(FlData::list[u]);
#else
                if (FlData::list[v].size() > FlData::list[u].size()) {
                    FlData::list[v].insert(FlData::list[v].end(), FlData::list[u].begin(), FlData::list[u].end());
                } else {
                    FlData::list[u].insert(FlData::list[u].end(), FlData::list[v].begin(), FlData::list[v].end());
                    FlData::list[u].swap(FlData::list[v]);
                }

                FlData::list[u].clear();
#endif /* USE_SMALL_VECTOR */
            }
        }

        times[iterationNumber][threadId][4] = rdtsc.end(threadId);
    }

    taskResult += tmpTaskResult;
    ++iterationNumber;
    return updated;
}

void doPrepare() {
    comp = new vid_t[vertexCount];
    for (vid_t i = 0; i < vertexCount; ++i)
        comp[i] = i;

    bestEid = new eid_t[vertexCount];
    bestComp = new vid_t[vertexCount];

#pragma omp parallel
    {
        const int threadId = omp_get_thread_num();
        const int curThreadsCount = omp_get_num_threads();
        stickThisThreadToCore(threadId);
#pragma omp master
        {
            threadsCount = curThreadsCount;
            assert(threadsCount < kMaxThreads);

            vertexIds = new vid_t[threadsCount + 1];
            vertexIds[0] = 0;

            FlData::allocFalData();
#ifdef ON_NUMA
            vertexesPerThread = vertexCount / threadsCount;
            assert(vertexesPerThread * threadsCount == vertexCount);
#endif /* ON_NUMA */
        }

#pragma omp barrier

#ifndef ON_NUMA
        eid_t degreeEnd = int64_t(edgesCount) * (threadId + 1) / threadsCount;
        eid_t degreeSum = 0;
        for (vid_t i = 0; i < vertexCount; ++i) {
            eid_t diff = edgesIds[i + 1] - edgesIds[i];
            degreeSum += diff;
            if (degreeSum >= degreeEnd) {
                vertexIds[threadId + 1] = i + 1;
                break;
            }
        }
#else
        vertexIds[threadId + 1] = int64_t(vertexCount) * (threadId + 1) / threadsCount;
#endif /* ON_NUMA */
#pragma omp barrier

        for (vid_t i = vertexIds[threadId]; i < vertexIds[threadId + 1]; ++i) {
#if 1
            FlData::list[i].reserve(10);
#endif
            FlData::list[i].push_back(FlData::ListElement{i, edgesIds[i], edgesIds[i + 1]});

            std::sort(edges + edgesIds[i], edges + edgesIds[i + 1], EdgeWeightCmp());
        }
    }
}

void warmup() {
    const int64_t iterationCount = 1e9;
#pragma omp parallel
    {
        volatile int64_t fpre = 0, fcur = 1;
        stickThisThreadToCore(omp_get_thread_num());
        for (int64_t i = iterationCount; i > 0; --i) {
            int64_t fnext = fpre + fcur;
            fpre = fcur;
            fcur = fnext;
        }
    }
}

int main(int argc, char *argv[]) {
    if (argc < 2) {
        fprintf(stderr, "Usage: %s input\n", argv[0]);
        return 1;
    }
    readAll(argv[1]);
    //warmup();
    fprintf(stderr, "Done\n");

    int64_t prepareTime = -currentNanoTime();
    doPrepare();
    prepareTime += currentNanoTime();

    int64_t calcTime = -currentNanoTime();
    while (doAll());
    calcTime += currentNanoTime();

    printf("%.10lf\n", double(taskResult));

    fprintf(stderr, "%.3lf\n%.3lf\n", double(prepareTime) / 1e9, double(calcTime) / 1e9);

#if 1
    for (int i = 0; i < iterationNumber; ++i) {
        fprintf(stderr, "iteration %2d\n", i);
        for (int j = 0; j < threadsCount; ++j) {
            fprintf(stderr, "%02d:   ", j);
            for (int k = 0; k < 5; ++k) // skip-loops, find-min-local, find-min-large-parallel, add edges to mst, pj, merge
                fprintf(stderr, "%.6lf ", times[i][j][k]);
            fputs("\n", stderr);
        }
    }
#endif

    return 0;
}


text:
_So you wanna build the site?_

[mochajs.org](https://mochajs.org) is built using [Eleventy](https://www.11ty.io/), a simple static site generator.

## Prerequisites

- Node.js v6.x or greater

## Development

1. Run `npm install` from working copy root to get Node.js deps.
1. To serve the site and rebuild as changes are made, execute `npm start docs.watch`.
1. To rebuild the site _once_, execute `npm start docs`.

### Notes

- The content lives in `docs/index.md`; everything else is markup, scripts, assets, etc.
- This file (`docs/README.md`) should _not_ be included in the build.
- `docs/_dist` is where the deployed site lives. `docs/_site` is essentially a build step. These directories are _not_ under version control.
- See `package-scripts.js` for details on what the builds are actually doing; especially see [markdown-magic](https://npm.im/markdown-magic) for how we're dynamically inserting information into `docs/index.md`.

## License

:copyright: 2016-2018 [JS Foundation](https://js.foundation) and contributors.

Content licensed [CC-BY-4.0](https://raw.githubusercontent.com/mochajs/mocha/master/docs/LICENSE-CC-BY-4.0).

Code licensed [MIT](https://raw.githubusercontent.com/mochajs/mocha/master/LICENSE-MIT).


text:
<?php

class WCML_Setup {

    private $step;
    private $woocommerce_wpml;
    private $sitepress;
    private $next_step = false;

    public function __construct( &$woocommerce_wpml, &$sitepress ){

        $this->woocommerce_wpml =& $woocommerce_wpml;
        $this->sitepress        =& $sitepress;

        $this->setup_redirect();

        $this->steps = array(
            'introduction' => array(
                'name'    =>  __( 'Introduction', 'woocommerce-multilingual' ),
                'view'    => array( $this, 'setup_introduction' ),
                'handler' => ''
            ),
            'store-pages' => array(
                'name'    =>  __( 'Store Pages', 'woocommerce-multilingual' ),
                'view'    => array( $this, 'setup_store_pages' ),
                'handler' => array( $this, 'install_store_pages' ),
            ),
            'attributes' => array(
                'name'    =>  __( 'Global Attributes', 'woocommerce-multilingual' ),
                'view'    => array( $this, 'setup_attributes' ),
                'handler' => array( $this, 'save_attributes' )
            ),
            'multi-currency' => array(
                'name'    =>  __( 'Multiple Currencies', 'woocommerce-multilingual' ),
                'view'    => array( $this, 'setup_multi_currency' ),
                'handler' => array( $this, 'save_multi_currency' )
            ),
            'ready' => array(
                'name'    =>  __( 'Ready!', 'woocommerce-multilingual' ),
                'view'    => array( $this, 'setup_ready' ),
                'handler' => ''
            )
        );

        if( current_user_can( 'manage_options' ) ) {
            if ( isset( $_GET['page'] ) && $_GET['page'] === 'wcml-setup' ) {
                add_action( 'admin_menu', array( $this, 'admin_menus' ) );
            }
            add_action( 'admin_init', array($this, 'setup_wizard') );

            add_action( 'admin_init', array($this, 'handle_steps'), 0 );
            add_filter( 'wp_redirect', array($this, 'redirect_filters') );
        }

        if( !$this->has_completed() ){
            add_filter( 'admin_notices', array( $this, 'setup_wizard_notice') );
            add_action( 'admin_init', array( $this, 'skip_setup' ), 1 );
        }

    }

    private function setup_redirect(){

        if ( get_transient( '_wcml_activation_redirect' ) ) {
            delete_transient( '_wcml_activation_redirect' );

            $woocommerce_notices = get_option( 'woocommerce_admin_notices', array() );
            $woocommerce_setup_not_run = in_array( 'install', $woocommerce_notices );

            if (
                ( ! empty( $_GET['page'] ) && in_array( $_GET['page'], array( 'wcml-setup' ) ) ) ||
                is_network_admin() ||
                isset( $_GET['activate-multi'] ) ||
                ! current_user_can( 'manage_options' ) ||
                $woocommerce_setup_not_run
            ) {
                return;
            }

            if( !$this->has_completed()){
                wp_safe_redirect( admin_url( 'index.php?page=wcml-setup' ) );
                exit;
            }
        }
    }

    public function admin_menus() {
        add_dashboard_page( '', '', 'manage_options', 'wcml-setup', '' );
    }

    public function setup_wizard_notice(){
        wp_enqueue_style( 'wcml-setup-wizard-notice', WCML_PLUGIN_URL . '/res/css/wcml-setup-wizard-notice.css' );
        ?>

                <?php _e('Prepare your WooCommerce store to run multilingual!', 'woocommerce-multilingual'); ?>

                <?php _e('We need to help you with a few steps to turn your WooCommerce store multilingual. These steps include:', 'woocommerce-multilingual'); ?>

<?php _e("Translating the 'store' pages", 'woocommerce-multilingual'); ?>

<?php _e("Choosing which attributes to make translatable", 'woocommerce-multilingual'); ?>

<?php _e("Choosing if you need multiple currencies", 'woocommerce-multilingual'); ?>

                <a href="<?php echo esc_url( admin_url('admin.php?page=wcml-setup') ); ?>" class="button-primary"><?php _e('Start the Setup Wizard', 'woocommerce-multilingual') ?>
                <a href="<?php echo esc_url( wp_nonce_url( add_query_arg( 'wcml-setup-skip', 1 ), 'wcml_setup_skip_nonce', '_wcml_setup_nonce' ) ); ?>" class="button-secondary skip"><?php _e('Skip', 'woocommerce-multilingual') ?>

        <?php
    }

    public function skip_setup(){

        if ( isset( $_GET['wcml-setup-skip'] ) && isset( $_GET['_wcml_setup_nonce'] ) ) {
            if ( ! wp_verify_nonce( $_GET['_wcml_setup_nonce'], 'wcml_setup_skip_nonce' ) ) {
                wp_die( __( 'Action failed. Please refresh the page and retry.', 'woocommerce-multilingual' ) );
            }

            if ( ! current_user_can( 'manage_options' ) ) {
                wp_die( __( 'Cheatin’ huh?', 'woocommerce' ) );
            }

            $this->complete_setup();
            remove_filter( 'admin_notices', array( $this, 'setup_wizard_notice') );

	        delete_transient( '_wcml_activation_redirect' );
        }

    }

    public function complete_setup(){
        $this->woocommerce_wpml->settings['set_up_wizard_run'] = 1;
        $this->woocommerce_wpml->settings['set_up_wizard_splash'] = 1;
        $this->woocommerce_wpml->update_settings();
    }

    public function has_completed(){

        return !empty( $this->woocommerce_wpml->settings['set_up_wizard_run'] );

    }

    public function splash_wizard_on_wcml_pages(){

        if( isset( $_GET['src'] ) && $_GET['src'] == 'setup_later' ){
            $this->woocommerce_wpml->settings['set_up_wizard_splash'] = 1;
            $this->woocommerce_wpml->update_settings();
        }

        if( isset( $_GET['page'] ) && $_GET['page'] == 'wpml-wcml' && !$this->has_completed() && empty( $this->woocommerce_wpml->settings['set_up_wizard_splash'] )){
            wp_redirect('admin.php?page=wcml-setup');
            exit;
        }
    }

    public function setup_wizard() {

        $this->splash_wizard_on_wcml_pages();

        if ( empty( $_GET['page'] ) || 'wcml-setup' !== $_GET['page'] ) {
            return;
        }

        $this->step = isset( $_GET['step'] ) ? sanitize_key( $_GET['step'] ) : current( array_keys( $this->steps ) );

        wp_enqueue_style( 'wcml-setup', WCML_PLUGIN_URL . '/res/css/wcml-setup.css', array( 'dashicons', 'install' ), WCML_VERSION );
        wp_enqueue_script( 'wcml-setup', WCML_PLUGIN_URL . '/res/js/wcml-setup.js', array('jquery'), WCML_VERSION );

        $this->setup_header();
        $this->setup_steps();
        $this->setup_content();
        $this->setup_footer();

        if( $this->step == 'ready' ){
            $this->complete_setup();
        }

        exit;
    }

    private function setup_header() {
        set_current_screen('wcml-setup');
        ?>
        <!DOCTYPE html>
        <html xmlns="http://www.w3.org/1999/xhtml" <?php language_attributes(); ?>>

                <meta name="viewport" content="width=device-width" />
                <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
                <title><?php _e( 'WooCommerce Multilingual › Setup Wizard', 'woocommerce-multilingual' ); ?></title>
                <?php wp_print_scripts( 'wcml-setup' ); ?>
                <?php do_action( 'admin_print_styles' ); ?>
                <?php do_action( 'admin_head' ); ?>

<img src="<?php echo WCML_PLUGIN_URL ?>/res/images/banner-772x120.png" alt="WooCommerce Multilingual" />

        <?php if( !empty( $this->steps[ $this->step ]['handler'] ) ): ?>
        <form class="wcml-setup-form" method="post">
        <input type="hidden" name="nonce" value="<?php echo wp_create_nonce( $this->step ) ?>" />
        <input type="hidden" name="handle_step" value="<?php echo $this->step ?>" />
        <?php endif; ?>
        <?php
    }

    private function setup_content(){

        echo '
';
        call_user_func( $this->steps[ $this->step ]['view'] );
        echo '
';

    }

    private function setup_footer() {
        ?>
        <?php if( !empty( $this->steps[ $this->step ]['handler'] ) ): ?>
        </form>
        <?php endif ?>

        <?php
    }

    private function setup_steps() {

        $steps = array_keys( $this->steps );
        $step_index = array_search( $this->step, $steps );
        $this->next_step = isset( $steps[$step_index + 1] ) ? $steps[$step_index + 1] : '';

        $ouput_steps = $this->steps;
        array_shift( $ouput_steps );
        ?>

            <?php foreach ( $ouput_steps as $step_key => $step ) : ?>
                <li class="<?php
                if ( $step_key === $this->step ) {
                    echo 'active';
                } elseif ( array_search( $this->step, array_keys( $this->steps ) ) > array_search( $step_key, array_keys( $this->steps ) ) ) {
                    echo 'done';
                }
                ?>"><?php echo esc_html( $step['name'] ); ?>

            <?php endforeach; ?>

        <?php
    }

    private function next_step_url(){
        $url = admin_url('admin.php?page=wcml-setup&step=' . $this->next_step );
        return $url;
    }

    public function setup_introduction(){
        $ui = new WCML_Setup_Introduction_UI( $this->woocommerce_wpml, $this->next_step_url() );
        echo $ui->get_view();
    }

    public function setup_store_pages(){

        $ui = new WCML_Setup_Store_Pages_UI( $this->woocommerce_wpml, $this->sitepress, $this->next_step_url() );
        echo $ui->get_view();
    }

    public function setup_attributes(){
        $ui = new WCML_Setup_Attributes_UI( $this->woocommerce_wpml, $this->next_step_url() );
        echo $ui->get_view();
    }

    public function setup_multi_currency(){
        $ui = new WCML_Setup_Multi_Currency_UI( $this->woocommerce_wpml, $this->next_step_url() );
        echo $ui->get_view();
    }

    public function setup_ready(){
        $ui = new WCML_Setup_Ready_UI( $this->woocommerce_wpml );
        echo $ui->get_view();
    }

    public function redirect_filters( $url ){

        if( isset($_POST['next_step_url']) && $_POST['next_step_url'] ){
            $url = sanitize_text_field( $_POST['next_step_url'] );
        }

        return $url;
    }

    private function get_handler( $step ){
        $handler = !empty( $this->steps[ $step ]['handler'] ) ? $this->steps[ $step ]['handler'] : '';
        return $handler;

    }

    public function handle_steps(){

        if( isset( $_POST[ 'handle_step' ] ) && $_POST['nonce'] == wp_create_nonce( $_POST[ 'handle_step' ] ) ){

            $step_name = sanitize_text_field( $_POST[ 'handle_step' ] );

            if( $handler = $this->get_handler( $step_name  )){
                call_user_func( $handler, $_POST );
            }

        }

    }

    /**
     * handler
     */
    public function save_attributes( $data ){

        if ( isset( $data['attributes'] ) ) {
            $this->woocommerce_wpml->attributes->set_translatable_attributes( $data['attributes'] );
        }

    }

    /**
     * handler
     */
    public function save_multi_currency( $data ){

        if( empty( $this->woocommerce_wpml->multi_currency )){
            $this->woocommerce_wpml->multi_currency = new WCML_Multi_Currency();
        }

        if( !empty( $data['enabled'] ) ){
            $this->woocommerce_wpml->multi_currency->enable();
        } else{
            $this->woocommerce_wpml->multi_currency->disable();
        }

    }

    /**
     * handler
     */
    public function install_store_pages( $data ){

        if( !empty( $data['create_pages'] ) ) {
            $this->woocommerce_wpml->store->create_missing_store_pages_with_redirect();
        }elseif( !empty( $data['install_missing_pages'] ) ){
            WC_Install::create_pages();
            $this->woocommerce_wpml->store->create_missing_store_pages_with_redirect();
        }

    }

}


text:
using System.Threading.Tasks;
using TfsWitAdminTools.Core;

namespace TfsWitAdminTools.ViewModel
{
    public class CategoriesViewerVM : ToolsChildVM
    {
        #region Ctor

        public CategoriesViewerVM(ToolsVM tools)
            : base(tools)
        {
            ShowCommand = new DelegateCommand(async () =>
            {
                await Show();
            },
            () =>
                (
                Tools.CurrentProjectCollection != null &&
                Tools.CurrentTeamProject != null
                )
            );
        }

        #endregion

        #region Props

        #endregion

        #region Methods

        private async Task Show()
        {
            string projectCollectionName = Tools.CurrentProjectCollection.Name;
            string teamProjectName = Tools.CurrentTeamProject.Name;
            string categories = null;

            Tools.Progress.BeginWorking();
            try
            {
                try
                {
                    categories = await Tools.WitAdminService
                        .ExportCategories(TFManager, projectCollectionName, teamProjectName);
                    Tools.Progress.NextStep();
                }
                catch (WitAdminException)
                {
                    Tools.Progress.FailStep();
                }
                Tools.CurrentTeamProject.Categories = categories;
            }
            finally
            {
                Tools.Progress.EndWorking();
            }
        }

        #endregion

        #region Commands

        public DelegateCommand ShowCommand { get; set; }

        #endregion
    }
}


text:
<title>Top Processes</title>
<link rel="stylesheet" type="text/css" href="pythia.css"/>
<link rel="shortcut icon" href="pythia32.gif"/>

Top Processes

Different ways to produce top quarks, singly or in pairs.

flag   Top:all
 (default = off)

Common switch for the group of top production.

flag   Top:gg2ttbar
 (default = off)

Scatterings g g -> t tbar.
Code 601.

flag   Top:qqbar2ttbar
 (default = off)

Scatterings q qbar -> t tbar by gluon exchange.
Code 602.

flag   Top:qq2tq(t:W)
 (default = off)

Scatterings q q' -> t q'' by t-channel exchange
of a W^+- boson.
Code 603.

flag   Top:ffbar2ttbar(s:gmZ)
 (default = off)

Scatterings f fbar -> t tbar by s-channel exchange
of a gamma^*/Z^0 boson.
Code 604.

flag   Top:ffbar2tqbar(s:W)
 (default = off)

Scatterings f fbar' -> t q'' by s-channel exchange
of a W^+- boson.
Code 605.

flag   Top:gmgm2ttbar
 (default = off)

Scatterings gamma gamma -> t tbar.
Code 606.

By default top always decays to a W and a down-type quark.
It is possible to switch on the t -> H+ b decay mode.
Note that its partial width is calculated using the tan(beta)
value stored in HiggsHchg:tanBeta, so that it can be used
without having to read in a SUSY parameter file. For the H+ to
decay also Higgs:useBSM = on is necessary.


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

<title>scheduler.processing Class Hierarchy</title>
<meta name="date" content="2014-10-20">
<link rel="stylesheet" type="text/css" href="../../stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Skip navigation links

Overview

Package

Class

Tree

Deprecated

Index

Help

Prev

Next

Frames

No Frames

All Classes

Hierarchy For Package scheduler.processing

Package Hierarchies:

All Packages

Class Hierarchy

java.lang.Object

scheduler.processing.SimpleProcess

Skip navigation links

Overview

Package

Class

Tree

Deprecated

Index

Help

Prev

Next

Frames

No Frames

All Classes


text:
package org.teavm.ast;

import java.util.List;

public class RecursiveVisitor implements ExprVisitor, StatementVisitor {
    protected void beforeVisit(Expr expr) {
    }

    protected void afterVisit(Expr expr) {
    }

    protected boolean canceled;

    protected final void cancel() {
        canceled = true;
    }

    @Override
    public void visit(BinaryExpr expr) {
        beforeVisit(expr);
        if (!canceled) {
            expr.getFirstOperand().acceptVisitor(this);
            if (!canceled) {
                expr.getSecondOperand().acceptVisitor(this);
            }
        }
        afterVisit(expr);
    }

    @Override
    public void visit(UnaryExpr expr) {
        beforeVisit(expr);
        if (!canceled) {
            expr.getOperand().acceptVisitor(this);
        }
        afterVisit(expr);
    }

    @Override
    public void visit(AssignmentStatement statement) {
        if (statement.getLeftValue() != null) {
            statement.getLeftValue().acceptVisitor(this);
            if (canceled) {
                return;
            }
        }
        statement.getRightValue().acceptVisitor(this);
    }

    @Override
    public void visit(ConditionalExpr expr) {
        beforeVisit(expr);
        if (!canceled) {
            expr.getCondition().acceptVisitor(this);
            if (!canceled) {
                expr.getConsequent().acceptVisitor(this);
                if (!canceled) {
                    expr.getAlternative().acceptVisitor(this);
                }
            }
        }
        afterVisit(expr);
    }

    public void visit(List<Statement> statements) {
        for (Statement part : statements) {
            part.acceptVisitor(this);
            if (canceled) {
                break;
            }
        }
    }

    @Override
    public void visit(SequentialStatement statement) {
        visit(statement.getSequence());
    }

    @Override
    public void visit(ConstantExpr expr) {
        beforeVisit(expr);
        afterVisit(expr);
    }

    @Override
    public void visit(ConditionalStatement statement) {
        statement.getCondition().acceptVisitor(this);
        visit(statement.getConsequent());
        if (!canceled) {
            visit(statement.getAlternative());
        }
    }

    @Override
    public void visit(VariableExpr expr) {
        beforeVisit(expr);
        afterVisit(expr);
    }

    @Override
    public void visit(SubscriptExpr expr) {
        beforeVisit(expr);
        expr.getArray().acceptVisitor(this);
        if (!canceled) {
            expr.getIndex().acceptVisitor(this);
        }
        afterVisit(expr);
    }

    @Override
    public void visit(SwitchStatement statement) {
        statement.getValue().acceptVisitor(this);
        if (canceled) {
            return;
        }
        for (SwitchClause clause : statement.getClauses()) {
            visit(clause.getBody());
            if (canceled) {
                return;
            }
        }
        if (!canceled) {
            visit(statement.getDefaultClause());
        }
    }

    @Override
    public void visit(UnwrapArrayExpr expr) {
        beforeVisit(expr);
        if (!canceled) {
            expr.getArray().acceptVisitor(this);
        }
        afterVisit(expr);
    }

    @Override
    public void visit(WhileStatement statement) {
        if (statement.getCondition() != null) {
            statement.getCondition().acceptVisitor(this);
            if (canceled) {
                return;
            }
        }
        visit(statement.getBody());
    }

    @Override
    public void visit(InvocationExpr expr) {
        beforeVisit(expr);
        if (!canceled) {
            for (Expr argument : expr.getArguments()) {
                argument.acceptVisitor(this);
                if (canceled) {
                    break;
                }
            }
        }
        afterVisit(expr);
    }

    @Override
    public void visit(BlockStatement statement) {
        visit(statement.getBody());
    }

    @Override
    public void visit(QualificationExpr expr) {
        beforeVisit(expr);
        if (!canceled) {
            if (expr.getQualified() != null) {
                expr.getQualified().acceptVisitor(this);
            }
        }
        afterVisit(expr);
    }

    @Override
    public void visit(BreakStatement statement) {
    }

    @Override
    public void visit(NewExpr expr) {
        beforeVisit(expr);
        afterVisit(expr);
    }

    @Override
    public void visit(ContinueStatement statement) {
    }

    @Override
    public void visit(NewArrayExpr expr) {
        beforeVisit(expr);
        if (!canceled) {
            expr.getLength().acceptVisitor(this);
        }
        afterVisit(expr);
    }

    @Override
    public void visit(NewMultiArrayExpr expr) {
        beforeVisit(expr);
        if (!canceled) {
            for (Expr dimension : expr.getDimensions()) {
                dimension.acceptVisitor(this);
                if (canceled) {
                    break;
                }
            }
        }
        afterVisit(expr);
    }

    @Override
    public void visit(ArrayFromDataExpr expr) {
        beforeVisit(expr);
        if (!canceled) {
            for (Expr element : expr.getData()) {
                element.acceptVisitor(this);
                if (canceled) {
                    break;
                }
            }
        }
        afterVisit(expr);
    }

    @Override
    public void visit(ReturnStatement statement) {
        if (statement.getResult() != null) {
            statement.getResult().acceptVisitor(this);
        }
    }

    @Override
    public void visit(InstanceOfExpr expr) {
        beforeVisit(expr);
        if (!canceled) {
            expr.getExpr().acceptVisitor(this);
        }
        afterVisit(expr);
    }

    @Override
    public void visit(ThrowStatement statement) {
        statement.getException().acceptVisitor(this);
    }

    @Override
    public void visit(CastExpr expr) {
        beforeVisit(expr);
        if (!canceled) {
            expr.getValue().acceptVisitor(this);
        }
        afterVisit(expr);
    }

    @Override
    public void visit(InitClassStatement statement) {
    }

    @Override
    public void visit(PrimitiveCastExpr expr) {
        beforeVisit(expr);
        if (!canceled) {
            expr.getValue().acceptVisitor(this);
        }
        afterVisit(expr);
    }

    @Override
    public void visit(TryCatchStatement statement) {
        visit(statement.getProtectedBody());
        visit(statement.getHandler());
    }

    @Override
    public void visit(GotoPartStatement statement) {
    }

    @Override
    public void visit(MonitorEnterStatement statement) {
        statement.getObjectRef().acceptVisitor(this);
    }

    @Override
    public void visit(MonitorExitStatement statement) {
        statement.getObjectRef().acceptVisitor(this);
    }

    @Override
    public void visit(BoundCheckExpr expr) {
        beforeVisit(expr);
        if (!canceled) {
            expr.getIndex().acceptVisitor(this);
            if (!canceled && expr.getArray() != null) {
                expr.getArray().acceptVisitor(this);
            }
        }
        afterVisit(expr);
    }
}


text:
namespace Envoy {
namespace Filesystem {

class FileImplWin32 : public FileSharedImpl {
public:
  FileImplWin32(const std::string& path) : FileSharedImpl(path) {}
  ~FileImplWin32();

protected:
  // Filesystem::FileSharedImpl
  void openFile() override;
  ssize_t writeFile(absl::string_view buffer) override;
  bool closeFile() override;

private:
  friend class FileSystemImplTest;
};

class InstanceImplWin32 : public Instance {
public:
  // Filesystem::Instance
  FilePtr createFile(const std::string& path) override;
  bool fileExists(const std::string& path) override;
  bool directoryExists(const std::string& path) override;
  ssize_t fileSize(const std::string& path) override;
  std::string fileReadToEnd(const std::string& path) override;
  bool illegalPath(const std::string& path) override;
};

} // namespace Filesystem
} // namespace Envoy


text:
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using OpenSource.UPnP;

namespace UPnPValidator
{
	/// <summary>
	/// Summary description for UPnPServiceLocator.
	/// </summary>
	public class UPnPServiceLocator : System.Windows.Forms.Form
	{
		private UPnPSmartControlPoint scp;
		private TreeNode UPnpRoot = new TreeNode("UPnP Devices",0,0);
		private delegate void UpdateTreeDelegate(TreeNode node);
		private UPnPService service = null;

		private System.Windows.Forms.Label label1;
		private System.Windows.Forms.ImageList imageList;
		private System.Windows.Forms.Button okButton;
		private System.Windows.Forms.Button cancelButton;
		private System.Windows.Forms.TreeView deviceTree;
		private System.ComponentModel.IContainer components;

		public UPnPService Service
		{
			get
			{
				return service;
			}
		}

		public UPnPServiceLocator()
		{
			//
			// Required for Windows Form Designer support
			//
			InitializeComponent();

			deviceTree.Nodes.Add(UPnpRoot);
			scp = new UPnPSmartControlPoint(new UPnPSmartControlPoint.DeviceHandler(HandleAddedDevice));
			scp.OnRemovedDevice += new UPnPSmartControlPoint.DeviceHandler(HandleRemovedDevice);
		}

		/// <summary>
		/// Clean up any resources being used.
		/// </summary>
		protected override void Dispose( bool disposing )
		{
			if( disposing )
			{
				if(components != null)
				{
					components.Dispose();
				}
			}
			base.Dispose( disposing );
		}

		#region Windows Form Designer generated code
		/// <summary>
		/// Required method for Designer support - do not modify
		/// the contents of this method with the code editor.
		/// </summary>
		private void InitializeComponent()
		{
			this.components = new System.ComponentModel.Container();
			System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(UPnPServiceLocator));
			this.deviceTree = new System.Windows.Forms.TreeView();
			this.imageList = new System.Windows.Forms.ImageList(this.components);
			this.okButton = new System.Windows.Forms.Button();
			this.cancelButton = new System.Windows.Forms.Button();
			this.label1 = new System.Windows.Forms.Label();
			this.SuspendLayout();
			//
			// deviceTree
			//
			this.deviceTree.Anchor = (((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
				| System.Windows.Forms.AnchorStyles.Left)
				| System.Windows.Forms.AnchorStyles.Right);
			this.deviceTree.ImageList = this.imageList;
			this.deviceTree.Location = new System.Drawing.Point(8, 40);
			this.deviceTree.Name = "deviceTree";
			this.deviceTree.Size = new System.Drawing.Size(328, 264);
			this.deviceTree.TabIndex = 0;
			this.deviceTree.MouseDown += new System.Windows.Forms.MouseEventHandler(this.deviceTree_MouseDown);
			this.deviceTree.DoubleClick += new System.EventHandler(this.deviceTree_DoubleClick);
			//
			// imageList
			//
			this.imageList.ColorDepth = System.Windows.Forms.ColorDepth.Depth16Bit;
			this.imageList.ImageSize = new System.Drawing.Size(16, 16);
			this.imageList.ImageStream = ((System.Windows.Forms.ImageListStreamer)(resources.GetObject("imageList.ImageStream")));
			this.imageList.TransparentColor = System.Drawing.Color.Transparent;
			//
			// okButton
			//
			this.okButton.Anchor = (System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right);
			this.okButton.Enabled = false;
			this.okButton.Location = new System.Drawing.Point(232, 312);
			this.okButton.Name = "okButton";
			this.okButton.Size = new System.Drawing.Size(96, 24);
			this.okButton.TabIndex = 1;
			this.okButton.Text = "OK";
			this.okButton.Click += new System.EventHandler(this.okButton_Click);
			//
			// cancelButton
			//
			this.cancelButton.Anchor = (System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right);
			this.cancelButton.DialogResult = System.Windows.Forms.DialogResult.Cancel;
			this.cancelButton.Location = new System.Drawing.Point(136, 312);
			this.cancelButton.Name = "cancelButton";
			this.cancelButton.Size = new System.Drawing.Size(96, 24);
			this.cancelButton.TabIndex = 2;
			this.cancelButton.Text = "Cancel";
			this.cancelButton.Click += new System.EventHandler(this.cancelButton_Click);
			//
			// label1
			//
			this.label1.Anchor = ((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
				| System.Windows.Forms.AnchorStyles.Right);
			this.label1.Location = new System.Drawing.Point(8, 8);
			this.label1.Name = "label1";
			this.label1.Size = new System.Drawing.Size(328, 32);
			this.label1.TabIndex = 3;
			this.label1.Text = "Select a network service from which the SCPD will be loaded from.";
			//
			// UPnPServiceLocator
			//
			this.AcceptButton = this.okButton;
			this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
			this.CancelButton = this.cancelButton;
			this.ClientSize = new System.Drawing.Size(344, 342);
			this.Controls.AddRange(new System.Windows.Forms.Control[] {
																		  this.label1,
																		  this.cancelButton,
																		  this.okButton,
																		  this.deviceTree});
			this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
			this.Name = "UPnPServiceLocator";
			this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
			this.Text = "UPnP Service Editor - SCPD Locator";
			this.Load += new System.EventHandler(this.UPnPServiceLocator_Load);
			this.ResumeLayout(false);

		}
		#endregion

		private void HandleRemovedDevice(UPnPSmartControlPoint sender, UPnPDevice device)
		{
			ArrayList TempList = new ArrayList();
			TreeNode tn;
			IEnumerator en = UPnpRoot.Nodes.GetEnumerator();
			while(en.MoveNext())
			{
				tn = (TreeNode)en.Current;
				if(((UPnPDevice)tn.Tag).UniqueDeviceName==device.UniqueDeviceName)
				{
					TempList.Add(tn);
				}
			}
			for(int x=0;x<TempList.Count;++x)
			{
				UPnpRoot.Nodes.Remove((TreeNode)TempList[x]);
			}
		}

		private void HandleAddedDevice(UPnPSmartControlPoint sender, UPnPDevice device)
		{
			HandleCreate(device,device.BaseURL);
		}

		private void HandleCreate(UPnPDevice device, Uri URL)
		{
			TreeNode Parent;
			TreeNode Child;

			Parent = new TreeNode(device.FriendlyName,1,1);
			Parent.Tag = device;
			for(int cid=0;cid<device.Services.Length;++cid)
			{
				Child = new TreeNode(device.Services[cid].ServiceURN,2,2);
				Child.Tag = device.Services[cid];
				Parent.Nodes.Add(Child);
			}

			for(int cid=0;cid<device.EmbeddedDevices.Length;++cid)
			{
				Child = ProcessEmbeddedDevice(device.EmbeddedDevices[cid]);
				Child.Tag = device.EmbeddedDevices[cid];
				Parent.Nodes.Add(Child);
			}

			if (this.IsHandleCreated == true)
			{
				Object[] args = new Object[1];
				args[0] = Parent;
				this.Invoke(new UpdateTreeDelegate(HandleTreeUpdate),args);
			}
			else
			{
				HandleTreeUpdate(Parent);
			}
		}

		private TreeNode ProcessEmbeddedDevice(UPnPDevice device)
		{
			TreeNode Parent;
			TreeNode Child;

			Parent = new TreeNode(device.FriendlyName,1,1);
			Parent.Tag = device;

			for(int cid=0;cid<device.Services.Length;++cid)
			{
				Child = new TreeNode(device.Services[cid].ServiceURN,2,2);
				Child.Tag = device.Services[cid];
				Parent.Nodes.Add(Child);
			}

			for(int cid=0;cid<device.EmbeddedDevices.Length;++cid)
			{
				Child = ProcessEmbeddedDevice(device.EmbeddedDevices[cid]);
				Child.Tag = device.EmbeddedDevices[cid];
				Parent.Nodes.Add(Child);
			}

			return(Parent);
		}

		private void HandleTreeUpdate(TreeNode node)
		{
			UPnpRoot.Nodes.Add(node);
			UPnpRoot.Expand();
		}

		private void deviceTree_MouseDown(object sender, System.Windows.Forms.MouseEventArgs e)
		{
			TreeNode node = deviceTree.GetNodeAt(e.X,e.Y);
			if (node == null) return;
			deviceTree.SelectedNode = node;
			object infoObject = node.Tag;
			if (infoObject == null)
			{
				service = null;
				okButton.Enabled = false;
				return;
			}
			if (infoObject.GetType() == typeof(UPnPService))
			{
				service = (UPnPService)infoObject;
				okButton.Enabled = true;
			}
			else
			{
				service = null;
				okButton.Enabled = false;
			}
		}

		private void okButton_Click(object sender, System.EventArgs e)
		{
			this.DialogResult = System.Windows.Forms.DialogResult.OK;
		}

		private void cancelButton_Click(object sender, System.EventArgs e)
		{
			this.DialogResult = System.Windows.Forms.DialogResult.Cancel;
		}

		private void UPnPServiceLocator_Load(object sender, System.EventArgs e)
		{
			UPnpRoot.Expand();
		}

		private void deviceTree_DoubleClick(object sender, System.EventArgs e)
		{
			if (deviceTree.SelectedNode == null) return;
			object infoObject = deviceTree.SelectedNode.Tag;
			if (infoObject.GetType() == typeof(UPnPService))
			{
				service = (UPnPService)infoObject;
				this.DialogResult = System.Windows.Forms.DialogResult.OK;
			}
		}

	}
}


text: Rails app which uses socket.io for realtime user experience


text:
<?xml version="1.0" encoding="UTF-8"?>
<!--

    Copyright (C) 2015 The Gravitee team (http://gravitee.io)

    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at

            http://www.apache.org/licenses/LICENSE-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.
    See the License for the specific language governing permissions and
    limitations under the License.

-->
<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>

    <parent>
        <artifactId>gravitee-am-factor</artifactId>
        <groupId>io.gravitee.am.factor</groupId>
        <version>3.10.0-SNAPSHOT</version>
    </parent>

    <artifactId>gravitee-am-factor-otp</artifactId>
    <name>Gravitee IO - Access Management - Factor - OTP</name>

    <dependencies>
        <!-- Gravitee.io -->
        <dependency>
            <groupId>io.gravitee.am.factor</groupId>
            <artifactId>gravitee-am-factor-api</artifactId>
            <version>${project.version}</version>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>io.gravitee.am.model</groupId>
            <artifactId>gravitee-am-model</artifactId>
            <version>${project.version}</version>
            <scope>provided</scope>
        </dependency>

        <!-- Spring -->
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-beans</artifactId>
            <scope>provided</scope>
        </dependency>

        <!-- Zxing for barcode generator -->
        <dependency>
            <groupId>com.google.zxing</groupId>
            <artifactId>javase</artifactId>
        </dependency>
    </dependencies>

    <build>
        <resources>
            <resource>
                <directory>src/main/resources</directory>
                <filtering>true</filtering>
            </resource>
        </resources>
        <plugins>
            <plugin>
                <artifactId>maven-assembly-plugin</artifactId>
                <version>2.3</version>
                <configuration>
                    <appendAssemblyId>false</appendAssemblyId>
                    <descriptors>
                        <descriptor>src/main/assembly/plugin-assembly.xml</descriptor>
                    </descriptors>
                </configuration>
                <executions>
                    <execution>
                        <id>make-plugin-assembly</id>
                        <phase>package</phase>
                        <goals>
                            <goal>single</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
</project>


text:
package org.htwkvisu.gui;

import org.htwkvisu.gui.interpolate.InterpolationMode;

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

public class ScoringConfig {

    private int samplingPixelDensity;
    private int minScoringValue;
    private int maxScoringValue;
    private InterpolationMode interpMode = InterpolationMode.BILINEAR;
    private ScoringCanvas canvas;

    public ScoringConfig(int samplingPixelDensity, int minScoringValue, int maxScoringValue) {
        this.samplingPixelDensity = samplingPixelDensity;
        this.minScoringValue = minScoringValue;
        this.maxScoringValue = maxScoringValue;
    }

    public int getMinScoringValue() {
        return minScoringValue;
    }

    public int getMaxScoringValue() {
        return maxScoringValue;
    }

    public int getSamplingPixelDensity() {
        return samplingPixelDensity;
    }

    public ScoringCanvas getCanvas() {
        return canvas;
    }

    public void setMinScoringValue(int minScoringValue) {
        if (minScoringValue >= 0 && minScoringValue < maxScoringValue) {
            this.minScoringValue = minScoringValue;
            canvas.redraw();
        } else {
            Logger.getGlobal().log(Level.INFO, "Min Score should be greater zero and lesser Max Score!");
        }
    }

    public void setSamplingPixelDensity(int samplingPixelDensity) {
        if (samplingPixelDensity > 0) {
            this.samplingPixelDensity = samplingPixelDensity;
            canvas.redraw();
        } else {
            Logger.getGlobal().log(Level.INFO, "Pixel Density should be greater zero!");
        }
    }

    public void setMaxScoringValue(int maxScoringValue) {
        if (maxScoringValue >= minScoringValue) {
            this.maxScoringValue = maxScoringValue;
            canvas.redraw();
        } else {
            Logger.getGlobal().log(Level.INFO, "Max Score should be greater Min Score!");
        }
    }

    public void setInterpolationMode(InterpolationMode mode) {
        this.interpMode = mode;
    }

    public InterpolationMode getInterpolationMode() {
        return interpMode;
    }

    public void setCanvas(ScoringCanvas canvas) {
        this.canvas = canvas;
    }

    /**
     * This method changes the value of the given field on the given config fields.
     * <p>
     * If the count of the config fields increase, a list or a container object will be a better parameter
     * - instead of all textFields.
     *
     * @param field      - the field, that must be changed
     * @param pixelField - pixelDensityTextField
     * @param minField   - minScoringTextField
     * @param maxField   - maxScoringTextField
     */
    public void changeValueOfNumericScoringTextField(NumericTextField field
            , NumericTextField pixelField, NumericTextField minField, NumericTextField maxField) {
        if (field.getText().isEmpty()) {
            field.setText(Integer.toString(field.getDefaultValue()));
        }

        int value = Integer.parseInt(field.getText());

        if (pixelField.equals(field)) {
            setSamplingPixelDensity(value);
            field.setText(Integer.toString(getSamplingPixelDensity()));
        } else if (minField.equals(field)) {
            setMinScoringValue(value);
            field.setText(Integer.toString(getMinScoringValue()));
        } else if (maxField.equals(field)) {
            setMaxScoringValue(value);
            field.setText(Integer.toString(getMaxScoringValue()));
        }
    }
}


text:
void
prepare_device
(
 void
);

//---------------------------------------------
// If a API is invoked by OMPT (TRUE/FALSE)
//---------------------------------------------

bool
ompt_runtime_status_get
(
 void
);

cct_node_t *
ompt_trace_node_get
(
 void
);

//-----------------------------------------------------------------------------
// NVIDIA GPU pc sampling support
//-----------------------------------------------------------------------------

void
ompt_pc_sampling_enable
(
 void
);

void
ompt_pc_sampling_disable
(
 void
);

//-----------------------------------------------------------------------------
// Use hpctoolkit callback/OMPT callback
//-----------------------------------------------------------------------------

void
ompt_external_subscriber_enable
(
 void
);

void
ompt_external_subscriber_disable
(
 void
);

#endif // _OMPT_INTERFACE_H_


text:
export = worldCurrencies;

declare const worldCurrencies: Record<string, worldCurrencies.Currency>;

declare namespace worldCurrencies {
    interface Currency {
        name: string;
        iso: IsoData;
        units: {
            major: Unit;
            minor: MinorUnit;
            minor2?: MinorUnit;
        };
        banknotes: CashValues;
        coins: CashValues;
    }

    interface IsoData {
        code: string;
        number: string;
    }

    interface Unit {
        name: string;
        symbol: string;
    }

    interface MinorUnit extends Unit {
        majorValue: number;
    }

    interface CashValues {
        frequent: string[];
        rare: string[];
    }
}


text:
package de.framey.lab.evil.eviltentaclesofdeath.asm.command;

import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import java.util.Stack;

import org.objectweb.asm.Opcodes;
import org.objectweb.asm.Type;
import org.objectweb.asm.tree.AbstractInsnNode;
import org.objectweb.asm.tree.InsnNode;
import org.objectweb.asm.tree.IntInsnNode;
import org.objectweb.asm.tree.JumpInsnNode;
import org.objectweb.asm.tree.LabelNode;
import org.objectweb.asm.tree.LdcInsnNode;
import org.objectweb.asm.tree.LocalVariableNode;
import org.objectweb.asm.tree.LookupSwitchInsnNode;
import org.objectweb.asm.tree.MethodInsnNode;
import org.objectweb.asm.tree.MethodNode;

import de.framey.lab.evil.eviltentaclesofdeath.Tentacle;
import de.framey.lab.evil.eviltentaclesofdeath.asm.AsmUtil;
import de.framey.lab.evil.eviltentaclesofdeath.asm.FrameTable;
import de.framey.lab.evil.eviltentaclesofdeath.asm.JumpTable;
import de.framey.lab.evil.eviltentaclesofdeath.util.StackUtil;

/**
 * Represents a GOTO command which jumps to a dynamic label.
 * <p>
 * Adds a LOOKUPSWITCH instruction to switch for label strings. The switch is done on hashcodes of the strings. Afterwards equals is called
 * on the strings. This is the same procedure used on Java switch statements. Default target is the last line.
 * </p>
 * TODO: Adjust according to text file!!!
 *
 * @author Frank Meyfarth
 */
public class DynamicLabelGotoCommand implements Command {

    private static final String METHOD       = "GOTO";
    private static final String SIGNATURE    = AsmUtil.getMethodSignature(Tentacle.class, METHOD, String.class);

    private static final String MTH_HASHCODE = "hashCode";
    private static final String MTH_EQUALS   = "equals";

    private static final String SGN_EQUALS   = AsmUtil.getMethodSignature(String.class, MTH_EQUALS, Object.class);
    private static final String SGN_HASHCODE = AsmUtil.getMethodSignature(String.class, MTH_HASHCODE);
    private static final String SGN_STRING   = Type.getType(String.class).getDescriptor();

    private static final String TYP_STRING   = Type.getInternalName(String.class);

    private static final String PFX_TEMP_VAR = "TEMP$";

    @Override
    public boolean doesInstructionFit(AbstractInsnNode ain, FrameTable frameTable, Stack<AbstractInsnNode> instructionStack) {
        return AsmUtil.isMethodSignatureMatching(ain, METHOD, SIGNATURE)
                && !AsmUtil.areParameterValuesStatic(AsmUtil.getParamStack(instructionStack, frameTable));
    }

    @Override
    @SuppressWarnings("unchecked")
    public void injectInstructions(MethodNode mn, MethodInsnNode min, JumpTable jumpTable, FrameTable frameTable,
            Stack<AbstractInsnNode> instructionStack) {
        LabelNode defaultSwitchTarget = new LabelNode();
        int[] hopByKeys = generateHopByKeys(jumpTable.getLabelHashCodes());
        LabelNode[] hopByTargets = generateHopByTargets(jumpTable.getLabelHashCodes());
        int maxLocals = mn.localVariables.size();
        mn.localVariables.add(
                new LocalVariableNode(
                        PFX_TEMP_VAR + maxLocals,
                        SGN_STRING, null,
                        jumpTable.getFirstTarget(),
                        jumpTable.getLastTarget(),
                        maxLocals));

        StackUtil.pushAll(AsmUtil.removeCurrentMethodCall(instructionStack, frameTable), instructionStack);
        instructionStack.push(new InsnNode(Opcodes.DUP));
        instructionStack.push(new IntInsnNode(Opcodes.ASTORE, maxLocals));
        instructionStack.push(new MethodInsnNode(Opcodes.INVOKEVIRTUAL, TYP_STRING, MTH_HASHCODE, SGN_HASHCODE, false));
        instructionStack.push(
                new LookupSwitchInsnNode(
                        defaultSwitchTarget,
                        hopByKeys,
                        hopByTargets));
        int i = 0;
        for (Entry<Integer, Set<String>> labelHashCode : jumpTable.getLabelHashCodes().entrySet()) {
            instructionStack.push(hopByTargets[i++]);
            for (String label : labelHashCode.getValue()) {
                instructionStack.push(new IntInsnNode(Opcodes.ALOAD, maxLocals));
                instructionStack.push(new LdcInsnNode(label));
                instructionStack.push(new MethodInsnNode(Opcodes.INVOKEVIRTUAL, TYP_STRING, MTH_EQUALS, SGN_EQUALS, false));
                instructionStack.push(new JumpInsnNode(Opcodes.IFNE, jumpTable.get(label)));
            }
            instructionStack.push(new JumpInsnNode(Opcodes.GOTO, defaultSwitchTarget));
        }
        instructionStack.push(defaultSwitchTarget);
        AsmUtil.addThrowExceptionToStack(instructionStack, IllegalArgumentException.class, "Illegal jump target!");
    }

    private int[] generateHopByKeys(Map<Integer, Set<String>> labelHashCodes) {
        int[] keys = new int[labelHashCodes.size()];
        int i = 0;
        for (int k : labelHashCodes.keySet()) {
            keys[i++] = k;
        }
        return keys;
    }

    private LabelNode[] generateHopByTargets(Map<Integer, Set<String>> labelHashCodes) {
        LabelNode[] targets = new LabelNode[labelHashCodes.size()];
        for (int i = 0; i < labelHashCodes.size(); i++) {
            targets[i] = new LabelNode();
        }
        return targets;
    }
}


text:
import { Router } from 'express';
import facets from './facets';
import request from 'request';
import cors from 'cors';

export default function() {
	var tradeURL = (process.env.GWURL || "http://127.0.0.1:8080") + "/Blaze/rest/trades";
	var api = Router();

	// mount the facets resource
	api.use('/facets', facets);

	// perhaps expose some API metadata at the root
	api.get('/', (req, res) => {
		res.json({
			version : '1.0'
		});
	});

	api.get('/v1/trades', function(req, res, next){
		//var opts = {url: 'http://172.16.22.17/trade/app'};
		console.log("Sending request to ", tradeURL);
		var opts = {
			url:tradeURL+'/details',
			json: true
		}
		console.log("/api/v1/trades About to request trades");
		request(opts, function(err, resp, body){
			if(!err && resp.statusCode === 200){
				console.log("Sucess!");
				var trades = body.allTasks;
				console.log("trades: ", trades);
				if(!res.headersSent){
					var json = {"trades": trades};
					res.status(200).json(json);
				}
				else{
					console.error("Headers already sent");
				}
				return next();
			}
			console.log("Error ", err);
			if(!res.headersSent){
			res.status(500).send("Error "+ err);
		}
		});

	});

	api.get('/v1/trades/:id', cors(), function(req, res, next){
			var holdingID = "54";

			if( req.params && req.params.hasOwnProperty( "id" ) ) {

				holdingID = req.params.id;
			}
			console.log("/api/v1/trades/ " + holdingID);
			console.log("Sending request to ", tradeURL);
			var opts = {
				url: tradeURL+'/details?holdingID=' + holdingID,
				json: true
			}

			request(opts, function(err, resp, body){
				if(!err && resp.statusCode === 200){
					console.log("Sucess!");
					var holding = body.TASK;
					var json = {"trade": holding};
					if(!res.headersSent){
						res.status(200).json(json);

					}
					else {
						console.error("Headers already sent");
					}
					return next();
				}
				console.log("Error ", err);
				if(!res.headersSent){
				res.status(500).send("Error "+ err);
			}
			});

		});

		api.post('/v1/trades/buy', cors(),function(req,res,next){
			console.log("POST Sending request to ", tradeURL + "/buy");
			console.log("POST /v1/trades/buy body: ", req.body, "\n req.BODY ", req.BODY);
			//console.log("POST /v1/trades/buy req: ", req);
			if(!req.hasOwnProperty('body')){
				console.error("Required post attributes missing");
				if(!res.headersSent){
					res.status(500).send({"result": 1, "resultMessage": "Failed to buy trade"})
				}
				return next();
			}
			else if(!req.body.amount && !req.body.symbol){
				console.error("Need required post attributes symbol and amount");
				if(!res.headersSent){
				res.status(500).send({"result": 1, "resultMessage": "Failed to buy trade"})
				}
				return next();
			}

			var opts = {
				url: tradeURL+"/buy",
				json: true,
				body: req.body,
				method: "post",
				headers: {
					"Content-Type": "application/json"
				}
			}
			request(opts, function(err, resp, body){
				if(!err && resp.statusCode === 200){
					console.log("Success buying trade");
					var json = body;
					console.log("RET: ", json);
					if(!res.headersSent){
						res.status(200).json(json);

					}
					return;
				}
				console.error("Problem buying trade: ", err);
				if(!res.headersSent){
				res.status(500).send({"result": 1, "resultMessage": "Failed to buy trade"})
			}
			})
		});

		api.put('/v1/trades/:id', cors(),function(req,res,next){
			console.log("PUT Sending request to ", tradeURL + '/id' );
			console.log("PUT /v1/trades/"+req.params.id+" body: ", req.body);
			if(!req.params && !req.params.hasOwnProperty('id')){
				console.error(("Required PUT attribute missing: id"));
			}

			if(!req.hasOwnProperty('body')){
				console.error("Required PUT attributes missing");
				res.status(500).send({"result": 1, "resultMessage": "Failed to update trade Required PUT attributes missing"})
				return; //next();
			}
			else if(!req.body.amount && !req.body.symbol){
				console.error("Need required PUT attributes symbol and amount");
				res.status(500).send({"result": 1, "resultMessage": "Failed to update trade Need required PUT attributes symbol and amount"})
				return;// next();
			}
			var id = req.params.id;

			var opts = {
				url: tradeURL+"/"+id,
				json: true,
				body: req.body,
				method: "put",
				headers: {
					"Content-Type": "application/json"
				}
			}

			request(opts, function(err, resp, body){
				if(!err && resp.statusCode === 200){
					console.log("Success buying trade");
					var json = body;
					console.log("RET: ", json);
					if(!res.headersSent){
						res.status(200).json(json);

					}
					return; //next();
				}
				console.error("Problem buying trade: ", err);
				if(!res.headersSent){
				res.status(500).send({"result": 1, "resultMessage": "Failed to buy trade"})
			}
			})
		});

		api.post('/v1/trades/sell', cors(),function(req,res,next){
			console.log("POST Sending request to ", tradeURL + "/sell");
			console.log("POST /v1/trades/sell body: ", req.body);
			//console.log("POST /v1/trades/buy req: ", req);
			if(!req.hasOwnProperty('body')){
				console.error("Required post attributes missing");
				if(!res.headersSent){
					res.status(500).send({"result": 1, "resultMessage": "Failed to sell trade"})
				}
				return next();
			}
			else if(!req.body.amount && !req.body.symbol){
				console.error("Need required post attributes symbol and amount");
				if(!res.headersSent){
				res.status(500).send({"result": 1, "resultMessage": "Failed to sell trade"})
				}
				return next();
			}

			var opts = {
				url: tradeURL+"/sell",
				json: true,
				body: req.body,
				method: "post",
				headers: {
					"Content-Type": "application/json"
				}
			}
			request(opts, function(err, resp, body){
				if(!err && resp.statusCode === 200){
					console.log("Success selling trade");
					var json = body;
					console.log("RET: ", json);
					if(!res.headersSent){
						res.status(200).json(json);

					}
					return;
				}
				console.error("Problem selling trade: ", err);
				if(!res.headersSent){
				res.status(500).send({"result": 1, "resultMessage": "Failed to buy trade"})
			}
			})
		});

		api.get('/v1/mockbuy', cors(),function(req,res,next){
			console.log("Sending POST to ", tradeURL , " from /v1/mockbuy");

			var postBody = {
				symbol: "s:0",
				amount: "50"
			}
			var opts = {
				url: tradeURL+"/buy",
				json: true,
				body: postBody,
				method: "post",
				headers: {
					"Content-Type": "application/json"
				}
			}
			request(opts, function(err, resp, body){
				if(!err && resp.statusCode === 200){
					console.log("Success buying trade");
					var json = body;
					console.log("RET: ", json);
					if(!res.headersSent){
						res.status(200).json(json);

					}
					return next();
				}
				console.error("Problem buying trade: ", err);
				if(!res.headersSent){
				res.status(500).send({"result": 1, "resultMessage": "Failed to buy trade"})
			}
			})
		})

	return api;
}


text:
/* Styles for user services page */

a,
.button,
.popego_avatar_thumbnail:hover a,
.date_separator,
.category strong,
.label_tooltip {
	color:#333333;
}

input:focus,
textarea:focus,
.date_separator,
.popego_avatar_thumbnail:hover img {
	border-color:#333333;
}

.menu_button_active,
.menu_closer_active,
.menu_button_arrow,
.poplink,
.category_selected {
	background-color:#333333;
}

.help_box {
	background-color:#333333;
}

/* Styles for widget */

h2 { color:#333333; }
.category_selected { background-color:#333333; }


text:
<meta http-equiv="Content-Language" content="en-us">
<title>Abra User Manual</title>
<base target="mainFrame">

Table of Contents

Introduction

Installing Abra

Running Abra

Command Line

As Ant Task

Using Abra

Optional add-ons

Abra API

License

Authors


text: An Experimental Social Bot


text:
.. _prepare:

.. currentmodule:: pyuv

======================================
:py:class:`Prepare` --- Prepare handle
======================================

.. py:class:: Prepare(loop)

    :type loop: :py:class:`Loop`
    :param loop: loop object where this handle runs (accessible through :py:attr:`Prepare.loop`).

    ``Prepare`` handles are usually used together with :py:class:`Check` handles.
    They run just before the event loop ia about to block for I/O. The callback will be
    called *once* each loop iteration, before I/O.

    .. py:method:: start(callback)

        :param callable callback: Function that will be called when the ``Prepare``
            handle is run by the event loop.

        Start the ``Prepare`` handle.

        Callback signature: ``callback(prepare_handle)``.

    .. py:method:: stop

        Stop the ``Prepare`` handle.


text:
var expect = require('unexpected'),
    cldr = require('../lib/cldr');

describe('extractLayout', function () {
    it('should extract the Arabian layout', function () {
        expect(cldr.extractLayout('ar'), 'to equal', {
            orientation: {
                characterOrder: 'right-to-left',
                lineOrder: 'top-to-bottom'
            }
        });
    });

    it('should extract the American English layout', function () {
        expect(cldr.extractLayout('en_US'), 'to equal', {
            orientation: {
                characterOrder: 'left-to-right',
                lineOrder: 'top-to-bottom'
            }
        });
    });
});


text:
package mesosphere.marathon
package plugin

/**
  * A Marathon RunSpec Definition
  */
trait RunSpec {

  /**
    * The unique id of this run specification
    */
  val id: PathId

  /**
    * The Mesos resource roles that are accepted
    */
  val acceptedResourceRoles: Set[String]

  /**
    * All defined secret definitions
    */
  val secrets: Map[String, Secret]

  /**
    * The networks that this run specification will join.
    */
  val networks: Seq[NetworkSpec]

  /**
    * Volume definitions
    */
  val volumes: Seq[VolumeSpec]

  /**
    * Volume mounts.
    */
  val volumeMounts: Seq[VolumeMountSpec]
}

/**
  * An application is a run spec that launches a single task.
  */
trait ApplicationSpec extends RunSpec {

  /**
    * The user to execute the app task
    */
  val user: Option[String]

  /**
    * The environment of this app.
    */
  val env: Map[String, EnvVarValue]

  /**
    * The labels in that app.
    */
  val labels: Map[String, String]
}

/**
  * A Marathon Container definition
  */
trait ContainerSpec {

  /**
    * The name of the container spec.
    */
  val name: String

  /**
    * The user to execute the container task
    */
  val user: Option[String]

  /**
    * The environment of this container.
    */
  val env: Map[String, EnvVarValue]

  /**
    * The labels in that container
    */
  val labels: Map[String, String]

  /**
    * Volume mounts.
    */
  val volumeMounts: Seq[VolumeMountSpec]
}

/**
  * A network definition.
  */
trait NetworkSpec {

  /**
    * Optional labels for a given network, may be empty.
    */
  val labels: Map[String, String]
}

/**
  * A pod is a run spec that launches a task group.
  */
trait PodSpec extends RunSpec {

  /**
    * All containers of this run specification
    */
  val containers: Seq[ContainerSpec]

  /**
    * The environment shared for all containers inside this pod.
    */
  val env: Map[String, EnvVarValue]

  /**
    * The labels in that pod.
    */
  val labels: Map[String, String]
}

/**
  * VolumeSpec is a base trait for all the volume types supported by
  * Marathon. A volume can have an optional name. An application volume
  * does not have a name, whereas a pod volume does have one. This is
  * due to the difference in the app and pod JSON definitions. In case
  * of apps, both volume and its mount point are defined using the same
  * JSON object. On the other hand, in case of pods, a volume is defined
  * separately from its mount points, which refer to the volume using its
  * name.
  */
trait VolumeSpec {
  /**
    * A volume name.
    */
  val name: Option[String]
}

/**
  * A volume referring to a secret to be made available to containers.
  */
trait SecretVolumeSpec extends VolumeSpec {
  /**
    * A secret name.
    */
  val secret: String
}

/**
  * A volume mount specifying a path to mount a volume at.
  */
trait VolumeMountSpec {
  /**
    * The volume name this mount is for.
    */
  val volumeName: Option[String]

  /**
    * A mount path for the corresponding volume.
    */
  val mountPath: String

  /**
    * This field specifies whether to mount the volume
    * as read-only or not.
    */
  val readOnly: Boolean
}


text:
Description parsing for the [command][] module, a component of the [toolkit][].

Represents a string as an object containing the properties `md` (markdown) and `txt` (plain text).


text:
<?php
namespace Yaf\Exception\LoadFailed ;

/**
 * @link http://www.php.net/manual/en/class.yaf-exception-loadfaild-action.php
 */
class Action extends \Yaf\Exception\LoadFailed {

}


text:
def Customer(object):
    """Produces objects that represent customers"""
    def __init__(self, customer_id):
        self.customer_id = customer_id

    def display_cart(self):
        print "String: cart contents!"

class ReturningCustomer(Customer):
    """ for customers of the repeat variety"""
    def display_order_history(self):
        print "String: your history!"

monty_python = ReturningCustomer(12345)
monty_python.display_cart()
monty_python.diaplay_history()


text:
from django.contrib.sites.models import Site
from django.conf import settings

class DynamicSiteMiddleware(object):

    def hosting_parse(self, hosting):
        """
        Returns ``(host, port)`` for ``hosting`` of the form ``'host:port'``.

        If hosting does not have a port number, ``port`` will be None.
        """
        if ':' in hosting:
            return hosting.rsplit(':', 1)
        return hosting, None

    def get_hosting(self, hosting):
        domain, port = self.hosting_parse(hosting)
        if domain in settings.OPPS_DEFAULT_URLS:
            domain = 'example.com'
        try:
            return Site.objects.get(domain=domain)
        except Site.DoesNotExist:
            return Site.objects.order_by('id')[0]

    def process_request(self, request):
        hosting = request.get_host().lower()
        site = self.get_hosting(hosting)

        request.site = site
        settings.SITE_ID = site.id
        settings.CACHE_MIDDLEWARE_KEY_PREFIX = "opps_site-{}".format(site.id)