text:
getStatsParser.candidatePair = function(result) {
    if (result.type !== 'googCandidatePair' && result.type !== 'candidate-pair' && result.type !== 'local-candidate' && result.type !== 'remote-candidate') return;

    // result.googActiveConnection means either STUN or TURN is used.

    if (result.googActiveConnection == 'true') {
        // id === 'Conn-audio-1-0'
        // localCandidateId, remoteCandidateId

        // bytesSent, bytesReceived

        Object.keys(getStatsResult.internal.candidates).forEach(function(cid) {
            var candidate = getStatsResult.internal.candidates[cid];
            if (candidate.ipAddress.indexOf(result.googLocalAddress) !== -1) {
                getStatsResult.connectionType.local.candidateType = candidate.candidateType;
                getStatsResult.connectionType.local.ipAddress = candidate.ipAddress;
                getStatsResult.connectionType.local.networkType = candidate.networkType;
                getStatsResult.connectionType.local.transport = candidate.transport;
            }
            if (candidate.ipAddress.indexOf(result.googRemoteAddress) !== -1) {
                getStatsResult.connectionType.remote.candidateType = candidate.candidateType;
                getStatsResult.connectionType.remote.ipAddress = candidate.ipAddress;
                getStatsResult.connectionType.remote.networkType = candidate.networkType;
                getStatsResult.connectionType.remote.transport = candidate.transport;
            }
        });

        getStatsResult.connectionType.transport = result.googTransportType;

        var localCandidate = getStatsResult.internal.candidates[result.localCandidateId];
        if (localCandidate) {
            if (localCandidate.ipAddress) {
                getStatsResult.connectionType.systemIpAddress = localCandidate.ipAddress;
            }
        }

        var remoteCandidate = getStatsResult.internal.candidates[result.remoteCandidateId];
        if (remoteCandidate) {
            if (remoteCandidate.ipAddress) {
                getStatsResult.connectionType.systemIpAddress = remoteCandidate.ipAddress;
            }
        }
    }

    if (result.type === 'candidate-pair') {
        if (result.selected === true && result.nominated === true && result.state === 'succeeded') {
            // remoteCandidateId, localCandidateId, componentId
            var localCandidate = getStatsResult.internal.candidates[result.remoteCandidateId];
            var remoteCandidate = getStatsResult.internal.candidates[result.remoteCandidateId];

            // Firefox used above two pairs for connection
        }
    }

    if (result.type === 'local-candidate') {
        getStatsResult.connectionType.local.candidateType = result.candidateType;
        getStatsResult.connectionType.local.ipAddress = result.ipAddress;
        getStatsResult.connectionType.local.networkType = result.networkType;
        getStatsResult.connectionType.local.transport = result.mozLocalTransport || result.transport;
    }

    if (result.type === 'remote-candidate') {
        getStatsResult.connectionType.remote.candidateType = result.candidateType;
        getStatsResult.connectionType.remote.ipAddress = result.ipAddress;
        getStatsResult.connectionType.remote.networkType = result.networkType;
        getStatsResult.connectionType.remote.transport = result.mozRemoteTransport || result.transport;
    }

    if (isSafari) {
        // result.remoteCandidateId
        // todo: below line will always force "send" on Safari; find a solution
        var sendrecvType = result.localCandidateId ? 'send' : 'recv';

        if (!sendrecvType) return;

        if (!!result.bytesSent) {
            var kilobytes = 0;
            if (!getStatsResult.internal.video[sendrecvType].prevBytesSent) {
                getStatsResult.internal.video[sendrecvType].prevBytesSent = result.bytesSent;
            }

            var bytes = result.bytesSent - getStatsResult.internal.video[sendrecvType].prevBytesSent;
            getStatsResult.internal.video[sendrecvType].prevBytesSent = result.bytesSent;

            kilobytes = bytes / 1024;

            getStatsResult.video[sendrecvType].availableBandwidth = kilobytes.toFixed(1);
            getStatsResult.video.bytesSent = kilobytes.toFixed(1);
        }

        if (!!result.bytesReceived) {
            var kilobytes = 0;
            if (!getStatsResult.internal.video[sendrecvType].prevBytesReceived) {
                getStatsResult.internal.video[sendrecvType].prevBytesReceived = result.bytesReceived;
            }

            var bytes = result.bytesReceived - getStatsResult.internal.video[sendrecvType].prevBytesReceived;
            getStatsResult.internal.video[sendrecvType].prevBytesReceived = result.bytesReceived;

            kilobytes = bytes / 1024;
            // getStatsResult.video[sendrecvType].availableBandwidth = kilobytes.toFixed(1);
            getStatsResult.video.bytesReceived = kilobytes.toFixed(1);
        }

        if (!!result.availableOutgoingBitrate) {
            var kilobytes = 0;
            if (!getStatsResult.internal.video[sendrecvType].prevAvailableOutgoingBitrate) {
                getStatsResult.internal.video[sendrecvType].prevAvailableOutgoingBitrate = result.availableOutgoingBitrate;
            }

            var bytes = result.availableOutgoingBitrate - getStatsResult.internal.video[sendrecvType].prevAvailableOutgoingBitrate;
            getStatsResult.internal.video[sendrecvType].prevAvailableOutgoingBitrate = result.availableOutgoingBitrate;

            kilobytes = bytes / 1024;
            // getStatsResult.video[sendrecvType].availableBandwidth = kilobytes.toFixed(1);
            getStatsResult.video.availableOutgoingBitrate = kilobytes.toFixed(1);
        }

        if (!!result.availableIncomingBitrate) {
            var kilobytes = 0;
            if (!getStatsResult.internal.video[sendrecvType].prevAvailableIncomingBitrate) {
                getStatsResult.internal.video[sendrecvType].prevAvailableIncomingBitrate = result.availableIncomingBitrate;
            }

            var bytes = result.availableIncomingBitrate - getStatsResult.internal.video[sendrecvType].prevAvailableIncomingBitrate;
            getStatsResult.internal.video[sendrecvType].prevAvailableIncomingBitrate = result.availableIncomingBitrate;

            kilobytes = bytes / 1024;
            // getStatsResult.video[sendrecvType].availableBandwidth = kilobytes.toFixed(1);
            getStatsResult.video.availableIncomingBitrate = kilobytes.toFixed(1);
        }
    }
};


text:
module Dribbble
  class Base
    include HTTParty
    extend HTTParty

    base_uri 'api.dribbble.com'

    def initialize(attributes = {})
      attributes ||= {}
      attributes.each do |key, value|
        setter = "#{key}="
        self.send setter, value if self.respond_to?(setter)
      end

      after_initialize(attributes)
    end

    def self.paginated_list(result, list_key='shots')
      result[llist_key].map do |attributes|
        new(attributes)
      end
    end
  end
end

redpajama_set_name: RedPajamaGithub


text:
class GamesController < ApplicationController
  def index
    @games = Game.all
  end

  def show
    @game = Game.find(params[:id])
  end

  def new
    @game = Game.new
  end

  def create
    @game = Game.new(game_params)
    # TODO TAKE THIS LINE OUT!!!!
    @game.update_attributes(creator_id: 1)

    if @game.save
      redirect_to game_path(@game)
    else
      render :new
    end
  end

  private

  def game_params
    params.require(:game).permit(:name, :description)
  end
end


text:
module Opinio
  module Controllers
    module Helpers

      def comments_for(object, options = {})
        render_comments(object, options) +
        ( render_comments_form(object, options) unless options[:no_new] ).to_s
      end

      def render_comments(object, options = {})
        limit = options.delete(:limit) || Opinio.model_name.constantize.default_per_page
        page  = options.delete(:page)  || 1
        render( :partial => "opinio/comments/comments", :locals => {:comments => object.comments.page(page).limit(limit), :commentable => object, :options => options} )
      end

      def render_comments_form(object, options = {})
        render( :partial => "opinio/comments/new", :locals => {:commentable => object, :options => options} )
      end
    end

  end
end


text:
package com.frdfsnlght.transporter;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;
import org.bukkit.Material;
import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.PlayerInventory;
import org.bukkit.material.MaterialData;

/**
 *
 * @author frdfsnlght <frdfsnlght@gmail.com>
 */
public final class Inventory {

    public static List<TypeMap> encodeItemStackArray(ItemStack[] isa) {
        if (isa == null) return null;
        List<TypeMap> inv = new ArrayList<TypeMap>();
        for (int slot = 0; slot < isa.length; slot++)
            inv.add(encodeItemStack(isa[slot]));
        return inv;
    }

    public static ItemStack[] decodeItemStackArray(List<TypeMap> inv) {
        if (inv == null) return null;
        ItemStack[] decoded = new ItemStack[inv.size()];
        for (int slot = 0; slot < inv.size(); slot++)
            decoded[slot] = decodeItemStack(inv.get(slot));
        return decoded;
    }

    public static TypeMap encodeItemStack(ItemStack stack) {
        if (stack == null) return null;
        TypeMap s = new TypeMap();
        s.put("type", stack.getTypeId());
        s.put("amount", stack.getAmount());
        s.put("durability", stack.getDurability());
        MaterialData data = stack.getData();
        if (data != null)
            s.put("data", (int)data.getData());
        TypeMap tag = Global.compatibility.getItemStackTag(stack);
        if (tag != null)
            s.put("tag", tag);
        return s;
    }

    public static ItemStack decodeItemStack(TypeMap s) {
        if (s == null) return null;
        ItemStack stack = Global.compatibility.createItemStack(
                s.getInt("type"),
                s.getInt("amount"),
                (short)s.getInt("durability"));
        if (s.containsKey("data")) {
            MaterialData data = stack.getData();
            if (data != null)
                data.setData((byte)s.getInt("data"));
        }
        if (s.containsKey("tag"))
            stack = Global.compatibility.setItemStackTag(stack, s.getMap("tag"));
        return stack;
    }

    public static String normalizeItem(String item) {
        if (item == null) return null;
        if (item.equals("*")) return item;
        item = item.toUpperCase();
        String parts[] = item.split(":");
        if (parts.length > 2) return null;
        try {
            int typeId = Integer.parseInt(parts[0]);
            Material material = Material.getMaterial(typeId);
            if (material == null) return null;
            item = material.toString();
        } catch (NumberFormatException nfe) {
            try {
                Material material = Utils.valueOf(Material.class, parts[0]);
                item = material.toString();
            } catch (IllegalArgumentException iae) {
                return null;
            }
        }
        if (parts.length > 1)
            try {
                short dura = Short.parseShort(parts[1]);
                item += ":" + dura;
            } catch (NumberFormatException e) {
                return null;
            }
        return item;
    }

    public static boolean appendItemList(Set<String> items, String item) throws InventoryException {
        item = normalizeItem(item);
        if (item == null)
            throw new InventoryException("invalid item");
        if (items.contains(item)) return false;
        items.add(item);
        return true;
    }

    public static boolean removeItemList(Set<String> items, String item) throws InventoryException {
        item = normalizeItem(item);
        if (item == null)
            throw new InventoryException("invalid item");
        if (! items.contains(item)) return false;
        items.remove(item);
        return true;
    }

