text:
namespace prefs {

// CookieControlsMode enum value that decides when the cookie controls UI is
// enabled. This will block third-party cookies similar to
// kBlockThirdPartyCookies but with a new UI.
const char kCookieControlsMode[] = "profile.cookie_controls_mode";

// Version of the pattern format used to define content settings.
const char kContentSettingsVersion[] = "profile.content_settings.pref_version";

// Integer that specifies the index of the tab the user was on when they
// last visited the content settings window.
const char kContentSettingsWindowLastTabIndex[] =
    "content_settings_window.last_tab_index";

// Preferences that are exclusively used to store managed values for default
// content settings.
const char kManagedDefaultAdsSetting[] =
    "profile.managed_default_content_settings.ads";
const char kManagedDefaultCookiesSetting[] =
    "profile.managed_default_content_settings.cookies";
const char kManagedDefaultGeolocationSetting[] =
    "profile.managed_default_content_settings.geolocation";
const char kManagedDefaultImagesSetting[] =
    "profile.managed_default_content_settings.images";
const char kManagedDefaultInsecureContentSetting[] =
    "profile.managed_default_content_settings.insecure_content";
const char kManagedDefaultJavaScriptSetting[] =
    "profile.managed_default_content_settings.javascript";
const char kManagedDefaultNotificationsSetting[] =
    "profile.managed_default_content_settings.notifications";
const char kManagedDefaultMediaStreamSetting[] =
    "profile.managed_default_content_settings.media_stream";
const char kManagedDefaultPopupsSetting[] =
    "profile.managed_default_content_settings.popups";
const char kManagedDefaultSensorsSetting[] =
    "profile.managed_default_content_settings.sensors";
const char kManagedDefaultWebBluetoothGuardSetting[] =
    "profile.managed_default_content_settings.web_bluetooth_guard";
const char kManagedDefaultWebUsbGuardSetting[] =
    "profile.managed_default_content_settings.web_usb_guard";
const char kManagedDefaultFileHandlingGuardSetting[] =
    "profile.managed_default_content_settings.file_handling_guard";
const char kManagedDefaultFileSystemReadGuardSetting[] =
    "profile.managed_default_content_settings.file_system_read_guard";
const char kManagedDefaultFileSystemWriteGuardSetting[] =
    "profile.managed_default_content_settings.file_system_write_guard";
const char kManagedDefaultSerialGuardSetting[] =
    "profile.managed_default_content_settings.serial_guard";
const char kManagedDefaultInsecurePrivateNetworkSetting[] =
    "profile.managed_default_content_settings.insecure_private_network";
const char kManagedDefaultJavaScriptJitSetting[] =
    "profile.managed_default_content_settings.javascript_jit";
const char kManagedDefaultWebHidGuardSetting[] =
    "profile.managed_default_content_settings.web_hid_guard";
const char kManagedDefaultWindowPlacementSetting[] =
    "profile.managed_default_content_settings.window_placement";

// Preferences that are exclusively used to store managed
// content settings patterns.
const char kManagedAutoSelectCertificateForUrls[] =
    "profile.managed_auto_select_certificate_for_urls";
const char kManagedCookiesAllowedForUrls[] =
    "profile.managed_cookies_allowed_for_urls";
const char kManagedCookiesBlockedForUrls[] =
    "profile.managed_cookies_blocked_for_urls";
const char kManagedCookiesSessionOnlyForUrls[] =
    "profile.managed_cookies_sessiononly_for_urls";
const char kManagedImagesAllowedForUrls[] =
    "profile.managed_images_allowed_for_urls";
const char kManagedImagesBlockedForUrls[] =
    "profile.managed_images_blocked_for_urls";
const char kManagedInsecureContentAllowedForUrls[] =
    "profile.managed_insecure_content_allowed_for_urls";
const char kManagedInsecureContentBlockedForUrls[] =
    "profile.managed_insecure_content_blocked_for_urls";
const char kManagedJavaScriptAllowedForUrls[] =
    "profile.managed_javascript_allowed_for_urls";
const char kManagedJavaScriptBlockedForUrls[] =
    "profile.managed_javascript_blocked_for_urls";
const char kManagedNotificationsAllowedForUrls[] =
    "profile.managed_notifications_allowed_for_urls";
const char kManagedNotificationsBlockedForUrls[] =
    "profile.managed_notifications_blocked_for_urls";
const char kManagedPopupsAllowedForUrls[] =
    "profile.managed_popups_allowed_for_urls";
const char kManagedPopupsBlockedForUrls[] =
    "profile.managed_popups_blocked_for_urls";
const char kManagedSensorsAllowedForUrls[] =
    "profile.managed_sensors_allowed_for_urls";
const char kManagedSensorsBlockedForUrls[] =
    "profile.managed_sensors_blocked_for_urls";
const char kManagedWebUsbAllowDevicesForUrls[] =
    "profile.managed_web_usb_allow_devices_for_urls";
const char kManagedWebUsbAskForUrls[] = "profile.managed_web_usb_ask_for_urls";
const char kManagedWebUsbBlockedForUrls[] =
    "profile.managed_web_usb_blocked_for_urls";
const char kManagedFileHandlingAllowedForUrls[] =
    "profile.managed_file_handling_allowed_for_urls";
const char kManagedFileHandlingBlockedForUrls[] =
    "profile.managed_file_handling_blocked_for_urls";
const char kManagedFileSystemReadAskForUrls[] =
    "profile.managed_file_system_read_ask_for_urls";
const char kManagedFileSystemReadBlockedForUrls[] =
    "profile.managed_file_system_read_blocked_for_urls";
const char kManagedFileSystemWriteAskForUrls[] =
    "profile.managed_file_system_write_ask_for_urls";
const char kManagedFileSystemWriteBlockedForUrls[] =
    "profile.managed_file_system_write_blocked_for_urls";
const char kManagedLegacyCookieAccessAllowedForDomains[] =
    "profile.managed_legacy_cookie_access_allowed_for_domains";
const char kManagedSerialAskForUrls[] = "profile.managed_serial_ask_for_urls";
const char kManagedSerialBlockedForUrls[] =
    "profile.managed_serial_blocked_for_urls";
const char kManagedInsecurePrivateNetworkAllowedForUrls[] =
    "profile.managed_insecure_private_network_allowed_for_urls";
const char kManagedJavaScriptJitAllowedForSites[] =
    "profile.managed_javascript_jit_allowed_for_sites";
const char kManagedJavaScriptJitBlockedForSites[] =
    "profile.managed_javascript_jit_blocked_for_sites";
const char kManagedWebHidAskForUrls[] = "profile.managed_web_hid_ask_for_urls";
const char kManagedWebHidBlockedForUrls[] =
    "profile.managed_web_hid_blocked_for_urls";
const char kManagedWindowPlacementAllowedForUrls[] =
    "profile.managed_window_placement_allowed_for_urls";
const char kManagedWindowPlacementBlockedForUrls[] =
    "profile.managed_window_placement_blocked_for_urls";

// Boolean indicating whether the quiet UI is enabled for notification
// permission requests.
const char kEnableQuietNotificationPermissionUi[] =
    "profile.content_settings.enable_quiet_permission_ui.notifications";

// Enum indicating by which method the quiet UI has been enabled for
// notification permission requests. This is stored as of M88 and will be
// backfilled if the quiet UI is enabled but this preference has no value.
const char kQuietNotificationPermissionUiEnablingMethod[] =
    "profile.content_settings.enable_quiet_permission_ui_enabling_method."
    "notifications";

// Time value indicating when the quiet notification UI was last disabled by the
// user. Only permission action history after this point is taken into account
// for adaptive quiet UI activation.
const char kQuietNotificationPermissionUiDisabledTime[] =
    "profile.content_settings.disable_quiet_permission_ui_time.notifications";

#if BUILDFLAG(IS_ANDROID)
// Enable vibration for web notifications.
const char kNotificationsVibrateEnabled[] = "notifications.vibrate_enabled";
#endif

}  // namespace prefs


text:
package stroom.security.identity.token;

import stroom.security.identity.config.IdentityConfig;
import stroom.security.openid.api.PublicJsonWebKeyProvider;

import javax.inject.Inject;
import javax.inject.Provider;
import javax.inject.Singleton;

@Singleton
public class TokenBuilderFactory {

    private final Provider<IdentityConfig> configProvider;
    private final PublicJsonWebKeyProvider publicJsonWebKeyProvider;

    @Inject
    public TokenBuilderFactory(final Provider<IdentityConfig> configProvider,
                               final PublicJsonWebKeyProvider publicJsonWebKeyProvider) {
        this.configProvider = configProvider;
        this.publicJsonWebKeyProvider = publicJsonWebKeyProvider;
    }

    public TokenBuilder builder() {
        final TokenBuilder tokenBuilder = new TokenBuilder();
        final IdentityConfig identityConfig = configProvider.get();
        tokenBuilder
                .issuer(identityConfig.getTokenConfig().getJwsIssuer())
                .privateVerificationKey(publicJsonWebKeyProvider.getFirst())
                .algorithm(identityConfig.getTokenConfig().getAlgorithm());
        return tokenBuilder;
    }
}

redpajama_set_name: RedPajamaGithub


text:
<!DOCTYPE html>

    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <title>Enum ErrorParameter
   </title>
    <meta name="viewport" content="width=device-width">
    <meta name="title" content="Enum ErrorParameter
   ">
    <meta name="generator" content="docfx 2.45.1.0">

    <link rel="shortcut icon" href="../favicon.ico">
    <link rel="stylesheet" href="../styles/docfx.vendor.css">
    <link rel="stylesheet" href="../styles/docfx.css">
    <link rel="stylesheet" href="../styles/main.css">
    <link rel="text/javascript" href="../styles/encrypter.js">
    <meta property="docfx:navrel" content="../toc.html">
    <meta property="docfx:tocrel" content="../toc.html">

              <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#navbar">
                Toggle navigation

              </button>

              <form class="navbar-form navbar-right" role="search" id="search">

                  <input type="text" class="form-control" id="search-query" placeholder="Search" autocomplete="off">

              </form>

Enum ErrorParameter

Namespace:Dacs7

Assembly:Dacs7.dll

Syntax

public enum ErrorParameter : ushort

Fields

                    Name
                    Description

                    AtLeatOneOfTheGivenBlocksNotFound

                    InvalidBlockTypeNum

                    InvalidParam

                    L7DgsConnAlreadyAnnou

                    L7DgsFktParSyntaxErr

                    L7InvalidCpuState

                    L7InvalidIndex

                    L7InvalidReqStatus

                    L7InvalidSzlID

                    L7InvalidVarAddr

                    L7MaxUserNb

                    L7NoInfo

                    L7PduSizeErr

                    L7PrtFktParSyntaxErr

                    L7UnknownReq

                    NoError

                    NotImplemented

                    NotImplementedOrFrameError

                    PgResourceError

                    PlcResourceError

                    ProtocolError

                    ReqIniErr

                    UserBufferTooShort

                    VersionMismatch

Extension Methods

                  Converter.SetSwap<ErrorParameter>(IFormatProvider)

                  Converter.SetNoSwap<ErrorParameter>()

                  Converter.ToByteArray<ErrorParameter>(Int32)

                    View Source

              Back to top

            Copyright © Benjamin Proemmer


text:
/*
	MIT License http://www.opensource.org/licenses/mit-license.php
	Author Tobias Koppers @sokra
*/
"use strict";

const forEachBail = require("./forEachBail");

function loadDescriptionFile(resolver, directory, filenames, resolveContext, callback) {
	(function findDescriptionFile() {
		forEachBail(filenames, (filename, callback) => {
			const descriptionFilePath = resolver.join(directory, filename);
			if(resolver.fileSystem.readJson) {
				resolver.fileSystem.readJson(descriptionFilePath, (err, content) => {
					if(err) {
						if(typeof err.code !== "undefined") return callback();
						return onJson(err);
					}
					onJson(null, content);
				});
			} else {
				resolver.fileSystem.readFile(descriptionFilePath, (err, content) => {
					if(err) return callback();
					let json;
					try {
						json = JSON.parse(content);
					} catch(e) {
						onJson(e);
					}
					onJson(null, json);
				});
			}

			function onJson(err, content) {
				if(err) {
					if(resolveContext.log)
						resolveContext.log(descriptionFilePath + " (directory description file): " + err);
					else
						err.message = descriptionFilePath + " (directory description file): " + err;
					return callback(err);
				}
				callback(null, {
					content: content,
					directory: directory,
					path: descriptionFilePath
				});
			}
		}, (err, result) => {
			if(err) return callback(err);
			if(result) {
				return callback(null, result);
			} else {
				directory = cdUp(directory);
				if(!directory) {
					return callback();
				} else {
					return findDescriptionFile();
				}
			}
		});
	}());
}

