text:
package org.jkiss.dbeaver.runtime.properties;

import org.jkiss.dbeaver.model.preferences.DBPPropertyDescriptor;

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

/**
 * PropertiesContributor
 */
public class PropertiesContributor {

    public static final String TAB_STANDARD = "standard"; //$NON-NLS-1$
    public static final String TAB_PROPERTIES = "properties"; //$NON-NLS-1$

    public static final String SECTION_STANDARD = "standard"; //$NON-NLS-1$
    public static final String SECTION_ADDITIONAL = "additional"; //$NON-NLS-1$

    private static final PropertiesContributor instance = new PropertiesContributor();

    public static PropertiesContributor getInstance()
    {
        return instance;
    }

    private final List<ILazyPropertyLoadListener> lazyListeners = new ArrayList<ILazyPropertyLoadListener>();

    public void addLazyListener(ILazyPropertyLoadListener listener)
    {
        synchronized (lazyListeners) {
            lazyListeners.add(listener);
        }
    }

    public void removeLazyListener(ILazyPropertyLoadListener listener)
    {
        synchronized (lazyListeners) {
            lazyListeners.remove(listener);
        }
    }

    public void notifyPropertyLoad(Object object, DBPPropertyDescriptor propertyId, Object propertyValue, boolean completed)
    {
        synchronized (lazyListeners) {
            if (!lazyListeners.isEmpty()) {
                for (ILazyPropertyLoadListener listener : lazyListeners) {
                    listener.handlePropertyLoad(object, propertyId, propertyValue, completed);
                }
            }
        }
    }

}


text:
<?php

namespace JordiLlonch\Bundle\DeployBundle\SSH;

use Psr\Log\LoggerInterface;

class SshClient
{
    private $proxy;
    private $params;
    private $host;
    private $connected = false;

    /**
     * Constructor
     *
     * @param ProxyInterface $proxy
     */
    public function __construct(ProxyInterface $proxy = null)
    {
        if (null === $proxy) {
            $proxy = function_exists('ssh2_auth_agent') ? new PeclSsh2Proxy() : new CLISshProxy();
        }

        $this->proxy = $proxy;
    }

    public function setLogger(LoggerInterface $logger)
    {
        $this->proxy->setLogger($logger);
    }

    /**
     * @param array $options array('user', 'password', 'public_key_file', 'private_key_file', 'private_key_file_pwd', 'ssh_port')
     */
    public function setParameters($params)
    {
        $this->connected = false;
        $this->params = array_merge(
            array(
                'user'                 => '',
                'password'             => '',
                'public_key_file'      => '',
                'private_key_file'     => '',
                'private_key_file_pwd' => '',
                'ssh_port'             => '22'),
            $params
        );
    }

    /**
     * @throws \Exception
     */
    public function connect()
    {
        if (null === $this->host) {
            throw new \Exception("You must set the host");
        }
        if (!$this->proxy->connect($this->host, $this->params['ssh_port'])) {
            throw new \Exception("Unable to connect");
        }

        if (!empty($this->params['password']) && !$this->proxy->authByPassword($this->params['user'], $this->params['password'])) {
            throw new \Exception("Unable to authenticate via password");
        }

        if (!empty($this->params['public_key_file']) && !$this->proxy->authByPublicKey($this->params['user'], $this->params['public_key_file'], $this->params['private_key_file'], $this->params['private_key_file_pwd'])) {
            throw new \Exception("Unable to authenticate via public/private keys");
        }

        if (empty($this->params['password']) && empty($this->params['public_key_file']) && !$this->proxy->authByAgent($this->params['user'])) {
            throw new \Exception("Unable to authenticate via agent");
        }

        $this->connected = true;

        return true;
    }

    public function disconnect()
    {
        $this->proxy->disconnect();
        $this->connected = false;
    }

    public function isConnected()
    {
        return $this->connected;
    }

    public function exec($cmd)
    {
        return $this->proxy->exec($cmd);
    }

    public function getLastOutput()
    {
        return $this->proxy->getLastOutput();
    }

    public function getLastError()
    {
        return $this->proxy->getLastError();
    }

    public function getUser()
    {
        return $this->params['user'];
    }

    public function getPort()
    {
        return $this->params['ssh_port'];
    }

    public function setHost($host)
    {
        $this->host = $host;
    }

    public function getHost()
    {
        return $this->host;
    }
}

redpajama_set_name: RedPajamaGithub


text:
/* eslint-env mocha */
/* globals expect */
/* eslint no-unused-vars: 0 */

import { getCredentials, api, login, request, credentials } from '../../data/api-data.js';
import { adminEmail, adminUsername, adminPassword, password } from '../../data/user.js';
import supertest from 'supertest';

describe('miscellaneous', function() {
	this.retries(0);

	before(done => getCredentials(done));

	describe('API default', () => {
		// Required by mobile apps
		it('/info', (done) => {
			request.get('/api/info')
				.expect('Content-Type', 'application/json')
				.expect(200)
				.expect((res) => {
					expect(res.body).to.have.property('version');
				})
				.end(done);
		});
	});

	it('/login', () => {
		expect(credentials).to.have.property('X-Auth-Token').with.length.at.least(1);
		expect(credentials).to.have.property('X-User-Id').with.length.at.least(1);
	});

	it('/login (wrapper username)', (done) => {
		request.post(api('login'))
			.send({
				user: {
					username: adminUsername
				},
				password: adminPassword
			})
			.expect('Content-Type', 'application/json')
			.expect(200)
			.expect((res) => {
				expect(res.body).to.have.property('status', 'success');
				expect(res.body).to.have.property('data').and.to.be.an('object');
				expect(res.body.data).to.have.property('userId');
				expect(res.body.data).to.have.property('authToken');
				expect(res.body.data).to.have.property('me');
			})
			.end(done);
	});

	it('/login (wrapper email)', (done) => {
		request.post(api('login'))
			.send({
				user: {
					email: adminEmail
				},
				password: adminPassword
			})
			.expect('Content-Type', 'application/json')
			.expect(200)
			.expect((res) => {
				expect(res.body).to.have.property('status', 'success');
				expect(res.body).to.have.property('data').and.to.be.an('object');
				expect(res.body.data).to.have.property('userId');
				expect(res.body.data).to.have.property('authToken');
				expect(res.body.data).to.have.property('me');
			})
			.end(done);
	});

	it('/login by user', (done) => {
		request.post(api('login'))
			.send({
				user: adminEmail,
				password: adminPassword
			})
			.expect('Content-Type', 'application/json')
			.expect(200)
			.expect((res) => {
				expect(res.body).to.have.property('status', 'success');
				expect(res.body).to.have.property('data').and.to.be.an('object');
				expect(res.body.data).to.have.property('userId');
				expect(res.body.data).to.have.property('authToken');
				expect(res.body.data).to.have.property('me');
			})
			.end(done);
	});

	it('/login by username', (done) => {
		request.post(api('login'))
			.send({
				username: adminUsername,
				password: adminPassword
			})
			.expect('Content-Type', 'application/json')
			.expect(200)
			.expect((res) => {
				expect(res.body).to.have.property('status', 'success');
				expect(res.body).to.have.property('data').and.to.be.an('object');
				expect(res.body.data).to.have.property('userId');
				expect(res.body.data).to.have.property('authToken');
				expect(res.body.data).to.have.property('me');
			})
			.end(done);
	});

	it('/me', (done) => {
		request.get(api('me'))
			.set(credentials)
			.expect('Content-Type', 'application/json')
			.expect(200)
			.expect((res) => {
				const allUserPreferencesKeys = ['enableAutoAway', 'idleTimeLimit', 'desktopNotificationDuration', 'audioNotifications',
					'desktopNotifications', 'mobileNotifications', 'unreadAlert', 'useEmojis', 'convertAsciiEmoji', 'autoImageLoad',
					'saveMobileBandwidth', 'collapseMediaByDefault', 'hideUsernames', 'hideRoles', 'hideFlexTab', 'hideAvatars',
					'sidebarViewMode', 'sidebarHideAvatar', 'sidebarShowUnread', 'sidebarShowFavorites', 'sidebarGroupByType',
					'sendOnEnter', 'messageViewMode', 'emailNotificationMode', 'roomCounterSidebar', 'newRoomNotification', 'newMessageNotification',
					'muteFocusedConversations', 'notificationsSoundVolume'];
				expect(res.body).to.have.property('success', true);
				expect(res.body).to.have.property('_id', credentials['X-User-Id']);
				expect(res.body).to.have.property('username', login.user);
				expect(res.body).to.have.property('active');
				expect(res.body).to.have.property('name');
				expect(res.body).to.have.property('roles').and.to.be.an('array');
				expect(res.body).to.have.nested.property('emails[0].address', adminEmail);
				expect(res.body).to.have.nested.property('settings.preferences').and.to.be.an('object');
				expect(res.body.settings.preferences).to.have.all.keys(allUserPreferencesKeys);
			})
			.end(done);
	});

	describe('/directory', () => {
		let user;
		let testChannel;
		before((done) => {
			const username = `user.test.${ Date.now() }`;
			const email = `${ username }@rocket.chat`;
			request.post(api('users.create'))
				.set(credentials)
				.send({ email, name: username, username, password })
				.end((err, res) => {
					user = res.body.user;
					done();
				});
		});
		after(done => {
			request.post(api('users.delete')).set(credentials).send({
				userId: user._id
			}).end(done);
			user = undefined;
		});
		it('create an channel', (done) => {
			request.post(api('channels.create'))
				.set(credentials)
				.send({
					name: `channel.test.${ Date.now() }`
				})
				.end((err, res) => {
					testChannel = res.body.channel;
					done();
				});
		});
		it('should return an array(result) when search by user and execute succesfully', (done) => {
			request.get(api('directory'))
				.set(credentials)
				.query({
					query: JSON.stringify({
						text: user.username,
						type: 'users'
					})
				})
				.expect('Content-Type', 'application/json')
				.expect(200)
				.expect((res) => {
					expect(res.body).to.have.property('success', true);
					expect(res.body).to.have.property('result').and.to.be.an('array');
					expect(res.body).to.have.property('offset');
					expect(res.body).to.have.property('total');
					expect(res.body).to.have.property('count');
					expect(res.body.result[0]).to.have.property('_id');
					expect(res.body.result[0]).to.have.property('createdAt');
					expect(res.body.result[0]).to.have.property('username');
					expect(res.body.result[0]).to.have.property('emails').and.to.be.an('array');
					expect(res.body.result[0]).to.have.property('name');
				})
				.end(done);
		});
		it('should return an array(result) when search by channel and execute succesfully', (done) => {
			request.get(api('directory'))
				.set(credentials)
				.query({
					query: JSON.stringify({
						text: testChannel.name,
						type: 'channels'
					})
				})
				.expect('Content-Type', 'application/json')
				.expect(200)
				.expect((res) => {
					expect(res.body).to.have.property('success', true);
					expect(res.body).to.have.property('offset');
					expect(res.body).to.have.property('total');
					expect(res.body).to.have.property('count');
					expect(res.body).to.have.property('result').and.to.be.an('array');
					expect(res.body.result[0]).to.have.property('_id');
					expect(res.body.result[0]).to.have.property('name');
					expect(res.body.result[0]).to.have.property('usernames').and.to.be.an('array');
					expect(res.body.result[0]).to.have.property('ts');
				})
				.end(done);
		});
		it('should return an array(result) when search by channel with sort params correctly and execute succesfully', (done) => {
			request.get(api('directory'))
				.set(credentials)
				.query({
					query: JSON.stringify({
						text: testChannel.name,
						type: 'channels'
					}),
					sort: JSON.stringify(({
						name: 1
					}))
				})
				.expect('Content-Type', 'application/json')
				.expect(200)
				.expect((res) => {
					expect(res.body).to.have.property('success', true);
					expect(res.body).to.have.property('offset');
					expect(res.body).to.have.property('total');
					expect(res.body).to.have.property('count');
					expect(res.body).to.have.property('result').and.to.be.an('array');
					expect(res.body.result[0]).to.have.property('_id');
					expect(res.body.result[0]).to.have.property('name');
					expect(res.body.result[0]).to.have.property('usernames').and.to.be.an('array');
					expect(res.body.result[0]).to.have.property('ts');
				})
				.end(done);
		});
		it('should return an error when send invalid query', (done) => {
			request.get(api('directory'))
				.set(credentials)
				.query({
					query: JSON.stringify({
						text: 'invalid channel',
						type: 'invalid'
					})
				})
				.expect('Content-Type', 'application/json')
				.expect(400)
				.expect((res) => {
					expect(res.body).to.have.property('success', false);
				})
				.end(done);
		});
		it('should return an error when have more than one sort parameter', (done) => {
			request.get(api('directory'))
				.set(credentials)
				.query({
					query: JSON.stringify({
						text: testChannel.name,
						type: 'channels'
					}),
					sort: JSON.stringify(({
						name: 1,
						test: 1
					}))
				})
				.expect('Content-Type', 'application/json')
				.expect(400)
				.expect((res) => {
					expect(res.body).to.have.property('success', false);
				})
				.end(done);
		});
	});
	describe('[/spotlight]', () => {
		let user;
		before((done) => {
			const username = `user.test.${ Date.now() }`;
			const email = `${ username }@rocket.chat`;
			request.post(api('users.create'))
				.set(credentials)
				.send({ email, name: username, username, password })
				.end((err, res) => {
					user = res.body.user;
					done();
				});
		});

		let userCredentials;
		let testChannel;
		before((done) => {
			request.post(api('login'))
				.send({
					user: user.username,
					password
				})
				.expect('Content-Type', 'application/json')
				.expect(200)
				.expect((res) => {
					userCredentials = {};
					userCredentials['X-Auth-Token'] = res.body.data.authToken;
					userCredentials['X-User-Id'] = res.body.data.userId;
				})
				.end(done);
		});
		after(done => {
			request.post(api('users.delete')).set(credentials).send({
				userId: user._id
			}).end(done);
			user = undefined;
		});
		it('create an channel', (done) => {
			request.post(api('channels.create'))
				.set(userCredentials)
				.send({
					name: `channel.test.${ Date.now() }`
				})
				.end((err, res) => {
					testChannel = res.body.channel;
					done();
				});
		});
		it('should fail when does not have query param', (done) => {
			request.get(api('spotlight'))
				.set(credentials)
				.expect('Content-Type', 'application/json')
				.expect(400)
				.expect((res) => {
					expect(res.body).to.have.property('success', false);
					expect(res.body).to.have.property('error');
				})
				.end(done);
		});
		it('should return object inside users array when search by a valid user', (done) => {
			request.get(api('spotlight'))
				.query({
					query: `@${ adminUsername }`
				})
				.set(credentials)
				.expect('Content-Type', 'application/json')
				.expect(200)
				.expect((res) => {
					expect(res.body).to.have.property('success', true);
					expect(res.body).to.have.property('users').and.to.be.an('array');
					expect(res.body.users[0]).to.have.property('_id');
					expect(res.body.users[0]).to.have.property('name');
					expect(res.body.users[0]).to.have.property('username');
					expect(res.body.users[0]).to.have.property('status');
					expect(res.body).to.have.property('rooms').and.to.be.an('array');
				})
				.end(done);
		});
		it('must return the object inside the room array when searching for a valid room and that user is not a member of it', (done) => {
			request.get(api('spotlight'))
				.query({
					query: `#${ testChannel.name }`
				})
				.set(credentials)
				.expect('Content-Type', 'application/json')
				.expect(200)
				.expect((res) => {
					expect(res.body).to.have.property('success', true);
					expect(res.body).to.have.property('users').and.to.be.an('array');
					expect(res.body).to.have.property('rooms').and.to.be.an('array');
					expect(res.body.rooms[0]).to.have.property('_id');
					expect(res.body.rooms[0]).to.have.property('name');
					expect(res.body.rooms[0]).to.have.property('t');
				})
				.end(done);
		});
	});
});