    public static boolean itemListContains(Set<String> items, String item, boolean matchAir) {
        if (item.equals("*")) return true;
        if ((! matchAir) && item.equals("AIR")) return false;
        String parts[] = item.split(":");
        return items.contains("*") ||
               items.contains(parts[0]) ||
               items.contains(item);
    }

    public static boolean appendItemMap(Map<String,String> items, String fromItem, String toItem) throws InventoryException {
        fromItem = Inventory.normalizeItem(fromItem);
        if (fromItem == null)
            throw new InventoryException("invalid from item");
        toItem = Inventory.normalizeItem(toItem);
        if (toItem == null)
            throw new InventoryException("invalid to item");
        if (items.containsKey(fromItem)) return false;
        items.put(fromItem, toItem);
        return true;
    }

    public static boolean removeItemMap(Map<String,String> items, String fromItem) throws InventoryException {
        fromItem = Inventory.normalizeItem(fromItem);
        if (fromItem == null)
            throw new InventoryException("invalid from item");
        if (! items.containsKey(fromItem)) return false;
        items.remove(fromItem);
        return true;
    }

    public static ItemStack filterItemStack(ItemStack stack, Map<String,String> replace, Set<String> allowed, Set<String> banned) {
        if (stack == null) return null;
        String item = stringifyItemStack(stack);
        if (item == null) return null;
        String newItem;
        String parts[] = item.split(":");
        if (replace != null) {
            if (replace.containsKey(parts[0]))
                newItem = replace.get(parts[0]);
            else
                newItem = replace.get(item);
        } else
            newItem = item;

        if ((newItem != null) && (! newItem.equals("*"))) {
            stack = destringifyItem(stack, newItem);
            item = newItem;
        }
        if ((allowed != null) && (! allowed.isEmpty())) {
            if (itemListContains(allowed, item, true)) return stack;
            return null;
        }
        if (banned != null)
            if (itemListContains(banned, item, false)) return null;
        return stack;
    }

    private static String stringifyItemStack(ItemStack stack) {
        if ((stack == null) || (stack.getType() == null)) return null;
        String item = stack.getType().toString();
        if (stack.getDurability() > 0)
            item += ":" + stack.getDurability();
        return item;
    }

    private static ItemStack destringifyItem(ItemStack oldItem, String item) {
        String[] parts = item.split(":");
        Material material;
        try {
            material = Utils.valueOf(Material.class, parts[0]);
        } catch (IllegalArgumentException iae) {
            material = Material.AIR;
        }
        int amount = oldItem.getAmount();
        short damage = oldItem.getDurability();
        if (parts.length > 1)
            try {
                damage = Short.parseShort(parts[1]);
            } catch (NumberFormatException e) {}
        return new ItemStack(material, amount, damage);
    }

    public static void requireBlocks(Player player, Map<Material,Integer> blocks) throws InventoryException {
        if ((player == null) || (blocks == null) || blocks.isEmpty()) return;
        PlayerInventory inv = player.getInventory();
        for (Material material : blocks.keySet()) {
            int needed = blocks.get(material);
            if (needed <= 0) continue;
            switch (material) {
                case WALL_SIGN:
                case SIGN_POST:
                    material = Material.SIGN;
                    break;
            }
            HashMap<Integer,? extends ItemStack> slots = inv.all(material);
            for (int slotNum : slots.keySet()) {
                ItemStack stack = slots.get(slotNum);
                needed -= stack.getAmount();
                if (needed <= 0) break;
            }
            if (needed > 0)
                throw new InventoryException("need %d more %s", needed, material);
        }
    }

    public static boolean deductBlocks(Player player, Map<Material,Integer> blocks) throws InventoryException {
        if ((player == null) || (blocks == null) || blocks.isEmpty()) return false;
        PlayerInventory inv = player.getInventory();
        for (Material material : blocks.keySet()) {
            int needed = blocks.get(material);
            if (needed <= 0) continue;
            switch (material) {
                case WALL_SIGN:
                case SIGN_POST:
                    material = Material.SIGN;
                    break;
            }
            HashMap<Integer,? extends ItemStack> slots = inv.all(material);
            for (int slotNum : slots.keySet()) {
                ItemStack stack = slots.get(slotNum);
                if (stack.getAmount() > needed) {
                    stack.setAmount(stack.getAmount() - needed);
                    needed = 0;
                } else {
                    needed -= stack.getAmount();
                    inv.clear(slotNum);
                }
                blocks.put(material, needed);
                if (needed <= 0) break;
            }
            if (needed > 0)
                throw new InventoryException("need %d more %s", needed, material);
        }
        return true;
    }

}


text:
<!DOCTYPE html>

        <title>Test multiple MediaKeys lifetimes</title>


text:
package org.apache.tapestry5.internal.services;

import java.io.IOException;
import java.io.PrintWriter;

import org.apache.tapestry5.ContentType;
import org.apache.tapestry5.MarkupWriter;
import org.apache.tapestry5.internal.structure.Page;
import org.apache.tapestry5.services.MarkupWriterFactory;
import org.apache.tapestry5.services.RequestGlobals;
import org.apache.tapestry5.services.Response;
import org.slf4j.Logger;

public class PageResponseRendererImpl implements PageResponseRenderer
{
    private final RequestGlobals requestGlobals;

    private final PageMarkupRenderer markupRenderer;

    private final MarkupWriterFactory markupWriterFactory;

    private final PageContentTypeAnalyzer pageContentTypeAnalyzer;

    private final Response response;

    private final Logger logger;

    public PageResponseRendererImpl(RequestGlobals requestGlobals, MarkupWriterFactory markupWriterFactory,
            PageMarkupRenderer markupRenderer, PageContentTypeAnalyzer pageContentTypeAnalyzer, Response response,
            Logger logger)
    {
        this.requestGlobals = requestGlobals;
        this.markupWriterFactory = markupWriterFactory;
        this.markupRenderer = markupRenderer;
        this.pageContentTypeAnalyzer = pageContentTypeAnalyzer;
        this.response = response;
        this.logger = logger;
    }

    public void renderPageResponse(Page page) throws IOException
    {
        assert page != null;

        requestGlobals.storeActivePageName(page.getName());

        ContentType contentType = pageContentTypeAnalyzer.findContentType(page);

        // For the moment, the content type is all that's used determine the model for the markup writer.
        // It's something of a can of worms.

        MarkupWriter writer = markupWriterFactory.newMarkupWriter(contentType);

        markupRenderer.renderPageMarkup(page, writer);

        PrintWriter pw = response.getPrintWriter(contentType.toString());

        long startNanos = System.nanoTime();

        writer.toMarkup(pw);

        long endNanos = System.nanoTime();

        if (logger.isDebugEnabled())
        {
            long elapsedNanos = endNanos - startNanos;
            double elapsedSeconds = ((float) elapsedNanos) / 1000000000F;

            logger.debug(String.format("Response DOM streamed to markup in %.3f seconds", elapsedSeconds));
        }

        pw.close();
    }
}


text:
package org.apache.hadoop.mapred;

public class ClaimedSlots {
  private final int numPreemptedForNewTasks;
  private final int numPreemptedForResumableTasks;

  public ClaimedSlots(final int numPreemptedForNewTasks
                    , final int numPreemptedForResumableTasks) {
    this.numPreemptedForNewTasks = numPreemptedForNewTasks;
    this.numPreemptedForResumableTasks = numPreemptedForResumableTasks;
  }

  public int getNumPreemptedForNewTasks() {
    return this.numPreemptedForNewTasks;
  }

  public int getNumPreemptedForResumableTasks() {
    return this.numPreemptedForResumableTasks;
  }

}