function getField(content, field) {
	if(!content) return undefined;
	if(Array.isArray(field)) {
		let current = content;
		for(let j = 0; j < field.length; j++) {
			if(current === null || typeof current !== "object") {
				current = null;
				break;
			}
			current = current[field[j]];
		}
		if(typeof current === "object") {
			return current;
		}
	} else {
		if(typeof content[field] === "object") {
			return content[field];
		}
	}
}

function cdUp(directory) {
	if(directory === "/") return null;
	const i = directory.lastIndexOf("/"),
		j = directory.lastIndexOf("\\");
	const p = i < 0 ? j : j < 0 ? i : i < j ? j : i;
	if(p < 0) return null;
	return directory.substr(0, p || 1);
}

exports.loadDescriptionFile = loadDescriptionFile;
exports.getField = getField;
exports.cdUp = cdUp;


text:
from django.conf.urls import url
from django.contrib.auth import views as auth_views

urlpatterns = [
    url(
        r'^login/$',
        auth_views.login, {'template_name': 'registration/login.html'},
        name='auth_login'),
    url(
        r'^logout/$',
        auth_views.logout, {'template_name': 'registration/logout.html'},
        name='auth_logout'),
    url(
        r'^password/change/$',
        auth_views.password_change,
        name='auth_password_change'),
    url(
        r'^password/change/done/$',
        auth_views.password_change_done,
        name='auth_password_change_done'),
    url(
        r'^password/reset/$',
        auth_views.password_reset,
        name='auth_password_reset'),
    url(
        r'^password/reset/confirm/(?P<uidb64>[0-9A-Za-z]+)-(?P<token>.+)/$',
        auth_views.password_reset_confirm,
        name='auth_password_reset_confirm'),
    url(
        r'^password/reset/complete/$',
        auth_views.password_reset_complete,
        name='auth_password_reset_complete'),
    url(
        r'^password/reset/done/$',
        auth_views.password_reset_done,
        name='auth_password_reset_done'),
]


text:
package net.runelite.client.plugins.team;

import java.awt.Dimension;
import java.awt.Graphics2D;
import java.util.Map;
import javax.inject.Inject;
import net.runelite.api.ItemID;
import static net.runelite.api.MenuAction.RUNELITE_OVERLAY_CONFIG;
import net.runelite.client.game.ItemManager;
import static net.runelite.client.ui.overlay.OverlayManager.OPTION_CONFIGURE;
import net.runelite.client.ui.overlay.OverlayMenuEntry;
import net.runelite.client.ui.overlay.OverlayPanel;
import net.runelite.client.ui.overlay.OverlayPosition;
import net.runelite.client.ui.overlay.OverlayPriority;
import net.runelite.client.ui.overlay.components.ComponentOrientation;
import net.runelite.client.ui.overlay.components.ImageComponent;

class TeamCapesOverlay extends OverlayPanel
{
	private final TeamPlugin plugin;
	private final TeamConfig config;
	private final ItemManager manager;

	@Inject
	private TeamCapesOverlay(TeamPlugin plugin, TeamConfig config, ItemManager manager)
	{
		super(plugin);
		setPosition(OverlayPosition.TOP_LEFT);
		setPriority(OverlayPriority.LOW);
		this.plugin = plugin;
		this.config = config;
		this.manager = manager;
		panelComponent.setWrap(true);
		panelComponent.setOrientation(ComponentOrientation.HORIZONTAL);
		getMenuEntries().add(new OverlayMenuEntry(RUNELITE_OVERLAY_CONFIG, OPTION_CONFIGURE, "Teamcapes overlay"));
	}

	@Override
	public Dimension render(Graphics2D graphics)
	{
		Map<Integer, Integer> teams = plugin.getTeams();
		if (teams.isEmpty() || !config.teamCapesOverlay())
		{
			return null;
		}

		for (Map.Entry<Integer, Integer> team : teams.entrySet())
		{
			// Only display team capes that have a count greater than the configured minimum
			if (team.getValue() < config.getMinimumCapeCount())
			{
				continue;
			}

			// Make the number 0 based
			final int teamcapeNumber = team.getKey() - 1;
			final int itemID;
			if (teamcapeNumber < 50)
			{
				// The team cape is every 2nd item id based on tc number
				itemID = 2 * teamcapeNumber + ItemID.TEAM1_CAPE;
			}
			else
			{
				// The team cape is every 3rd item id based on tc number starting from 0
				itemID = 3 * (teamcapeNumber - 50) + ItemID.TEAM_CAPE_ZERO;
			}

			panelComponent.getChildren().add(new ImageComponent(manager.getImage(itemID, team.getValue(), true)));
		}

		return super.render(graphics);
	}
}


text:
var DEFAULT_TIMEOUT = 2000;
var FRAME_DELTA = 1000/60;

test_runners.push(testConfig);

function testConfig(medealib, dom_element) {

	describe("core", function(done) {
		var medea;

		beforeEach(function(done) {
			var init_fail = false
			, 	init_ok = false
			;

			medea = undefined;

	    	medealib.CreateContext(dom_element, {dataroot:'../../data'}, ['forwardrenderer'], function(_medea) {
	    		medea = _medea;
	    		init_ok = true;

	    		expect(init_fail).toBeFalsy();
				expect(medea).toBeDefined();
				expect(medea.ForwardRenderer).toBeDefined();
				done();
			},

			function() {
				init_fail = true;
				expect(init_ok).toBeFalsy();
				expect(false).toBeTruthy();
				done();
			});
		});

		afterEach(function() {
			medea.Dispose();
		});

		it("should be able to create a context", function () {

		});

		it("should have valid defaults", function () {
			var stats;

			expect(medea.Node).toBeTruthy();
			expect(medea.RootNode()).toBeTruthy();
			expect(medea.EnsureIsResponsive()).toBeFalsy();
			expect(medea.Wireframe()).toBeFalsy();
			expect(medea.CanRender()).toBeFalsy();

			stats = medea.GetStatistics();
			expect(stats.count_frames).toBe(0);
			expect(stats.primitives_frame).toBe(0);
			expect(stats.vertices_frame).toBe(0);
		});

		it("should have loaded the <node> and <viewport> modules", function () {
			expect(medea.Node).toBeTruthy();
			expect(medea.Viewport).toBeTruthy();
		});

		it("should be able to define() more modules and resolve their dependencies", function () {
			var init2 = false
			,	init1 = false
			,	called = false
			;

			console.log(medealib.id);

			medealib.define('__test1', ['node'], function() {
				expect(init2).toBeFalsy();
				init1 = true;
			});
			expect(init1).toBeFalsy();
			expect(init2).toBeFalsy();

			// core itself should be loaded too, so should __test1
			medealib.define('__test2', ['__test1', 'core'], function() {
				expect(init1).toBeTruthy();
				init2 = true;
			});
			expect(init1).toBeFalsy();
			expect(init2).toBeFalsy();

			// registering the same module again should throw an exception
			expect(function() {
				medealib.define('__test1', ['node'], function() {
					expect(false).toBeTruthy();
				});
			}).toThrow();

			// now load the modules into the medea context
			medea.LoadModules(['__test2'], function() {
				expect(init1).toBeTruthy();
				expect(init2).toBeTruthy();
				called = true;
			});

			expect(called).toBeTruthy();
		});

		it("should be able to fetch more modules", function (done) {
			var ok = false;

			expect(medea.Node).toBeDefined(); // node is there by default
			expect(medea.Mesh).not.toBeDefined();
			expect(medea.Shader).not.toBeDefined();

			medea.LoadModules(['node', 'mesh', 'shader'], function() {

				expect(medea.Node).toBeDefined(); // still here
				expect(medea.Mesh).toBeDefined();
				expect(medea.Shader).toBeDefined();

				done();
			});
		});

		it("should not be able to render unless there is a viewport", function () {

			// this should throw an exception
			expect(function() {medea.DoSingleFrame(0);}).toThrow(new medealib.FatalError());
			expect(medea.CanRender()).toBeFalsy();

			var vp = medea.CreateViewport();
			vp.Renderer(medea.CreateForwardRenderer());
			vp.ClearColor([1,0,1]);

			//expect(medea.CanRender()).toBeFalsy();
			//vp1.Renderer(medea.CreateForwardRenderer());

			// this, however, should not
			expect(medea.CanRender()).toBeTruthy();
			expect(function() {medea.DoSingleFrame(0);}).not.toThrow(new medealib.FatalError());
		});

		it("should be able to do a single frame", function () {

			expect(medea.CanRender()).toBeFalsy();
			var vp = medea.CreateViewport();
			vp.Renderer(medea.CreateForwardRenderer());
			vp.ClearColor([1,0,1]);

			//expect(medea.CanRender()).toBeFalsy();
			//vp1.Renderer(medea.CreateForwardRenderer());

			expect(medea.CanRender()).toBeTruthy();
			expect(function() {medea.DoSingleFrame(0);}).not.toThrow(new medealib.FatalError());

			stats = medea.GetStatistics();
			expect(stats.count_frames).toBe(1);
			expect(stats.primitives_frame).toBe(0);
			expect(stats.vertices_frame).toBe(0);
			// can't make assumptions on fps values after one frame
		});

		it("should be able to have a tick callback remove itself", function () {

			expect(medea.CanRender()).toBeFalsy();
			var vp = medea.CreateViewport();
			vp.Renderer(medea.CreateForwardRenderer());
			vp.ClearColor([1,0,1]);

			var called = false;
			medea.SetTickCallback(function() {
				expect(called).toBeFalsy();
				called = true;
				medea.RemoveTickCallback();
			});

			medea.DoSingleFrame(0);
			expect(called).toBeTruthy();
			medea.DoSingleFrame(0);

			called = false;
			medea.SetTickCallback(function() {
				expect(called).toBeFalsy();
				called = true;
				medea.RemoveTickCallback('key');
			}, 'key');
		});

		it("should be able to do a rendering loop, and be able to get callbacks and stop again", function (done) {
			var count = 0
			,	count_2 = 0
			,	stopped = false
			,	stats
			;

			var vp = medea.CreateViewport();
			vp.Renderer(medea.CreateForwardRenderer());
			vp.ClearColor([1,0,1]);

			expect(medea.IsStopMarkerSet()).toBeFalsy();
			expect(medea.IsStopMarkerSet()).toBeFalsy();

			medea.SetTickCallback(function() {
				++count;

				if(count === 5) {
					// redundant calls should be ok, this also tests if adding
					// or removing listeners works from within tick callbacks
					medea.RemoveTickCallback('keyed_callback');
					medea.RemoveTickCallback('keyed_callback');
				}

				if(count === 10) {
					medea.StopNextFrame();
					expect(medea.IsStopMarkerSet()).toBeTruthy();
					stopped = true;

					setTimeout(function() {
						stats = medea.GetStatistics();
						expect(stats.count_frames).toBe(10);
						expect(count).toBe(10);
						expect(count_2).toBe(5);

						// stop marker should now be unset again
						expect(medea.IsStopMarkerSet()).toBeFalsy();

						// start again, first check if removing the unnamed tick callback works
						// start() never runs a frame immediately, it always delays so
						// RemoveTickCallback() should execute first.
						medea.Start();
						expect(medea.IsStopMarkerSet()).toBeFalsy();

						medea.RemoveTickCallback();

						// now run again and check if stopping by returning something falsy works
						medea.SetTickCallback(function() {
							--count_2;
							var stop = count_2 === 0;
							if(stop) {
								setTimeout(function() {
									expect(medea.IsStopMarkerSet()).toBeFalsy();
									expect(count_2).toBe(0);
									expect(stats.count_frames).toBe(15);
									done();

								}, FRAME_DELTA * 2);
							}
							return !stop;
						}, 'another_keyed_callback');
					}, FRAME_DELTA * 2);
				}
				// should not be called an 11th time
				expect(count).toBeLessThan(11);
				return true;
			});

			// also try with a keyed callback
			medea.SetTickCallback(function() {
				expect(count).toBeLessThan(6);
				count_2++;
				return true;
			}, 'keyed_callback');

			medea.Start();
		});

		it("should keep time correctly", function () {
			var time = medea.GetTime();
			var vp = medea.CreateViewport();
			vp.Renderer(medea.CreateForwardRenderer());
			vp.ClearColor([1,0,1]);

			expect(medea.GetTime()).toBe(0.0);

			medea.DoSingleFrame(0);
			medea.DoSingleFrame(1.0);
			medea.DoSingleFrame(2.0);

			expect(medea.GetTime()).toBeCloseTo(3.0,-8);
		});

		it("should correctly call debug hooks", function (done) {
			var ok= false;

			var vp = medea.CreateViewport();
			vp.Renderer(medea.CreateForwardRenderer());
			vp.ClearColor([1,0,1]);

			medea.SetDebugPanel(null, function() {
				spyOn(medea.debug_panel, 'BeginFrame');
				spyOn(medea.debug_panel, 'EndFrame');

				medea.SetTickCallback(function() {
					expect(medea.debug_panel.BeginFrame).toHaveBeenCalled();
					expect(medea.debug_panel.EndFrame).not.toHaveBeenCalled();
					ok = true;
					return true;
				});

				medea.DoSingleFrame(0);

				expect(medea.debug_panel.BeginFrame).toHaveBeenCalled();
					expect(medea.debug_panel.EndFrame).toHaveBeenCalled();
				expect(ok).toBeTruthy();

				done();
			});
		});
	});
}