text:
A starter kit for static sites and blogs. Uses [Jekyll](https://github.com/mojombo/jekyll/) to generate the site and [Bourbon](https://github.com/thoughtbot/bourbon) to make writing CSS more pleasurable.

Includes sensible defaults for Jekyll and minimal HTML/CSS/JS starting points.

Start the Jekyll server and watch the Sass/Bourbon files with:

    rake serve


text:
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.

using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics;
using osu.Game.Overlays.Dashboard.Home;
using osu.Game.Beatmaps;
using osu.Game.Overlays;
using osu.Framework.Allocation;
using osu.Game.Users;
using System;
using osu.Framework.Graphics.Shapes;
using System.Collections.Generic;
using osu.Game.Online.API.Requests.Responses;

namespace osu.Game.Tests.Visual.UserInterface
{
    public class TestSceneDashboardBeatmapListing : OsuTestScene
    {
        [Cached]
        private readonly OverlayColourProvider colourProvider = new OverlayColourProvider(OverlayColourScheme.Purple);

        private readonly Container content;

        public TestSceneDashboardBeatmapListing()
        {
            Add(content = new Container
            {
                Anchor = Anchor.Centre,
                Origin = Anchor.Centre,
                AutoSizeAxes = Axes.Y,
                Width = 300,
                Children = new Drawable[]
                {
                    new Box
                    {
                        RelativeSizeAxes = Axes.Both,
                        Colour = colourProvider.Background4
                    },
                    new Container
                    {
                        RelativeSizeAxes = Axes.X,
                        AutoSizeAxes = Axes.Y,
                        Padding = new MarginPadding { Horizontal = 10 },
                        Child = new DashboardBeatmapListing(new_beatmaps, popular_beatmaps)
                    }
                }
            });
        }

        protected override void LoadComplete()
        {
            base.LoadComplete();

            AddStep("Set width to 500", () => content.ResizeWidthTo(500, 500));
            AddStep("Set width to 300", () => content.ResizeWidthTo(300, 500));
        }

        private static readonly List<BeatmapSetInfo> new_beatmaps = new List<BeatmapSetInfo>
        {
            new BeatmapSetInfo
            {
                Metadata = new BeatmapMetadata
                {
                    Title = "Very Long Title (TV size) [TATOE]",
                    Artist = "This artist has a really long name how is this possible",
                    Author = new User
                    {
                        Username = "author",
                        Id = 100
                    }
                },
                OnlineInfo = new APIBeatmapSet
                {
                    Covers = new BeatmapSetOnlineCovers
                    {
                        Cover = "https://assets.ppy.sh/beatmaps/1189904/covers/cover.jpg?1595456608",
                    },
                    Ranked = DateTimeOffset.Now
                }
            },
            new BeatmapSetInfo
            {
                Metadata = new BeatmapMetadata
                {
                    Title = "Very Long Title (TV size) [TATOE]",
                    Artist = "This artist has a really long name how is this possible",
                    Author = new User
                    {
                        Username = "author",
                        Id = 100
                    }
                },
                OnlineInfo = new APIBeatmapSet
                {
                    Covers = new BeatmapSetOnlineCovers
                    {
                        Cover = "https://assets.ppy.sh/beatmaps/1189904/covers/cover.jpg?1595456608",
                    },
                    Ranked = DateTimeOffset.MinValue
                }
            }
        };

        private static readonly List<BeatmapSetInfo> popular_beatmaps = new List<BeatmapSetInfo>
        {
            new BeatmapSetInfo
            {
                Metadata = new BeatmapMetadata
                {
                    Title = "Title",
                    Artist = "Artist",
                    Author = new User
                    {
                        Username = "author",
                        Id = 100
                    }
                },
                OnlineInfo = new APIBeatmapSet
                {
                    Covers = new BeatmapSetOnlineCovers
                    {
                        Cover = "https://assets.ppy.sh/beatmaps/1079428/covers/cover.jpg?1595295586",
                    },
                    FavouriteCount = 100
                }
            },
            new BeatmapSetInfo
            {
                Metadata = new BeatmapMetadata
                {
                    Title = "Title 2",
                    Artist = "Artist 2",
                    Author = new User
                    {
                        Username = "someone",
                        Id = 100
                    }
                },
                OnlineInfo = new APIBeatmapSet
                {
                    Covers = new BeatmapSetOnlineCovers
                    {
                        Cover = "https://assets.ppy.sh/beatmaps/1079428/covers/cover.jpg?1595295586",
                    },
                    FavouriteCount = 10
                }
            }
        };
    }
}


text:
package org.jbpm.test.functional.timer;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.List;

import javax.persistence.Persistence;

import org.jbpm.process.core.timer.impl.ThreadPoolSchedulerService;
import org.jbpm.test.functional.timer.addon.TransactionalThreadPoolSchedulerService;
import org.jbpm.test.listener.NodeLeftCountDownProcessEventListener;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;
import org.junit.runners.Parameterized.Parameters;
import org.kie.api.event.process.DefaultProcessEventListener;
import org.kie.api.event.process.ProcessEventListener;
import org.kie.api.event.process.ProcessNodeLeftEvent;
import org.kie.api.io.ResourceType;
import org.kie.api.runtime.KieSession;
import org.kie.api.runtime.manager.RuntimeEngine;
import org.kie.api.runtime.manager.RuntimeEnvironment;
import org.kie.api.runtime.manager.RuntimeEnvironmentBuilder;
import org.kie.api.runtime.manager.RuntimeManager;
import org.kie.api.runtime.manager.RuntimeManagerFactory;
import org.kie.api.runtime.process.ProcessInstance;
import org.kie.internal.io.ResourceFactory;
import org.kie.internal.runtime.manager.SessionNotFoundException;
import org.kie.internal.runtime.manager.context.ProcessInstanceIdContext;

@RunWith(Parameterized.class)
public class GlobalThreadPoolTimerServiceTest extends GlobalTimerServiceBaseTest {

    private int managerType;

    @Parameters
    public static Collection<Object[]> persistence() {
        Object[][] data = new Object[][] { { 1 }, { 2 }, { 3 }  };
        return Arrays.asList(data);
    };

    public GlobalThreadPoolTimerServiceTest(int managerType) {
        this.managerType = managerType;
    }
    @Before
    public void setUp() {
        cleanupSingletonSessionId();
        emf = Persistence.createEntityManagerFactory("org.jbpm.test.persistence");
        globalScheduler = new ThreadPoolSchedulerService(1);
    }

    @After
    public void tearDown() {
        try {
            globalScheduler.shutdown();
        } catch (Exception e) {

        }
        cleanup();
    }

    @Override
    protected RuntimeManager getManager(RuntimeEnvironment environment, boolean waitOnStart) {
        if (managerType ==1) {
            return RuntimeManagerFactory.Factory.get().newSingletonRuntimeManager(environment);
        } else if (managerType == 2) {
            return RuntimeManagerFactory.Factory.get().newPerRequestRuntimeManager(environment);
        } else if (managerType == 3) {
            return RuntimeManagerFactory.Factory.get().newPerProcessInstanceRuntimeManager(environment);
        } else {
            throw new IllegalArgumentException("Invalid runtime maanger type");
        }
    }

    @Test(timeout=20000)
    public void testInterediateTimerWithGlobalTestServiceWithinTransaction() throws Exception {
        NodeLeftCountDownProcessEventListener countDownListener = new NodeLeftCountDownProcessEventListener("timer", 3);

        globalScheduler = new TransactionalThreadPoolSchedulerService(3);
        // prepare listener to assert results
        final List<Long> timerExporations = new ArrayList<Long>();
        ProcessEventListener listener = new DefaultProcessEventListener(){

            @Override
            public void afterNodeLeft(ProcessNodeLeftEvent event) {
                if (event.getNodeInstance().getNodeName().equals("timer")) {
                    timerExporations.add(event.getProcessInstance().getId());
                }
            }

        };

        environment = RuntimeEnvironmentBuilder.Factory.get()
    			.newDefaultBuilder()
    			.entityManagerFactory(emf)
                .addAsset(ResourceFactory.newClassPathResource("org/jbpm/test/functional/timer/IntermediateCatchEventTimerCycle3.bpmn2"), ResourceType.BPMN2)
                .schedulerService(globalScheduler)
                .registerableItemsFactory(new TestRegisterableItemsFactory(listener, countDownListener))
                .get();

        manager = getManager(environment, true);

        RuntimeEngine runtime = manager.getRuntimeEngine(ProcessInstanceIdContext.get());
        KieSession ksession = runtime.getKieSession();

        ProcessInstance processInstance = ksession.startProcess("IntermediateCatchEvent");
        assertTrue(processInstance.getState() == ProcessInstance.STATE_ACTIVE);
        // now wait for 1 second for first timer to trigger
        countDownListener.waitTillCompleted(2000);
        // dispose session to force session to be reloaded on timer expiration
        manager.disposeRuntimeEngine(runtime);
        countDownListener.waitTillCompleted();
        countDownListener.reset(1);

        try {
            runtime = manager.getRuntimeEngine(ProcessInstanceIdContext.get(processInstance.getId()));
            ksession = runtime.getKieSession();

            processInstance = ksession.getProcessInstance(processInstance.getId());
            assertNull(processInstance);
        } catch (SessionNotFoundException e) {
            // expected for PerProcessInstanceManagers since process instance is completed
        }
        // let's wait to ensure no more timers are expired and triggered
        countDownListener.waitTillCompleted(3000);

        assertEquals(3, timerExporations.size());
        manager.disposeRuntimeEngine(runtime);
    }

}


text:
void MakeStaticSplitter(HWND hwnd);

//extern TCHAR		g_szFileName[MAX_PATH];
//extern TCHAR		g_szFileTitle[MAX_PATH];

//
//	Set the date-time pickers from the specified file
//
void UpdateFileTime(HWND hwnd, HANDLE hFile)
{
	SYSTEMTIME st;
	FILETIME ft, ftc, fta, ftm;

	GetFileTime(hFile, &ftc, &fta, &ftm);

	FileTimeToLocalFileTime(&ftc, &ft);
	FileTimeToSystemTime(&ft, &st);			//created
	SendDlgItemMessage(hwnd, IDC_DATETIMEPICKER1, DTM_SETSYSTEMTIME, GDT_VALID, (LPARAM)&st);
	SendDlgItemMessage(hwnd, IDC_DATETIMEPICKER2, DTM_SETSYSTEMTIME, GDT_VALID, (LPARAM)&st);

	FileTimeToLocalFileTime(&ftm, &ft);
	FileTimeToSystemTime(&ft, &st);			//modified
	SendDlgItemMessage(hwnd, IDC_DATETIMEPICKER3, DTM_SETSYSTEMTIME, GDT_VALID, (LPARAM)&st);
	SendDlgItemMessage(hwnd, IDC_DATETIMEPICKER4, DTM_SETSYSTEMTIME, GDT_VALID, (LPARAM)&st);

	FileTimeToLocalFileTime(&fta, &ft);
	FileTimeToSystemTime(&ft, &st);			//accessed
	SendDlgItemMessage(hwnd, IDC_DATETIMEPICKER5, DTM_SETSYSTEMTIME, GDT_VALID, (LPARAM)&st);
	SendDlgItemMessage(hwnd, IDC_DATETIMEPICKER6, DTM_SETSYSTEMTIME, GDT_VALID, (LPARAM)&st);
}

BOOL ApplyFileTime(HWND hwndDlg, HWND hwndHV)
{
	SYSTEMTIME st1, st2;
	FILETIME ft, ftc, fta, ftm;
	HANDLE hFile;

	// need to combine the date and time portions to give the
	// appropriate time

	// creation time
	SendDlgItemMessage(hwndDlg, IDC_DATETIMEPICKER1, DTM_GETSYSTEMTIME, 0, (LPARAM)&st1);
	SendDlgItemMessage(hwndDlg, IDC_DATETIMEPICKER2, DTM_GETSYSTEMTIME, 0, (LPARAM)&st2);
	st1.wHour			= st2.wHour;
	st1.wMilliseconds	= st2.wMilliseconds;
	st1.wMinute			= st2.wMinute;
	st1.wSecond			= st2.wSecond;
	st1.wDayOfWeek		= 0;
	SystemTimeToFileTime(&st1, &ft);		//created
	LocalFileTimeToFileTime(&ft, &ftc);

	// modify time
	SendDlgItemMessage(hwndDlg, IDC_DATETIMEPICKER3, DTM_GETSYSTEMTIME, 0, (LPARAM)&st1);
	SendDlgItemMessage(hwndDlg, IDC_DATETIMEPICKER4, DTM_GETSYSTEMTIME, 0, (LPARAM)&st2);
	st1.wHour			= st2.wHour;
	st1.wMilliseconds	= st2.wMilliseconds;
	st1.wMinute			= st2.wMinute;
	st1.wSecond			= st2.wSecond;
	st1.wDayOfWeek		= 0;
	SystemTimeToFileTime(&st1, &ft);		//modified
	LocalFileTimeToFileTime(&ft, &ftm);

	// access time
	SendDlgItemMessage(hwndDlg, IDC_DATETIMEPICKER5, DTM_GETSYSTEMTIME, 0, (LPARAM)&st1);
	SendDlgItemMessage(hwndDlg, IDC_DATETIMEPICKER6, DTM_GETSYSTEMTIME, 0, (LPARAM)&st2);
	st1.wHour			= st2.wHour;
	st1.wMilliseconds	= st2.wMilliseconds;
	st1.wMinute			= st2.wMinute;
	st1.wSecond			= st2.wSecond;
	st1.wDayOfWeek		= 0;
	SystemTimeToFileTime(&st1, &ft);		//accessed
	LocalFileTimeToFileTime(&ft, &fta);

	//Finally set the file time
	hFile = HexView_GetFileHandle(hwndHV);

	return SetFileTime(hFile, &ftc, &fta, &ftm);
}

BOOL ShowProperties(HWND hwndDlg, HWND hwndHV)
{
	UINT64 nFileSize;
	TCHAR  buf[60];
	DWORD  dwAttr;
	HANDLE hFile;

	TCHAR  szFilePath[MAX_PATH], *name;
	SHFILEINFO shfi = { 0 };

	HexView_GetFileSize(hwndHV, &nFileSize);

	HexView_GetFileName(hwndHV, szFilePath, MAX_PATH);
	name = _tcsrchr(szFilePath, '\\') + 1;

	SHGetFileInfo(szFilePath, 0, &shfi, sizeof(shfi), SHGFI_ICON);

	SendDlgItemMessage(hwndDlg, IDC_FILEICON, STM_SETIMAGE, IMAGE_ICON, (LPARAM)shfi.hIcon);
	//
	//	File name/path
	//
	SetDlgItemText(hwndDlg, IDC_FILENAME, name);
	SetDlgItemText(hwndDlg, IDC_FILEPATH, szFilePath);

	//
	//	File size
	//
	if(nFileSize < 1024)
		wsprintf(buf, TEXT("%I64u bytes (%I64u bytes)"), nFileSize, nFileSize);
	else if(nFileSize >= 1024 && nFileSize < 1024*1024)
		wsprintf(buf, TEXT("%I64u KB (%I64u bytes)"), (nFileSize + 1024) / 1024, nFileSize);
	else
		wsprintf(buf, TEXT("%I64u MB (%I64u bytes)"), (nFileSize + 1024*1024) / (1024*1024), nFileSize);

	SetDlgItemText(hwndDlg, IDC_FILESIZE, buf);

	//
	//	File attributes
	//
	dwAttr = GetFileAttributes(szFilePath);

	CheckDlgButton(hwndDlg, IDC_ATTR_A, dwAttr & FILE_ATTRIBUTE_ARCHIVE);
	CheckDlgButton(hwndDlg, IDC_ATTR_R, dwAttr & FILE_ATTRIBUTE_READONLY);
	CheckDlgButton(hwndDlg, IDC_ATTR_S, dwAttr & FILE_ATTRIBUTE_SYSTEM);
	CheckDlgButton(hwndDlg, IDC_ATTR_H, dwAttr & FILE_ATTRIBUTE_HIDDEN);

	//
	//	File timestamps
	//
	hFile = HexView_GetFileHandle(hwndHV);

	if(hFile && hFile != INVALID_HANDLE_VALUE)
	{
		UpdateFileTime(hwndDlg, hFile);
		//CloseHandle(hFile);
	}

	return TRUE;
}

BOOL ApplyFileAttr(HWND hwndDlg, HWND hwndHV)
{
	TCHAR szFilePath[MAX_PATH];
	DWORD dwAttr;
	DWORD dwAttrNew = 0;

	HexView_GetFileName(hwndHV, szFilePath, MAX_PATH);

	// get the file's current attributes
	dwAttr = GetFileAttributes(szFilePath);

	// clear the R/A/S/H bits
	dwAttr &= ~ (FILE_ATTRIBUTE_READONLY | FILE_ATTRIBUTE_HIDDEN |
				 FILE_ATTRIBUTE_SYSTEM |  FILE_ATTRIBUTE_ARCHIVE );

	// now reset them based on what the tick-boxes are set to
	if(IsDlgButtonChecked(hwndDlg, IDC_ATTR_R))
		dwAttr |= FILE_ATTRIBUTE_READONLY;

	if(IsDlgButtonChecked(hwndDlg, IDC_ATTR_H))
		dwAttr |= FILE_ATTRIBUTE_HIDDEN;

	if(IsDlgButtonChecked(hwndDlg, IDC_ATTR_A))
		dwAttr |= FILE_ATTRIBUTE_ARCHIVE;

	if(IsDlgButtonChecked(hwndDlg, IDC_ATTR_S))
		dwAttr |= FILE_ATTRIBUTE_SYSTEM;

	return SetFileAttributes(szFilePath, dwAttr);
}

INT_PTR CALLBACK FilePropertiesDlgProc(HWND hwnd, UINT iMsg, WPARAM wParam, LPARAM lParam)
{
	FILETIME   ft;
	FILETIME   lt;
	SYSTEMTIME st;
	NMHDR	 * nmhdr;

	HWND hwndHexView;
	HWND hwndMain;

	static BOOL fTimeChanged = FALSE;
	static BOOL fAttrChanged = FALSE;

	switch(iMsg)
	{
	case WM_INITDIALOG:

		hwndMain = GetParent(GetParent(hwnd));
		hwndHexView = GetActiveHexView(hwndMain);

		CenterRelative(GetParent(hwnd), hwndMain, NULL);

		MakeStaticSplitter(GetDlgItem(hwnd, IDC_LINE1));
		MakeStaticSplitter(GetDlgItem(hwnd, IDC_LINE2));

		ShowProperties(hwnd, hwndHexView);

		fTimeChanged = FALSE;
		fAttrChanged = FALSE;
		return TRUE;

	case WM_COMMAND:

		switch(LOWORD(wParam))
		{
		// if one of the file-attributes is toggled then enable the APPLY button
		case IDC_ATTR_R: case IDC_ATTR_H: case IDC_ATTR_A: case IDC_ATTR_S:
			PostMessage(GetParent(hwnd), PSM_CHANGED, (WPARAM)hwnd, 0);
			fAttrChanged = TRUE;
			return 0;

		// 'Touch' button - update the date-time pickers but
		// don't modify the file's timestamps
		case IDC_PROPERTY_TOUCH:

			GetSystemTimeAsFileTime(&ft);
			FileTimeToLocalFileTime(&ft, &lt);
			FileTimeToSystemTime(&lt, &st);

			SendDlgItemMessage(hwnd, IDC_DATETIMEPICKER3, DTM_SETSYSTEMTIME, GDT_VALID, (LPARAM)&st);
			SendDlgItemMessage(hwnd, IDC_DATETIMEPICKER4, DTM_SETSYSTEMTIME, GDT_VALID, (LPARAM)&st);
			SendDlgItemMessage(hwnd, IDC_DATETIMEPICKER5, DTM_SETSYSTEMTIME, GDT_VALID, (LPARAM)&st);
			SendDlgItemMessage(hwnd, IDC_DATETIMEPICKER6, DTM_SETSYSTEMTIME, GDT_VALID, (LPARAM)&st);

			PostMessage(GetParent(hwnd), PSM_CHANGED, (WPARAM)hwnd, 0);
			fTimeChanged = TRUE;
			return FALSE;

		}

		return FALSE;

	case WM_NOTIFY:
		nmhdr = (NMHDR *)lParam;
		if(nmhdr->code == DTN_DATETIMECHANGE)
		{
			fTimeChanged = TRUE;
			PostMessage(GetParent(hwnd), PSM_CHANGED, (WPARAM)hwnd, 0);
		}
		else if(nmhdr->code == PSN_APPLY)
		{
			hwndMain = GetParent(GetParent(hwnd));
			hwndHexView = GetActiveHexView(hwndMain);

			// Apply button - if there are any changes then ask the user!
			if(fTimeChanged || fAttrChanged)
			{
				TCHAR szFilePath[MAX_PATH];
				HexView_GetFileName(hwndHexView, szFilePath, MAX_PATH);
				//if(IDYES != HexErrorBoxIdExt(MB_ICONEXCLAMATION | MB_YESNO, IDS_MSG_QUERYMODTS) ))
				//	return TRUE;
				//if(MessageBox(hwnd, L"Change file?", L"HexEdit", MB_YESNO|MB_ICONEXCLAMATION) != IDYES)
				//	return TRUE;

				if(fTimeChanged)
				{
					if(ApplyFileTime(hwnd, hwndHexView))
					{
						fTimeChanged = FALSE;
						UpdateFileTime(hwnd, hwndHexView);
					}
					else
					{
						HexWinErrorBox(GetLastError(), TEXT("%s\r\n\r\nYou do not have permission to modify this file,\r\n")
													   TEXT("or the file may already be in use by another application."),
													   szFilePath);
						return TRUE;
					}
				}

				if(fAttrChanged)
				{
					fAttrChanged = FALSE;
					if(!ApplyFileAttr(hwnd, hwndHexView))
					{
						HexWinErrorBox(GetLastError(), TEXT("%s\r\n\r\nYou do not have permission to modify this file,\r\n")
													   TEXT("or the file may already be in use by another application."),
													   szFilePath);
						return TRUE;
					}
				}
			}

		}

		return TRUE;

	case WM_HELP:
		return HandleContextHelp(hwnd, lParam, IDD_PROPERTIES);

	}

	return FALSE;
}

BOOL FileProperties(HWND hwndMain)
{
	PROPSHEETHEADER psh = { sizeof(psh) };
	PROPSHEETPAGE psp[1] = { { sizeof(psp[0]) } };

	//ZeroMemory(&pspage, nNumPropSheetPages * sizeof(PROPSHEETPAGE));

	psp[0].dwSize			= sizeof(PROPSHEETPAGE);
	psp[0].dwFlags			= PSP_USETITLE;
	psp[0].hInstance		= GetModuleHandle(0);
	psp[0].pszTemplate		= MAKEINTRESOURCE(IDD_PROPERTIES);
	psp[0].pszIcon			= 0;
	psp[0].pfnDlgProc		= FilePropertiesDlgProc;
	psp[0].lParam			= 0;
	psp[0].pfnCallback		= 0;
	psp[0].pszTitle			= TEXT("General");

	psh.dwFlags			= PSH_PROPSHEETPAGE;	//set so can use array of propsheetpages
	psh.hwndParent		= hwndMain;
	psh.hInstance		= GetModuleHandle(0);
	psh.pszCaption		= TEXT("Properties");
	psh.nPages			= 1;
	psh.ppsp			= psp;
	psh.pfnCallback		= 0;

	return (BOOL)PropertySheet(&psh);
}


text:
#pragma once

#include <ctime>

#include "ts/ink_platform.h"
#include "ts/Arena.h"

namespace LogUtils
{
enum AlarmType {
  LOG_ALARM_ERROR = 0,
  LOG_ALARM_WARNING,
  LOG_ALARM_N_TYPES,
};

static inline long
timestamp()
{
  return (long)time(nullptr);
}

int timestamp_to_str(long timestamp, char *buf, int size);
char *timestamp_to_netscape_str(long timestamp);
char *timestamp_to_date_str(long timestamp);
char *timestamp_to_time_str(long timestamp);
unsigned ip_from_host(char *host);
void manager_alarm(AlarmType alarm_type, const char *msg, ...) TS_PRINTFLIKE(2, 3);
void strip_trailing_newline(char *buf);
char *escapify_url(Arena *arena, char *url, size_t len_in, int *len_out, char *dst = nullptr, size_t dst_size = 0,
                   const unsigned char *map = nullptr);
char *pure_escapify_url(Arena *arena, char *url, size_t len_in, int *len_out, char *dst = nullptr, size_t dst_size = 0,
                        const unsigned char *map = nullptr);
char *int64_to_str(char *buf, unsigned int buf_size, int64_t val, unsigned int *total_chars, unsigned int req_width = 0,
                   char pad_char = '0');
void remove_content_type_attributes(char *type_str, int *type_len);
int timestamp_to_hex_str(unsigned timestamp, char *str, size_t len, size_t *n_chars = nullptr);
int seconds_to_next_roll(time_t time_now, int rolling_offset, int rolling_interval);
int file_is_writeable(const char *full_filename, off_t *size_bytes = nullptr, bool *has_size_limit = nullptr,
                      uint64_t *current_size_limit_bytes = nullptr);
}; // namespace LogUtils


text:
package org.mobilitydata.gtfsvalidator.validator;

import javax.inject.Inject;
import org.mobilitydata.gtfsvalidator.annotation.GtfsValidator;
import org.mobilitydata.gtfsvalidator.notice.NoticeContainer;
import org.mobilitydata.gtfsvalidator.notice.SeverityLevel;
import org.mobilitydata.gtfsvalidator.notice.ValidationNotice;
import org.mobilitydata.gtfsvalidator.table.GtfsStopTime;
import org.mobilitydata.gtfsvalidator.table.GtfsStopTimeTableContainer;
import org.mobilitydata.gtfsvalidator.table.GtfsStopTimeTimepoint;

/**
 * Validates timepoints from GTFS file "stop_times.txt" have time fields.
 *
 *
Generated notices:
 *
 *

 *
{@link StopTimeTimepointWithoutTimesNotice} - a timepoint does not specifies arrival_time
 *       or departure_time
 *
{@link MissingTimepointValueNotice} - value for {@code stop_times.timepoint} is missing
 *
{@link MissingTimepointColumnNotice} - field {@code stop_times.timepoint} is missing
 *

 */
@GtfsValidator
public class TimepointTimeValidator extends FileValidator {
  private final GtfsStopTimeTableContainer stopTimes;

  @Inject
  TimepointTimeValidator(GtfsStopTimeTableContainer stopTimes) {
    this.stopTimes = stopTimes;
  }

  @Override
  public void validate(NoticeContainer noticeContainer) {
    if (!stopTimes.hasColumn(GtfsStopTime.TIMEPOINT_FIELD_NAME)) {
      // legacy datasets do not use timepoint column in stop_times.txt as a result:
      // - this should be flagged;
      // - but also no notice regarding the absence of arrival_time or departure_time should be
      // generated
      noticeContainer.addValidationNotice(new MissingTimepointColumnNotice());
      return;
    }
    for (GtfsStopTime stopTime : stopTimes.getEntities()) {
      if (!stopTime.hasTimepoint()) {
        noticeContainer.addValidationNotice(new MissingTimepointValueNotice(stopTime));
      }
      if (isTimepoint(stopTime)) {
        if (!stopTime.hasArrivalTime()) {
          noticeContainer.addValidationNotice(
              new StopTimeTimepointWithoutTimesNotice(
                  stopTime, GtfsStopTime.ARRIVAL_TIME_FIELD_NAME));
        }
        if (!stopTime.hasDepartureTime()) {
          noticeContainer.addValidationNotice(
              new StopTimeTimepointWithoutTimesNotice(
                  stopTime, GtfsStopTime.DEPARTURE_TIME_FIELD_NAME));
        }
      }
    }
  }

  private boolean isTimepoint(GtfsStopTime stopTime) {
    return stopTime.hasTimepoint() && stopTime.timepoint().equals(GtfsStopTimeTimepoint.EXACT);
  }

  /**
   * Timepoint without time
   *
   *
Severity: {@code SeverityLevel.ERROR}
   */
  static class StopTimeTimepointWithoutTimesNotice extends ValidationNotice {
    private final int csvRowNumber;
    private final String tripId;
    private final long stopSequence;
    private final String specifiedField;

    StopTimeTimepointWithoutTimesNotice(GtfsStopTime stopTime, String specifiedField) {
      super(SeverityLevel.ERROR);
      this.csvRowNumber = stopTime.csvRowNumber();
      this.tripId = stopTime.tripId();
      this.stopSequence = stopTime.stopSequence();
      this.specifiedField = specifiedField;
    }
  }

  /**
   * {@code stop_times.timepoint} value is missing
   *
   *
Severity: {@code SeverityLevel.WARNING}
   */
  static class MissingTimepointValueNotice extends ValidationNotice {
    private final int csvRowNumber;
    private final String tripId;
    private final long stopSequence;

    MissingTimepointValueNotice(GtfsStopTime stopTime) {
      super(SeverityLevel.WARNING);
      this.csvRowNumber = stopTime.csvRowNumber();
      this.tripId = stopTime.tripId();
      this.stopSequence = stopTime.stopSequence();
    }
  }

  /**
   * Column {@code stop_times.timepoint} is missing.
   *
   *
Severity: {@code SeverityLevel.WARNING}
   */
  static class MissingTimepointColumnNotice extends ValidationNotice {
    private final String filename;

    MissingTimepointColumnNotice() {
      super(SeverityLevel.WARNING);
      this.filename = GtfsStopTime.FILENAME;
    }
  }
}


text:
 **Calm Animals**

**School** enchantment (compulsion) [mind-affecting]; **Level** druid 1, ranger 1

**Casting Time** 1 standard action

**Components** V, S

**Range** close (25 ft. + 5 ft./2 levels)

**Targets** animals within 30 ft. of each other

**Duration** 1 min./level

**Saving Throw** [Will](../combat#_will) negates; **[Spell Resistance](../glossary#_spell-resistance)** yes

This spell soothes and quiets animals, rendering them docile and harmless. Only ordinary animals (those with [Intelligence](../gettingStarted#_intelligence) scores of 1 or 2) can be affected by this spell. All the subjects must be of the same kind, and no two may be more than 30 feet apart. The maximum number of HD of animals you can affect is equal to 2d4 + caster level.

The affected creatures remain where they are and do not attack or flee. They are not [helpless](../glossary#_helpless) and defend themselves normally if attacked. Any threat breaks the spell on the threatened creatures.


text:
var safe = { w: "majority", wtimeout: 10000 };

module.exports = {
	created_time: { type: Date, default: Date.now },
	email: { type: String },
	first_name: { type: String },
	last_name: { type: String },
	id: { type: String },
	updated_time: { type: Date, default: Date.now },
	username: { type: String, required: true },
	password: { type: String, required: true },
	admin: { type: Boolean, default: false}
}, { safe: safe };


text:
<template name="postItem">

        {{title}}{{domain}}

        {{pluralize votes "Vote"}},
        submitted by {{author}},
        {{pluralize commentsCount "comment"}}
        {{#if ownPost}}Edit{{/if}}

    Discuss

</template>


text:
package org.nd4j.linalg.function;

/**
 * A boolean valued function of a single input argument
 *
 * @param <T> Type of the input
 */
public interface Predicate<T> {

    /**
     * Returns the result of the predicate on the given input
     *
     * @param t Input
     * @return Result
     */
    boolean test(T t);

}


text:
package io.realm.internal;

import android.test.MoreAsserts;

import junit.framework.TestCase;

import java.util.Date;

import io.realm.RealmFieldType;
import io.realm.Sort;
import io.realm.TestHelper;

@SuppressWarnings("deprecation")
public class JNIViewTest extends TestCase {
    Table t;
    Date date1 = new Date(2010-1900,  1,  5);
    Date date2 = new Date(1999-1900, 12,  1);
    Date date3 = new Date(1990-1900, 12, 24);
    Date date4 = new Date(2010-1900,  1,  4);

    @Override
    public void setUp() {
        //Specify table
        t = new Table();
        t.addColumn(RealmFieldType.STRING, "Name");
        t.addColumn(RealmFieldType.BOOLEAN,   "Study");
        t.addColumn(RealmFieldType.INTEGER,    "Age");
        t.addColumn(RealmFieldType.DATE,   "Birthday");

        // Add unsupported column types
        t.addColumn(RealmFieldType.UNSUPPORTED_MIXED,  "Unsupported3");
        t.addColumn(RealmFieldType.UNSUPPORTED_TABLE,  "Unsupported4");

        //Add data
        t.add("cc", true,  24, date1, 0, null);
        t.add("dd", false, 35, date2, 0, null);
        t.add("bb", true,  22, date3, 0, null);
        t.add("aa", false, 22, date4, 0, null);

        assertEquals(date1, t.getDate(3, 0));
        assertEquals(date2, t.getDate(3, 1));
        assertEquals(date3, t.getDate(3, 2));
        assertEquals(date4, t.getDate(3, 3));
    }

    public void testUnimplementedMethodsShouldFail() {
        //Get a view containing all rows in table since you can only sort views currently.
        TableView view = t.where().findAll();

        try { view.upperBoundLong(0, 0); fail("Not implemented yet"); } catch (RuntimeException e ) { }
        try { view.lowerBoundLong(0, 0); fail("Not implemented yet"); } catch (RuntimeException e ) { }
      //  try { view.lookup("Some String"); fail("Not implemented yet"); } catch (RuntimeException e ) { }
        try { view.count(0, "Some String"); fail("Not implemented yet"); } catch (RuntimeException e ) { }
    }

    public void testShouldSortViewDate() {
        //Get a view containing all rows in table since you can only sort views currently.
        TableView view = t.where().findAll();

        //Sort without specifying the order, should default to ascending.
        view.sort(3);
        assertEquals(date3, view.getDate(3, 0));
        assertEquals(date2, view.getDate(3, 1));
        assertEquals(date4, view.getDate(3, 2));
        assertEquals(date1, view.getDate(3, 3));
        assertEquals("cc", view.getString(0, 3));
    }

    public void testShouldSortViewIntegers() {
        //Get a view containing all rows in table since you can only sort views currently.
        TableView view = t.where().findAll();

        //Sort without specifying the order, should default to ascending.
        view.sort(2);
        assertEquals(22, view.getLong(2, 0));
        assertEquals(22, view.getLong(2, 1));
        assertEquals(24, view.getLong(2, 2));
        assertEquals(35, view.getLong(2, 3));
        assertEquals("dd", view.getString(0, 3));

        //Sort descending - creating a new view
        view.sort(2, Sort.DESCENDING);
        assertEquals(35, view.getLong(2, 0));
        assertEquals(24, view.getLong(2, 1));
        assertEquals(22, view.getLong(2, 2));
        assertEquals(22, view.getLong(2, 3));
        assertEquals("dd", view.getString(0, 0));

        //Sort ascending.
        TableView view2 = t.where().findAll();
        view2.sort(2, Sort.ASCENDING);
        assertEquals(22, view2.getLong(2, 0));
        assertEquals(22, view2.getLong(2, 1));
        assertEquals(24, view2.getLong(2, 2));
        assertEquals(35, view2.getLong(2, 3));
        assertEquals("dd", view2.getString(0, 3));

        // Check that old view is still the same
        assertEquals(35, view.getLong(2, 0));
        assertEquals(24, view.getLong(2, 1));
        assertEquals(22, view.getLong(2, 2));
        assertEquals(22, view.getLong(2, 3));
        assertEquals("dd", view.getString(0, 0));
    }

    public void testSetBinary() {

        Table table = new Table();
        table.addColumn(RealmFieldType.BINARY, "binary");

        byte[] arr1 = new byte[] {1,2,3};
        table.add(new Object[]{arr1});
        MoreAsserts.assertEquals(arr1, table.getBinaryByteArray(0, 0));

        TableView view = table.where().findAll();

        byte[] arr2 = new byte[] {1,2,3, 4, 5};

        view.setBinaryByteArray(0, 0, arr2);

        MoreAsserts.assertEquals(arr2, view.getBinaryByteArray(0, 0));
    }

    public void testSubtable() {
        Table persons = new Table();
        persons.addColumn(RealmFieldType.STRING, "name");
        persons.addColumn(RealmFieldType.STRING, "email");
        persons.addColumn(RealmFieldType.UNSUPPORTED_TABLE, "addresses");

        TableSchema addresses = persons.getSubtableSchema(2);
        addresses.addColumn(RealmFieldType.STRING, "street");
        addresses.addColumn(RealmFieldType.INTEGER, "zipcode");
        addresses.addColumn(RealmFieldType.UNSUPPORTED_TABLE, "phone_numbers");

        TableSchema phone_numbers = addresses.getSubtableSchema(2);
        phone_numbers.addColumn(RealmFieldType.INTEGER, "number");

        // Inserting data
        persons.add("Mr X", "xx@xxxx.com",
                new Object[][] { { "X Street", 1234, new Object[][] {{ 12345678 }} },
                                 { "Y Street", 1234, new Object[][] {{ 12345678 }} }
                               });

        TableView personsView = persons.where().findAll();

        assertEquals(2, personsView.getSubtableSize(2, 0));

        Table address = personsView.getSubtable(2, 0);
        assertEquals(2, address.size());
        assertEquals(3, address.getColumnCount());

        personsView.clearSubtable(2, 0);
        assertEquals(0, personsView.getSubtableSize(2, 0));
    }

    public void testSortOnNonexistingColumn() {
        TableView view = t.where().findAll();

        try { view.sort(-1); fail("Column is less than 0"); } catch (ArrayIndexOutOfBoundsException e) { }
        try { view.sort(-100); fail("Column is less than 0"); } catch (ArrayIndexOutOfBoundsException e) { }
        try { view.sort(100); fail("Column is 100, column does not exist"); } catch (ArrayIndexOutOfBoundsException e) { }
    }

    public void testFindFirstNonExisting() {
        Table tt = TestHelper.getTableWithAllColumnTypes();
        tt.add(new byte[]{1,2,3}, true, new Date(1384423149761l), 4.5d, 5.7f, 100, new Mixed("mixed"), "string", null);
        TableView v = tt.where().findAll();

        assertEquals(-1, v.findFirstBoolean(1, false));
        assertEquals(-1, v.findFirstDate(2, new Date(138442314986l)));
        assertEquals(-1, v.findFirstDouble(3, 1.0d));
        assertEquals(-1, v.findFirstFloat(4, 1.0f));
        assertEquals(-1, v.findFirstLong(5, 50));
        assertEquals(-1, v.findFirstString(7, "other string"));
    }

    public void testGetValuesFromNonExistingColumn() {
        Table table = TestHelper.getTableWithAllColumnTypes();
        TableView view = table.where().findAll();

        try { view.getBinaryByteArray(-1, 0);   fail("Column is less than 0"); } catch (ArrayIndexOutOfBoundsException e) { }
        try { view.getBinaryByteArray(-10, 0);  fail("Column is less than 0"); } catch (ArrayIndexOutOfBoundsException e) { }
        try { view.getBinaryByteArray(100, 0);  fail("Column does not exist"); } catch (ArrayIndexOutOfBoundsException e) { }

        try { view.getBoolean(-1, 0);           fail("Column is less than 0"); } catch (ArrayIndexOutOfBoundsException e) { }
        try { view.getBoolean(-10, 0);          fail("Column is less than 0"); } catch (ArrayIndexOutOfBoundsException e) { }
        try { view.getBoolean(100, 0);          fail("Column does not exist"); } catch (ArrayIndexOutOfBoundsException e) { }

        try { view.getDate(-1, 0);              fail("Column is less than 0"); } catch (ArrayIndexOutOfBoundsException e) { }
        try { view.getDate(-10, 0);             fail("Column is less than 0"); } catch (ArrayIndexOutOfBoundsException e) { }
        try { view.getDate(100, 0);             fail("Column does not exist"); } catch (ArrayIndexOutOfBoundsException e) { }

        try { view.getDouble(-1, 0);            fail("Column is less than 0"); } catch (ArrayIndexOutOfBoundsException e) { }
        try { view.getDouble(-10, 0);           fail("Column is less than 0"); } catch (ArrayIndexOutOfBoundsException e) { }
        try { view.getDouble(100, 0);           fail("Column does not exist"); } catch (ArrayIndexOutOfBoundsException e) { }

        try { view.getFloat(-1, 0);             fail("Column is less than 0"); } catch (ArrayIndexOutOfBoundsException e) { }
        try { view.getFloat(-10, 0);            fail("Column is less than 0"); } catch (ArrayIndexOutOfBoundsException e) { }
        try { view.getFloat(100, 0);            fail("Column does not exist"); } catch (ArrayIndexOutOfBoundsException e) { }

        try { view.getLong(-1, 0);              fail("Column is less than 0"); } catch (ArrayIndexOutOfBoundsException e) { }
        try { view.getLong(-10, 0);             fail("Column is less than 0"); } catch (ArrayIndexOutOfBoundsException e) { }
        try { view.getLong(100, 0);             fail("Column does not exist"); } catch (ArrayIndexOutOfBoundsException e) { }

        try { view.getMixed(-1, 0);             fail("Column is less than 0"); } catch (ArrayIndexOutOfBoundsException e) { }
        try { view.getMixed(-10, 0);            fail("Column is less than 0"); } catch (ArrayIndexOutOfBoundsException e) { }
        try { view.getMixed(100, 0);            fail("Column does not exist"); } catch (ArrayIndexOutOfBoundsException e) { }

        try { view.getString(-1, 0);            fail("Column is less than 0"); } catch (ArrayIndexOutOfBoundsException e) { }
        try { view.getString(-10, 0);           fail("Column is less than 0"); } catch (ArrayIndexOutOfBoundsException e) { }
        try { view.getString(100, 0);           fail("Column does not exist"); } catch (ArrayIndexOutOfBoundsException e) { }

        try { view.getSubtable(-1, 0);          fail("Column is less than 0"); } catch (ArrayIndexOutOfBoundsException e) { }
        try { view.getSubtable(-10, 0);         fail("Column is less than 0"); } catch (ArrayIndexOutOfBoundsException e) { }
        try { view.getSubtable(100, 0);         fail("Column does not exist"); } catch (ArrayIndexOutOfBoundsException e) { }
    }

    public void testGetSourceRow() {
        Table t = new Table();
        t.addColumn(RealmFieldType.STRING, "");
        t.addColumn(RealmFieldType.INTEGER, "");
        t.addColumn(RealmFieldType.BOOLEAN, "");

        t.add("1", 1, true);
        t.add("2", 2, true);
        t.add("3", 3, false);
        t.add("4", 5, false);

        TableView v = t.where().equalTo(new long[]{2}, false).findAll();

        assertEquals(2, v.getSourceRowIndex(0));
        assertEquals(3, v.getSourceRowIndex(1));

        // Out of bound
        try { assertEquals(0, v.getSourceRowIndex(2));      fail("index ot of bounds"); } catch (IndexOutOfBoundsException e) { }
        try { assertEquals(0, v.getSourceRowIndex(100));    fail("index ot of bounds"); } catch (IndexOutOfBoundsException e) { }
        try { assertEquals(0, v.getSourceRowIndex(-1));     fail("index ot of bounds"); } catch (IndexOutOfBoundsException e) { }
        try { assertEquals(0, v.getSourceRowIndex(-100));   fail("index ot of bounds"); } catch (IndexOutOfBoundsException e) { }
    }

    public void testGetSourceRowNoRows() {
        Table t = new Table();
        t.addColumn(RealmFieldType.STRING, "");
        t.addColumn(RealmFieldType.INTEGER, "");
        t.addColumn(RealmFieldType.BOOLEAN, "");
        // No data is added
        TableView v = t.where().findAll();

        // Out of bound
        try { assertEquals(0, v.getSourceRowIndex(0));      fail("index ot of bounds"); } catch (IndexOutOfBoundsException e) { }
        try { assertEquals(0, v.getSourceRowIndex(1));      fail("index ot of bounds"); } catch (IndexOutOfBoundsException e) { }
    }

    public void testGetSourceRowEmptyTable() {
        Table t = new Table();
        // No columns
        TableView v = t.where().findAll();

        // Out of bound
        try { assertEquals(0, v.getSourceRowIndex(0));      fail("index ot of bounds"); } catch (IndexOutOfBoundsException e) { }
        try { assertEquals(0, v.getSourceRowIndex(1));      fail("index ot of bounds"); } catch (IndexOutOfBoundsException e) { }
    }

    public void testShouldSortViewBool() {
        //Get a view containing all rows in table since you can only sort views currently.
        TableView view = t.where().findAll();

        //Sort without specifying the order, should default to ascending.
        view.sort(1);
        assertEquals(false, view.getBoolean(1, 0));
        assertEquals(false, view.getBoolean(1, 1));
        assertEquals(true, view.getBoolean(1, 2));
        assertEquals(true, view.getBoolean(1, 3));
        assertEquals("bb", view.getString(0, 3));
    }

    public void testShouldThrowExceptionForUnsupportedColumns() {
        TableView view = t.where().findAll();
        long colIndex;
        for (colIndex = 4; colIndex <= 5; colIndex++) {
            try {
                view.sort(colIndex); // Must throw for invalid column types
                fail("expected exception.");
            } catch (IllegalArgumentException e) {
            }
        }
    }

    public void testShouldSearchByColumnValue() {
        Table table = new Table();
        table.addColumn(RealmFieldType.STRING, "name");

        table.add("Foo");
        table.add("Bar");

        TableQuery query = table.where();
        TableView view = query.findAll(0, table.size(), Integer.MAX_VALUE);
        assertEquals(2, view.size());

        view.findAllString(0, "Foo");
    }

    public void testShouldQueryInView() {
        Table table = new Table();
        table.addColumn(RealmFieldType.STRING, "name");

        table.add("A1");
        table.add("B");
        table.add("A2");
        table.add("B");
        table.add("A3");
        table.add("B");
        table.add("A3");

        TableQuery query = table.where();
        TableView view = query.beginsWith(new long[]{0}, "A").findAll(0, table.size(), Table.INFINITE);
        assertEquals(4, view.size());

        TableQuery query2 = table.where();
        TableView view2 = query2.tableview(view).contains(new long[]{0}, "3").findAll();
        assertEquals(2, view2.size());
    }

    public void testGetNonExistingColumn() {
        Table t = new Table();
        t.addColumn(RealmFieldType.INTEGER, "int");
        TableView view = t.where().findAll();
        assertEquals(-1, view.getColumnIndex("non-existing column"));
    }

    public void testGetNullColumn() {
        Table t = new Table();
        t.addColumn(RealmFieldType.INTEGER, "");
        TableView view = t.where().findAll();
        try { view.getColumnIndex(null); fail("Getting null column"); } catch(IllegalArgumentException e) { }
    }

    public void testViewToString() {
        Table t = new Table();
        t.addColumn(RealmFieldType.STRING, "stringCol");
        t.addColumn(RealmFieldType.INTEGER, "intCol");
        t.addColumn(RealmFieldType.BOOLEAN, "boolCol");

        t.add("s1", 1, true);
        t.add("s2", 2, false);

        TableView view = t.where().findAll();

        String expected =
                "    stringCol  intCol  boolCol\n" +
                        "0:  s1              1     true\n" +
                        "1:  s2              2    false\n" ;

        assertEquals(expected, view.toString());
    }

    void accessingViewOk(TableView view)
    {
        view.size();
        view.isEmpty();
        view.getLong(0, 0);
        view.getColumnCount();
        view.getColumnName(0);
        view.getColumnIndex("");
        view.getColumnType(0);
        view.averageLong(0);
        view.maximumLong(0);
        view.minimumLong(0);
        view.sumLong(0);
        view.findAllLong(0, 2);
        view.findFirstLong(0, 2);
        view.where();
        view.toJson();
        view.toString();
    }

    void accessingViewMustThrow(TableView view)
    {
        try { view.size();              assert(false); } catch (IllegalStateException e) {}
        try { view.isEmpty();           assert(false); } catch (IllegalStateException e) {}
        try { view.getLong(0,0);        assert(false); } catch (IllegalStateException e) {}
        try { view.getColumnCount();    assert(false); } catch (IllegalStateException e) {}
        try { view.getColumnName(0);    assert(false); } catch (IllegalStateException e) {}
        try { view.getColumnIndex("");  assert(false); } catch (IllegalStateException e) {}
        try { view.getColumnType(0);    assert(false); } catch (IllegalStateException e) {}
        try { view.averageLong(0);      assert(false); } catch (IllegalStateException e) {}
        try { view.maximumLong(0);      assert(false); } catch (IllegalStateException e) {}
        try { view.minimumLong(0);      assert(false); } catch (IllegalStateException e) {}
        try { view.sumLong(0);          assert(false); } catch (IllegalStateException e) {}
        try { view.findAllLong(0, 2);   assert(false); } catch (IllegalStateException e) {}
        try { view.findFirstLong(0, 2); assert(false); } catch (IllegalStateException e) {}
        try { view.where();             assert(false); } catch (IllegalStateException e) {}
        try { view.toJson();            assert(false); } catch (IllegalStateException e) {}
        try { view.toString();          assert(false); } catch (IllegalStateException e) {}
    }

    public void testViewShouldInvalidate() {
        Table t = new Table();
        t.addColumn(RealmFieldType.INTEGER, "intCol");
        t.add(1);
        t.add(2);
        t.add(3);

        TableView view = t.where().equalTo(new long[]{0}, 2).findAll();
        // access view is ok.
        assertEquals(1, view.size());

        // access view after change in value is ok
        t.setLong(0, 0, 3);
        accessingViewOk(view);

        // access view after additions to table must fail
        t.add(4);
        accessingViewMustThrow(view);

        // recreate view to access again
        view = t.where().equalTo(new long[]{0}, 2).findAll();
        accessingViewOk(view);

        // Removing any row in Table should invalidate view
        t.remove(3);
        accessingViewMustThrow(view);
    }

    public void testMaximumDate() {

        Table table = new Table();
        table.addColumn(RealmFieldType.DATE, "date");

        table.add(new Date(0));
        table.add(new Date(10000));
        table.add(new Date(1000));

        TableView view = table.where().findAll();

        assertEquals(new Date(10000), view.maximumDate(0));

    }

    public void testMinimumDate() {

        Table table = new Table();
        table.addColumn(RealmFieldType.DATE, "date");

        table.add(new Date(10000));
        table.add(new Date(0));
        table.add(new Date(1000));

        TableView view = table.where().findAll();

        assertEquals(new Date(0), view.minimumDate(0));

    }
}


text:
package stroom.index.shared;

import stroom.entity.shared.ExpressionCriteria;
import stroom.util.shared.FetchWithIntegerId;
import stroom.util.shared.ResourcePaths;
import stroom.util.shared.RestResource;
import stroom.util.shared.ResultPage;

import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.fusesource.restygwt.client.DirectRestService;

import javax.ws.rs.Consumes;
import javax.ws.rs.DELETE;
import javax.ws.rs.GET;
import javax.ws.rs.POST;
import javax.ws.rs.PUT;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;

@Tag(name = "Index Volume Groups")
@Path("/index/volumeGroup" + ResourcePaths.V2)
@Produces(MediaType.APPLICATION_JSON)
@Consumes(MediaType.APPLICATION_JSON)
public interface IndexVolumeGroupResource extends RestResource, DirectRestService,
        FetchWithIntegerId<IndexVolumeGroup> {

    @POST
    @Path("find")
    @Operation(
            summary = "Finds index volume groups matching request",
            operationId = "findIndexVolumeGroups")
    ResultPage<IndexVolumeGroup> find(
            @Parameter(description = "request", required = true) ExpressionCriteria request);

    @POST
    @Operation(
            summary = "Creates an index volume group",
            operationId = "createIndexVolumeGroup")
    IndexVolumeGroup create(@Parameter(description = "name", required = true) String name);

    @GET
    @Path("/{id}")
    @Operation(
            summary = "Gets an index volume group",
            operationId = "fetchIndexVolumeGroup")
    IndexVolumeGroup fetch(@PathParam("id") Integer id);

    @GET
    @Path("/fetchByName/{name}")
    @Operation(
            summary = "Gets an index volume group by name",
            operationId = "fetchIndexVolumeGroupByName")
    IndexVolumeGroup fetchByName(@PathParam("name") String name);

    @PUT
    @Path("/{id}")
    @Operation(
            summary = "Updates an index volume group",
            operationId = "updateIndexVolumeGroup")
    IndexVolumeGroup update(@PathParam("id") Integer id, IndexVolumeGroup indexVolumeGroup);

    @DELETE
    @Path("/{id}")
    @Operation(
            summary = "Deletes an index volume group",
            operationId = "deleteIndexVolumeGroup")
    Boolean delete(@PathParam("id") Integer id);
}


text:
/**
 * index.js
 * Mike Erickson <codedungeon@gmail.com>
 * 2016.05.20 20:54 (mikee)
 * =============================================================================
 */

module.exports = function (params) {

	var utils = require('./src/cd-utils')(params || {});

	var module = {
		version: function () {
			return require('./package').version;
		},
		name: function () {
			return require('./package').name;
		},
		notifyOptions:  utils.notifyOptions,
		failMessage:    utils.failMessage,
		passMessage:    utils.passMessage,
		notifyPassed:   utils.notifyPassed,
		notifyFailed:   utils.notifyFailed,
		error:          utils.error,
		info:           utils.info,
		success:        utils.success,
		warning:        utils.warning,
		is:             utils.is,
		kindOf:         utils.kindOf,
		chalk:          utils.chalk,
		isWindows:      utils.isWindows,
		isOSX:          utils.isOSX,
		isLinux:        utils.isLinux,
		platform:       utils.platform,
		mergeTemplate:  utils.mergeTemplate,
		timestamp:      utils.timestamp,
		difference:     utils.difference,
		params:         utils.params,
		param:          utils.param,
		args:           utils.params,
		arg:            utils.param,
		padLeft:        utils.padLeft,
		padStart:       utils.padLeft,
		padCenter:      utils.padCenter,
		padRight:       utils.padRight,
		padEnd:         utils.padRight,
		readFile:       utils.readFile,
		removeDir:      utils.removeDir,
		removeFile:     utils.removeFile,
		createDir:      utils.createDir,
		mkdir:          utils.createDir,
		ellipsis:       utils.ellipsis,
		extend:         utils.extend,
		dates:          utils.dates,
		sprintf:        utils.sprintf,
		vsprintf:       utils.vsprintf,
		pluralize:      utils.pluralize,

	}

	return module;

}


text:
// Code generated by injection-gen. DO NOT EDIT.

package image

import (
	"context"

	v1alpha1 "github.com/knative/caching/pkg/client/informers/externalversions/caching/v1alpha1"
	factory "github.com/knative/caching/pkg/client/injection/informers/caching/factory"
	controller "github.com/knative/pkg/controller"
	injection "github.com/knative/pkg/injection"
	logging "github.com/knative/pkg/logging"
)

func init() {
	injection.Default.RegisterInformer(withInformer)
}

// Key is used for associating the Informer inside the context.Context.
type Key struct{}

func withInformer(ctx context.Context) (context.Context, controller.Informer) {
	f := factory.Get(ctx)
	inf := f.Caching().V1alpha1().Images()
	return context.WithValue(ctx, Key{}, inf), inf.Informer()
}

// Get extracts the typed informer from the context.
func Get(ctx context.Context) v1alpha1.ImageInformer {
	untyped := ctx.Value(Key{})
	if untyped == nil {
		logging.FromContext(ctx).Fatalf(
			"Unable to fetch %T from context.", (v1alpha1.ImageInformer)(nil))
	}
	return untyped.(v1alpha1.ImageInformer)
}


text:
function g = noiseGradX(noise, mu, varsigma, dmu, dvs, y);

% NOISEGRADX Returns the gradient of the log-likelihood wrt x.
%
%	Description:
%	g = noiseGradX(noise, mu, varsigma, dmu, dvs, y);
%

[dlnZ_dmu, dlnZ_dvs] = noiseGradVals(noise, mu, varsigma, y);
g = dlnZ_dmu*dmu' + dlnZ_dvs*dvs';


text:
This library provides easy access to the [Inbound Domains](https://developers.sparkpost.com/api/inbound-domains) Resource.

*Note: All methods return promises and accept an optional last argument callback. [Read about how we handle callbacks and promises](/docs/async.md).*

## Methods
* **list()**

  List an overview of all inbound domains in the account.
* **get(domain)**

  Get an inbound domain by its domain name
  * `domain` - the name of the domain you want to look up **required**
* **create(createOpts)**

  Create a new inbound domain
  * `createOpts` - a hash of [inbound domain attributes](https://developers.sparkpost.com/api/inbound-domains#header-inbound-domains-attributes) **required**
* **delete(domain)**

  Delete an existing inbound domain
  * `domain` - the name of the domain you want to delete **required**

## Examples

Visit our examples section to see all of [our inbound domains resource examples](/examples/inboundDomains).


text:
#ifndef BOOST_TT_IS_VIRTUAL_BASE_OF_HPP_INCLUDED
#define BOOST_TT_IS_VIRTUAL_BASE_OF_HPP_INCLUDED

#include <lslboost/type_traits/is_base_of.hpp>
#include <lslboost/type_traits/is_same.hpp>
#include <lslboost/mpl/and.hpp>
#include <lslboost/mpl/not.hpp>

// should be the last #include
#include <lslboost/type_traits/detail/bool_trait_def.hpp>

namespace lslboost {
namespace detail {

#ifdef BOOST_MSVC
#pragma warning( push )
#pragma warning( disable : 4584 4250)
#elif defined __GNUC__
#pragma GCC system_header
#endif

template<typename Base, typename Derived, typename tag>
struct is_virtual_base_of_impl
{
    BOOST_STATIC_CONSTANT(bool, value = false);
};

template<typename Base, typename Derived>
struct is_virtual_base_of_impl<Base, Derived, mpl::true_>
{
#ifdef __BORLANDC__
    struct lslboost_type_traits_internal_struct_X : public virtual Derived, public virtual Base
    {
       lslboost_type_traits_internal_struct_X();
       lslboost_type_traits_internal_struct_X(const lslboost_type_traits_internal_struct_X&);
       lslboost_type_traits_internal_struct_X& operator=(const lslboost_type_traits_internal_struct_X&);
       ~lslboost_type_traits_internal_struct_X()throw();
    };
    struct lslboost_type_traits_internal_struct_Y : public virtual Derived
    {
       lslboost_type_traits_internal_struct_Y();
       lslboost_type_traits_internal_struct_Y(const lslboost_type_traits_internal_struct_Y&);
       lslboost_type_traits_internal_struct_Y& operator=(const lslboost_type_traits_internal_struct_Y&);
       ~lslboost_type_traits_internal_struct_Y()throw();
    };
#else
    struct lslboost_type_traits_internal_struct_X : public Derived, virtual Base
    {
       lslboost_type_traits_internal_struct_X();
       lslboost_type_traits_internal_struct_X(const lslboost_type_traits_internal_struct_X&);
       lslboost_type_traits_internal_struct_X& operator=(const lslboost_type_traits_internal_struct_X&);
       ~lslboost_type_traits_internal_struct_X()throw();
    };
    struct lslboost_type_traits_internal_struct_Y : public Derived
    {
       lslboost_type_traits_internal_struct_Y();
       lslboost_type_traits_internal_struct_Y(const lslboost_type_traits_internal_struct_Y&);
       lslboost_type_traits_internal_struct_Y& operator=(const lslboost_type_traits_internal_struct_Y&);
       ~lslboost_type_traits_internal_struct_Y()throw();
    };
#endif
    BOOST_STATIC_CONSTANT(bool, value = (sizeof(lslboost_type_traits_internal_struct_X)==sizeof(lslboost_type_traits_internal_struct_Y)));
};

template<typename Base, typename Derived>
struct is_virtual_base_of_impl2
{
   typedef typename mpl::and_<is_base_of<Base, Derived>, mpl::not_<is_same<Base, Derived> > >::type tag_type;
   typedef is_virtual_base_of_impl<Base, Derived, tag_type> imp;
   BOOST_STATIC_CONSTANT(bool, value = imp::value);
};

#ifdef BOOST_MSVC
#pragma warning( pop )
#endif

} // namespace detail

BOOST_TT_AUX_BOOL_TRAIT_DEF2(
      is_virtual_base_of
       , Base
       , Derived
       , (::lslboost::detail::is_virtual_base_of_impl2<Base,Derived>::value)
)

#ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC2_2(typename Base,typename Derived,is_virtual_base_of,Base&,Derived,false)
BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC2_2(typename Base,typename Derived,is_virtual_base_of,Base,Derived&,false)
BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC2_2(typename Base,typename Derived,is_virtual_base_of,Base&,Derived&,false)
#endif

} // namespace lslboost

#include <lslboost/type_traits/detail/bool_trait_undef.hpp>

#endif


text:
export class profile
{

        public firstName: string;
        public lastName : string;
        public fileToUpload:any;

}


text:
__attribute__((visibility("hidden")))
@interface BRMetadataDetailControl : BRControl <BRMetadataContainer>
{
}

- (id)accessibilityLabel;
- (void)addDetails:(id)arg1 withLabel:(id)arg2;
- (void)layoutSubcontrols;
- (void)setMetadata:(id)arg1 withLabels:(id)arg2;
- (struct CGSize)sizeThatFits:(struct CGSize)arg1;

@end


text:
<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE chapter SYSTEM "chapter.dtd">

<chapter>

    <copyright>
      <year>2007</year>
      <year>2016</year>
      <holder>Ericsson AB, All Rights Reserved</holder>
    </copyright>
    <legalnotice>
  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.

  The Initial Developer of the Original Code is Ericsson AB.
    </legalnotice>

    <title>The Seven Myths of Erlang Performance</title>
    <prepared>Bjorn Gustavsson</prepared>
    <docno></docno>
    <date>2007-11-10</date>
    <rev></rev>
    <file>myths.xml</file>

  <marker id="myths"></marker>

Some truths seem to live on well beyond their best-before date,
  perhaps because "information" spreads faster from person-to-person
  than a single release note that says, for example, that body-recursive
  calls have become faster.

This section tries to kill the old truths (or semi-truths) that have
  become myths.

    <title>Myth: Tail-Recursive Functions are Much Faster
    Than Recursive Functions</title>

<marker id="tail_recursive"></marker>According to the myth,
    using a tail-recursive function that builds a list in reverse
    followed by a call to <c>lists:reverse/1</c> is faster than
    a body-recursive function that builds the list in correct order;
    the reason being that body-recursive functions use more memory than
    tail-recursive functions.

That was true to some extent before R12B. It was even more true
    before R7B. Today, not so much. A body-recursive function
    generally uses the same amount of memory as a tail-recursive
    function. It is generally not possible to predict whether the
    tail-recursive or the body-recursive version will be
    faster. Therefore, use the version that makes your code cleaner
    (hint: it is usually the body-recursive version).

For a more thorough discussion about tail and body recursion,
    see <url href="http://ferd.ca/erlang-s-tail-recursion-is-not-a-silver-bullet.html">Erlang's Tail Recursion is Not a Silver Bullet</url>.

    <note>
A tail-recursive function that does not need to reverse the
    list at the end is faster than a body-recursive function,
    as are tail-recursive functions that do not construct any terms at all
    (for example, a function that sums all integers in a list).
</note>

    <title>Myth: Operator "++" is Always Bad</title>

The <c>++</c> operator has, somewhat undeservedly, got a bad reputation.
    It probably has something to do with code like the following,
    which is the most inefficient way there is to reverse a list:

DO NOT

naive_reverse([H|T]) ->
    naive_reverse(T)++[H];
naive_reverse([]) ->
    [].

As the <c>++</c> operator copies its left operand, the result
    is copied repeatedly, leading to quadratic complexity.

But using <c>++</c> as follows is not bad:

OK

naive_but_ok_reverse([H|T], Acc) ->
    naive_but_ok_reverse(T, [H]++Acc);
naive_but_ok_reverse([], Acc) ->
    Acc.

Each list element is copied only once.
    The growing result <c>Acc</c> is the right operand
    for the <c>++</c> operator, and it is not copied.

Experienced Erlang programmers would write as follows:

DO

vanilla_reverse([H|T], Acc) ->
    vanilla_reverse(T, [H|Acc]);
vanilla_reverse([], Acc) ->
    Acc.

This is slightly more efficient because here you do not build a
    list element only to copy it directly. (Or it would be more efficient
    if the compiler did not automatically rewrite <c>[H]++Acc</c>
    to <c>[H|Acc]</c>.)

    <title>Myth: Strings are Slow</title>

String handling can be slow if done improperly.
    In Erlang, you need to think a little more about how the strings
    are used and choose an appropriate representation. If you
    use regular expressions, use the
    <seeerl marker="stdlib:re">re</seeerl> module in STDLIB
    instead of the obsolete <c>regexp</c> module.

    <title>Myth: Repairing a Dets File is Very Slow</title>

The repair time is still proportional to the number of records
    in the file, but Dets repairs used to be much slower in the past.
    Dets has been massively rewritten and improved.

    <title>Myth: BEAM is a Stack-Based Byte-Code Virtual Machine
    (and Therefore Slow)</title>

BEAM is a register-based virtual machine. It has 1024 virtual registers
    that are used for holding temporary values and for passing arguments when
    calling functions. Variables that need to survive a function call are saved
    to the stack.

BEAM is a threaded-code interpreter. Each instruction is word pointing
    directly to executable C-code, making instruction dispatching very fast.

    <title>Myth: Use "_" to Speed Up Your Program When a Variable
    is Not Used</title>

That was once true, but from R6B the BEAM compiler can see
    that a variable is not used.

Similarly, trivial transformations on the source-code level
    such as converting a <c>case</c> statement to clauses at the
    top-level of the function seldom makes any difference to the
    generated code.

    <title>Myth: A NIF Always Speeds Up Your Program</title>

Rewriting Erlang code to a NIF to make it faster should be
    seen as a last resort. It is only guaranteed to be dangerous,
    but not guaranteed to speed up the program.

Doing too much work in each NIF call will
    <seecref marker="erts:erl_nif#WARNING">degrade responsiveness
    of the VM</seecref>. Doing too little work may mean that
    the gain of the faster processing in the NIF is eaten up by
    the overhead of calling the NIF and checking the arguments.

Be sure to read about
    <seecref marker="erts:erl_nif#lengthy_work">Long-running NIFs</seecref>
    before writing a NIF.

</chapter>


text:
from jupyter_client.localinterfaces import public_ips

c = get_config()  # noqa

c.JupyterHub.ssl_key = 'test.key'
c.JupyterHub.ssl_cert = 'test.crt'

c.JupyterHub.hub_ip = public_ips()[0]

c.JupyterHub.spawner_class = (
    'remoteappmanager.jupyterhub.spawners.VirtualUserSpawner'
    )

# Parent directory in which temporary directory is created for
# each virtual user
# Set this to a drive with well defined capacity quota
# If unset, no workspace would be available
c.Spawner.workspace_dir = '/tmp/remoteapp'

# Uncomment this if you want to enable the use of the configuration
# file for the spawned service, instead of using the defaults.
# c.Spawner.config_file_path = 'remoteappmanager_config.py'

c.JupyterHub.authenticator_class = (
    'remoteappmanager.jupyterhub.auth.WorldAuthenticator')
c.Authenticator.admin_users = {"admin"}


text:
package com.sksamuel.elastic4s.requests.searches

sealed trait SearchType
object SearchType {

  case object DfsQueryThenFetch extends SearchType
  case object QueryThenFetch    extends SearchType

  val DEFAULT: QueryThenFetch.type = QueryThenFetch
  val QUERY_THEN_FETCH: QueryThenFetch.type = QueryThenFetch
  val DFS_QUERY_THEN_FETCH: DfsQueryThenFetch.type = DfsQueryThenFetch
}


text:
<?php

	trait TestTrait {
		public static function test() {
			return static::$test;
		}
	}

	class A {
		use TestTrait;
		protected static $test = "Test A";
	}

	class B extends A {
		protected static $test = "Test B";
	}

	echo B::test();

?>


text:
module PublishingApi
  class WorldLocationNewsPresenter
    include FeaturedDocumentsPresenter

    attr_accessor :world_location, :world_location_news, :update_type

    def initialize(world_location_news, update_type: nil)
      self.world_location_news = world_location_news
      self.world_location = world_location_news.world_location
      self.update_type = update_type || "major"
    end

    delegate :content_id, to: :world_location_news

    def content
      content = BaseItemPresenter.new(
        world_location_news,
        title: world_location_news.title,
        update_type:,
      ).base_attributes

      content.merge!(
        description: I18n.t("world_news.uk_updates_in_country", country: world_location.name),
        details: {
          ordered_featured_links: featured_links,
          mission_statement: world_location_news.mission_statement || "",
          ordered_featured_documents: featured_documents(world_location_news, WorldLocationNews::FEATURED_DOCUMENTS_DISPLAY_LIMIT),
          world_location_news_type: world_location.world_location_type,
        },
        document_type: "world_location_news",
        public_updated_at: world_location_news.updated_at,
        rendering_app: Whitehall::RenderingApp::COLLECTIONS_FRONTEND,
        schema_name: "world_location_news",
        base_path: path_for_news_page,
      )
      content.merge!(PayloadBuilder::Routes.for(path_for_news_page))
      content.merge!(PayloadBuilder::AnalyticsIdentifier.for(world_location))
    end

    def links
      {
        ordered_contacts: world_location_news.contacts.map(&:content_id),
        organisations: world_location_news.organisations.map(&:content_id),
        worldwide_organisations: world_location_news.worldwide_organisations.map(&:content_id),
      }
    end

  private

    def featured_links
      world_location_news.featured_links.limit(FeaturedLink::DEFAULT_SET_SIZE).map do |link|
        {
          title: link.title,
          href: link.url,
        }
      end
    end

    def path_for_news_page
      Whitehall.url_maker.world_location_news_index_path(world_location)
    end
  end
end


text:
package Paws::MobileHub::UpdateProjectResult;
  use Moose;
  has Details => (is => 'ro', isa => 'Paws::MobileHub::ProjectDetails', traits => ['NameInRequest'], request_name => 'details');

  has _request_id => (is => 'ro', isa => 'Str');
1;

### main pod documentation begin ###

=head1 NAME

Paws::MobileHub::UpdateProjectResult

=head1 ATTRIBUTES

=head2 Details => L<Paws::MobileHub::ProjectDetails>

Detailed information about the updated AWS Mobile Hub project.

=head2 _request_id => Str

=cut


text:
/**
 * @module ol/format/filter/Intersects
 */
import Spatial from '../filter/Spatial.js';

/**
 * @classdesc
 * Represents a `<Intersects>` operator to test whether a geometry-valued property
 * intersects a given geometry.
 * @api
 */
class Intersects extends Spatial {

  /**
   * @param {!string} geometryName Geometry name to use.
   * @param {!import("../../geom/Geometry.js").default} geometry Geometry.
   * @param {string=} opt_srsName SRS name. No srsName attribute will be
   *    set on geometries when this is not provided.
   */
  constructor(geometryName, geometry, opt_srsName) {
    super('Intersects', geometryName, geometry, opt_srsName);
  }

}

export default Intersects;


text:
package com.javafx.experiments.dataapp.model.transit;

import com.javafx.experiments.dataapp.model.Product;
import com.javafx.experiments.dataapp.model.ProductType;
import com.javafx.experiments.dataapp.model.Region;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Calendar;
import java.util.Date;
import java.util.GregorianCalendar;
import java.util.List;
import javax.xml.bind.annotation.XmlAnyElement;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlSeeAlso;

@XmlRootElement
public class ProductTypeTransitCumulativeSales extends TransitCumulativeSales implements Serializable {

    private static final long serialVersionUID = 1L;

    private ProductType productType;

    public ProductType getProductType() {
        return productType;
    }

    public void setProductType(ProductType productType){
        this.productType = productType;
    }
}