text:
/*global define, window*/
define([
    'jquery',
    'logger',
    'kernel',
    'jabbr/messageprocessors/collapse',
    'jabbr/utility',

    'jquery.captureDocumentWrite'
], function ($, Logger, kernel, collapse, utility) {
    var logger = new Logger('jabbr/contentproviders/capture-document-write'),
        ru = null,
        object = null;

    var initialize = function () {
        function captureDocumentWrite (documentWritePath, headerText, elementToAppendTo) {
            $.fn.captureDocumentWrite(documentWritePath, function (content) {
                var nearEnd = ru.isNearTheEnd(),
                    roomName = null,
                    collapsible = null,
                    insertContent = null,
                    links = null;

                roomName = elementToAppendTo.closest('ul.messages').attr('id');
                roomName = roomName.substring(9);

                collapsible = $('

' + utility.getLanguageResource('Content_HeaderAndToggle', headerText) + '

');
                $('.captureDocumentWrite_content', collapsible).append(content);

                // Since IE doesn't render the css if the links are not in the head element, we move those to the head element
                links = $('link', collapsible);
                links.remove();
                $('head').append(links);

                // Remove the target off any existing anchor tags, then re-add target as _blank so it opens new tab (or window)
                $('a', collapsible).removeAttr('target').attr('target', '_blank');

                insertContent = collapsible[0].outerHTML;

                if (collapse.shouldCollapseContent(insertContent, roomName)) {
                    insertContent = ui.collapseRichContent(insertContent);
                }

                elementToAppendTo.append(insertContent);

                if (nearEnd) {
                    ru.scrollToBottom();
                }
            });
        }

        window.captureDocumentWrite = captureDocumentWrite;

        return {
            activate: function () {
                ru = kernel.get('jabbr/components/rooms.ui');

                logger.trace('activated');
            },

            captureDocumentWrite: captureDocumentWrite
        };
    };

    return function () {
        if (object === null) {
            object = initialize();
            kernel.bind('jabbr/contentproviders/capture-document-write', object);
        }

        return object;
    };
});


text:
/*
© 2017 Altavant Technologies Inc.
Web: http://www.altavant.com
*/

namespace Altavant.Fusion.Utils
{
	using System.IO;
	using Fusion.Core.Data;

	public class Asset : IReleasable
	{
		private string _path;
		private MemoryStream _stream;

		public Asset(string path)
		{
			_path = path;
		}

		public MemoryStream Stream
		{
			get
			{
				if (_stream == null)
					_stream = Utils.ReadAsset(_path);

				return _stream;
			}
		}

		public void Release()
		{
			_stream = null;
		}
	}
}


text:
<?php

/**
 * class Tinebase_Model_State
 *
 * @package     Tinebase
 * @subpackage  Record
 */
class Tinebase_Model_State extends Tinebase_Record_Abstract
{
    /**
     * identifier field name
     *
     * @var string
     */
    protected $_identifier = 'id';

    /**
     * application the record belongs to
     *
     * @var string
     */
    protected $_application = 'Tinebase';

    /**
     * record validators
     *
     * @var array
     */
    protected $_validators = array(
        'id'                => array('allowEmpty' => TRUE),
        'user_id'           => array('presence' => 'required'),
        'data'              => array('allowEmpty' => TRUE),
    );
}


text:
<?php

/**
 * Smarty plugin
 * -------------------------------------------------------------
 * File:     compiler.brisk_page_flush.php
 * Type:     compiler
 * Name:     page_flush
 * Purpose:  Flush all resources and render page fragment
 * -------------------------------------------------------------
 */

function smarty_compiler_brisk_page_flush($params, $smarty) {
  $apiPath = preg_replace('/[\\/\\\\]+/', '/', dirname(__FILE__) . '/brisk/api.php');
  $code  = '<?php ';
  $code .= 'require_once(\'' . $apiPath . '\');';
  $code .= '$_smarty_tpl->registerFilter(\'output\', \'brisk_render_response\');';
  $code .= ' ?>';

  return $code;
}


text:
This folder contains SASS files of various kinds, organized in sub-folders:

    theme-neptune-touch/sass/etc
    theme-neptune-touch/sass/src
    theme-neptune-touch/sass/var


text:
package com.cp.monsterMod.helpers.lastfm;

import java.util.HashMap;
import java.util.Map;

import com.cp.monsterMod.helpers.DomElement;
import com.cp.monsterMod.helpers.utils.StringUtilities;

/**
 * Wrapper class for Album related API calls and Album Bean.
 *
 * @author Janni Kovacs
 */
public class Album extends MusicEntry {

    static final ItemFactory<Album> FACTORY = new AlbumFactory();

    private String artist;

    private Album(String name, String url, String artist) {
        super(name, url);
        this.artist = artist;
    }

    private Album(String name, String url, String mbid, int playcount, int listeners,
            boolean streamable, String artist) {
        super(name, url, mbid, playcount, listeners, streamable);
        this.artist = artist;
    }

    public String getArtist() {
        return artist;
    }

    /**
     * Get the metadata for an album on Last.fm using the album name or a
     * musicbrainz id. See playlist.fetch on how to get the album playlist.
     *
     * @param artist Artist's name
     * @param albumOrMbid Album name or MBID
     * @param apiKey The API key
     * @return Album metadata
     */
    public static Album getInfo(String artist, String albumOrMbid, String apiKey) {
        return getInfo(artist, albumOrMbid, null, apiKey);
    }

    /**
     * Get the metadata for an album on Last.fm using the album name or a
     * musicbrainz id. See playlist.fetch on how to get the album playlist.
     *
     * @param artist Artist's name
     * @param albumOrMbid Album name or MBID
     * @param username The username for the context of the request. If supplied,
     *            the user's playcount for this album is included in the
     *            response.
     * @param apiKey The API key
     * @return Album metadata
     */
    public static Album getInfo(String artist, String albumOrMbid, String username, String apiKey) {
        Map<String, String> params = new HashMap<String, String>();
        if (StringUtilities.isMbid(albumOrMbid)) {
            params.put("mbid", albumOrMbid);
        } else {
            params.put("artist", artist);
            params.put("album", albumOrMbid);
        }
        if (username != null) {
        	params.put("username", username);
		}
        Result result = Caller.getInstance().call("album.getInfo", apiKey, params);
        return ResponseBuilder.buildItem(result, Album.class);
    }

    private static class AlbumFactory implements ItemFactory<Album> {
        @Override
        public Album createItemFromElement(DomElement element) {
            Album album = new Album(null, null, null);
            MusicEntry.loadStandardInfo(album, element);
            if (element.hasChild("artist")) {
                album.artist = element.getChild("artist").getChildText("name");
                if (album.artist == null)
                    album.artist = element.getChildText("artist");
            }
            return album;
        }
    }
}


text:
from azure.cli.core import AzCommandsLoader

from azure.cli.command_modules.backup._help import helps  # pylint: disable=unused-import

class BackupCommandsLoader(AzCommandsLoader):

    def __init__(self, cli_ctx=None):
        from azure.cli.core.commands import CliCommandType
        from azure.cli.core.profiles import ResourceType
        backup_custom = CliCommandType(operations_tmpl='azure.cli.command_modules.backup.custom#{}')
        super(BackupCommandsLoader, self).__init__(cli_ctx=cli_ctx,
                                                   resource_type=ResourceType.MGMT_BACKUP,
                                                   custom_command_type=backup_custom)

    def load_command_table(self, args):
        from azure.cli.command_modules.backup.commands import load_command_table
        load_command_table(self, args)
        return self.command_table

    def load_arguments(self, command):
        from azure.cli.command_modules.backup._params import load_arguments
        load_arguments(self, command)

COMMAND_LOADER_CLS = BackupCommandsLoader


text:
// Copyright 2021 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

package org.chromium.chrome.browser.language.settings;

import android.text.TextUtils;

import androidx.test.filters.SmallTest;

import org.junit.After;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.MockitoAnnotations;

import org.chromium.base.test.BaseRobolectricTestRunner;
import org.chromium.base.test.util.CommandLineFlags;
import org.chromium.base.test.util.JniMocker;
import org.chromium.chrome.browser.flags.ChromeSwitches;
import org.chromium.chrome.browser.language.AppLocaleUtils;
import org.chromium.chrome.browser.language.LanguageTestUtils;
import org.chromium.chrome.browser.translate.FakeTranslateBridgeJni;
import org.chromium.chrome.browser.translate.TranslateBridge;
import org.chromium.chrome.browser.translate.TranslateBridgeJni;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;

/**
 * Tests for {@link LanguagesManager} which gets language lists from native.
 */
@RunWith(BaseRobolectricTestRunner.class)
@CommandLineFlags.Add({ChromeSwitches.DISABLE_FIRST_RUN_EXPERIENCE})
public class LanguagesManagerTest {
    @Rule
    public JniMocker mJniMocker = new JniMocker();

    private FakeTranslateBridgeJni mFakeTranslateBridge;

    @Before
    public void setUp() throws Exception {
        MockitoAnnotations.initMocks(this);
        LanguageTestUtils.initializeResourceBundleForTesting();
        // Setup fake translate and language preferences.
        List<LanguageItem> chromeLanguages = FakeTranslateBridgeJni.getSimpleLanguageItemList();
        List<String> acceptLanguages = Arrays.asList("sw", "en", "en-US");
        List<String> neverLanguages = Arrays.asList("en");
        List<String> alwaysLanguages = new ArrayList();
        String targetLanguage = "en";
        mFakeTranslateBridge = new FakeTranslateBridgeJni(
                chromeLanguages, acceptLanguages, neverLanguages, alwaysLanguages, targetLanguage);
        mJniMocker.mock(TranslateBridgeJni.TEST_HOOKS, mFakeTranslateBridge);
    }

    @After
    public void tearDown() {
        LanguageTestUtils.clearResourceBundleForTesting();
    }

    /**
     * Tests for getting the potential accept languages.
     */
    @Test
    @SmallTest
    public void testGetPotentialAcceptLanguages() {
        List<LanguageItem> items = LanguagesManager.getInstance().getPotentialLanguages(
                LanguagesManager.LanguageListType.ACCEPT_LANGUAGES);

        // The default accept languages list is "sw,en,en-US". Those languages should not be
        // in the potential languages for Accept Languages.
        Assert.assertFalse(containsLanguage(items, "sw"));
        Assert.assertFalse(containsLanguage(items, "en"));
        Assert.assertFalse(containsLanguage(items, "en-US"));
        // But other languages should be.
        Assert.assertEquals(mFakeTranslateBridge.getChromeLanguagesCount() - 3, items.size());
        Assert.assertTrue(containsLanguage(items, "en-GB"));

        // The first language should be Afrikaans.
        Assert.assertEquals(items.get(0).getCode(), "af");

        // Add "af" to front of Accept-Languages.
        items = LanguagesManager.getInstance().getUserAcceptLanguageItems();
        items.add(0, LanguagesManager.getInstance().getLanguageItem("af"));
        setOrder(items);

        items = LanguagesManager.getInstance().getPotentialLanguages(
                LanguagesManager.LanguageListType.ACCEPT_LANGUAGES);
        Assert.assertFalse(containsLanguage(items, "en"));
        Assert.assertFalse(containsLanguage(items, "en-US"));
        // Now "af" should not be in the list.
        Assert.assertFalse(containsLanguage(items, "af"));
        Assert.assertTrue(containsLanguage(items, "en-GB"));
    }

    /**
     * Tests for getting the potential UI languages.
     */
    @Test
    @SmallTest
    public void testGetPotentialUiLanguages() {
        // Set UI Language to Swahili.
        AppLocaleUtils.setAppLanguagePref("sw");

        List<LanguageItem> items = LanguagesManager.getInstance().getPotentialLanguages(
                LanguagesManager.LanguageListType.UI_LANGUAGES);
        Assert.assertFalse(containsLanguage(items, "en"));
        Assert.assertTrue(containsLanguage(items, "en-US"));
        Assert.assertTrue(containsLanguage(items, "en-GB"));

        // Languages that can not be UI languages are not present.
        Assert.assertFalse(containsLanguage(items, "xh"));
        Assert.assertFalse(containsLanguage(items, "wa"));

        // Check that the current UI language (Swahili) is not on the list.
        Assert.assertFalse(containsLanguage(items, "sw"));

        // Check that the first language is the system default language.
        Assert.assertTrue(AppLocaleUtils.isFollowSystemLanguage(items.get(0).getCode()));
        // Check that the second language is "en-US" from the Accept-Languages.
        Assert.assertEquals(items.get(1).getCode(), "en-US");

        // Set UI Language to system default.
        AppLocaleUtils.setAppLanguagePref(AppLocaleUtils.APP_LOCALE_USE_SYSTEM_LANGUAGE);

        items = LanguagesManager.getInstance().getPotentialLanguages(
                LanguagesManager.LanguageListType.UI_LANGUAGES);

        // Check that system default is not on the list and that German is.
        Assert.assertFalse(containsLanguage(items, AppLocaleUtils.APP_LOCALE_USE_SYSTEM_LANGUAGE));
        // Check that the fist languages are from the Accept-Languages.
        Assert.assertEquals(items.get(0).getCode(), "sw");
        Assert.assertEquals(items.get(1).getCode(), "en-US");
    }

    /**
     * Tests for getting the all UI languages.
     */
    @Test
    @SmallTest
    public void testGetAllPossibleUiLanguages() {
        List<LanguageItem> items = LanguagesManager.getInstance().getAllPossibleUiLanguages();
        List<String> itemCodes = items.stream().map(i -> i.getCode()).collect(Collectors.toList());
        Assert.assertEquals(itemCodes, Arrays.asList("af", "en-GB", "en-US", "fil", "hi", "sw"));
    }

    /**
     * Tests for getting the potential target languages.
     */
    @Test
    @SmallTest
    public void testGetPotentialTargetLanguages() {
        List<LanguageItem> items = LanguagesManager.getInstance().getPotentialLanguages(
                LanguagesManager.LanguageListType.TARGET_LANGUAGES);
        Assert.assertFalse(containsLanguage(items, "en-US"));
        Assert.assertFalse(containsLanguage(items, "en-GB"));
        Assert.assertTrue(containsLanguage(items, "fil"));

        // Check that the default target language "en" is not in the list.
        Assert.assertFalse(containsLanguage(items, "en"));

        // Check that the first language is "sw" from the Accept-Languages.
        Assert.assertEquals(items.get(0).getCode(), "sw");

        // Set the target language to "fil" (Filipino) which is "tl" as a Translate language.
        TranslateBridge.setDefaultTargetLanguage("fil");
        items = LanguagesManager.getInstance().getPotentialLanguages(
                LanguagesManager.LanguageListType.TARGET_LANGUAGES);
        Assert.assertFalse(containsLanguage(items, "fil"));
        Assert.assertTrue(containsLanguage(items, "en"));

        // Set the target language to "sw" (Swahili).
        TranslateBridge.setDefaultTargetLanguage("sw");
        items = LanguagesManager.getInstance().getPotentialLanguages(
                LanguagesManager.LanguageListType.TARGET_LANGUAGES);
        Assert.assertFalse(containsLanguage(items, "sw"));
        Assert.assertTrue(containsLanguage(items, "fil"));
    }

    /**
     * Tests for getting the potential always translate languages.
     */
    @Test
    @SmallTest
    public void testGetPotentialAlwaysLanguages() {
        List<LanguageItem> items = LanguagesManager.getInstance().getPotentialLanguages(
                LanguagesManager.LanguageListType.ALWAYS_LANGUAGES);
        int itemsCount = items.size();

        Assert.assertTrue(containsLanguage(items, "en"));
        Assert.assertFalse(containsLanguage(items, "en-US"));
        Assert.assertFalse(containsLanguage(items, "en-GB"));
        Assert.assertTrue(containsLanguage(items, "fil"));

        // Check that the first language is "sw" from the Accept-Languages.
        Assert.assertEquals(items.get(0).getCode(), "sw");

        // Add English and Filipino to always translate languages.
        TranslateBridge.setLanguageAlwaysTranslateState("en", true);
        TranslateBridge.setLanguageAlwaysTranslateState("fil", true);

        items = LanguagesManager.getInstance().getPotentialLanguages(
                LanguagesManager.LanguageListType.ALWAYS_LANGUAGES);
        Assert.assertFalse(containsLanguage(items, "fil"));
        Assert.assertFalse(containsLanguage(items, "en"));
        Assert.assertEquals(itemsCount - 2, items.size());
    }

    /**
     * Test for getting the potential never translate languages.
     */
    @Test
    @SmallTest
    public void testGetPotentialNeverLanguages() {
        List<LanguageItem> items = LanguagesManager.getInstance().getPotentialLanguages(
                LanguagesManager.LanguageListType.NEVER_LANGUAGES);
        int itemsCount = items.size();

        // English is the default never translate language.
        Assert.assertFalse(containsLanguage(items, "en"));
        Assert.assertFalse(containsLanguage(items, "en-US"));
        Assert.assertFalse(containsLanguage(items, "en-GB"));
        Assert.assertTrue(containsLanguage(items, "af"));
        Assert.assertTrue(containsLanguage(items, "fil"));

        // Check that the second language is "sw" from the Accept-Languages.
        Assert.assertEquals(items.get(0).getCode(), "sw");

        TranslateBridge.setLanguageBlockedState("fil", true);
        TranslateBridge.setLanguageBlockedState("sw", true);

        items = LanguagesManager.getInstance().getPotentialLanguages(
                LanguagesManager.LanguageListType.NEVER_LANGUAGES);
        Assert.assertFalse(containsLanguage(items, "fil"));
        Assert.assertFalse(containsLanguage(items, "sw"));
        Assert.assertEquals(itemsCount - 2, items.size());
    }

    /**
     * @param languageList List of LanguageItems.
     * @param language String language code to check for.
     * @return boolean True if |languageList has a {@link LanguageItem} matching |language|.
     */
    private boolean containsLanguage(List<LanguageItem> languageList, String language) {
        for (LanguageItem item : languageList) {
            if (TextUtils.equals(item.getCode(), language)) return true;
        }
        return false;
    }

    /**
     * param languages List of LanguageItems in the order to set Accept-Languages to.
     */
    private void setOrder(List<LanguageItem> languages) {
        String[] codes = new String[languages.size()];
        int i = 0;
        for (LanguageItem item : languages) {
            codes[i++] = item.getCode();
        }
        TranslateBridge.setLanguageOrder(codes);
    }
}


text:
{% extends "easyblog/base.html" %}
{% block keywords %}{{ post.keywords }}{% endblock %}
{% block author %}{{ post.user.get_full_name }}{% endblock %}
{% block description %}{{ post.description }}{% endblock %}
{% block content %}
    {% include "easyblog/posts/article-detail.html" %}
{% endblock %}


text:
<?php

namespace App\Model\Entity;

use DateTime;
use Doctrine\ORM\EntityNotFoundException;
use Doctrine\ORM\Mapping as ORM;

/**
 * ModifiedEventCoorganizer
 *
 * @ORM\Table(name="modified__event_coorganizer")
 * @ORM\Entity
 */
class ModifiedEventCoorganizer
{
    use MagicGetters;

    /**
     * @ORM\Column(type="integer")
     * @ORM\Id
     * @ORM\GeneratedValue
     */
    protected $id;

    /**
     * @ORM\ManyToOne(targetEntity="User")
     */
    protected $user;

    /**
     * @ORM\ManyToOne(targetEntity="EventCoorganizer", inversedBy="modifications")
     */
    protected $eventCoorganizer;

    /**
     * @ORM\Column(type="datetime")
     */
    protected $modTime;

    public function __construct(User $user, EventCoorganizer $eventCoorganizer)
    {
        $this->user = $user;
        $this->eventCoorganizer = $eventCoorganizer;
        $this->modTime = new DateTime;
    }

    ////////////////////////////////////////////////////////////////////////////

    public function getId(): int
    {
        return $this->id;
    }

    public function getModTime(): DateTime
    {
        return $this->modTime;
    }

    public function getUser(): ?User
    {
        try {
            $this->user->getDeleted();
            return $this->user; // entity not deleted, return it
        } catch (EntityNotFoundException $e) {
            return null; // could not fetch soft-deleted entity, return null
        }
    }

    public function getEventCoorganizer(): ?EventCoorganizer
    {
        try {
            $this->eventCoorganizer->getDeleted();
            return $this->eventCoorganizer; // entity not deleted, return it
        } catch (EntityNotFoundException $e) {
            return null; // could not fetch soft-deleted entity, return null
        }
    }
}


text:
ZEPHIR_INIT_CLASS(ArangoDBClient_ClientException) {

	ZEPHIR_REGISTER_CLASS_EX(ArangoDBClient, ClientException, arangodbclient, clientexception, arangodbclient_exception_ce, arangodbclient_clientexception_method_entry, 0);

	return SUCCESS;

}

PHP_METHOD(ArangoDBClient_ClientException, __toString) {

	zval _0;
	zend_long ZEPHIR_LAST_CALL_STATUS;
	zval *this_ptr = getThis();

	ZVAL_UNDEF(&_0);

	ZEPHIR_MM_GROW();

	ZEPHIR_CALL_METHOD(&_0, this_ptr, "getmessage", NULL, 0);
	zephir_check_call_status();
	ZEPHIR_CONCAT_SSV(return_value, "ArangoDBClient\\ClientException", ": ", &_0);
	RETURN_MM();

}


text:
/**
 * Async helpers.
 */
package com.cesi.noodle.async;


text:
Date: Tuesday, 14-Jan-97 21:39:22 GMT
Server: NCSA/1.3
MIME-version: 1.0
Content-type: text/html
Last-modified: Tuesday, 21-May-96 22:26:21 GMT
Content-length: 1061

<TITLE>Copyright Information: UMass Experimental Knowledge Systems Laboratory</TITLE>

Copyright Information

<!WA0> 1993-1996 University of Massachusetts Amherst,
   Amherst, Massachusetts.

All rights reserved.

Permission to use, copy, and distribute this document for research
or educational purposes and without fee is hereby granted, provided
that the above copyright notice and direct reference to the original
document appear on all copies of these documents. Permission to modify
this document, or use it for commercial purpose or financial gain,
must be negotiated with representatives of the University of
Massachusetts Amherst in advance.  The name of the University of
Massachusetts Amherst, may not be used in advertising or publicity
pertaining to this document without express, written prior consent.

<!WA1><!WA2> Back to the EKSL Home Page

<address><!WA3>
EKSL Web Server Administrator
</address>


text:
var __extends = (this && this.__extends) || function (d, b) {
    for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
    function __() { this.constructor = d; }
    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
define(["require", "exports", "./SignalAbstract"], function (require, exports, SignalAbstract_1) {
    var Signal1 = (function (_super) {
        __extends(Signal1, _super);
        function Signal1() {
            _super.apply(this, arguments);
        }
        Signal1.prototype.emit = function (arg1) {
            var _this = this;
            if (this.dispatching()) {
                this.defer(function () { return _this.emitImpl(arg1); });
            }
            else {
                this.emitImpl(arg1);
            }
        };
        Signal1.prototype.emitImpl = function (arg1) {
            var head = this.willEmit();
            var p = head;
            while (p != null) {
                p._listener(arg1);
                if (!p.stayInList) {
                    p.dispose();
                }
                p = p._next;
            }
            this.didEmit(head);
        };
        return Signal1;
    })(SignalAbstract_1.default);
    Object.defineProperty(exports, "__esModule", { value: true });
    exports.default = Signal1;
});


text:
/**
* @Author: Paul Joannon <paulloz>
* @Date:   2016-04-16T09:46:07+02:00
* @Email:  hello@pauljoannon.com
* @Last modified by:   Paul Joannon
* @Last modified time: 2016-04-19T20:10:22+02:00
*/

window.addEventListener('load', function() {
    var now = parseInt(document.querySelector('.content').getAttribute('x-attr-page-loaded'));

    function update() {
        [].slice.call(document.querySelectorAll('.time[x-attr-since]')).forEach(function(element) {
            var timeDiff = (now - parseInt(element.getAttribute('x-attr-since'))) / 1000;
            if (timeDiff / 60 > 1) {
                element.innerText = `${parseInt(timeDiff / 60)} min ${parseInt(timeDiff % 60)} sec`;
            } else {
                element.innerText = `${parseInt(timeDiff)} sec`;
            }
        });

        now += 1000;
        setTimeout(update, 1000);
    }

    update();
});


text:
@implementation PPNQASampleAppTests

- (void)setUp
{
    [super setUp];

    // Set-up code here.
}

- (void)tearDown
{
    // Tear-down code here.

    [super tearDown];
}

- (void)testExample
{
    STFail(@"Unit tests are not implemented yet in PPNQASampleAppTests");
}

@end


text:
package org.pentaho.di.trans.steps.gpbulkloader;

import org.junit.Before;
import org.junit.Test;
import org.junit.Assert;
import org.pentaho.di.core.database.DatabaseMeta;
import org.pentaho.di.core.logging.LoggingObjectInterface;
import org.pentaho.di.trans.steps.mock.StepMockHelper;

import static org.mockito.Mockito.*;

public class GPBulkLoaderTest {

  private GPBulkLoader loader;
  private StepMockHelper<GPBulkLoaderMeta, GPBulkLoaderData> mockHelper;

  @Before
  public void setUp() throws Exception {
    mockHelper =
      new StepMockHelper<GPBulkLoaderMeta, GPBulkLoaderData>(
        "GPBulkLoad", GPBulkLoaderMeta.class, GPBulkLoaderData.class );
    when( mockHelper.logChannelInterfaceFactory.create( any(), any( LoggingObjectInterface.class ) ) ).thenReturn(
      mockHelper.logChannelInterface );
    when( mockHelper.trans.isRunning() ).thenReturn( true );
  }

  @Test
  public void testInputFileSurroundedBySingleQuotes() throws Exception {

    String datafile = "test-data-file";

    loader =
      new GPBulkLoader( mockHelper.stepMeta, mockHelper.stepDataInterface, 0, mockHelper.transMeta, mockHelper.trans );

    DatabaseMeta dbMetaMock = mock( DatabaseMeta.class );
    doReturn( "" ).when( dbMetaMock ).getQuotedSchemaTableCombination( anyString(), anyString() );
    doReturn( "" ).when( dbMetaMock ).quoteField( anyString() );

    GPBulkLoaderMeta meta = new GPBulkLoaderMeta();
    meta.setLoadAction( "" );
    meta.setFieldStream( new String[] { "" } );
    meta.setFieldTable( new String[] { "" } );
    meta.setDatabaseMeta( dbMetaMock );
    meta.setDataFile( datafile );

    String actual = loader.getControlFileContents( meta, null, null );

    int first = actual.indexOf( datafile );
    if ( first > 0 ) {
      if ( actual.charAt( first - 1 ) != '\'' || actual.charAt( first + datafile.length() ) != '\'' ) {
        Assert.fail( "Datafile name is not surrounded by single quotes. Actual control file: " + actual );
      }
    } else {
      Assert.fail( "Datafile name not found in control file. Actual control file: " + actual );
    }

  }
}


text:
Gateway includes a Laravel authentication guard, user provider, and middleware for easily configuring applications to work with OAuth tokens. This allows your application to verify tokens created by [Northstar](https://github.com/dosomething/northstar) (or another OpenID Connect server).

## Installation

To start, let's configure Gateway's guard & user provider. In your `config/auth.php`:

```php
<?php

return [
    // ...

    'guards' => [
        // ...

        'api' => [
            'driver' => 'gateway',
            'provider' => 'northstar',
        ],
    ],

    'providers' => [
        'northstar' => [
            'driver' => 'gateway',
            'url' => env('NORTHSTAR_URL'),
            'key' => storage_path('keys/public.key'),
        ],
    ],
```

You can now run `php artisan gateway:key` to fetch Northstar's public key. This is used by Gateway to validate that tokens are really created by Northstar, and haven't been tampered with by a malicious user. You should run this command on deploys, or whenever you change `NORTHSTAR_URL`.

Finally, let's add some extra middleware to your `app/Http/Kernel.php`:

```php
<?php
// ...

protected $middlewareGroups = [
    'api' => [
        'guard:api',
        // ...
    ],
];

protected $routeMiddleware = [
    // ...
    'guard' => \DoSomething\Gateway\Server\Middleware\SetGuard::class,
    'user' => \DoSomething\Gateway\Server\Middleware\RequireUser::class,
    'role' => \DoSomething\Gateway\Server\Middleware\RequireRole::class,
    'scopes' => \DoSomething\Gateway\Server\Middleware\RequireScope::class,
];
```

## Usage

The routes in your `api` middleware group will now default to using JWT tokens for authentication!

Laravel's `Auth` facade (or `auth()` helper function) will both read data included in the JWT token now, so your API routes can use `Auth::check()` or `Auth::id()` to read the user's ID, just like you would from a database-backed web session. You can also use the built-in `auth` middleware, just like you would for any other request.

There are some extra things you might want to check from an API request. For this, you can use Gateway's middleware or `token()` helper to inspect the details of the current access token.

### Roles

We often want to allow staff members to have extra permissions that a normal user wouldn't, like reviewing a post. You can can easily restrict routes to certain roles with the included `role` middleware:

```
<?php

// Only allow staff or admin users to hit the 'delete' route.
$this->middleware('role:staff,admin')->only('delete');
```

Or use `token()->role()` to read the role and make custom assertions.

### Scopes

Scopes are used to restrict what an application can do with a user's token (for example, whether or not it can take advantage of a user's admin privileges). (Gateway will automatically check a token for the appropriate `role:staff` and `role:admin` when using the `role` middleware!)

```
<?php

// Require the 'user' and 'profile' scopes.
$this->middleware('scopes:user,profile);
```

Or use `token()->scopes()` to read the scopes directly from the token.

### And more!

There's a lot of other interesting information [included in an access token](https://github.com/DoSomething/northstar/blob/dev/documentation/authentication.md#access-tokens)! You can use `token()->client()` to check which client issued a token (for example, to automatically set a `source` field to the appropriate application). To read other included claims, use the `token()->getClaim()` method.

## PHPUnit & JWT Tokens

To make testing JWT-secured routes easy, Gateway includes some [test helpers](https://github.com/DoSomething/gateway/blob/master/src/Testing/WithOAuthTokens.php) that allow your test suite to create test tokens on-demand. To start, include the `WithOAuthTokens` trait in your test case:

```php
<?php

use DoSomething\Gateway\Testing\WithOAuthTokens;
use Illuminate\Foundation\Testing\TestCase as BaseTestCase;

abstract class TestCase extends BaseTestCase
{
    use WithOAuthTokens;

    // ...
```

This will provide the `withAccessToken` method to your tests:

```php
<?php

class ExampleTest extends TestCase
{
    public function testExample()
    {
        $userId = '5554eac1a59dbf117e8b4567';
        $this->withAccessToken($userId)->getJson('/hello');

        // or a shortcut w/ a randomly-generated user ID:
        $this->withStandardAccessToken()->getJson('/hello');
    }

    public function testAdminExample()
        $adminId = '5575e568a59dbf3b7a8b4572';
        $this->withAccessToken($adminId, 'admin')->getJson('/admin');

        // or a shortcut w/ a randomly-generated user ID:
        $this->withAdminAccessToken()->getJson('/admin');
    }
}
```

## Local Development

When testing API requests on your local machine, you can configure [Paw's OAuth 2 dynamic value](https://paw.cloud/docs/auth/oauth2), [Postman's authorization tab](https://www.getpostman.com/docs/postman/sending_api_requests/authorization#oauth-20), or your API tool of choice to use OAuth 2 tokens. Provide the details for the relevant Northstar environment when configuring the request.


text:
SYNONYM

#### According to
The Catalogue of Life, 3rd January 2011

#### Published in
Epicr. syst. mycol. (Upsaliae) 74 (1838)

#### Original name
Agaricus cinerascens Batsch, 1786

### Remarks
null


text:
#include <_type/type.time.h>
#include <_type/type.user.guest.h>
#include <_type/type.winds.h>

//! File-Images
#include <_resource/resource.icon.file.h>
#include <_resource/resource.icon.exe.h>
#include <_resource/resource.icon.txt.h>
#include <_resource/resource.icon.xml.h>
#include <_resource/resource.icon.nds.h>
#include <_resource/resource.icon.gba.h>
#include <_resource/resource.icon.ini.h>
#include <_resource/resource.icon.lua.h>
#include <_resource/resource.icon.folder.h>
#include <_resource/resource.icon.font.h>
#include <_resource/resource.icon.music.h>
#include <_resource/resource.icon.jpg.h>
#include <_resource/resource.icon.image.h>
#include <_resource/resource.icon.registry.h>
#include <_resource/resource.icon.archive.h>

bool _registryController::init()
{
	// Open registries
	fileTypeRegistry	= new _iniFile("%SYSTEM%/filetypes.reg");
	systemRegistry		= new _iniFile("%SYSTEM%/registry.reg");
	setUserRegistry( new _guestUser() );

	// Prepare them for the first use (if needed)
	if( fileTypeRegistry->isUsedFirstTime() )
		_registryController::prepareFileTypeRegistry();
	if( systemRegistry->isUsedFirstTime() )
		_registryController::prepareSystemRegistry();

	// Make sure they exists
	fileTypeRegistry->create();
	systemRegistry->create();

	// Fill Cache-Parameters
	safeBootMode		= systemRegistry->readIndexInt( "bootParams" , "safeBootMode" );
	correctShutDown		= systemRegistry->readIndexInt( "bootParams" , "correctShutDown" );
	systemStartTime		= _time::now();

	// Act, as if the system has not been shut down safely. If it did, that attribute will be changed after the successful shutdown
	systemRegistry->writeIndex( "bootParams" , "correctShutDown" , "0" );

	return true;
}

void _registryController::prepareFileTypeRegistry()
{
	fileTypeRegistry->setMap( {{
		{ "fileMapper" , {{
			{ "jpg"	, "%WINDIR%/accessories/paint.exe -\"$F\"" } ,
			{ "png"	, "%WINDIR%/accessories/paint.exe -\"$F\"" } ,
			{ "bmp"	, "%WINDIR%/accessories/paint.exe -\"$F\"" } ,
			{ "gif"	, "%WINDIR%/accessories/paint.exe -\"$F\"" } ,
			{ "ico"	, "%WINDIR%/accessories/paint.exe -\"$F\"" } ,
			{ "nds"	, "%SYSTEM%/rom_exec.exe -\"$F\"" } ,
			{ "*"	, "%SYSTEM%/progmapper.exe -\"$F\"" }
		}} }
		, { "fileIcon" , {{
			//{ "%dir%" , "" }
		}} }
	}} );
	fileTypeRegistry->flush();
}

void _registryController::prepareSystemRegistry()
{
	systemRegistry->setMap( {{
		{ "bootParams" , {{
			{ "safeBootMode" , "0" } ,
			{ "correctShutDown" , "1" } ,
			{ "timeOnline" , "0" } ,
		}} }
		, { "localization" , {{
			{ "language" , _winds::getDSLanguage().c_str() }
		}} }
		, { "gui" , {{
			{ "minDragDistance" , "9" } ,
			{ "maxClickPeriod" , "30" } ,
			{ "keyRepetitionDelay" , "30" } ,
			{ "keyRepetitionPause" , "6" } ,
			{ "maxDoubleClickPeriod" , "60" } ,
			{ "maxDoubleClickArea" , "6" } ,
			{ "rightClickDelay" , "45" } ,

			{ "fileObjectHeight" , "10" } ,
			{ "listItemHeight" , "9" } ,
			{ "counterHeight" , "16" } ,
			{ "selectHeight" , "10" } ,

			{ "startButtonTextColor" , "RGB(30,30,30)" } ,
			{ "fileExtensionVisible" , "1" } ,

		}} }
		, { "serviceMapper" , {{
		}} }
	}} );
	systemRegistry->flush();
}

void _registryController::indicateSafeShutdown(){
	systemRegistry->writeIndex( "bootParams" , "correctShutDown" , "1" );
}

void _registryController::end()
{
	// Delete currently logged in user
	setUserRegistry( nullptr );

	// Update time that windows ran
	_unixTime timeOnline = getSystemRegistry().readIndexInt( "bootParams" , "timeOnline" );
	timeOnline += _time::now().toUnixTime() - systemStartTime;						// Add difference between system end and system start
	getSystemRegistry().writeIndex( "bootParams" , "timeOnline" , int2string(timeOnline) );	// Write new time

	// Remove the safe boot flag
	systemRegistry->writeIndex( "bootParams" , "safeBootMode" , "0" );

	// Delete Registries
	systemRegistry = nullptr; // Flush the system registry
	fileTypeRegistry = nullptr; // Flush the filetype registry

	// Indicate that the computer was successfully shut down
	indicateSafeShutdown();
}

string	_registryController::getPackagePath( const string& package ){
	return fileTypeRegistry->readIndex( "serviceMapper" , package ).cpp_str();
}

void	_registryController::setPackagePath( const string& package , string path ){
	fileTypeRegistry->writeIndex( "serviceMapper" , package , move(path) );
}

string _registryController::getFileTypeHandler( const string& extension )
{
	string index = fileTypeRegistry->readIndex( "fileMapper" , extension ).cpp_str();

	// Read mapper that can read all types of files
	if( index.empty() )
		return fileTypeRegistry->readIndex( "fileMapper" , "*" ).cpp_str();

	return move(index);
}

_bitmap _registryController::getFileTypeImage( const string& extension , _mimeType mimeType )
{
	// Fetch Url of the Icon

	const string& iconUrl = fileTypeRegistry->readIndex( "fileIcon" , extension ).cpp_str();

	// If we already loaded the icon corresponding to a specific extension
	_pair<string,_bitmap>& cachedIcon = _registryController::extension2UrlAndimage[extension];

	// If the Cached Icon is valid and the url has not changed since
	if( cachedIcon.second.isValid() && cachedIcon.first == iconUrl )
		return cachedIcon.second;

	if( iconUrl.empty() || iconUrl == "default" )
	{
		switch( mimeType )
		{
			case _mime::directory:
				return BMP_FolderIcon();

			case _mime::application_x_lua_bytecode:
				return BMP_LuaIcon();

			case _mime::application_octet_stream:
			case _mime::application_microsoft_installer:
				return BMP_ExeIcon();

			case _mime::text_plain:
				return BMP_TxtIcon();

			case _mime::text_xml:
				return BMP_XmlIcon();

			case _mime::text_x_ini:
				return BMP_IniIcon();

			case _mime::application_x_ms_registry:
				return BMP_RegistryIcon();

			case _mime::application_x_nintendo_ds_rom:
				return BMP_NdsIcon();

			case _mime::application_x_nintendo_gba_rom:
				return BMP_GbaIcon();

			case _mime::application_zip:
				return BMP_ArchiveIcon();

			case _mime::font_opentype:
			case _mime::font_truetype:
				return BMP_FontIcon();

			case _mime::audio_mpeg:
			case _mime::audio_wav:
			case _mime::audio_x_aiff:
			case _mime::audio_x_midi:
			case _mime::audio_x_mpegurl:
			case _mime::audio_x_mod:
				return BMP_MusicIcon();

			case _mime::image_jpeg:
				return BMP_JpegIcon();

			case _mime::image_png:
			case _mime::image_gif:
			case _mime::image_bmp:
				return BMP_ImageIcon();

			default:
				break;
		}
		return BMP_FileIcon();
	}

	// Add the corresponding bitmap to the cache
	cachedIcon.first = iconUrl;
	cachedIcon.second = _imageFile( iconUrl , false ).readBitmap(); // Read Image from File

	return cachedIcon.second;
}

void _registryController::setFileTypeHandler( const string& extension , const string& command ){
	fileTypeRegistry->writeIndex( "fileMapper" , extension , command );
}

void _registryController::setUserRegistry( _uniquePtr<_user> newUser ){
	userRegistry = move(newUser);
	_filesystemController::setCurrentUserDir( userRegistry ? userRegistry->getHomeFolder() : "" );
}

_uniquePtr<_iniFile>				_registryController::systemRegistry;
_uniquePtr<_user>					_registryController::userRegistry;
_uniquePtr<_iniFile>				_registryController::fileTypeRegistry;
bool								_registryController::correctShutDown;
bool								_registryController::safeBootMode;
_unixTime							_registryController::systemStartTime;
_map<string,_pair<string,_bitmap>>	_registryController::extension2UrlAndimage;


text:
<!DOCTYPE html >

          <title>Scalactic 3.0.1</title>
          <meta name="description" content="Scalactic 3.0.1" />
          <meta name="keywords" content="Scalactic 3.0.1" />
          <meta http-equiv="content-type" content="text/html; charset=UTF-8" />

      <link href="../lib/ref-index.css" media="screen" type="text/css" rel="stylesheet" />

zip

Accumulatable

zipAll

Chain Every

zipWithIndex

Chain Every


text:
class SweepsController < ApplicationController

  before_filter :workflows_enabled?

  skip_before_filter :restrict_guest_user, :only => :new
  skip_after_filter :log_event, :only => :runs

  before_filter :find_sweep, :except => [:create, :new, :index]
  before_filter :find_run, :only => :new
  before_filter :set_runlet_parameters, :only => :create
  before_filter :find_workflow_and_version, :only => :new
  before_filter :auth, :except => [ :index, :new, :create ]

  def show
    @runs = @sweep.runs.select { |r| r.can_view? }
  end

  def new
    @sweep = Sweep.new
  end

  def edit
    respond_to do |format|
      format.html
    end
  end

  def update
    @sweep.attributes = params[:sweep]

    if params[:sharing]
      @sweep.policy_or_default
      @sweep.policy.set_attributes_with_sharing params[:sharing], @sweep.projects
    end

    if @sweep.save
      respond_to do |format|
        format.html { redirect_to sweep_path(@sweep) }
      end
    else
      respond_to do |format|
        format.html { render edit_sweep_path(@sweep) }
      end
    end
  end

  def create

    @sweep = Sweep.new(params[:sweep])
    @workflow = @sweep.workflow
    @workflow_version = @workflow.find_version(@sweep.workflow_version)

    raise if @workflow.nil?
    # Manually add projects of current user, as they aren't prompted for this information in the form
    @sweep.projects = current_person.projects
    @sweep.policy.set_attributes_with_sharing params[:sharing], @sweep.projects
    respond_to do |format|
      if @sweep.save
        format.html { redirect_to sweep_path(@sweep) }
      else
        format.html { render :action => "new" }
      end
    end
  end

  def cancel
    @sweep.cancel
    respond_to do |format|
      format.html { redirect_to taverna_player.runs_path }
    end
  end

  def destroy
    @sweep.destroy
    respond_to do |format|
      format.html { redirect_to params[:redirect_to].blank? ? taverna_player.runs_path : params[:redirect_to]}
    end
  end

  def runs
    @sweep = Sweep.find(params[:id], :include => {:runs => :workflow})
    @runs = @sweep.runs.select { |r| r.can_view? }
    respond_to do |format|
      format.js { render "taverna_player/runs/index" }
    end
  end

  # Display the result value for a given output port of a given run.
  def view_result
    respond_to do |format|
      format.js  { render 'view_result.js.erb' }
    end
  end

  # Zip/assemble results for a given output port over selected sweep's runs,
  # results for a run (for all output ports), or all results for all output ports
  # and all runs.
  def download_results
    @sweep = Sweep.find(params[:id], :include => { :runs => :outputs })

    if params[:download].blank?
      respond_to do |format|
        flash[:error] = "You must select at least one output to download"
        format.html { redirect_to :back }
      end
    else
      outputs = []
      params[:download].each do |run_id, output_names|
        outputs = outputs + @sweep.runs.detect {|r| r.id == run_id.to_i}.outputs.select {|o| output_names.include?(o.name)}
      end

      path = @sweep.build_zip(outputs)

      respond_to do |format|
        format.html {send_file path, :type => "application/zip",
          :filename => path.split('/').last }
      end
    end
  end

  private

  def find_run
    if !params[:run_id].blank? # New sweep based on a previous special_run
      @run = TavernaPlayer::Run.find(params[:run_id], :include => :inputs)
    else # New sweep from scratch
      @run = nil
    end
  end

  def find_workflow_and_version
    if !@run.blank?
      @workflow = @run.workflow
      @workflow_version = @run.executed_workflow
    else
      @workflow = Workflow.find(params[:workflow_id])
      @workflow_version = params[:version].blank? ? @workflow.latest_version : @workflow.find_version(params[:version])
    end
  end

  def set_runlet_parameters

    shared_input_values_for_all_runs = params[:sweep].delete(:shared_input_values_for_all_runs)
    params[:sweep][:runs_attributes].each_with_index do |(run_id, run_attributes), iteration_index|
      run_attributes[:workflow_id] = params[:sweep][:workflow_id]
      run_attributes[:workflow_version] = params[:sweep][:workflow_version]

      # Set parent ID to replay interactions
      run_attributes[:parent_id] = params[:run_id].to_i unless params[:run_id].blank?
      run_attributes[:project_ids] = current_person.projects.map { |p| p.id }

      # Copy shared inputs from "parent" run
      if !shared_input_values_for_all_runs.blank?
        base_index = run_attributes[:inputs_attributes].keys.map { |k| k.to_i }.max + 1
        if shared_input_values_for_all_runs[:inputs_attributes]
          shared_input_values_for_all_runs[:inputs_attributes].each do |input_id, input_attributes|
            run_attributes[:inputs_attributes][(base_index + input_id.to_i).to_s] = input_attributes
          end
        end
      end

      # Set the runlet names based on their input data, or just number them
      unless params[:name_input].blank?
        i = run_attributes[:inputs_attributes].values.detect {|v| v[:name] == params[:name_input]}
        if i[:file]
          identifier = "#{i[:file].original_filename}"
        elsif !i[:value].blank?
          identifier = "#{i[:value][0...32]}"
          identifier << '...' if i[:value].length > 32
        end
      end
      identifier ||= "(#{iteration_index + 1})"
      run_attributes[:name] = "#{params[:sweep][:name]} - #{identifier}"

      # Set the project for each runlet
      run_attributes[:project_ids] = current_person.projects.map { |p| p.id }
    end
  end

  def auth
    action = translate_action(action_name)
    unless is_auth?(@sweep, action)
      if current_user.nil?
        flash[:error] = "You are not authorized to #{action} this Sweep, you may need to login first."
      else
        flash[:error] = "You are not authorized to #{action} this Sweep."
      end
      respond_to do |format|
        format.html do
          case action
            when 'manage','edit','download','delete'
              redirect_to @sweep
            else
              redirect_to taverna_player.runs_path
          end
        end
      end
    end
  end

  def find_sweep
    @sweep = Sweep.find(params[:id], :include => :runs)
  end

end


text:
'use strict';

import { combineReducers } from 'redux';
import books from './book';
import tags from './tag';

const rootReducer = combineReducers({
  books,
  tags
});

export default rootReducer;


text:
package apoc.algo;

import org.neo4j.procedure.Description;
import apoc.path.RelationshipTypeAndDirections;
import apoc.result.PathResult;
import apoc.result.WeightedPathResult;
import apoc.util.Util;
import org.neo4j.graphalgo.CommonEvaluators;
import org.neo4j.graphalgo.GraphAlgoFactory;
import org.neo4j.graphalgo.PathFinder;
import org.neo4j.graphalgo.WeightedPath;
import org.neo4j.graphdb.*;
import org.neo4j.helpers.collection.Pair;
import org.neo4j.procedure.Context;
import org.neo4j.procedure.Name;
import org.neo4j.procedure.Procedure;

import java.util.Collections;
import java.util.Map;
import java.util.stream.Stream;
import java.util.stream.StreamSupport;

public class PathFinding {

    @Context
    public GraphDatabaseService db;

    @Procedure
    @Description("apoc.algo.aStar(startNode, endNode, 'KNOWS|<WORKS_WITH|IS_MANAGER_OF>', 'distance','lat','lon') " +
            "YIELD path, weight - run A* with relationship property name as cost function")
    public Stream<WeightedPathResult> aStar(
            @Name("startNode") Node startNode,
            @Name("endNode") Node endNode,
            @Name("relationshipTypesAndDirections") String relTypesAndDirs,
            @Name("weightPropertyName") String weightPropertyName,
            @Name("latPropertyName") String latPropertyName,
            @Name("lonPropertyName") String lonPropertyName) {

        PathFinder<WeightedPath> algo = GraphAlgoFactory.aStar(
                buildPathExpander(relTypesAndDirs),
                CommonEvaluators.doubleCostEvaluator(weightPropertyName),
                CommonEvaluators.geoEstimateEvaluator(latPropertyName, lonPropertyName));
        return WeightedPathResult.streamWeightedPathResult(startNode, endNode, algo);
    }

    @Procedure
    @Description("apoc.algo.aStar(startNode, endNode, 'KNOWS|<WORKS_WITH|IS_MANAGER_OF>', {weight:'dist',default:10," +
            "x:'lon',y:'lat'}) YIELD path, weight - run A* with relationship property name as cost function")
    public Stream<WeightedPathResult> aStarConfig(
            @Name("startNode") Node startNode,
            @Name("endNode") Node endNode,
            @Name("relationshipTypesAndDirections") String relTypesAndDirs,
            @Name("config") Map<String, Object> config) {

        config = config == null ? Collections.emptyMap() : config;
        String relationshipCostPropertyKey = config.getOrDefault("weight", "distance").toString();
        double defaultCost = ((Number) config.getOrDefault("default", Double.MAX_VALUE)).doubleValue();
        String latPropertyName = config.getOrDefault("y", "latitude").toString();
        String lonPropertyName = config.getOrDefault("x", "longitude").toString();

        PathFinder<WeightedPath> algo = GraphAlgoFactory.aStar(
                buildPathExpander(relTypesAndDirs),
                CommonEvaluators.doubleCostEvaluator(relationshipCostPropertyKey, defaultCost),
                CommonEvaluators.geoEstimateEvaluator(latPropertyName, lonPropertyName));
        return WeightedPathResult.streamWeightedPathResult(startNode, endNode, algo);
    }

    @Procedure
    @Description("apoc.algo.dijkstra(startNode, endNode, 'KNOWS|<WORKS_WITH|IS_MANAGER_OF>', 'distance') YIELD path," +
            " weight - run dijkstra with relationship property name as cost function")
    public Stream<WeightedPathResult> dijkstra(
            @Name("startNode") Node startNode,
            @Name("endNode") Node endNode,
            @Name("relationshipTypesAndDirections") String relTypesAndDirs,
            @Name("weightPropertyName") String weightPropertyName) {

        PathFinder<WeightedPath> algo = GraphAlgoFactory.dijkstra(
                buildPathExpander(relTypesAndDirs),
                weightPropertyName
        );
        return WeightedPathResult.streamWeightedPathResult(startNode, endNode, algo);
    }

    @Procedure
    @Description("apoc.algo.allSimplePaths(startNode, endNode, 'KNOWS|<WORKS_WITH|IS_MANAGER_OF>', 5) YIELD path, " +
            "weight - run allSimplePaths with relationships given and maxNodes")
    public Stream<PathResult> allSimplePaths(
            @Name("startNode") Node startNode,
            @Name("endNode") Node endNode,
            @Name("relationshipTypesAndDirections") String relTypesAndDirs,
            @Name("maxNodes") long maxNodes) {

        PathFinder<Path> algo = GraphAlgoFactory.allSimplePaths(
                buildPathExpander(relTypesAndDirs),
                (int) maxNodes
        );
        Iterable<Path> allPaths = algo.findAllPaths(startNode, endNode);
        return StreamSupport.stream(allPaths.spliterator(), false)
                .map(PathResult::new);
    }

    @Procedure
    @Description("apoc.algo.dijkstraWithDefaultWeight(startNode, endNode, 'KNOWS|<WORKS_WITH|IS_MANAGER_OF>', " +
            "'distance', 10) YIELD path, weight - run dijkstra with relationship property name as cost function" +
            " and a default weight if the property does not exist")
    public Stream<WeightedPathResult> dijkstraWithDefaultWeight(
            @Name("startNode") Node startNode,
            @Name("endNode") Node endNode,
            @Name("relationshipTypesAndDirections") String relTypesAndDirs,
            @Name("weightPropertyName") String weightPropertyName,
            @Name("defaultWeight") double defaultWeight) {

        PathFinder<WeightedPath> algo = GraphAlgoFactory.dijkstra(
                buildPathExpander(relTypesAndDirs),
                (relationship, direction) -> Util.toDouble(relationship.getProperty(weightPropertyName, defaultWeight))
        );
        return WeightedPathResult.streamWeightedPathResult(startNode, endNode, algo);
    }

    private PathExpander<Object> buildPathExpander(String relationshipsAndDirections) {
        PathExpanderBuilder builder = PathExpanderBuilder.empty();
        for (Pair<RelationshipType, Direction> pair : RelationshipTypeAndDirections
                .parse(relationshipsAndDirections)) {
            if (pair.first() == null) {
                if (pair.other() == null) {
                    builder = PathExpanderBuilder.allTypesAndDirections();
                } else {
                    builder = PathExpanderBuilder.allTypes(pair.other());
                }
            } else {
                if (pair.other() == null) {
                    builder = builder.add(pair.first());
                } else {
                    builder = builder.add(pair.first(), pair.other());
                }
            }
        }
        return builder.build();
    }

}


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

<routes xmlns="http://symfony.com/schema/routing"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:schemaLocation="http://symfony.com/schema/routing http://symfony.com/schema/routing/routing-1.0.xsd">

    <route id="log_blog_homepage" path="/">
        <default key="_controller">LogBlogBundle:Homepage:homepage</default>
    </route>
</routes>


text:
var assert = require('assert')

module.exports = function (gm, dir, finish, GM) {

  var m = gm
  .charcoal(1);

  var args = m.args();
  assert.equal('convert', args[0]);
  assert.equal('-charcoal', args[2]);
  assert.equal(1, args[3]);

  if (!GM.integration)
    return finish();

  m
  .write(dir + '/charcoal.png', function charcoal (err) {
    finish(err);
  });
}


text:
body > div.container-fluid {
      padding-left  : 50px;
      padding-right : 50px;
}

body > div.container-fluid:nth-child(odd) {
  background-color: #E6E8FF;
}

span.section-title {
  text-transform: uppercase;
  font-family   : Arial, Helvetica Neue, Helvetica, sans-serif;
  font-weight   : bold;
  font-size     : 31px;
  display       : block;
}

div.container-fluid {
  max-width: 1600px;
}

p {
  color         : #122357;
  font-family   : Arial, Helvetica Neue, Helvetica, sans-serif;
  margin-left   : 80px;
}

@media (max-width: 577px) {
  img[src$="-icon.png"] {
    float: none !important;
  }
  span.section-title {
    text-align: center;
  }
  p {
    margin-left : 0;
    text-align  : left;
  }
  div.container-fluid p img {
      margin-left : auto !important;
      margin-right: auto !important;
  }
  .col-text {
    text-align: center;
  }
  div#science > div div div.container {
    padding-left: 15px !important;
  }
  div#maritime figure {
    position    : relative !important;
    margin-left : auto !important;
    margin-right: auto !important;
    margin-top  : 0 !important;
    text-align  : center;
  }
  div#esri > div div div.container {
    padding-left: 15px !important;
  }
  div.jumbotron {
    padding-top : 15px !important;
    height      : 846 px !important;
  }
  div.jumbotron nav {
    margin-top: 60px !important;
  }
  div#education > .row > div:first-child {
    padding-top: 35px;
  }
}