text:
<?xml version='1.0' encoding='UTF-8'?>
<resources><string name="name">Naam</string>
    <string name="categories">Categorieën</string>
    <string name="manga">Manga</string>
    <string name="chapters">Hoofdstukken</string>
    <string name="track">Tracking</string>
    <string name="history">Geschiedenis</string>

    <string name="label_settings">Instellingen</string>
    <string name="label_library">Mijn bibliotheek</string>
    <string name="label_recent_manga">Onlangs gelezen</string>
    <string name="label_catalogues">Catalogi</string>
    <string name="label_latest_updates">Laatste updates</string>
    <string name="label_categories">Categorieën</string>
    <string name="label_selected">Geselecteerd: %1$d</string>
    <string name="label_backup">Back-up</string>

    <string name="action_settings">Instellingen</string>
    <string name="action_filter">Filter</string>
    <string name="action_filter_downloaded">Gedownload</string>
    <string name="action_filter_unread">Ongelezen</string>
    <string name="action_filter_read">Gelezen</string>
    <string name="action_filter_empty">Verwijder filter</string>
    <string name="action_sort_alpha">Alfabetisch</string>
    <string name="action_sort_last_read">Laatst gelezen</string>
    <string name="action_sort_last_updated">Laatst geüpdatet</string>
    <string name="action_search">Zoeken</string>
    <string name="action_select_all">Alles selecteren</string>
    <string name="action_mark_as_read">Als gelezen markeren</string>
    <string name="action_mark_as_unread">Als ongelezen markeren</string>
    <string name="action_mark_previous_as_read">Markeer vorige als gelezen</string>
    <string name="action_download">Downloaden</string>
    <string name="action_bookmark">Bladwijzer toevoegen</string>
    <string name="action_remove_bookmark">Bladwijzer verwijderen</string>
    <string name="action_delete">Verwijderen</string>
    <string name="action_update">Updaten</string>
    <string name="action_edit">Bewerken</string>
    <string name="action_add">Toevoegen</string>
    <string name="action_add_category">Categorie toevoegen</string>
    <string name="action_edit_categories">Categorieën bewerken</string>
    <string name="action_rename_category">Categorie hernoemen</string>
    <string name="action_move_category">Verplaatsen naar categorieën</string>
    <string name="action_edit_cover">Omslag wijzigen</string>
    <string name="action_show_unread">Ongelezen</string>
    <string name="action_show_downloaded">Gedownload</string>
    <string name="action_next_unread">Volgende ongelezen</string>
    <string name="action_start">Start</string>
    <string name="action_stop">Stop</string>
    <string name="action_pause">Pauzeer</string>
    <string name="action_close">Sluiten</string>
    <string name="action_previous_chapter">Vorige hoofdstuk</string>
    <string name="action_next_chapter">Volgende hoofdstuk</string>
    <string name="label_download_queue">Downloads</string>
    <string name="action_update_library">Bibliotheek bijwerken</string>
    <string name="action_retry">Opnieuw proberen</string>
    <string name="action_remove">Verwijderen</string>
    <string name="action_resume">Hervatten</string>
    <string name="action_move">Verplaatsen</string>
    <string name="action_open_in_browser">Openen in browser</string>
    <string name="action_add_to_home_screen">Toevoegen aan beginscherm</string>
    <string name="action_display_mode">Verander weergavemodus</string>
    <string name="action_display">Weergave</string>
    <string name="action_display_grid">Raster</string>
    <string name="action_display_list">Lijst</string>
    <string name="action_set_filter">Filter instellen</string>
    <string name="action_cancel">Annuleren</string>
    <string name="action_sort">Sorteren</string>
    <string name="action_install">Installeren</string>
    <string name="action_share">Delen</string>
    <string name="action_save">Opslaan</string>
    <string name="action_reset">Reset</string>
    <string name="action_undo">Ongedaan maken</string>
    <string name="action_export">Exporteren</string>
    <string name="action_open_log">Open log</string>
    <string name="action_create">Maken</string>
    <string name="action_restore">Terugzetten</string>

    <string name="deleting">Verwijderen…</string>
    <string name="loading">Laden…</string>

    <string name="pref_category_general">Algemeen</string>
    <string name="pref_category_reader">Lezer</string>
    <string name="pref_category_downloads">Downloads</string>
    <string name="pref_category_sources">Bronnen</string>
    <string name="pref_category_tracking">Tracking</string>
    <string name="pref_category_advanced">Geavanceerd</string>
    <string name="pref_library_columns">Manga per rij in de bibliotheek</string>
    <string name="default_columns">Standaard</string>
    <string name="pref_library_update_interval">Bibliotheek update frequentie</string>
    <string name="update_never">Manueel</string>
    <string name="update_1hour">Ieder uur</string>
    <string name="update_2hour">Iedere 2 uur</string>
    <string name="update_3hour">Iedere 3 uur</string>
    <string name="update_6hour">Iedere 6 uur</string>
    <string name="update_12hour">Iedere 12 uur</string>
    <string name="update_24hour">Iedere dag</string>
    <string name="update_48hour">Iedere 2 dagen</string>
    <string name="update_weekly">Iedere week</string>
    <string name="update_monthly">Iedere maand</string>
    <string name="all">Alles</string>
    <string name="dark_theme">Donker thema</string>
    <string name="amoled_theme">AMOLED thema</string>
    <string name="pref_start_screen">Beginscherm</string>
    <string name="pref_language">Taal</string>
    <string name="system_default">Systeemstandaard</string>
    <string name="default_category">Standaard categorie</string>
    <string name="default_category_summary">Altijd vragen</string>

      <string name="pref_fullscreen">Volledig scherm</string>
    <string name="pref_page_transitions">Paginaovergangen</string>
    <string name="pref_show_page_number">Toon paginanummer</string>
    <string name="pref_crop_borders">Randen bijsnijden</string>
    <string name="pref_custom_brightness">Gebruik aangepaste helderheid</string>
    <string name="pref_custom_color_filter">Gebruik aangepaste filter</string>
    <string name="pref_read_with_volume_keys">Volumeknoppen</string>
    <string name="pref_read_with_tapping">Tikken</string>
    <string name="pref_reader_theme">Achtergrondkleur</string>
    <string name="white_background">Wit</string>
    <string name="black_background">Zwart</string>
    <string name="pref_viewer_type">Standaardlezer</string>
    <string name="default_viewer">Standaard</string>
    <string name="left_to_right_viewer">Links naar rechts</string>
    <string name="right_to_left_viewer">Rechts naar links</string>
    <string name="vertical_viewer">Verticaal</string>
    <string name="webtoon_viewer">Webtoon</string>
    <string name="scale_type_stretch">Uitrekken</string>
    <string name="scale_type_fit_width">Aanpassen aan de breedte</string>
    <string name="scale_type_fit_height">Aanpassen aan de hoogte</string>
    <string name="scale_type_original_size">Originele grootte</string>
    <string name="scale_type_smart_fit">Intelligent aanpassen</string>
    <string name="zoom_start_automatic">Automatisch</string>
    <string name="zoom_start_left">Links</string>
    <string name="zoom_start_right">Rechts</string>
    <string name="zoom_start_center">Midden</string>
    <string name="pref_rotation_type">Rotatie</string>
    <string name="rotation_free">Vrij</string>
    <string name="rotation_lock">Vast</string>
    <string name="color_filter_r_value">R</string>
    <string name="color_filter_g_value">G</string>
    <string name="color_filter_b_value">B</string>
    <string name="color_filter_a_value">A</string>

      <string name="pref_download_directory">Downloadmap</string>
    <string name="pref_download_slots">Gelijktijdige downloads</string>
    <string name="pref_download_only_over_wifi">Download alleen over Wi-Fi</string>
    <string name="custom_dir">Aangepaste map</string>
    <string name="last_read_chapter">Laatst gelezen hoofdstuk</string>
    <string name="second_to_last">Voorlaatst gelezen hoofdstuk</string>
    <string name="third_to_last">Op 2 na laaste</string>
    <string name="pref_download_new">Download nieuwe hoofdstukken</string>
    <string name="services">Services</string>

    <string name="backup">Back-up</string>
    <string name="pref_create_backup">Back-up maken</string>
    <string name="pref_create_backup_summ">Kan worden gebruikt om huidige bibliotheek terug te zetten</string>
    <string name="pref_restore_backup">Back-up terugzetten</string>
    <string name="pref_restore_backup_summ">Back-up terugzetten van bestand</string>
    <string name="pref_backup_directory">Back-up map</string>
    <string name="pref_backup_service_category">Service</string>
    <string name="pref_backup_interval">Back-up frequentie</string>
    <string name="pref_backup_slots">Max aantal automatische back-ups</string>
    <string name="dialog_restoring_backup">Back-up terugzetten
%1$s toegevoegd aan bibliotheek</string>
    <string name="source_not_found">Bron niet gevonden</string>
    <string name="dialog_restoring_source_not_found">Backup terugzetten
%1$s bron niet gevonden</string>
    <string name="backup_created">Back-up gemaakt</string>
    <string name="restore_completed">Terugzetten voltooid</string>
    <string name="error_opening_log">Kon log niet openen</string>
    <string name="restore_completed_content">Terugzetten nam %1$s in beslag.
%2$s errors gevonden.</string>
    <string name="file_saved">Bestand opgeslagen op %1$s</string>
    <string name="backup_choice">Wat wil je back-uppen?</string>
    <string name="restoring_backup">Backup aan het terugzetten</string>
    <string name="creating_backup">Back-up aan het maken</string>

      <string name="used_cache">Gebruikt: %1$s</string>
    <string name="pref_clear_cookies">Verwijder cookies</string>
    <string name="cookies_cleared">Cookies verwijdered</string>
    <string name="pref_refresh_library_tracking_summary">Update status, score en laatst gelezen hoofdstuk van de tracking services</string>

      <string name="version">Versie</string>
    <string name="pref_enable_automatic_updates">Op updates controleren</string>
    <string name="pref_enable_automatic_updates_summary">Automatisch op updates controleren</string>
    <string name="login_title">Login voor %1$s</string>
    <string name="username">Gebruikersnaam</string>
    <string name="password">Wachtwoord</string>
    <string name="show_password">Toon wachtwoord</string>
    <string name="login">Log in</string>
    <string name="unknown_error">Onbekende fout</string>

    <string name="library_search_hint">Titel of auteur…</string>
    <string name="updating_category">Categorie bijwerken</string>
    <string name="confirm_delete_manga">Ben je zeker dat je de geselecteerde manga wil verwijderen?</string>
    <string name="also_delete_chapters">Verwijder ook gedownloade hoofdstukken</string>

    <string name="select_source">Selecteer een bron</string>
    <string name="no_valid_sources">Gelieve zeker één geldige bron te kiezen</string>
    <string name="no_more_results">Geen verdere resultaten</string>
    <string name="local_source">Lokale manga</string>
    <string name="invalid_combination">Standaard kan niet geselecteerd worden met andere categorieën</string>
    <string name="added_to_library">De manga is toegevoegd aan je bibliotheek</string>

    <string name="manga_not_in_db">Deze manga is verwijderd uit de databank!</string>

    <string name="manga_detail_tab">Info</string>
    <string name="description">Beschrijving</string>
    <string name="unknown">Onbekend</string>
    <string name="add_to_library">Toevoegen aan bibliotheek</string>
    <string name="remove_from_library">Verwijderen uit bibliotheek</string>
    <string name="manga_info_author_label">Auteur</string>
    <string name="manga_info_artist_label">Artiest</string>
    <string name="manga_info_chapters_label">Hoofdstukken</string>
    <string name="manga_info_last_chapter_label">Laatste hoofdstuk</string>
    <string name="manga_info_status_label">Status</string>
    <string name="manga_info_source_label">Bron</string>
    <string name="display_mode_chapter">Hoofdstuk %1$s</string>
    <string name="chapter_downloaded">Gedownload</string>
    <string name="chapter_queued">In de wachtrij</string>
    <string name="chapter_downloading">Aan het downloaden</string>
    <string name="chapter_downloading_progress">Aan het downloaden (%1$d/%2$d)</string>
    <string name="chapter_error">Error</string>
    <string name="chapter_paused">Gepauzeerd</string>
    <string name="show_title">Toon titel</string>
    <string name="show_chapter_number">Toon hoofdstuknummer</string>
    <string name="sorting_mode">Sorteermodus</string>
    <string name="sort_by_source">Op bron</string>
    <string name="sort_by_number">Op hoofdstuknummer</string>
    <string name="manga_download">Downloaden</string>
    <string name="download_1">Download het volgende hoofdstuk</string>
    <string name="download_5">Download de volgende 5 hoofdstukken</string>
    <string name="download_10">Download de volgende 10 hoofdstukken</string>
    <string name="download_all">Download alles</string>
    <string name="download_unread">Download ongelezen</string>
    <string name="confirm_delete_chapters">Ben je zeker dat je de geselecteerde hoofdstukken wilt verwijderen?</string>

    <string name="manga_tracking_tab">Tracking</string>
    <string name="completed">Voltooid</string>
    <string name="score">Score</string>
    <string name="title">Titel</string>
    <string name="status">Status</string>

    <string name="error_category_exists">Er bestaat al een categorie met deze naam!</string>
    <string name="snack_categories_deleted">Categorieën verwijderd</string>

    <string name="dialog_with_checkbox_reset">Reset alle hoofdstukken voor deze manga</string>

    <string name="snack_add_to_library">Manga toevoegen aan bibliotheek?</string>

    <string name="picture_saved">Afbeelding opgeslagen</string>
    <string name="saving_picture">Afbeelding aan het opslaan</string>
    <string name="options">Opties</string>

    <string name="custom_filter">Aangepaste filter</string>
    <string name="set_as_cover">Instellen als omslagfoto</string>
    <string name="cover_updated">Omslagfoto bijgewerkt</string>
    <string name="page_downloaded">Pagina gekopieerd naar %1$s</string>
    <string name="downloading">Aan het downloaden…</string>
    <string name="download_progress">%1$d%% gedownload</string>
    <string name="chapter_progress">Pagina: %1$d</string>
    <string name="chapter_subtitle">Hoofdstuk %1$s</string>
    <string name="no_next_chapter">Volgende hoofdstuk niet gevonden</string>
    <string name="no_previous_chapter">Vorige hoofdstuk niet gevonden</string>
    <string name="confirm_set_image_as_cover">Wil je deze afbeelding als omslagfoto gebruiken?</string>
    <string name="viewer_for_this_series">Lezer voor deze serie</string>

    <string name="recent_manga_source">%1$s - Hfdst.%2$s</string>

    <string name="notification_update_progress">Updatevoortgang: %1$d/%2$d</string>
    <string name="notification_new_chapters">Nieuwe hoofdstukken gevonden</string>
    <string name="notification_new_chapters_text">Voor %1$d titels</string>
    <string name="notification_first_add_to_library">Gelieve eerst de manga aan je bibliotheek toe te voegen</string>
    <string name="file_select_cover">Selecteer omslagfoto</string>
    <string name="file_select_backup">Selecteer back-upbestand</string>
    <string name="update_check_title">Nieuwe update beschikbaar!</string>
    <string name="update_check_confirm">Download</string>
    <string name="update_check_ignore">Negeren</string>
    <string name="update_check_no_new_updates">Geen nieuwe updates beschikbaar</string>
    <string name="update_check_download_started">Download gestart</string>
    <string name="update_check_notification_download_complete">Download voltooid</string>
    <string name="update_check_notification_update_available">Update beschikbaar</string>

    <string name="description_cover">Omslag van de manga</string>

    <string name="information_no_downloads">Geen downloads</string>
    <string name="information_no_recent">Geen recente hoofdstukken</string>
    <string name="information_empty_library">De bibliotheek is leeg, manga kunnen toegevoegd worden vanuit de catalogi.</string>
    <string name="information_empty_category">Er zijn nog geen categorieën, druk op de plus knop om een categorie aan te maken.</string>

    <string name="download_notifier_downloader_title">Downloader</string>
    <string name="download_notifier_title_error">Error</string>
    <string name="download_notifier_page_ready_error">Een pagina is niet geladen</string>
    <string name="download_notifier_text_only_wifi">Geen Wi-Fi verbinding beschikbaar</string>
    <string name="download_notifier_no_network">Geen netwerkverbinding beschikbaar</string>
    <string name="download_notifier_download_paused">Download gepauzeerd</string>

<string name="label_recent_updates">Bibliotheek updates</string>
    <string name="action_sort_total">Aantal hoofdstukken</string>
    <string name="action_sort_up">Sorteer oplopend</string>
    <string name="action_sort_down">Sorteer aflopend</string>
    <string name="app_not_available">Applicatie niet beschikbaar</string>
    <string name="short_recent_updates">Updates</string>

    <string name="pref_category_about">Over</string>

      <string name="portrait">Staand</string>
    <string name="landscape">Liggend</string>
    <string name="pref_library_update_restriction_summary">Update alleen wanneer de voorwaarden zijn voldaan</string>
    <string name="wifi">Wi-Fi</string>
    <string name="charging">Aan het opladen</string>
    <string name="pref_ask_update_manga_sync">Vraag om bevestiging alvorens te updaten</string>
    <string name="pref_theme">Thema</string>
    <string name="light_theme">Hoofdthema</string>
    <string name="pref_reader_navigation">Navigatie</string>
    <string name="pref_read_with_volume_keys_inverted">Keer volumeknoppen om</string>
    <string name="pref_image_decoder">Afbeeldingdecoder</string>
    <string name="pref_image_scale_type">Schaalmodus</string>
    <string name="scale_type_fit_screen">Aanpassen aan scherm</string>
    <string name="pref_zoom_start">Zoom startpositie</string>
    <string name="rotation_force_portrait">Forceer staand</string>
    <string name="rotation_force_landscape">Forceer liggend</string>
    <string name="pref_remove_after_marked_as_read">Verwijder wanneer gemarkeerd als gelezen</string>
    <string name="pref_remove_after_read">Verwijder na lezen</string>
    <string name="disabled">Uitgeschakeld</string>
    <string name="fourth_to_last">Op 3 na laatste</string>
    <string name="fifth_to_last">Op 4 na laatste</string>
    <string name="pref_clear_chapter_cache">Leeg hoofdstuk cache</string>
    <string name="cache_deleted">Cache geleegd. %1$d bestanden zijn verwijderd</string>
    <string name="cache_delete_error">Er is een fout opgetreden bij het legen van de cache</string>
    <string name="pref_clear_database">Database legen</string>
    <string name="pref_clear_database_summary">Verwijder manga en hoofdstukken die niet in je bibliotheek staan</string>
    <string name="pref_refresh_library_metadata">Bijwerken van bibliotheek metadata</string>
    <string name="pref_refresh_library_metadata_summary">Update omslagen, genres, beschrijvingen en status van manga</string>
    <string name="pref_refresh_library_tracking">Bijwerken van tracking metadata</string>
    <string name="build_time">Compilatietijd</string>
    <string name="pref_enable_acra">Rapporteer bugs</string>
    <string name="pref_acra_summary">Helpt bij het bestrijden van bugs. Geen gevoelige data wordt verzonden</string>

    <string name="information_no_recent_manga">Geen recentelijk gelezen manga</string>
    <string name="download_notifier_unkown_error">Er is een onverwachte fout opgetreden bij het downloaden van het hoofdstuk</string>
    <string name="download_notifier_page_error">Er ontbreekt een pagina</string>
    <string name="action_clear">Legen</string>
    <string name="pref_library_update_restriction">Bibliotheek updatebeperkingen</string>
    <string name="pref_library_update_categories">Categorieën om op te nemen in globale update</string>
    <string name="pref_update_only_non_completed">Update alleen actieve manga</string>
    <string name="pref_auto_update_manga_sync">Synchroniseer hoofdstukken na lezen</string>
    <string name="pref_lock_orientation">Vergrendel oriëntatie</string>
    <string name="pref_keep_screen_on">Automatisch dimmen uitschakelen</string>
    <string name="pref_download_new_categories">Categorieën om op te nemen in de download</string>

      <string name="clear_database_confirmation">Ben je zeker? Gelezen hoofdstukken en voortgang voor manga niet in de bibliotheek zullen verloren gaan</string>
    <string name="clear_database_completed">Databank geleegd</string>
    <string name="source_requires_login">Deze bron vereist dat je inlogt</string>
    <string name="ongoing">Lopend</string>
    <string name="manga_info_genres_label">Genres</string>
    <string name="circular_icon">Circulair icoon</string>
    <string name="rounded_icon">Afgerond icoon</string>
    <string name="square_icon">Vierkant icoon</string>
    <string name="star_icon">Stervormig icoon</string>
    <string name="icon_shape">Icoonvorm</string>
    <string name="icon_creation_fail">Maken van snelkoppeling mislukt!</string>
    <string name="delete_downloads_for_manga">Verwijder gedownloade hoofdstukken?</string>

    <string name="manga_chapters_tab">Hoofdstukken</string>
    <string name="manga_chapter_no_title">Geen titel</string>
    <string name="fetch_chapters_error">Er is een fout opgetreden bij het ophalen van hoofdstukken</string>
    <string name="reading">Aan het lezen</string>
    <string name="dropped">Laten vallen</string>
    <string name="on_hold">In de wacht</string>
    <string name="dialog_with_checkbox_remove_description">Dit verwijdert de datum waarop het hoofdstuk is gelezen. Ben je zeker?</string>
    <string name="decode_image_error">Afbeelding kon niet worden geladen.