@media (min-width: 577px) {
  div#science > .row > div:last-child p {
    margin-left: 90px;
  }
}

img[src$="-icon.png"] {
  float: left;
}

div.container-fluid p img {
  display: block;
}

div.jumbotron {
  background    : url("../images/bannerlarge.jpg") no-repeat center top;
  padding-top   : 25px;
  padding-left  : 0;
  padding-right : 0;
  padding-bottom: 0;
  border-radius : 0;
}

div.jumbotron img[src="images/rps_logo_white.png"] {
  padding-left: 15px;
}

div.jumbotron > div.container-fluid > div.row > div.col-lg-10 {
  padding-right: 0;
}

div.jumbotron > div.container-fluid > div.row:last-of-type {
  text-align: center;
}

div.jumbotron > div.container-fluid > div.row:last-of-type img {
  margin-top: -73px;
}

div.jumbotron > div.container-fluid:last-child {
  background: rgba(18, 35, 87, 0.75);
  max-width : 1600px;
}
div.jumbotron nav {
  margin-top: 60px;
  text-align: center;
}
div.jumbotron nav a {
  width           : 150px;
  height          : 105px;
  opacity         : 1;
  margin          : 20px 10px;
  display: inline-block;
}
div.jumbotron nav a[href="#about"] {
  background: transparent url("../images/about_but.png") no-repeat 0 0;
}
div.jumbotron nav a[href="#science"] {
  background: transparent url("../images/science_but.png") no-repeat 0 0;
}
div.jumbotron nav a[href="#maritime"] {
  background: transparent url("../images/maritime_but.png") no-repeat 0 0;
}
div.jumbotron nav a[href="#esri"] {
  background: transparent url("../images/esri_but.png") no-repeat 0 0;
}
div.jumbotron nav a[href="#education"] {
  background: transparent url("../images/education_but.png") no-repeat 0 0;
}
div.jumbotron nav a:hover {
  background-position: 0 -105px;
}