Probeer de afbeeldingdecoder te veranderen met een van de onderstaande opties</string>
    <string name="download_queue_error">Er is een fout opgetreden bij het downloaden van hoofdstukken. Je kan het opnieuw proberen in de downloadwachtrij</string>

    <string name="notification_cover_update_failed">Updaten van omslag mislukt</string>
    <string name="notification_not_connected_to_ac_title">Synchronisatie geannuleerd</string>
    <string name="notification_not_connected_to_ac_body">Niet aangesloten op netstroom</string>
    <string name="notification_no_connection_title">Synchronisatie geannuleerd</string>
    <string name="notification_no_connection_body">Verbinding niet beschikbaar</string>

    <string name="file_select_icon">Selecteer icoon voor snelkoppeling</string>

    <string name="update_check_look_for_updates">Aan het controleren op updates</string>

    <string name="update_check_notification_file_download">Download update</string>
    <string name="update_check_notification_download_in_progress">Bezig met downloaden</string>
    <string name="update_check_notification_download_error">Fout bij het downloaden</string>
    <string name="description_backdrop">Achtergrondafbeelding van manga</string>
    <string name="action_filter_bookmarked">Met bladwijzer</string>
    <string name="backup_restore_content">Terugzetten gebruikt bron om data op te halen, mogelijk zijn extra kosten van toepassing.
Zorg ook dat je ingelogd bent voor bronnen die dit vereisen alvorens je het terugzetten start.</string>
    <string name="choices_reset">Keuzes gereset</string>
    <string name="login_success">Login geslaagd</string>
    <string name="invalid_login">Login error</string>
    <string name="share_text">Bekijk %1$s! op %2$s</string>
    <string name="shortcut_title">Titel van de snelkoppeling</string>
    <string name="confirm_update_manga_sync">Update het laatst gelezen hoofdstuk in de ingeschakelde services op %1$d?</string>
    <string name="licensed">Gelicenseerd</string>
    <string name="plan_to_read">Van plan te lezen</string>
    <string name="action_global_search">Globaal zoeken</string>
    <string name="action_display_download_badge">Download badges</string>
    <string name="action_open">Open</string>
    <string name="action_login">Inloggen</string>

    <string name="local_source_badge">Lokaal</string>
    <string name="other_source">Alternatief</string>
    <string name="action_global_search_hint">Globaal zoeken…</string>
    <string name="no_results">Geen resultaten gevonden!</string>
    <string name="latest">Recent</string>
    <string name="shortcut_created">Snelkoppeling toegevoegd aan startscherm.</string>
    <string name="channel_library">Bibliotheek</string>
    <string name="channel_downloader">Downloader</string>
<string name="browse">Bladeren</string>

    <string name="channel_common">Algemeen</string>
    </resources>


text:
require 'minitest/autorun'
require 'minitest/pride'

ENV["MY_MANGA_ENV"] = "test"
ENV["MY_MANGA_DOWNLOAD_DIR"] = File.expand_path("../downloads", __FILE__)

require_relative "../db/environment"

MyManga::DB.establish_base_connection
MyManga::DB.drop_database
MyManga::DB.create_database

MyManga::DB.establish_connection
MyManga::DB.migrate


text:
#include "lullaby/modules/dispatcher/dispatcher.h"
#include "gtest/gtest.h"
#include "lullaby/util/common_types.h"

namespace lull {
namespace {

struct Event {
  Event() {}
  explicit Event(int value) : value(value) {}

  template <typename Archive>
  void Serialize(Archive archive) {
    archive(&value, Hash("value"));
  }

  int value = 0;
};

struct OtherEvent {
  OtherEvent() {}
  explicit OtherEvent(const std::string& value) : value(value) {}

  template <typename Archive>
  void Serialize(Archive archive) {
    archive(&value, Hash("value"));
  }

  std::string value;
};

}  // namespace
}  // namespace lull

LULLABY_SETUP_TYPEID(Event);
LULLABY_SETUP_TYPEID(OtherEvent);

namespace lull {
namespace {

struct EventHandlerClass {
  EventHandlerClass() {
    // Ensure the static value is reset correctly for each test.
    static_value = 0;
    other_static_value = "";
  }

  void HandleEvent(const Event& e) { value = e.value; }

  static void StaticHandleEvent(const Event& e) { static_value = e.value; }

  void HandleOtherEvent(const OtherEvent& e) { other_value = e.value; }

  static void StaticHandleOtherEvent(const OtherEvent& e) {
    other_static_value = e.value;
  }

  int value = 0;
  std::string other_value;
  static int static_value;
  static std::string other_static_value;
};

int EventHandlerClass::static_value = 0;
std::string EventHandlerClass::other_static_value = "";

TEST(Dispatcher, BaseTestNoRegisteredHandlers) {
  Dispatcher d;
  EventHandlerClass h;

  EXPECT_EQ(0, h.value);
  EXPECT_EQ(0, h.static_value);

  Event e(123);
  d.Send(e);

  EXPECT_EQ(0, h.value);
  EXPECT_EQ(0, h.static_value);
}

TEST(Dispatcher, StaticFunction) {
  Dispatcher d;
  EventHandlerClass h;
  auto c = d.Connect(
      [](const Event& event) { EventHandlerClass::StaticHandleEvent(event); });

  EXPECT_EQ(static_cast<size_t>(1), d.GetHandlerCount());

  EXPECT_EQ(static_cast<size_t>(1), d.GetHandlerCount(GetTypeId<Event>()));
  EXPECT_EQ(static_cast<size_t>(0), d.GetHandlerCount(GetTypeId<OtherEvent>()));

  EXPECT_EQ(0, h.value);
  EXPECT_EQ(0, h.static_value);

  Event e(123);
  d.Send(e);

  EXPECT_EQ(0, h.value);
  EXPECT_EQ(e.value, h.static_value);
}

TEST(Dispatcher, MemberFunction) {
  Dispatcher d;
  EventHandlerClass h;
  auto c = d.Connect([&](const Event& event) { h.HandleEvent(event); });

  EXPECT_EQ(0, h.value);
  EXPECT_EQ(0, h.static_value);

  Event e(123);
  d.Send(e);

  EXPECT_EQ(e.value, h.value);
  EXPECT_EQ(0, h.static_value);
}

TEST(Dispatcher, MultiFunction) {
  Dispatcher d;
  EventHandlerClass h;
  auto c1 = d.Connect(
      [](const Event& event) { EventHandlerClass::StaticHandleEvent(event); });
  auto c2 = d.Connect([&](const Event& event) { h.HandleEvent(event); });

  EXPECT_EQ(static_cast<size_t>(2), d.GetHandlerCount());

  EXPECT_EQ(static_cast<size_t>(2), d.GetHandlerCount(GetTypeId<Event>()));
  EXPECT_EQ(static_cast<size_t>(0), d.GetHandlerCount(GetTypeId<OtherEvent>()));

  EXPECT_EQ(0, h.value);
  EXPECT_EQ(0, h.static_value);

  Event e(123);
  d.Send(e);

  EXPECT_EQ(e.value, h.value);
  EXPECT_EQ(e.value, h.static_value);
}

TEST(Dispatcher, MultiFunctionAndEvent) {
  Dispatcher d;
  EventHandlerClass h;
  auto c1 = d.Connect(
      [](const Event& event) { EventHandlerClass::StaticHandleEvent(event); });
  auto c2 = d.Connect([&](const Event& event) { h.HandleEvent(event); });
  auto c3 = d.Connect([](const OtherEvent& event) {
    EventHandlerClass::StaticHandleOtherEvent(event);
  });
  auto c4 =
      d.Connect([&](const OtherEvent& event) { h.HandleOtherEvent(event); });

  EXPECT_EQ(static_cast<size_t>(4), d.GetHandlerCount());

  EXPECT_EQ(static_cast<size_t>(2), d.GetHandlerCount(GetTypeId<Event>()));
  EXPECT_EQ(static_cast<size_t>(2), d.GetHandlerCount(GetTypeId<OtherEvent>()));

  EXPECT_EQ(0, h.value);
  EXPECT_EQ(0, h.static_value);
  EXPECT_EQ("", h.other_value);
  EXPECT_EQ("", h.other_static_value);

  Event e(123);
  d.Send(e);

  OtherEvent e2("hello");
  d.Send(e2);

  EXPECT_EQ(e.value, h.value);
  EXPECT_EQ(e.value, h.static_value);

  EXPECT_EQ("hello", h.other_value);
  EXPECT_EQ("hello", h.other_static_value);
}

TEST(Dispatcher, MutableFunction) {
  Dispatcher d;
  int temp = 0;  // Only used in lambda scope.
  int sum = 0;
  auto c = d.Connect([temp, &sum](const Event& event) mutable {
    temp += event.value;
    sum = temp;
  });
  EXPECT_EQ(0, sum);

  Event e(123);
  d.Send(e);
  EXPECT_EQ(123, sum);

  sum = 0;
  EXPECT_EQ(0, sum);

  d.Send(e);
  EXPECT_EQ(246, sum);
}

TEST(Dispatcher, AddRentrant) {
  Dispatcher d;
  EventHandlerClass h;

  d.Connect(&h, [&](const Event& event) {
    d.Connect(&h, [&](const Event& event) { h.HandleEvent(event); });
  });

  EXPECT_EQ(static_cast<size_t>(1), d.GetHandlerCount());

  EXPECT_EQ(static_cast<size_t>(1), d.GetHandlerCount(GetTypeId<Event>()));

  Event e(123);
  d.Send(e);
  EXPECT_EQ(static_cast<size_t>(2), d.GetHandlerCount());
  EXPECT_EQ(static_cast<size_t>(2), d.GetHandlerCount(GetTypeId<Event>()));
  EXPECT_EQ(0, h.value);

  d.Send(e);
  EXPECT_EQ(123, h.value);
}

TEST(Dispatcher, RemoveRentrant) {
  Dispatcher d;
  EventHandlerClass h;

  auto c1 = d.Connect([&](const Event& event) { h.HandleEvent(event); });
  auto c2 = d.Connect([&](const Event& event) { c1.Disconnect(); });

  EXPECT_EQ(static_cast<size_t>(2), d.GetHandlerCount());
  EXPECT_EQ(static_cast<size_t>(2), d.GetHandlerCount(GetTypeId<Event>()));

  Event e1(123);
  d.Send(e1);
  EXPECT_EQ(static_cast<size_t>(1), d.GetHandlerCount());
  EXPECT_EQ(static_cast<size_t>(1), d.GetHandlerCount(GetTypeId<Event>()));
  EXPECT_EQ(123, h.value);

  Event e2(456);
  d.Send(e2);
  EXPECT_EQ(static_cast<size_t>(1), d.GetHandlerCount());
  EXPECT_EQ(static_cast<size_t>(1), d.GetHandlerCount(GetTypeId<Event>()));
  EXPECT_EQ(123, h.value);
}

TEST(Dispatcher, DisconnectAfterDelete) {
  {
    Dispatcher::ScopedConnection c;
    {
      Dispatcher d;
      EventHandlerClass h;
      c = d.Connect([&](const Event& event) { h.HandleEvent(event); });

      Event e1(123);
      d.Send(e1);
      EXPECT_EQ(123, h.value);
    }
    c.Disconnect();
  }
}

TEST(Dispatcher, Disconnect) {
  Dispatcher d;
  EventHandlerClass h;
  auto c1 = d.Connect(
      [](const Event& event) { EventHandlerClass::StaticHandleEvent(event); });
  auto c2 = d.Connect([&](const Event& event) { h.HandleEvent(event); });

  EXPECT_EQ(static_cast<size_t>(2), d.GetHandlerCount());
  EXPECT_EQ(static_cast<size_t>(2), d.GetHandlerCount(GetTypeId<Event>()));

  EXPECT_EQ(0, h.value);
  EXPECT_EQ(0, h.static_value);

  Event e(123);
  d.Send(e);

  EXPECT_EQ(e.value, h.value);
  EXPECT_EQ(e.value, h.static_value);

  c1.Disconnect();

  EXPECT_EQ(static_cast<size_t>(1), d.GetHandlerCount());
  EXPECT_EQ(static_cast<size_t>(1), d.GetHandlerCount(GetTypeId<Event>()));

  c2.Disconnect();

  EXPECT_EQ(static_cast<size_t>(0), d.GetHandlerCount());
  EXPECT_EQ(static_cast<size_t>(0), d.GetHandlerCount(GetTypeId<Event>()));

  Event e2(456);
  d.Send(e2);

  EXPECT_EQ(e.value, h.value);
  EXPECT_EQ(e.value, h.static_value);
}

TEST(Dispatcher, DisconnectConnectionId) {
  Dispatcher d;
  EventHandlerClass h;
  auto c1 = d.Connect(&h,
      [](const Event& event) { EventHandlerClass::StaticHandleEvent(event); });
  auto c2 = d.Connect(&h, [&](const Event& event) { h.HandleEvent(event); });

  EXPECT_EQ(static_cast<size_t>(2), d.GetHandlerCount());
  EXPECT_EQ(static_cast<size_t>(2), d.GetHandlerCount(GetTypeId<Event>()));

  EXPECT_EQ(0, h.value);
  EXPECT_EQ(0, h.static_value);

  Event e(123);
  d.Send(e);

  EXPECT_EQ(e.value, h.value);
  EXPECT_EQ(e.value, h.static_value);

  d.Disconnect(GetTypeId<Event>(), c1.GetId());

  EXPECT_EQ(static_cast<size_t>(1), d.GetHandlerCount());
  EXPECT_EQ(static_cast<size_t>(1), d.GetHandlerCount(GetTypeId<Event>()));

  d.Disconnect(GetTypeId<Event>(), c2.GetId());

  EXPECT_EQ(static_cast<size_t>(0), d.GetHandlerCount());
  EXPECT_EQ(static_cast<size_t>(0), d.GetHandlerCount(GetTypeId<Event>()));

  Event e2(456);
  d.Send(e2);

  EXPECT_EQ(e.value, h.value);
  EXPECT_EQ(e.value, h.static_value);
}

TEST(Dispatcher, DisconnectOwner) {
  Dispatcher d;
  EventHandlerClass h;

  d.Connect(&h, [&](const Event& event) { h.HandleEvent(event); });
  d.Connect(&h, [&](const OtherEvent& event) { h.HandleOtherEvent(event); });

  EXPECT_EQ(0, h.static_value);
  EXPECT_EQ("", h.other_static_value);
  EXPECT_EQ(static_cast<size_t>(2), d.GetHandlerCount());
  EXPECT_EQ(static_cast<size_t>(1), d.GetHandlerCount(GetTypeId<Event>()));
  EXPECT_EQ(static_cast<size_t>(1), d.GetHandlerCount(GetTypeId<OtherEvent>()));

  d.Send(Event(123));
  d.Send(OtherEvent("hello"));

  EXPECT_EQ(123, h.value);
  EXPECT_EQ("hello", h.other_value);
  EXPECT_EQ(static_cast<size_t>(2), d.GetHandlerCount());
  EXPECT_EQ(static_cast<size_t>(1), d.GetHandlerCount(GetTypeId<Event>()));
  EXPECT_EQ(static_cast<size_t>(1), d.GetHandlerCount(GetTypeId<OtherEvent>()));

  d.Disconnect<Event>(&h);

  d.Send(Event(456));
  d.Send(OtherEvent("world"));

  EXPECT_EQ(123, h.value);
  EXPECT_EQ("world", h.other_value);
  EXPECT_EQ(static_cast<size_t>(1), d.GetHandlerCount());
  EXPECT_EQ(static_cast<size_t>(0), d.GetHandlerCount(GetTypeId<Event>()));
  EXPECT_EQ(static_cast<size_t>(1), d.GetHandlerCount(GetTypeId<OtherEvent>()));

  d.Disconnect<OtherEvent>(&h);

  d.Send(Event(789));
  d.Send(OtherEvent("goodbye"));

  EXPECT_EQ(123, h.value);
  EXPECT_EQ("world", h.other_value);
  EXPECT_EQ(static_cast<size_t>(0), d.GetHandlerCount());
  EXPECT_EQ(static_cast<size_t>(0), d.GetHandlerCount(GetTypeId<Event>()));
  EXPECT_EQ(static_cast<size_t>(0), d.GetHandlerCount(GetTypeId<OtherEvent>()));
}

TEST(Dispatcher, DisconnectAll) {
  Dispatcher d;
  EventHandlerClass h;

  d.Connect(&h, [&](const Event& event) { h.HandleEvent(event); });
  d.Connect(&h, [&](const OtherEvent& event) { h.HandleOtherEvent(event); });

  EXPECT_EQ(0, h.value);
  EXPECT_EQ("", h.other_value);
  EXPECT_EQ(static_cast<size_t>(2), d.GetHandlerCount());
  EXPECT_EQ(static_cast<size_t>(1), d.GetHandlerCount(GetTypeId<Event>()));
  EXPECT_EQ(static_cast<size_t>(1), d.GetHandlerCount(GetTypeId<OtherEvent>()));

  d.Send(Event(123));
  d.Send(OtherEvent("hello"));

  EXPECT_EQ(123, h.value);
  EXPECT_EQ("hello", h.other_value);
  EXPECT_EQ(static_cast<size_t>(2), d.GetHandlerCount());
  EXPECT_EQ(static_cast<size_t>(1), d.GetHandlerCount(GetTypeId<Event>()));
  EXPECT_EQ(static_cast<size_t>(1), d.GetHandlerCount(GetTypeId<OtherEvent>()));

  d.DisconnectAll(&h);

  d.Send(Event(456));
  d.Send(OtherEvent("world"));

  EXPECT_EQ(123, h.value);
  EXPECT_EQ("hello", h.other_value);
  EXPECT_EQ(static_cast<size_t>(0), d.GetHandlerCount());
  EXPECT_EQ(static_cast<size_t>(0), d.GetHandlerCount(GetTypeId<Event>()));
  EXPECT_EQ(static_cast<size_t>(0), d.GetHandlerCount(GetTypeId<OtherEvent>()));
}

TEST(Dispatcher, EventWrapper) {
  static const TypeId kTestTypeId = 123;

  int count = 0;
  Dispatcher d;
  auto conn = d.Connect(kTestTypeId, [&](const EventWrapper& e) { ++count; });

  d.Send(EventWrapper(kTestTypeId));
  EXPECT_EQ(1, count);

  d.Send(EventWrapper(kTestTypeId));
  EXPECT_EQ(2, count);

  conn.Disconnect();

  d.Send(EventWrapper(kTestTypeId));
  EXPECT_EQ(2, count);
}

TEST(Dispatcher, OwnedEventWrapper) {
  static const TypeId kTestTypeId = 123;

  int count = 0;
  Dispatcher d;
  d.Connect(kTestTypeId, &d, [&](const EventWrapper& e) { ++count; });

  d.Send(EventWrapper(kTestTypeId));
  EXPECT_EQ(1, count);

  d.Send(EventWrapper(kTestTypeId));
  EXPECT_EQ(2, count);

  d.Disconnect(kTestTypeId, &d);

  d.Send(EventWrapper(kTestTypeId));
  EXPECT_EQ(2, count);
}

TEST(Dispatcher, ConnectEventWrapperWithData) {
  Dispatcher d;

  const TypeId type = Hash("Event");

  int value1 = 0;
  int value2 = 0;
  int value3 = 0;
  auto c = d.Connect(type, [&](const EventWrapper& event) {
    auto ptr = event.GetValue<int>(Hash("value"));
    if (ptr) {
      value1 = *ptr;
    }
    value2 = event.GetValueWithDefault(Hash("value"), 0);
    value3 = event.GetValueWithDefault(Hash("value3"), 123);
  });

  d.Send(Event(123));
  EXPECT_EQ(123, value1);
  EXPECT_EQ(123, value2);
  EXPECT_EQ(123, value3);
}

TEST(Dispatcher, SendEventWrapperWithData) {
  Dispatcher d;

  const TypeId type = Hash("Event");

  int value = 0;
  auto c = d.Connect([&value](const Event& event) { value = event.value; });

  EventWrapper event(type);
  event.SetValue(Hash("value"), 123);
  d.Send(event);

  EXPECT_EQ(123, value);
}

TEST(Dispatcher, ConnectToAll) {
  Dispatcher d;
  EventHandlerClass h;

  auto c1 = d.Connect([&](const Event& event) { h.HandleEvent(event); });

  int value1 = 0;
  int value2 = 0;
  auto c2 = d.ConnectToAll([&](const EventWrapper& event) {
    value1 += 1;
    value2 = event.GetValueWithDefault(Hash("value"), 0);
  });

  EXPECT_EQ(static_cast<size_t>(2), d.GetHandlerCount());
  EXPECT_EQ(static_cast<size_t>(1), d.GetHandlerCount(0));
  EXPECT_EQ(static_cast<size_t>(1), d.GetHandlerCount(GetTypeId<Event>()));

  d.Send(Event(123));
  EXPECT_EQ(1, value1);
  EXPECT_EQ(123, value2);
  EXPECT_EQ(123, h.value);

  d.Send(Event(456));
  EXPECT_EQ(2, value1);
  EXPECT_EQ(456, value2);
  EXPECT_EQ(456, h.value);

  d.Send(OtherEvent("Hello"));
  EXPECT_EQ(3, value1);
  EXPECT_EQ(0, value2);
  EXPECT_EQ(456, h.value);

  c1.Disconnect();

  EXPECT_EQ(static_cast<size_t>(1), d.GetHandlerCount());
  EXPECT_EQ(static_cast<size_t>(1), d.GetHandlerCount(0));
  EXPECT_EQ(static_cast<size_t>(0), d.GetHandlerCount(GetTypeId<Event>()));

  d.Send(Event(123));
  EXPECT_EQ(4, value1);
  EXPECT_EQ(123, value2);
  EXPECT_EQ(456, h.value);

  c2.Disconnect();
  EXPECT_EQ(static_cast<size_t>(0), d.GetHandlerCount());
  EXPECT_EQ(static_cast<size_t>(0), d.GetHandlerCount(0));
  EXPECT_EQ(static_cast<size_t>(0), d.GetHandlerCount(GetTypeId<Event>()));

  d.Send(Event(789));
  EXPECT_EQ(4, value1);
  EXPECT_EQ(123, value2);
  EXPECT_EQ(456, h.value);
}

}  // namespace
}  // namespace lull


text:
import * as React from 'react';
import { ButtonProps } from '../../elements/Button';

export interface ModalActionsProps {
  [key: string]: any;

  /** An element type to render as (string or function). */
  as?: any;

  /** An element type to render as (string or function). */
  actions?: Array<any>;

  /** Primary content. */
  children?: React.ReactNode;

  /** Additional classes. */
  className?: string;

  /**
   * onClick handler for an action. Mutually exclusive with children.
   *
   * @param {SyntheticEvent} event - React's original SyntheticEvent.
   * @param {object} data - All item props.
   */
  onActionClick?: (event: React.MouseEvent<HTMLAnchorElement>, data: ButtonProps) => void;
}

declare const ModalActions: React.ComponentClass<ModalActionsProps>;

export default ModalActions;


text:
package org.apache.camel.component.aws.kms;

import com.amazonaws.regions.Regions;

import org.apache.camel.test.junit4.CamelTestSupport;
import org.junit.Test;

public class KMSComponentConfigurationTest extends CamelTestSupport {

    @Test
    public void createEndpointWithComponentElements() throws Exception {
        KMSComponent component = new KMSComponent(context);
        component.setAccessKey("XXX");
        component.setSecretKey("YYY");
        KMSEndpoint endpoint = (KMSEndpoint)component.createEndpoint("aws-kms://label");

        assertEquals("XXX", endpoint.getConfiguration().getAccessKey());
        assertEquals("YYY", endpoint.getConfiguration().getSecretKey());
    }

    @Test
    public void createEndpointWithComponentAndEndpointElements() throws Exception {
        KMSComponent component = new KMSComponent(context);
        component.setAccessKey("XXX");
        component.setSecretKey("YYY");
        component.setRegion(Regions.US_WEST_1.toString());
        KMSEndpoint endpoint = (KMSEndpoint)component.createEndpoint("aws-kms://label?accessKey=xxxxxx&secretKey=yyyyy&region=US_EAST_1");

        assertEquals("xxxxxx", endpoint.getConfiguration().getAccessKey());
        assertEquals("yyyyy", endpoint.getConfiguration().getSecretKey());
        assertEquals("US_EAST_1", endpoint.getConfiguration().getRegion());
    }

}


text:
const int kDefaultPollIntervalMsec = 250;