img[src="images/stats.png"] {
  padding-top : 25px;
  float       : right;
}

div#science > .row > div:last-child,
div#maritime > .row > div:first-child,
div#esri > .row > div:last-child {
  padding-top: 35px;
}

div#about img[src="images/oceansmap_framework2.png"] {
  margin-bottom: 25px;
}

div#science img[src="images/analysis.jpg"] {
  margin-top    : 33px;
  margin-bottom: 33px;
  box-shadow    : 0px 0px 8px rgba(18,35,87,0.5),0px 0px 8px rgba(18,35,87,0.5);
}
div#science > div div div.container {
  padding-bottom: 20px;
}
div#science > div div div.container,
div#esri > div div div.container {
  padding-left  : 80px;
}

div#maritime figure {
  position    : absolute;
  margin-left : 52%;
  margin-top  : 30%;
}

figure.figure img.figure-img:hover {
  box-shadow: 0px 0px 8px rgba(41,171,226,0.5),0px 0px 8px rgba(41,171,226,0.5);
}

figcaption.figure-caption {
  color       : #122357;
  font-size   : 18px;
  line-height : 22px;
  font-weight : bold;
}

div#education {
  margin-bottom: 90px;
}
div#education > .row > div:first-child {
  padding-top: 60px;
}

footer.navbar-fixed-bottom {
  background-color: #122357;
  height          : 90px;
  padding-top     : 25px;
}
footer.navbar-fixed-bottom a[href="#"] {
  width     : 167px;
  height    : 17px;
  background: transparent url("../images/back_to_top.png") no-repeat 0 0;
  margin-top: 15px;
  display   : block;
}
footer.navbar-fixed-bottom a[href="#"]:hover {
  background-position: 0 -17px;
}

@media (max-width: 992px) {
  div.jumbotron > div.container-fluid > div.row:last-of-type img {
    margin-top: 0;
  }
  div#science {
    padding-top: 25px;
  }
  div#science img[src="images/analysis.jpg"] {
    margin-top    : 0 !important;
    margin-bottom : 0 !important;
  }
}


text:
'use strict';

Object.defineProperty(exports, "__esModule", {
  value: true
});

var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();

var _events = require('events');

var _fs = require('q-io/fs');

var _fs2 = _interopRequireDefault(_fs);

var _fs3 = require('fs');

var _fs4 = _interopRequireDefault(_fs3);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, arguments); return new Promise(function (resolve, reject) { function step(key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { return Promise.resolve(value).then(function (value) { return step("next", value); }, function (err) { return step("throw", err); }); } } return step("next"); }); }; }

function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }

function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }

function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }

var FSWatcher = function (_EventEmitter) {
  _inherits(FSWatcher, _EventEmitter);

  _createClass(FSWatcher, null, [{
    key: 'createWatchedResource',
    value: function createWatchedResource(path, synchronous, asynchronous) {
      if (!_fs4.default.existsSync(path)) {
        return;
      }
      if (typeof asynchronous === 'function') {
        new FSWatcher(path).on('change', _asyncToGenerator(regeneratorRuntime.mark(function _callee() {
          var exists;
          return regeneratorRuntime.wrap(function _callee$(_context) {
            while (1) {
              switch (_context.prev = _context.next) {
                case 0:
                  _context.prev = 0;
                  _context.next = 3;
                  return _fs2.default.exists(path);

                case 3:
                  exists = _context.sent;

                  if (!exists) {
                    _context.next = 7;
                    break;
                  }

                  _context.next = 7;
                  return asynchronous(path);

                case 7:
                  _context.next = 12;
                  break;

                case 9:
                  _context.prev = 9;
                  _context.t0 = _context['catch'](0);

                  require('./logger').default.error(_context.t0.stack || _context.t0);

                case 12:
                case 'end':
                  return _context.stop();
              }
            }
          }, _callee, this, [[0, 9]]);
        })));
      }
      return synchronous(path);
    }
  }]);

  function FSWatcher(fileName) {
    _classCallCheck(this, FSWatcher);

    var _this = _possibleConstructorReturn(this, Object.getPrototypeOf(FSWatcher).call(this));

    _this.fileName = fileName;
    _this.resetWatcher();
    return _this;
  }

  _createClass(FSWatcher, [{
    key: 'resetWatcher',
    value: function () {
      var ref = _asyncToGenerator(regeneratorRuntime.mark(function _callee2() {
        var _this2 = this;

        var exists;
        return regeneratorRuntime.wrap(function _callee2$(_context2) {
          while (1) {
            switch (_context2.prev = _context2.next) {
              case 0:
                if (this.watcher) {
                  this.watcher.removeAllListeners('change');
                  this.watcher.close();
                }
                _context2.next = 3;
                return _fs2.default.exists(this.fileName);

              case 3:
                exists = _context2.sent;

                if (exists) {
                  _context2.next = 6;
                  break;
                }

                return _context2.abrupt('return');

              case 6:
                this.watcher = _fs4.default.watch(this.fileName);
                this.watcher.on('change', function (type, fileName) {
                  if ('rename' === type) {
                    if (_this2.fileName.split('/').pop() !== fileName) {
                      return;
                    }
                    _this2.resetWatcher();
                  } else if ('change' === type) {
                    _this2.emit('change');
                  }
                });

              case 8:
              case 'end':
                return _context2.stop();
            }
          }
        }, _callee2, this);
      }));

      function resetWatcher() {
        return ref.apply(this, arguments);
      }

      return resetWatcher;
    }()
  }]);

  return FSWatcher;
}(_events.EventEmitter);