bool SleepInJavascript(content::WebContents* tab_contents, int timeout_msec) {
  const std::string javascript = base::StringPrintf(
      "setTimeout(function() {"
      "  window.domAutomationController.send('sleep-ok');"
      "}, %d)", timeout_msec);

  std::string result;
  bool ok = content::ExecuteScriptAndExtractString(
      tab_contents, javascript, &result);
  return ok && result == "sleep-ok";
}

bool PollingWaitUntil(const std::string& javascript,
                      const std::string& evaluates_to,
                      content::WebContents* tab_contents) {
  return PollingWaitUntil(javascript, evaluates_to, tab_contents,
                          kDefaultPollIntervalMsec);
}

bool PollingWaitUntil(const std::string& javascript,
                      const std::string& evaluates_to,
                      content::WebContents* tab_contents,
                      int poll_interval_msec) {
  base::Time start_time = base::Time::Now();
  base::TimeDelta timeout = TestTimeouts::action_max_timeout();
  std::string result;

  while (base::Time::Now() - start_time < timeout) {
    std::string result;
    if (!content::ExecuteScriptAndExtractString(tab_contents, javascript,
                                                &result)) {
      LOG(ERROR) << "Failed to execute javascript " << javascript;
      return false;
    }

    if (evaluates_to == result)
      return true;

    // Sleep a bit here to keep this loop from spinlocking too badly.
    if (!SleepInJavascript(tab_contents, poll_interval_msec)) {
      // TODO(phoglund): Figure out why this fails every now and then.
      // It's not a huge deal if it does though.
      LOG(ERROR) << "Failed to sleep.";
    }
  }
  LOG(ERROR) << "Timed out while waiting for " << javascript <<
      " to evaluate to " << evaluates_to << "; last result was '" << result <<
      "'";
  return false;
}

static base::FilePath::CharType kServerExecutable[] =
#if defined(OS_WIN)
    FILE_PATH_LITERAL("peerconnection_server.exe");
#else
    FILE_PATH_LITERAL("peerconnection_server");
#endif

const char PeerConnectionServerRunner::kDefaultPort[] = "7778";

bool PeerConnectionServerRunner::Start() {
  base::FilePath peerconnection_server;
  if (!PathService::Get(base::DIR_MODULE, &peerconnection_server)) {
    LOG(ERROR) << "Failed retrieving base::DIR_MODULE!";
    return false;
  }
  peerconnection_server = peerconnection_server.Append(kServerExecutable);

  if (!base::PathExists(peerconnection_server)) {
    LOG(ERROR) << "Missing " << kServerExecutable << ". You must build "
        "it so it ends up next to the browser test binary.";
    return false;
  }

  CommandLine command_line(peerconnection_server);
  command_line.AppendSwitchASCII("port", kDefaultPort);
  VLOG(0) << "Running " << command_line.GetCommandLineString();
  return base::LaunchProcess(command_line,
                             base::LaunchOptions(),
                             &server_pid_);
}

bool PeerConnectionServerRunner::Stop() {
  return base::KillProcess(server_pid_, 0, false);
}

void PeerConnectionServerRunner::KillAllPeerConnectionServersOnCurrentSystem() {
  if (!base::KillProcesses(kServerExecutable, -1, NULL)) {
    LOG(ERROR) << "Failed to kill instances of " << kServerExecutable << ".";
    return;
  }
  base::WaitForProcessesToExit(kServerExecutable,
                               base::TimeDelta::FromSeconds(5), NULL);
}


text:
FRONTLIGHTDEVICE=/sys/devices/system/fl_tps6116x/fl_tps6116x0/fl_intensity
FRAMEWORK=$(ps -A | grep framework)

if [ "$FRAMEWORK" != "" ] ; then
	echo "killing framework..."
	stop lab126_gui
fi

lipc-set-prop com.lab126.powerd preventScreenSaver 1
echo -n 0 > $FRONTLIGHTDEVICE
/mnt/us/weather/display-weather.sh


text:
CREATE OR REPLACE FUNCTION ts.insertdepagenttypes(_depagent character varying)
 RETURNS integer
 LANGUAGE sql
AS $function$
  INSERT INTO ndb.depagenttypes(depagent)
  VALUES (_depagent)
  RETURNING depagentid
$function$


text:
import os
import sys

sys.path.append(os.path.abspath(os.path.dirname(__file__) + "/" + "../../servicemanager"))


text:
module Api
  module V1
    class EventsController < Api::BaseController
      load_resource :conference, find_by: :short_title
      respond_to :json

      def index
        events = Event.includes(:conference, :track, :room, :event_type, event_users: :user)

        if @conference
          events = events.where(conference: @conference)
        end

        respond_with events.confirmed
      end
    end
  end
end


text:
import { Component, OnInit } from '@angular/core';
import './carousel.js';
@Component({
  selector: 'app-carousel',
  templateUrl: './carousel.component.html',
  styleUrls: ['./carousel.component.css']
})
export class CarouselComponent implements OnInit {

  constructor() { }

  ngOnInit() {
  }

}


text:
#ifndef EDITPROFILE_H
#define EDITPROFILE_H

#include<QDialog>
#include"userdao.h"
#include"myhelper.h"
#include"text.h"

namespace Ui {
class EditProfile;
}

class EditProfile : public QDialog
{
    Q_OBJECT

public:
    explicit EditProfile(QWidget *parent = 0);
    ~EditProfile();
    void init();

private slots:

    void on_btnOk_clicked();

    void on_btnCancel_clicked();

private:
    Ui::EditProfile *ui;
    User  user;
};

#endif // EDITPROFILE_H


text:
package puzzles.arrays.intersection;

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

/**
 * Given two list of friends, find the common friends
 * in an efficient way.
 *
 * @author lresende
 *
 */

public class ArrayIntersection {
	private static String[] MY_FRIENDS = {"John", "Peter", "Frank", "Paul"};
	private static String[] HIS_FRIENDS = {"Alan", "Mike", "Frank", "Peter", "Michael"};

	public static List<String> getIntersection(String[] l1, String[] l2) {
		List<String> common = new ArrayList<String>();
		int size = l1.length + l2.length;
		int p1 = 0;
		int p2 = 0;
		for(int n=0; n<size; n++) {
			String e1 = l1[p1];
			String e2 = l2[p2];
			if(e1.equalsIgnoreCase(e2)) {
				// intersection
				common.add(e1);
				p1++;
				p2++;
			} if(e1.compareTo(e2) < 0 ) {
				p1++;
			} if(e1.compareTo(e2) > 0) {
				p2++;
			}

			if(p1 >= l1.length || p2 >= l2.length) {
				break;
			}
		}

		return common;
	}

	public static void printList(String title, List<String> list) {
		String[] array = new String[list.size()];
		array = list.toArray(array);

		printList(title, array);
	}

	public static void printList(String title, String[] list) {
		System.out.println(title);
		for(String e : list) {
			System.out.print(e + " ");
		}
		System.out.println();
		System.out.println();
	}

	public static void main(String[] args) {
		Arrays.sort(MY_FRIENDS);
		Arrays.sort(HIS_FRIENDS);

		ArrayIntersection.printList("My friends:", MY_FRIENDS);
		ArrayIntersection.printList("His Friends", HIS_FRIENDS);

		ArrayIntersection list = new ArrayIntersection();
		List<String> common = ArrayIntersection.getIntersection(MY_FRIENDS, HIS_FRIENDS);

		ArrayIntersection.printList("Common elements :", common);

	}

}


text:
<!DOCTYPE html>

    <meta http-equiv="refresh" content="0;URL=type.Marker.html">

Redirecting to type.Marker.html...


text:
package com.time2desenho.wikalendario.view;

import android.content.Context;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.support.v7.app.ActionBar;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.DefaultItemAnimator;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.util.Log;
import android.view.View;
import android.widget.TextView;
import android.widget.Toast;

import com.google.android.gms.appindexing.Action;
import com.google.android.gms.appindexing.AppIndex;
import com.google.android.gms.common.api.GoogleApiClient;
import com.time2desenho.wikalendario.R;
import com.time2desenho.wikalendario.controller.ClassController;
import com.time2desenho.wikalendario.model.Class;
import com.time2desenho.wikalendario.model.Subject;

import static com.time2desenho.wikalendario.R.id.recyclerView;
import static com.time2desenho.wikalendario.R.string.show_code;

public class SubjectActivity extends AppCompatActivity {

    private RecyclerView recyclerView;

    private ClassController classController;
    private Context context = this;

    private GoogleApiClient client;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_subject2);

        classController = new ClassController(context);

        Intent intent = getIntent();
        String name = intent.getStringExtra("name");
        String code = intent.getStringExtra("code");
        String id = intent.getStringExtra("id");

        classController.setCurrentSubject(Long.valueOf(id));

        for (Class mclass : classController.getSubjectClasses()) {
            Log.d("CLASSES", mclass.getLetter() + " " + mclass.getSubject().getName() + " " + mclass.getTeacher());
        }

        recyclerView = (RecyclerView) findViewById(R.id.recyclerView);
        recyclerView.setLayoutManager(new LinearLayoutManager(this));
        recyclerView.setItemAnimator(new DefaultItemAnimator());
        recyclerView.setHasFixedSize(true);

        //    Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
        //    setSupportActionBar(toolbar);
        ActionBar actionBar = getSupportActionBar();
        assert actionBar != null;
        actionBar.setTitle("Disciplina");

        client = new GoogleApiClient.Builder(this).addApi(AppIndex.API).build();
    }

    @Override
    protected void onResume(){
        super.onResume();
        recyclerView.setAdapter(new ClassAdapter(this, classController.getSubjectClasses(), onClickClass()));
    }

    public ClassAdapter.ClassOnClickListener onClickClass(){
        return new ClassAdapter.ClassOnClickListener(){
            @Override
            public void onClickClass(View view, int position){
                 Class mClass = classController.getSubjectClasses().get(position);

                Intent intent = new Intent(getContext(), EventsActivity.class);
                intent.putExtra("id", String.valueOf(mClass.getIdClass()));
                startActivity(intent);

                /**Toast.makeText(getContext(),"Class: " + mClass.getLetter() + ":" + mClass.getTeacher()
                        , Toast.LENGTH_SHORT).show();*/
            }
        };
    }

    public Context getContext() {
        return this;
    }

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

        client.connect();
        Action viewAction = Action.newAction(
                Action.TYPE_VIEW, // TODO: choose an action type.
                "Subject Page", // TODO: Define a title for the content shown.
                // TODO: If you have web page content that matches this app activity's content,
                // make sure this auto-generated web page URL is correct.
                // Otherwise, set the URL to null.
                Uri.parse("http://host/path"),
                // TODO: Make sure this auto-generated app URL is correct.
                Uri.parse("android-app://com.time2desenho.wikalendario/http/host/path")
        );
        AppIndex.AppIndexApi.start(client, viewAction);
    }

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

        // ATTENTION: This was auto-generated to implement the App Indexing API.
        // See https://g.co/AppIndexing/AndroidStudio for more information.
        Action viewAction = Action.newAction(
                Action.TYPE_VIEW, // TODO: choose an action type.
                "Subject Page", // TODO: Define a title for the content shown.
                // TODO: If you have web page content that matches this app activity's content,
                // make sure this auto-generated web page URL is correct.
                // Otherwise, set the URL to null.
                Uri.parse("http://host/path"),
                // TODO: Make sure this auto-generated app URL is correct.
                Uri.parse("android-app://com.time2desenho.wikalendario/http/host/path")
        );
        AppIndex.AppIndexApi.end(client, viewAction);
        client.disconnect();
    }
}


text:
/**
 * @author Aleksander V. Budniy
 */

/**
 * Created on 1.05.2006
 */
package org.apache.harmony.jpda.tests.jdwp.StackFrame;

import org.apache.harmony.jpda.tests.share.JPDADebuggeeSynchronizer;
import org.apache.harmony.jpda.tests.share.SyncDebuggee;

public class PopFramesDebuggee extends SyncDebuggee {

    public static final String METHOD_TO_INVOKE_NAME = "methodToInvoke";

    public static long methodToInvoke(long timeToSleep) {

        Object obj = new Object();
        synchronized (obj) {
            try {
                obj.wait(timeToSleep);
            } catch (Exception e) {
                e.printStackTrace();
            }
        }
        return timeToSleep;
    }