exports.default = FSWatcher;
//# sourceMappingURL=fs-watcher.js.map


text:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mbean PUBLIC
   "-//JBoss//DTD JBOSS XMBEAN 1.1//EN"
   "http://www.jboss.org/j2ee/dtd/jboss_xmbean_1_1.dtd">

<mbean>
   <description>MPPS SCU Service to forward MPPS messages received by
   the MPPS SCP Service
   </description>

   <descriptors>
      <persistence persistPolicy="OnUpdate" />
      <persistence-manager value="org.jboss.mx.persistence.DelegatingPersistenceManager" />
   </descriptors>

   <class>org.dcm4chex.archive.dcm.mppsscu.MPPSScuService</class>

   <constructor>
      <description>The default constructor</description>
      <name>IanScuService</name>
   </constructor>

   <!-- Attributes -->
   <attribute access="read-write"
      getMethod="getForwardAETs"
      setMethod="setForwardAETs">
      <description>AET(s) of AE(s) to forward destinations.
      Separate multiple values by '\'(backslash).
      "NONE" = do not forward MPPS to any AE.
      </description>
      <name>ForwardAETs</name>
      <type>java.lang.String</type>
      <descriptors>
         <value value="NONE" />
      </descriptors>
   </attribute>
   <attribute access="read-write"
      getMethod="getCallingAET"
      setMethod="setCallingAET">
      <description>Calling AET used in Association Request.
      </description>
      <name>CallingAET</name>
      <type>java.lang.String</type>
      <descriptors>
         <value value="PACS_TIANI" />
      </descriptors>
   </attribute>
   <attribute access="read-write"
      getMethod="getRetryIntervalls"
      setMethod="setRetryIntervalls">
      <description>Number and intervalls of retries of failed
      MPPS forward requests by a list of comma separated NUMBERxINTERVAL pairs.
      The intervall can be specified in seconds (##s), minutes (##m),
      hours (##h) or days (##d).
      </description>
      <name>RetryIntervalls</name>
      <type>java.lang.String</type>
      <descriptors>
         <value value="5x1m,12x5m,24x1h,7x1d" />
      </descriptors>
   </attribute>
   <attribute access="read-write"
      getMethod="getAcTimeout"
      setMethod="setAcTimeout">
      <description>A-ASSOCIATE AC timeout in ms. 0 = no timeout.
      </description>
      <name>AcTimeout</name>
      <type>int</type>
      <descriptors>
         <value value="10000" />
      </descriptors>
   </attribute>
   <attribute access="read-write"
      getMethod="getDimseTimeout"
      setMethod="setDimseTimeout">
      <description>DIMSE message timeout in ms. 0 = no timeout.
      </description>
      <name>DimseTimeout</name>
      <type>int</type>
      <descriptors>
         <value value="60000" />
      </descriptors>
   </attribute>
   <attribute access="read-write"
      getMethod="getSoCloseDelay"
      setMethod="setSoCloseDelay">
      <description>Socket close delay in ms after A-RELEASE RSP.
      </description>
      <name>SoCloseDelay</name>
      <type>int</type>
      <descriptors>
         <value value="50" />
      </descriptors>
   </attribute>
   <attribute access="read-write"
      getMethod="getQueueName"
      setMethod="setQueueName">
      <description>Used internally - do NOT modify.
      </description>
      <name>QueueName</name>
      <type>java.lang.String</type>
      <descriptors>
         <value value="MPPSScu" />
      </descriptors>
   </attribute>
   <attribute access="read-write"
      getMethod="getMppsScpServiceName"
      setMethod="setMppsScpServiceName">
      <description>Used internally - do NOT modify.
      </description>
      <name>MppsScpServiceName</name>
      <type>javax.management.ObjectName</type>
      <descriptors>
         <value value="tiani.archive:service=MPPSScp" />
      </descriptors>
   </attribute>
   <attribute access="read-write"
      getMethod="getTLSConfigName"
      setMethod="setTLSConfigName">
      <description>Used internally - do NOT modify.
      </description>
      <name>TLSConfigName</name>
      <type>javax.management.ObjectName</type>
      <descriptors>
         <value value="tiani.archive:service=TLSConfig" />
      </descriptors>
   </attribute>
   &defaultAttributes;

   <!-- Operations -->
   &defaultOperations;
   <operation impact="ACTION">
      <description>Used internally</description>
      <name>sendMPPS</name>
      <parameter>
        <description>MPPS</description>
        <name>mpps</name>
        <type>org.dcm4che.data.Dataset</type>
      </parameter>
      <parameter>
        <description>Destination</description>
        <name>aet</name>
        <type>java.lang.String</type>
      </parameter>
      <return-type>int</return-type>
   </operation>

</mbean>


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

<title>org.apache.jmeter.save.converters (Apache JMeter API)</title>
<link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style">

org.apache.jmeter.save.converters

Classes

BooleanPropertyConverter

ConversionHelp

HashTreeConverter

IntegerPropertyConverter

LongPropertyConverter

MultiPropertyConverter

SampleEventConverter

SampleResultConverter

SampleSaveConfigurationConverter

StringPropertyConverter

TestElementConverter

TestElementPropertyConverter

TestResultWrapperConverter


text:
/// <reference path="../../_references.ts"/>

module powerbi.data {
    export class FilterRuleEvaluation extends RuleEvaluation {
        private selection: FilterValueScopeIdsContainer;

        constructor(scopeIds: FilterValueScopeIdsContainer) {
            debug.assertValue(scopeIds, 'scopeIds');

            super();
            this.selection = scopeIds;
        }

        public evaluate(evalContext: IEvalContext): any {
            debug.assertValue(evalContext, 'evalContext');

            let currentScopeId = evalContext.getCurrentIdentity(),
                selectedScopeIds = this.selection.scopeIds;
            for (let i = 0, len = selectedScopeIds.length; i < len; i++) {
                if (DataViewScopeIdentity.equals(currentScopeId, selectedScopeIds[i]))
                    return !this.selection.isNot;
            }
        }
    }
}