    public static void main(String [] args) {
        runDebuggee(PopFramesDebuggee.class);
    }

    public void run() {
        logWriter.println("Entering nestledMethod1");
        nestledMethod1();
    }

    private void nestledMethod1() {
        logWriter.println("Entering nestledMethod2");
        nestledMethod2();
    }

    private void nestledMethod2() {
        logWriter.println("Entering nestledMethod3");
        //next line for breakpoint
        nestledMethod3();
    }

    private void nestledMethod3() {
        synchronizer.sendMessage(JPDADebuggeeSynchronizer.SGNL_READY);
        synchronizer.receiveMessage(JPDADebuggeeSynchronizer.SGNL_CONTINUE);
        logWriter.println("Entering nestledMethod4");
        //next line for breakpoint
        nestledMethod4();
    }

    private void nestledMethod4() {
        boolean boolLocalVariable = true;
        int intLocalVariable = -512;
        String strLocalVariable = "test string";
        logWriter.println("nestledMethod4 achieved");
        logWriter.println("boolLocalVariable = " + boolLocalVariable);
        logWriter.println("intLocalVariable = " + intLocalVariable);
        logWriter.println("strLocalVariable = " +strLocalVariable);

        synchronizer.sendMessage(JPDADebuggeeSynchronizer.SGNL_READY);
        synchronizer.receiveMessage(JPDADebuggeeSynchronizer.SGNL_CONTINUE);
        logWriter.println("PopFramesDebuggee is ended");
    }

}


text:
// This file is automatically generated.

package adila.db;

/*
 * Lenovo A936
 *
 * DEVICE: A936
 * MODEL: Lenovo A936
 */
final class a936_lenovo20a936 {
    public static final String DATA = "Lenovo|A936|";
}


text:
from django.shortcuts import render, get_object_or_404, redirect
from django_blog_it.models import (BlogUser, Category, Tag, Article)
from django_blog_it.forms import CategoryForm, ArticleForm
from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger
from django.contrib.auth.decorators import login_required
from django.http.response import JsonResponse
from django.http import Http404
from django.urls import reverse
from django.contrib.auth import get_user_model

def required_roles(roles):
    def user_role(function):
        def wrap(request, *args, **kwargs):
            user = BlogUser.objects.filter(
                user=request.user, is_active=True).values_list(
                'role', flat=True)
            for role in user:
                if (role in roles) or (
                        'admin' in roles and request.user.is_superuser):
                    return function(request, *args, **kwargs)
            raise Http404
        return wrap
    return user_role

@login_required
def dashboard(request):
    return render(request, 'django_blog_it/admin/dashboard.html')

@login_required
@required_roles(["admin", 'blog_admin'])
def user_list(request):
    total_users = get_user_model().objects.all()
    page = request.GET.get('page', 1)
    if request.GET.get('name'):
        name = request.GET.get('name')
        total_users = total_users.filter(email__icontains=name)
    if request.GET.get('page_length'):
        length = request.GET.get('page_length')
    else:
        length = 15
    paginator = Paginator(total_users, length)
    try:
        users = paginator.page(page)
    except PageNotAnInteger:
        users = paginator.page(1)
    except EmptyPage:
        users = paginator.page(paginator.num_pages)
    return render(request, 'django_blog_it/admin/user_list.html',
                  {'users': users, 'list_length': length})

@login_required
@required_roles(["admin", 'blog_admin'])
def user_role(request):
    if request.method == "POST":
        role = request.POST.get('role')
        user = request.POST.get('user_id')
        if role:
            if not BlogUser.objects.filter(user_id=user, role=role).exists():
                BlogUser.objects.create(user_id=user, role=role)
        return JsonResponse({"response": 'done'})
    else:
        user_id = request.GET.get('user_id')
        role = request.GET.get('role')
        blog = BlogUser.objects.filter(user_id=user_id, role=role).first()
        blog.delete()
        return JsonResponse({"response": 'done'})

@login_required
@required_roles(["admin", "blog_admin", 'blog_publisher', 'blog_author'])
def blog_list(request):
    article_data = Article.objects.order_by('id')
    if request.GET.get('name'):
        name = request.GET.get('name')
        article_data = article_data.filter(
            title__icontains=name)
    blogs_list = article_data.filter(is_page=False)
    pages_list = article_data.filter(is_page=True)
    return render(
        request, 'django_blog_it/admin/blog_list.html', {'blogs_list': blogs_list, 'pages_list': pages_list})

@login_required
@required_roles(["admin", 'blog_admin', 'blog_publisher', 'blog_author'])
def blog_new(request):
    category_list = Category.objects.filter(created_by=request.user)
    tag_ids = Article.objects.values_list("tags", flat=True)
    tags = Tag.objects.filter(id__in=tag_ids)
    if request.method == 'POST':
        form = ArticleForm(request.POST, type=request.POST.get('is_page'))
        if form.is_valid():
            blog = form.save(commit=False)
            blog.created_by = request.user
            if request.POST.get('category'):
                blog.category = Category.objects.filter(
                    id=request.POST['category']).first()
            if request.POST.get('is_page') == "Page":
                blog.is_page = True
            else:
                blog.is_page = False
            blog.save()
            if request.POST.getlist('tags'):
                splitted_tags = request.POST.getlist("tags")
                for t in splitted_tags:
                    tag = Tag.objects.filter(name=t.lower())
                    if tag:
                        tag = tag[0]
                    else:
                        tag = Tag.objects.create(name=t.lower())
                    blog.tags.add(tag)
            return redirect('django_blog_it:blog_list')
        return render(request, 'django_blog_it/admin/blog_new.html', {'category': category_list, 'form': form.errors, 'tags': tags})
    return render(request, 'django_blog_it/admin/blog_new.html', {'category': category_list, 'tags': tags})

@login_required
@required_roles(["admin", 'blog_admin', 'blog_publisher', 'blog_author'])
def blog_edit(request, pk):
    blog_content = get_object_or_404(Article, id=pk)
    category_list = Category.objects.filter(
        created_by=request.user)
    tag_ids = Article.objects.filter(
        created_by=request.user).values_list("tags", flat=True)
    tags = Tag.objects.filter(id__in=tag_ids)
    if request.method == 'POST':
        form = ArticleForm(request.POST, instance=blog_content,
                           type=request.POST.get('is_page'))
        if form.is_valid():
            blog = form.save(commit=False)
            if request.POST.get("is_page") == "Page":
                blog.is_page = True
            else:
                blog.is_page = False
            blog.save()
            if request.POST.getlist('tags'):
                blog_content.tags.clear()
                tags = request.POST.getlist('tags')
                for t in tags:
                    tag = Tag.objects.filter(name=t.lower())
                    if tag:
                        tag = tag[0]
                    else:
                        tag = Tag.objects.create(name=t.lower())
                    blog.tags.add(tag)
            return redirect('django_blog_it:blog_list')
        return render(request, 'django_blog_it/admin/blog_edit.html', {'form': form.errors, 'blog': blog_content, 'category': category_list, 'tags': tags})
    return render(request, 'django_blog_it/admin/blog_edit.html', {'blog': blog_content, 'category': category_list, 'tags': tags})

@login_required
@required_roles(["admin", 'blog_admin', 'blog_publisher', 'blog_author'])
def blog_delete(request, pk):
    blog = get_object_or_404(Article, id=pk)
    blog.delete()
    return redirect('django_blog_it:blog_list')

@login_required
@required_roles(["admin", 'blog_admin', 'blog_publisher', 'blog_author'])
def blog_category_list(request):
    category_list = Category.objects.order_by('id')
    page = request.GET.get('page', 1)
    if request.GET.get('name'):
        name = request.GET.get('name')
        category_list = category_list.filter(name__icontains=name)
    if request.GET.get('page_length'):
        length = request.GET.get('page_length')
    else:
        length = 15
    paginator = Paginator(category_list, length)
    try:
        blog = paginator.page(page)
    except PageNotAnInteger:
        blog = paginator.page(1)
    except EmptyPage:
        blog = paginator.page(paginator.num_pages)
    return render(request, 'django_blog_it/admin/blog_category_list.html', {'blogdata': blog, 'list_length': length})

@login_required
@required_roles(["admin", 'blog_admin', 'blog_publisher', 'blog_author'])
def blog_category(request):
    if request.method == 'POST':
        form = CategoryForm(request.POST)
        if form.is_valid():
            blog = form.save(commit=False)
            blog.created_by = request.user
            blog.is_active = True
            blog.save()
            return redirect('django_blog_it:blog_category_list')
        return render(request, 'django_blog_it/admin/blog_category_create.html', {'form': form.errors
                                                                                })
    return render(request, 'django_blog_it/admin/blog_category_create.html')

@login_required
@required_roles(["admin", 'blog_admin', 'blog_publisher', 'blog_author'])
def blog_catergory_edit(request, pk):
    blog = get_object_or_404(Category, id=pk)
    if request.method == 'POST':
        form = CategoryForm(request.POST, instance=blog)
        if form.is_valid():
            form.save()
            return redirect('django_blog_it:blog_category_list')
        return render(request, 'django_blog_it/admin/blog_category_edit.html',
                      {'form': form.errors, 'blog_data': blog})
    return render(request, 'django_blog_it/admin/blog_category_edit.html', {'blog_data': blog})

@login_required
@required_roles(["admin", 'blog_admin', 'blog_publisher', 'blog_author'])
def blog_category_delete(request, pk):
    blog = get_object_or_404(Category, id=pk)
    blog.delete()
    return redirect('django_blog_it:blog_category_list')

@login_required
@required_roles(["admin", 'blog_admin', 'blog_publisher', 'blog_author'])
def page_category(request):
    if request.method == 'POST':
        form = CategoryForm(request.POST)
        if form.is_valid():
            blog = form.save(commit=False)
            blog.created_by = request.user
            blog.is_active = True
            blog.is_page = True
            blog.save()
            return redirect('django_blog_it:page_category_list')
        return render(request, 'django_blog_it/admin/page_category.html', {'form': form.errors
                                                                           })
    return render(request, 'django_blog_it/admin/page_category.html')

@login_required
def blog_detail(request, slug):
    blog = get_object_or_404(Article, slug=slug, is_page=False)
    return render(request, 'django_blog_it/blog/blog.html', {'data': blog})

@login_required
def blog_preview(request, pk):
    blog = get_object_or_404(Article, id=pk)
    return render(request, 'django_blog_it/admin/preview.html', {'data': blog})

@login_required
def page_detail(request, slug):
    blog = get_object_or_404(Article, slug=slug, is_page=True)
    return render(request, 'django_blog_it/page/page.html', {'data': blog})

@login_required
def blog_content_edit_with_grapejs(request, pk):
    blog = get_object_or_404(Article, pk=pk)
    if request.method == "GET":
        landinpage_url = reverse(
            "django_blog_it:get_blog_content", kwargs={"pk": pk}
        )
        return render(
            request,
            "django_blog_it/admin/grape_js.html",
            {"landinpage_url": landinpage_url},
        )
    if request.method == "POST":
        html = request.POST.get("html")
        css = request.POST.get("css")
        if html and css:
            html_css = html + "<style>" + css + "</style>"
            blog.content = html_css
            blog.save()
        url = reverse("django_blog_it:blog_edit", kwargs={"pk": pk})
        return JsonResponse({"redirect_url": url})

@login_required
def get_blog_content(request, pk):
    blog = get_object_or_404(Article, pk=pk)
    if request.method == "POST":
        html = blog.content
        return JsonResponse({"html": html})
    return render(request, 'django_blog_it/admin/preview.html', {"data": blog})

@login_required
def blog_content_edit_with_ckeditor(request, pk):
    blog = get_object_or_404(Article, pk=pk)
    if request.method == "GET":
        return render(
            request,
            "django_blog_it/admin/ckeditor.html", {"blog": blog}
        )
    if request.method == "POST":
        content = request.POST.get("content")
        if content:
            blog.content = content
            blog.save()
        url = reverse("django_blog_it:blog_edit", kwargs={"pk": pk})
        return JsonResponse({"redirect_url": url})