text:
var g_keyStatusIndicator = "status-indicator";

function OrderOption (editor, bitCode, labelName, initChecked) {
	this.editor = editor;
	this.bitCode = bitCode;
	this.labelName = labelName;
	this.checkbox = null;
	this.initChecked = initChecked;
	this.appendTo = function(par) {
		var container = $("
", {
			"class": "order-option"
		}).appendTo(par);

		var label = $('', {
			"class": "order-label"
		}).appendTo(container);

		this.checkbox = $("<input>",{
			type: "checkbox",
			"class": "order-checkbox"
		}).appendTo(label);

		var name = $("<plaintext>", {
			"class": "order-label-name",
			text: this.labelName
		}).appendTo(label);

		var aEditor = this.editor;
		this.checkbox.change(function(evt) {
			aEditor.enableSubmit();
		});
		if (this.initChecked > 0)	this.check();
	};
	this.check = function() {
		if (this.checkbox == null) return;
		checkField(this.checkbox);
	};
	this.uncheck = function() {
		if (this.checkbox == null) return;
		uncheckField(this.checkbox);
	};
}

function PriorityEditor (activity) {
	this.activity = activity;
	this.btnCheckAll = null;
	this.btnUncheckAll = null;
	this.orderOptionList = null;
	this.selectPriority = null;
	this.btnSubmit = null;
	this.disableSubmit = function () {
		disableField(this.btnSubmit);
	};
	this.enableSubmit = function () {
		enableField(this.btnSubmit);
	};
	this.appendTo = function(par) {
		var container = $("
", {
			"class": "priority-editor",
		}).appendTo(par);

		var aEditor = this;

		var sectionPriority = $("
").appendTo(container);
		this.selectPriority = createSelector(sectionPriority, ["none", "low", "medium", "high"], [0, 1, 2, 3], 0, 0, 0, 0);
		this.selectPriority.val(activity.priority);
		this.selectPriority.change(function(evt) {
			aEditor.enableSubmit();
		});

		var buttonsRow  = $("
", {
			"class": "priority-editor-buttons-row"
		}).appendTo(container);

		this.btnCheckAll = $("<button>", {
			"class": "priority-editor-check-all",
			text: TITLES["check_all"]
		}).appendTo(buttonsRow);

		this.btnUncheckAll = $("<button>", {
			"class": "priority-editor-uncheck-all",
			text: TITLES["uncheck_all"]
		}).appendTo(buttonsRow);

		this.btnCheckAll.click(function(evt) {
			evt.preventDefault();
			for (var i = 0; i < aEditor.orderOptionList.length; ++i) {
				var orderOption = aEditor.orderOptionList[i];
				orderOption.check();
				aEditor.enableSubmit();
			}
		});

		this.btnUncheckAll.click(function(evt) {
			evt.preventDefault();
			for (var i = 0; i < aEditor.orderOptionList.length; ++i) {
				var orderOption = aEditor.orderOptionList[i];
				orderOption.uncheck();
				aEditor.enableSubmit();
			}
		});

		var sectionOrderList = $("
", {
			"class": "priority-editor-order-option-list"
		}).appendTo(container);
		this.orderOptionList = [];

		var labelNameList = [TITLES["last_accepted_time"], TITLES["begin_time"], TITLES["deadline"]];
		var bitCodeList = [1, 2, 4];

		var length = labelNameList.length;

		for (var i = 0; i < length; ++i) {
			var labelName = labelNameList[i];
			var bitCode = bitCodeList[i];
			var initChecked = ((activity.orderMask & bitCode) > 0 ? 1 : 0);
			var orderOption = new OrderOption(this, bitCode, labelName, (activity.orderMask & bitCode));
			orderOption.appendTo(sectionOrderList);
			this.orderOptionList.push(orderOption);
		}

		var sectionSubmit = $("
", {
			"class": "priority-editor-buttons-row"
		}).appendTo(container);

		this.btnSubmit = $("<button>", {
			text: TITLES["update"],
			"class": "priority-editor-submit"
		}).appendTo(sectionSubmit);

		this.btnSubmit.click(function(evt) {
			evt.preventDefault();
			var token = $.cookie(g_keyToken);
			if (token == null) return;

			var orderMask = 0;
			for (var i = 0; i < aEditor.orderOptionList.length; ++i) {
				var orderOption = aEditor.orderOptionList[i];
				if (!isChecked(orderOption.checkbox)) continue;
				orderMask |= orderOption.bitCode;
			}

			var priority = aEditor.selectPriority.val();

			var params = {};
			params[g_keyToken] = token;
			params[g_keyPriority] = priority;
			params[g_keyOrderMask] = orderMask;
			params[g_keyActivityId] = aEditor.activity.id;

			aEditor.disableSubmit();
			$.ajax({
				type: "POST",
				url: "/admin/prioritize",
				data: params,
				success: function(data, status, xhr) {
					aEditor.activity.orderMask = orderMask;
				},
				error: function(xhr, status, err) {
					alert(ALERTS["not_updated"]);
					aEditor.enableSubmit();
				}
			});
		});

		// initialize submit button
		this.disableSubmit();
	};
}

// Assistant Handlers
function onBtnAcceptClicked(evt) {

	var btnAccept = $(evt.srcElement ? evt.srcElement : evt.target);

	evt.preventDefault();
	var data = evt.data;
	var token = $.cookie(g_keyToken);
	var params = {};
 	params[g_keyActivityId] = data[g_keyActivityId];
	params[g_keyToken] = token;

	disableField(btnAccept);
	$.ajax({
		type: "POST",
		url: "/el/admin/activity/accept",
		// url: "/admin/accept",
		data: params,
		success: function(data, status, xhr) {
			enableField(btnAccept);
			if (isTokenExpired(data)) {
				logout(null);
				return;
			}
			if (!isStandardSuccess(data)) return;
			var buttonsWrap = btnAccept.parent();
			var cell = buttonsWrap.parent();
			btnAccept.remove();
			var indicator = cell.data(g_keyStatusIndicator);
			indicator.text("Accepted");
		},
		error: function(xhr, status, err) {
			enableField(btnAccept);
		}
	});
}

function onBtnRejectClicked(evt) {

	var btnReject = $(evt.srcElement ? evt.srcElement : evt.target);

	evt.preventDefault();
	var data = evt.data;
	var token = $.cookie(g_keyToken);
	var params = {};
 	params[g_keyActivityId] = data[g_keyActivityId];
	params[g_keyToken] = token;

	disableField(btnReject);
	$.ajax({
		type: "POST",
		url: "/el/admin/activity/reject",
		// url: "/admin/reject",
		data: params,
		success: function(data, status, xhr){
			enableField(btnReject);
			if (isTokenExpired(data)) {
				logout(null);
				return;
			}
			if (!isStandardSuccess(data)) return;
			var buttonsWrap = btnReject.parent();
			var cell = buttonsWrap.parent();
			btnReject.remove();
			var indicator = cell.data(g_keyStatusIndicator);
			indicator.text("Rejected");
		},
		error: function(xhr, status, err){
			enableField(btnReject);
		}
	});
}

function onBtnDeleteClicked(evt){

	var btnDelete = $(evt.srcElement ? evt.srcElement : evt.target);

	evt.preventDefault();
	var data = evt.data;
	var token = $.cookie(g_keyToken);
	var params = {};
	params[g_keyActivityId] = data[g_keyActivityId];
	params[g_keyToken] = token;

	disableField(btnDelete);
	$.ajax({
		type: "POST",
		url: "/admin/delete",
		data: params,
		success: function(data, status, xhr){
			enableField(btnDelete);
			if (isTokenExpired(data)) {
				logout(null);
				return;
			}
			if (!isStandardSuccess(data)) return;
			var buttonsWrap = btnDelete.parent();
			var cell = buttonsWrap.parent();
			btnDelete.remove();
			var indicator = cell.data(g_keyStatusIndicator);
			indicator.text("Deleted");
		},
		error: function(xhr, status, err){
			enableField(btnDelete);
		}
	});
}

function listActivitiesAndRefreshAdmin() {
	var page = 1;
	listActivities(page, onListActivitiesSuccessAdmin, onListActivitiesErrorAdmin);
}

function onListActivitiesSuccessAdmin(data) {

	if (isTokenExpired(data)) {
		logout(null);
		return;
	}
	var jsonResponse = data;

	var pageSt = parseInt(jsonResponse[g_keyPageSt]);
	var pageEd = parseInt(jsonResponse[g_keyPageEd]);
	var page = pageSt;

	var activitiesJson = jsonResponse[g_keyActivities];
	var length = Object.keys(activitiesJson).length;

	g_pager.screen.empty();
	var activities = [];
	for(var idx = 1; idx <= length; ++idx) {
		var activityJson = activitiesJson[idx - 1];
		var activity = new Activity(activityJson);
		activities.push(activity);
		if (page == g_pager.page) {
			generateActivityCellForAdmin(g_pager.screen, activity);
		}

		if (idx % g_pager.nItems != 0) continue;
		g_pager.cache.putPage(page, activities);
		activities = [];
		++page;
	}
	if (activities != null && activities.length > 0) {
		// for the last page
		g_pager.cache.putPage(page, activities);
	}

	g_pager.refreshBar();
}

function onListActivitiesErrorAdmin(err) {

}

// Generators
function generateActivityCellForAdmin(par, activity) {

	var arrayStatusName = ['created','pending','rejected','accepted','expired'];

	var coverImageUrl = null;

	var ret = $("
", {
		style: "display: block;"
	}).appendTo(par);

	var infoWrap = $("
", {
		style: "margin-left: 5pt;"
	}).appendTo(ret);

	if(activity.images != null) {
		var imagesContainer = $('
', {
			"class": "activity-image-container clearfix"
		}).appendTo(infoWrap);
		for(var i = 0; i < activity.images.length; ++i){
		    var imageNode = $('
', {
			"class": "activity-image left"
		    }).appendTo(imagesContainer);
		    $('',{
			"class": "image-helper"
		    }).appendTo(imageNode);
		    $('',{
			src: activity.images[i].url,
		    }).appendTo(imageNode);
		}
	}

	var cellActivityTitle = $("", {
	    href: window.location.protocol + "//" + window.location.host + "#" +("detail?" + g_keyActivityId + "=" + activity.id.toString()),
		"class": "activity-title",
		text: activity.title
	}).appendTo(infoWrap);

	var cellActivityContent = $("
", {
		"class": "truncate",
		style: "font-size: 1.2em; width: 100%;",
		text: activity.content
	}).appendTo(infoWrap);

	$("

").appendTo(ret);

	var statusIndicator = $("
", {
		style: "color: red; font-size: 15pt; margin-left: 5pt; display: inline-block",
		text: arrayStatusName[parseInt(activity.status)]
	}).appendTo(ret);

	ret.data(g_keyStatusIndicator, statusIndicator);

	var buttonsWrap = $("
", {
	    style: "display: inline-block;"
	}).appendTo(ret);

	// this condition is temporarily hard-coded
	if(activity.status != g_statusAccepted){
            var btnAccept = $("<button>", {
		        style: "width: 64pt; height: 36pt; font-size: 16pt; color: DarkSlateBlue; margin-left: 5pt; background-color: #aaaaaa;",
                text: 'Accept'
            }).appendTo(buttonsWrap);
            var dAccept = {};
            dAccept[g_keyActivityId] = activity.id;
            btnAccept.click(dAccept, onBtnAcceptClicked);
        }

	if(activity.status != g_statusRejected){
            var btnReject = $("<button>", {
		        style: " width: 64pt; height: 36pt; font-size: 16pt; color: purple; margin-left: 5pt; background-color: #aaaaaa;",
                text: 'Reject'
            }).appendTo(buttonsWrap);
            var dReject = {};
            dReject[g_keyActivityId] = activity.id;
            btnReject.click(dReject, onBtnRejectClicked);
        }

	var btnDelete = $("<button>", {
		style: "width: 64pt; height: 36pt; font-size: 16pt; color: IndianRed; margin-left: 5pt; background-color: #aaaaaa;",
		text: 'Delete'
	}).appendTo(buttonsWrap);
	var dDelete = {};
	dDelete[g_keyActivityId] = activity.id;
	btnDelete.click(dDelete, onBtnDeleteClicked);

	if (activity.status == g_statusAccepted) {
		var sectionPriorityEditor = $("
", {
			style: "padding: 2px;"
		}).appendTo(ret);
		var editor = new PriorityEditor(activity);
		editor.appendTo(sectionPriorityEditor);
	}

	var hr = $("
", {
		style: "height: 1pt; color: black; background-color: black"
	}).appendTo(ret);

	return ret;
}

function requestAdmin() {

	var selector = createSelector($("#pager-filters"), ["pending", "accepted", "rejected"], [g_statusPending, g_statusAccepted, g_statusRejected], null, null, null, null);
	var filter = new PagerFilter(g_keyStatus, selector);
	var filters = [filter];

	var pagerCache = new PagerCache(10);

	// initialize pager widgets
	g_pager = new Pager($("#pager-screen-activities"), $("#pager-bar-activities"), g_numItemsPerPage, "/activity/list", generateActivitiesListParams, null, pagerCache, filters, onListActivitiesSuccessAdmin, onListActivitiesErrorAdmin);

	var onLoginSuccess = function(data) {
		listActivitiesAndRefreshAdmin();
	};

	var onLoginError = function(err) {

	};

	var onLogoutSuccess = function(data) {

	};

	var onLogoutError = null;

	// registering is disabled on admin page
	g_preLoginForm = generatePreLoginForm(g_sectionLogin, onLoginSuccess, onLoginError, onLogoutSuccess, onLogoutError, false);

	checkLoginStatus();

}

$(document).ready(function() {

	initTopbar($("#topbar"));
	initActivityEditor($("#wrap"), listActivitiesAndRefreshAdmin);

	requestAdmin();
});


text:
import React from 'react'
import { Loader, Image, Segment } from 'semantic-ui-react'

const LoaderExampleDisabled = () => (
  <Segment>
    <Loader disabled />

    <Image src='http://semantic-ui.com/images/wireframe/short-paragraph.png' />
  </Segment>
)

export default LoaderExampleDisabled

redpajama_set_name: RedPajamaGithub


text:
extern "C" void* memcpy(void* a, const void* b, size_t c);
void* memcpy_int(void* a, const void* b, size_t c)
{
    return memcpy(a, b, c);
}

namespace
{
// trigger: Use the memcpy_int wrapper which calls our internal memcpy.
//   A direct call to memcpy may be optimized away by the compiler.
// test: Fill an array with a sequence of integers. memcpy to a new empty array.
//   Verify that the arrays are equal. Use an odd size to decrease the odds of
//   the call being optimized away.
template <unsigned int T>
bool sanity_test_memcpy()
{
    unsigned int memcpy_test[T];
    unsigned int memcpy_verify[T] = {};
    for (unsigned int i = 0; i != T; ++i)
        memcpy_test[i] = i;

    memcpy_int(memcpy_verify, memcpy_test, sizeof(memcpy_test));

    for (unsigned int i = 0; i != T; ++i) {
        if (memcpy_verify[i] != i)
            return false;
    }
    return true;
}

#if defined(HAVE_SYS_SELECT_H)
// trigger: Call FD_SET to trigger __fdelt_chk. FORTIFY_SOURCE must be defined
//   as >0 and optimizations must be set to at least -O2.
// test: Add a file descriptor to an empty fd_set. Verify that it has been
//   correctly added.
bool sanity_test_fdelt()
{
    fd_set fds;
    FD_ZERO(&fds);
    FD_SET(0, &fds);
    return FD_ISSET(0, &fds);
}
#endif

} // anon namespace

bool glibc_sanity_test()
{
#if defined(HAVE_SYS_SELECT_H)
    if (!sanity_test_fdelt())
        return false;
#endif
    return sanity_test_memcpy<1025>();
}


text:
package org.sleuthkit.autopsy.corecomponents;

import java.awt.Color;
import java.awt.Cursor;
import java.awt.Dialog;
import java.awt.EventQueue;
import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;
import java.util.List;
import java.util.Map;
import java.util.concurrent.ExecutionException;
import java.util.function.Function;
import java.util.logging.Level;
import java.util.prefs.Preferences;
import java.util.stream.Collectors;
import javax.swing.JOptionPane;
import javax.swing.ListSelectionModel;
import javax.swing.SortOrder;
import javax.swing.SwingWorker;
import org.apache.commons.lang3.StringUtils;
import org.netbeans.api.progress.ProgressHandle;
import org.openide.DialogDescriptor;
import org.openide.DialogDisplayer;
import org.openide.NotifyDescriptor;
import org.openide.explorer.ExplorerManager;
import org.openide.nodes.AbstractNode;
import org.openide.nodes.Children;
import org.openide.nodes.Node;
import org.openide.nodes.NodeEvent;
import org.openide.nodes.NodeListener;
import org.openide.nodes.NodeMemberEvent;
import org.openide.nodes.NodeReorderEvent;
import org.openide.util.NbBundle;
import org.openide.util.NbPreferences;
import org.sleuthkit.autopsy.corecomponentinterfaces.DataResultViewer;
import static org.sleuthkit.autopsy.corecomponents.Bundle.*;
import org.sleuthkit.autopsy.corecomponents.ResultViewerPersistence.SortCriterion;
import org.sleuthkit.autopsy.coreutils.ImageUtils;
import org.sleuthkit.autopsy.coreutils.Logger;
import org.sleuthkit.datamodel.AbstractFile;
import org.sleuthkit.datamodel.TskCoreException;

/**
 * A thumbnail viewer for the results view, with paging support.
 *
 * The paging is intended to reduce memory footprint by load only up to
 * (currently) 200 images at a time. This works whether or not the underlying
 * content nodes are being lazy loaded or not.
 *
 * TODO (JIRA-2658): Fix DataResultViewer extension point. When this is done,
 * restore implementation of DataResultViewerTable as a DataResultViewer service
 * provider.
 */
//@ServiceProvider(service = DataResultViewer.class)
final class DataResultViewerThumbnail extends AbstractDataResultViewer {

    private static final long serialVersionUID = 1L;
    private static final Logger logger = Logger.getLogger(DataResultViewerThumbnail.class.getName());
    private int curPage;
    private int totalPages;
    private int curPageImages;
    private int thumbSize = ImageUtils.ICON_SIZE_MEDIUM;
    private final PageUpdater pageUpdater = new PageUpdater();
    private TableFilterNode tfn;
    private ThumbnailViewChildren tvc;

    /**
     * Constructs a thumbnail viewer for the results view, with paging support,
     * that is compatible with node multiple selection actions.
     *
     * @param explorerManager The shared ExplorerManager for the result viewers.
     */
    DataResultViewerThumbnail(ExplorerManager explorerManager) {
        super(explorerManager);
        initialize();
    }

    /**
     * Constructs a thumbnail viewer for the results view, with paging support,
     * that is NOT compatible with node multiple selection actions.
     */
    DataResultViewerThumbnail() {
        initialize();
    }

    @NbBundle.Messages({"DataResultViewerThumbnail.thumbnailSizeComboBox.small=Small Thumbnails",
        "DataResultViewerThumbnail.thumbnailSizeComboBox.medium=Medium Thumbnails",
        "DataResultViewerThumbnail.thumbnailSizeComboBox.large=Large Thumbnails"
    })
    private void initialize() {
        initComponents();
        iconView.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
        em.addPropertyChangeListener(new ExplorerManagerNodeSelectionListener());
        thumbnailSizeComboBox.setModel(new javax.swing.DefaultComboBoxModel<>(
                new String[]{Bundle.DataResultViewerThumbnail_thumbnailSizeComboBox_small(),
                    Bundle.DataResultViewerThumbnail_thumbnailSizeComboBox_medium(),
                    Bundle.DataResultViewerThumbnail_thumbnailSizeComboBox_large()}));
        thumbnailSizeComboBox.setSelectedIndex(1);
        curPage = -1;
        totalPages = 0;
        curPageImages = 0;
    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        pageLabel = new javax.swing.JLabel();
        pagesLabel = new javax.swing.JLabel();
        pagePrevButton = new javax.swing.JButton();
        pageNextButton = new javax.swing.JButton();
        imagesLabel = new javax.swing.JLabel();
        imagesRangeLabel = new javax.swing.JLabel();
        pageNumLabel = new javax.swing.JLabel();
        filePathLabel = new javax.swing.JLabel();
        goToPageLabel = new javax.swing.JLabel();
        goToPageField = new javax.swing.JTextField();
        thumbnailSizeComboBox = new javax.swing.JComboBox<>();
        iconView = new org.openide.explorer.view.IconView();
        sortButton = new javax.swing.JButton();
        sortLabel = new javax.swing.JLabel();

        pageLabel.setText(org.openide.util.NbBundle.getMessage(DataResultViewerThumbnail.class, "DataResultViewerThumbnail.pageLabel.text")); // NOI18N

        pagesLabel.setText(org.openide.util.NbBundle.getMessage(DataResultViewerThumbnail.class, "DataResultViewerThumbnail.pagesLabel.text")); // NOI18N

        pagePrevButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/corecomponents/btn_step_back.png"))); // NOI18N
        pagePrevButton.setText(org.openide.util.NbBundle.getMessage(DataResultViewerThumbnail.class, "DataResultViewerThumbnail.pagePrevButton.text")); // NOI18N
        pagePrevButton.setDisabledIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/corecomponents/btn_step_back_disabled.png"))); // NOI18N
        pagePrevButton.setFocusable(false);
        pagePrevButton.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        pagePrevButton.setMargin(new java.awt.Insets(2, 0, 2, 0));
        pagePrevButton.setPreferredSize(new java.awt.Dimension(55, 23));
        pagePrevButton.setRolloverIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/corecomponents/btn_step_back_hover.png"))); // NOI18N
        pagePrevButton.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        pagePrevButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                pagePrevButtonActionPerformed(evt);
            }
        });

        pageNextButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/corecomponents/btn_step_forward.png"))); // NOI18N
        pageNextButton.setText(org.openide.util.NbBundle.getMessage(DataResultViewerThumbnail.class, "DataResultViewerThumbnail.pageNextButton.text")); // NOI18N
        pageNextButton.setDisabledIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/corecomponents/btn_step_forward_disabled.png"))); // NOI18N
        pageNextButton.setFocusable(false);
        pageNextButton.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        pageNextButton.setMargin(new java.awt.Insets(2, 0, 2, 0));
        pageNextButton.setMaximumSize(new java.awt.Dimension(27, 23));
        pageNextButton.setMinimumSize(new java.awt.Dimension(27, 23));
        pageNextButton.setRolloverIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/corecomponents/btn_step_forward_hover.png"))); // NOI18N
        pageNextButton.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        pageNextButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                pageNextButtonActionPerformed(evt);
            }
        });

        imagesLabel.setText(org.openide.util.NbBundle.getMessage(DataResultViewerThumbnail.class, "DataResultViewerThumbnail.imagesLabel.text")); // NOI18N

        imagesRangeLabel.setText(org.openide.util.NbBundle.getMessage(DataResultViewerThumbnail.class, "DataResultViewerThumbnail.imagesRangeLabel.text")); // NOI18N

        pageNumLabel.setText(org.openide.util.NbBundle.getMessage(DataResultViewerThumbnail.class, "DataResultViewerThumbnail.pageNumLabel.text")); // NOI18N

        filePathLabel.setText(org.openide.util.NbBundle.getMessage(DataResultViewerThumbnail.class, "DataResultViewerThumbnail.filePathLabel.text")); // NOI18N

        goToPageLabel.setText(org.openide.util.NbBundle.getMessage(DataResultViewerThumbnail.class, "DataResultViewerThumbnail.goToPageLabel.text")); // NOI18N

        goToPageField.setText(org.openide.util.NbBundle.getMessage(DataResultViewerThumbnail.class, "DataResultViewerThumbnail.goToPageField.text")); // NOI18N
        goToPageField.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                goToPageFieldActionPerformed(evt);
            }
        });

        thumbnailSizeComboBox.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                thumbnailSizeComboBoxActionPerformed(evt);
            }
        });

        sortButton.setText(org.openide.util.NbBundle.getMessage(DataResultViewerThumbnail.class, "DataResultViewerThumbnail.sortButton.text")); // NOI18N
        sortButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                sortButtonActionPerformed(evt);
            }
        });

        sortLabel.setText(org.openide.util.NbBundle.getMessage(DataResultViewerThumbnail.class, "DataResultViewerThumbnail.sortLabel.text")); // NOI18N

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
        this.setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(iconView, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addGroup(javax.swing.GroupLayout.Alignment.LEADING, layout.createSequentialGroup()
                        .addComponent(pageLabel)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(pageNumLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 95, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(pagesLabel)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(pagePrevButton, javax.swing.GroupLayout.PREFERRED_SIZE, 23, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(0, 0, 0)
                        .addComponent(pageNextButton, javax.swing.GroupLayout.PREFERRED_SIZE, 23, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(goToPageLabel)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(goToPageField, javax.swing.GroupLayout.PREFERRED_SIZE, 54, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(12, 12, 12)
                        .addComponent(imagesLabel)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(imagesRangeLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 91, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(thumbnailSizeComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(30, 30, 30)
                        .addComponent(sortButton)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(sortLabel))
                    .addComponent(filePathLabel, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addContainerGap())
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.CENTER)
                    .addComponent(pageLabel)
                    .addComponent(pageNumLabel)
                    .addComponent(pagesLabel)
                    .addComponent(pagePrevButton, javax.swing.GroupLayout.PREFERRED_SIZE, 23, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(pageNextButton, javax.swing.GroupLayout.PREFERRED_SIZE, 23, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(goToPageLabel)
                    .addComponent(goToPageField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(imagesLabel)
                    .addComponent(imagesRangeLabel)
                    .addComponent(thumbnailSizeComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(sortButton)
                    .addComponent(sortLabel))
                .addGap(13, 13, 13)
                .addComponent(iconView, javax.swing.GroupLayout.DEFAULT_SIZE, 322, Short.MAX_VALUE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(filePathLabel))
        );
    }// </editor-fold>//GEN-END:initComponents

    private void pagePrevButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_pagePrevButtonActionPerformed
        previousPage();
    }//GEN-LAST:event_pagePrevButtonActionPerformed

    private void pageNextButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_pageNextButtonActionPerformed
        nextPage();
    }//GEN-LAST:event_pageNextButtonActionPerformed

    private void goToPageFieldActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_goToPageFieldActionPerformed
        goToPage(goToPageField.getText());
    }//GEN-LAST:event_goToPageFieldActionPerformed

    private void thumbnailSizeComboBoxActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_thumbnailSizeComboBoxActionPerformed
        int newIconSize;
        switch (thumbnailSizeComboBox.getSelectedIndex()) {
            case 0:
                newIconSize = ImageUtils.ICON_SIZE_SMALL;
                break;
            case 2:
                newIconSize = ImageUtils.ICON_SIZE_LARGE;
                break;
            case 1:
            default:
                newIconSize = ImageUtils.ICON_SIZE_MEDIUM;   //default size
                break;
        }

        if (thumbSize != newIconSize) {
            thumbSize = newIconSize;
            Node root = em.getRootContext();
            ((ThumbnailViewChildren) root.getChildren()).setThumbsSize(thumbSize);

            // Temporarily set the explored context to the root, instead of a child node.
            // This is a workaround hack to convince org.openide.explorer.ExplorerManager to
            // update even though the new and old Node values are identical. This in turn
            // will cause the entire view to update completely. After this we
            // immediately set the node back to the current child by calling switchPage().
            em.setExploredContext(root);
            switchPage();
        }
    }//GEN-LAST:event_thumbnailSizeComboBoxActionPerformed

    private void sortButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_sortButtonActionPerformed
        List<Node.Property<?>> childProperties = ResultViewerPersistence.getAllChildProperties(em.getRootContext(), 100);
        SortChooser sortChooser = new SortChooser(childProperties, ResultViewerPersistence.loadSortCriteria(tfn));
        DialogDescriptor dialogDescriptor = new DialogDescriptor(sortChooser, sortChooser.getDialogTitle());
        Dialog createDialog = DialogDisplayer.getDefault().createDialog(dialogDescriptor);
        createDialog.setVisible(true);
        final Object dialogReturnValue = dialogDescriptor.getValue();
        if (DialogDescriptor.OK_OPTION == dialogReturnValue) {
            //apply new sort
            List<SortCriterion> criteria = sortChooser.getCriteria();
            final Preferences preferences = NbPreferences.forModule(DataResultViewerThumbnail.class);

            Map<Node.Property<?>, SortCriterion> criteriaMap = criteria.stream()
                    .collect(Collectors.toMap(SortCriterion::getProperty,
                            Function.identity(),
                            (u, v) -> u)); //keep first criteria if property is selected multiple times.

            //store the sorting information
            int numProperties = childProperties.size();
            for (int i = 0; i < numProperties; i++) {
                Node.Property<?> prop = childProperties.get(i);
                String propName = prop.getName();
                SortCriterion criterion = criteriaMap.get(prop);
                final String columnSortOrderKey = ResultViewerPersistence.getColumnSortOrderKey(tfn, propName);
                final String columnSortRankKey = ResultViewerPersistence.getColumnSortRankKey(tfn, propName);

                if (criterion != null) {
                    preferences.putBoolean(columnSortOrderKey, criterion.getSortOrder() == SortOrder.ASCENDING);
                    preferences.putInt(columnSortRankKey, criterion.getSortRank() + 1);
                } else {
                    preferences.remove(columnSortOrderKey);
                    preferences.remove(columnSortRankKey);
                }
            }
            setNode(tfn); //this is just to force a refresh
        }
    }//GEN-LAST:event_sortButtonActionPerformed

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JLabel filePathLabel;
    private javax.swing.JTextField goToPageField;
    private javax.swing.JLabel goToPageLabel;
    private org.openide.explorer.view.IconView iconView;
    private javax.swing.JLabel imagesLabel;
    private javax.swing.JLabel imagesRangeLabel;
    private javax.swing.JLabel pageLabel;
    private javax.swing.JButton pageNextButton;
    private javax.swing.JLabel pageNumLabel;
    private javax.swing.JButton pagePrevButton;
    private javax.swing.JLabel pagesLabel;
    private javax.swing.JButton sortButton;
    private javax.swing.JLabel sortLabel;
    private javax.swing.JComboBox<String> thumbnailSizeComboBox;
    // End of variables declaration//GEN-END:variables

    @Override
    public boolean isSupported(Node selectedNode) {
        if (selectedNode == null) {
            return false;
        }
        return true;
    }

    @Override
    public void setNode(Node givenNode) {
        setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
        if (tvc != null) {
            tvc.cancelLoadingThumbnails();
        }
        try {
            if (givenNode != null) {
                tfn = (TableFilterNode) givenNode;
                /*
                 * Wrap the given node in a ThumbnailViewChildren that will
                 * produce ThumbnailPageNodes with ThumbnailViewNode children
                 * from the child nodes of the given node.
                 */
                tvc = new ThumbnailViewChildren(givenNode,thumbSize);
                final Node root = new AbstractNode(tvc);

                pageUpdater.setRoot(root);
                root.addNodeListener(pageUpdater);
                em.setRootContext(root);
            } else {
                tfn = null;
                tvc = null;
                Node emptyNode = new AbstractNode(Children.LEAF);
                em.setRootContext(emptyNode);
                iconView.setBackground(Color.BLACK);
            }
        } finally {
            this.setCursor(null);
        }
    }

    @Override
    public String getTitle() {
        return NbBundle.getMessage(this.getClass(), "DataResultViewerThumbnail.title");
    }

    @Override
    public DataResultViewer createInstance() {
        return new DataResultViewerThumbnail();
    }

    @Override
    public void resetComponent() {
        super.resetComponent();
        this.totalPages = 0;
        this.curPage = -1;
        curPageImages = 0;
        updateControls();
    }

    @Override
    public void clearComponent() {
        this.iconView.removeAll();
        this.iconView = null;
        super.clearComponent();
    }

    private void nextPage() {
        if (curPage < totalPages) {
            curPage++;
            switchPage();
        }
    }

    private void previousPage() {
        if (curPage > 1) {
            curPage--;
            switchPage();
        }
    }

    private void goToPage(String pageNumText) {
        int newPage;
        try {
            newPage = Integer.parseInt(pageNumText);
        } catch (NumberFormatException e) {
            //ignore input
            return;
        }

        if (newPage > totalPages || newPage < 1) {
            JOptionPane.showMessageDialog(this,
                    NbBundle.getMessage(this.getClass(), "DataResultViewerThumbnail.goToPageTextField.msgDlg", totalPages),
                    NbBundle.getMessage(this.getClass(), "DataResultViewerThumbnail.goToPageTextField.err"),
                    JOptionPane.WARNING_MESSAGE);
            return;
        }

        curPage = newPage;
        switchPage();
    }

    private void switchPage() {

        EventQueue.invokeLater(() -> {
            setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
        });

        //Note the nodes factories are likely creating nodes in EDT anyway, but worker still helps
        new SwingWorker<Object, Void>() {
            private ProgressHandle progress;

            @Override
            protected Object doInBackground() throws Exception {
                pagePrevButton.setEnabled(false);
                pageNextButton.setEnabled(false);
                goToPageField.setEnabled(false);
                progress = ProgressHandle.createHandle(
                        NbBundle.getMessage(this.getClass(), "DataResultViewerThumbnail.genThumbs"));
                progress.start();
                progress.switchToIndeterminate();
                Node root = em.getRootContext();
                Node pageNode = root.getChildren().getNodeAt(curPage - 1);
                em.setExploredContext(pageNode);
                curPageImages = pageNode.getChildren().getNodesCount();
                return null;
            }

            @Override
            protected void done() {
                progress.finish();
                setCursor(null);
                updateControls();
                // see if any exceptions were thrown
                try {
                    get();
                } catch (InterruptedException | ExecutionException ex) {
                    NotifyDescriptor d =
                            new NotifyDescriptor.Message(
                                    NbBundle.getMessage(this.getClass(), "DataResultViewerThumbnail.switchPage.done.errMsg",
                                            ex.getMessage()),
                                    NotifyDescriptor.ERROR_MESSAGE);
                    DialogDisplayer.getDefault().notify(d);
                    logger.log(Level.SEVERE, "Error making thumbnails: {0}", ex.getMessage()); //NON-NLS
                } // catch and ignore if we were cancelled
                catch (java.util.concurrent.CancellationException ex) {
                }
            }
        }.execute();

    }

    @NbBundle.Messages({
        "# {0} - sort criteria", "DataResultViewerThumbnail.sortLabel.textTemplate=Sorted by: {0}",
        "DataResultViewerThumbnail.sortLabel.text=Sorted by: ---"})
    private void updateControls() {
        if (totalPages == 0) {
            pagePrevButton.setEnabled(false);
            pageNextButton.setEnabled(false);
            goToPageField.setEnabled(false);
            pageNumLabel.setText("");
            imagesRangeLabel.setText("");
            thumbnailSizeComboBox.setEnabled(false);
            sortButton.setEnabled(false);
            sortLabel.setText(DataResultViewerThumbnail_sortLabel_text());

        } else {
            pageNumLabel.setText(
                    NbBundle.getMessage(this.getClass(), "DataResultViewerThumbnail.pageNumbers.curOfTotal",
                            Integer.toString(curPage), Integer.toString(totalPages)));
            final int imagesFrom = (curPage - 1) * ThumbnailViewChildren.IMAGES_PER_PAGE + 1;
            final int imagesTo = curPageImages + (curPage - 1) * ThumbnailViewChildren.IMAGES_PER_PAGE;
            imagesRangeLabel.setText(imagesFrom + "-" + imagesTo);

            pageNextButton.setEnabled(!(curPage == totalPages));
            pagePrevButton.setEnabled(!(curPage == 1));
            goToPageField.setEnabled(totalPages > 1);
            sortButton.setEnabled(true);
            thumbnailSizeComboBox.setEnabled(true);
            if (tfn != null) {
                String sortString = ResultViewerPersistence.loadSortCriteria(tfn).stream()
                        .map(SortCriterion::toString)
                        .collect(Collectors.joining(" "));
                sortString = StringUtils.defaultIfBlank(sortString, "---");
                sortLabel.setText(Bundle.DataResultViewerThumbnail_sortLabel_textTemplate(sortString));
            } else {
                sortLabel.setText(DataResultViewerThumbnail_sortLabel_text());
            }
        }
    }

    /**
     * Listens for root change updates and updates the paging controls
     */
    private class PageUpdater implements NodeListener {

        private Node root;

        void setRoot(Node root) {
            this.root = root;
        }

        @Override
        public void propertyChange(PropertyChangeEvent evt) {
        }

        @Override
        public void childrenAdded(NodeMemberEvent nme) {
            totalPages = root.getChildren().getNodesCount();

            if (totalPages == 0) {
                curPage = -1;
                updateControls();
                return;
            }

            if (curPage == -1 || curPage > totalPages) {
                curPage = 1;
            }

            //force load the curPage node
            final Node pageNode = root.getChildren().getNodeAt(curPage - 1);

            //em.setSelectedNodes(new Node[]{pageNode});
            if (pageNode != null) {
                pageNode.addNodeListener(new NodeListener() {
                    @Override
                    public void childrenAdded(NodeMemberEvent nme) {
                        curPageImages = pageNode.getChildren().getNodesCount();
                        updateControls();
                    }

                    @Override
                    public void childrenRemoved(NodeMemberEvent nme) {
                        curPageImages = 0;
                        updateControls();
                    }

                    @Override
                    public void childrenReordered(NodeReorderEvent nre) {
                    }

                    @Override
                    public void nodeDestroyed(NodeEvent ne) {
                    }

                    @Override
                    public void propertyChange(PropertyChangeEvent evt) {
                    }
                });

                em.setExploredContext(pageNode);
            }

            updateControls();
        }

        @Override
        public void childrenRemoved(NodeMemberEvent nme) {
            totalPages = 0;
            curPage = -1;
            updateControls();
        }

        @Override
        public void childrenReordered(NodeReorderEvent nre) {
        }

        @Override
        public void nodeDestroyed(NodeEvent ne) {
        }
    }

    private class ExplorerManagerNodeSelectionListener implements PropertyChangeListener {

        @Override
        public void propertyChange(PropertyChangeEvent evt) {
            if (evt.getPropertyName().equals(ExplorerManager.PROP_SELECTED_NODES)) {
                setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
                try {
                    Node[] selectedNodes = em.getSelectedNodes();
                    if (selectedNodes.length == 1) {
                        AbstractFile af = selectedNodes[0].getLookup().lookup(AbstractFile.class);
                        if (af == null) {
                            filePathLabel.setText("");
                        } else {
                            try {
                                String uPath = af.getUniquePath();
                                filePathLabel.setText(uPath);
                                filePathLabel.setToolTipText(uPath);
                            } catch (TskCoreException e) {
                                logger.log(Level.WARNING, "Could not get unique path for content: {0}", af.getName()); //NON-NLS
                            }
                        }
                    } else {
                        filePathLabel.setText("");
                    }
                } finally {
                    setCursor(null);
                }
            }
        }
    }

}


text:
#include "HitFinderTools.h"

using namespace std;

vector<JPetHit> HitFinderTools::createHits(JPetStatistics& stats,
  const SignalsContainer& allSignalsInTimeWindow,
  const double timeDifferenceWindow,
  const std::map<int, std::vector<double>> velMap)
{
	vector<JPetHit> hits;

	for (auto scintillator : allSignalsInTimeWindow) {

		auto sideA = scintillator.second.first;
		auto sideB = scintillator.second.second;

		if (sideA.size() > 0 && sideB.size() > 0) {

			std::sort(sideA.begin(),
				sideA.end(),
				[] (const JPetPhysSignal & h1,
					const JPetPhysSignal & h2) {
					return h1.getTime() < h2.getTime();
				});

			std::sort(sideB.begin(),
				sideB.end(),
				[] (const JPetPhysSignal & h1,
					const JPetPhysSignal & h2) {
				        return h1.getTime() < h2.getTime();
				});

			for (auto signalA : sideA) {
				for (auto signalB : sideB) {

					if ((signalB.getTime() - signalA.getTime())
								> timeDifferenceWindow)
									break;

					if (fabs(signalA.getTime() - signalB.getTime())
								< timeDifferenceWindow) {

						//Creating hit for successfully matched pair of Phys singlas
						//Setting meaningless parameters of Energy, Position, quality
						JPetHit hit;
						hit.setSignalA(signalA);
						hit.setSignalB(signalB);
						hit.setTime((signalA.getTime()+signalB.getTime())/2.0);
						hit.setQualityOfTime(-1.0);
						hit.setTimeDiff(signalA.getTime()-signalB.getTime());
						hit.setQualityOfTimeDiff(-1.0);
						hit.setEnergy(-1.0);
						hit.setQualityOfEnergy(-1.0);
            hit.setScintillator(signalA.getPM().getScin());
						hit.setBarrelSlot(signalA.getPM().getBarrelSlot());
						hit.setPosX(hit.getBarrelSlot().getLayer().getRadius()
												*cos(hit.getBarrelSlot().getTheta()));
						hit.setPosY(hit.getBarrelSlot().getLayer().getRadius()
												*sin(hit.getBarrelSlot().getTheta()));

						auto search = velMap.find(hit.getBarrelSlot().getID());
						if(search != velMap.end()){
							double vel = search->second.at(0);
							double position = vel*hit.getTimeDiff()/2000;
							hit.setPosZ(position);
						}else{
							hit.setPosZ(-1000000.0);
						}

						hits.push_back(hit);

            stats.getHisto2D("time_diff_per_scin")
              .Fill(hit.getTimeDiff(),
                (float) (hit.getScintillator().getID()));

						stats.getHisto2D("hit_pos_per_scin")
							.Fill(hit.getPosZ(),
                (float) (hit.getScintillator().getID()));
					}
				}
			}
		}
	}
	return hits;
}


text:
/*
 * DO NOT EDIT THIS FILE! Automatically generated
 */

#include "base/debug.hh"

namespace Debug {

SimpleFlag Arm("Arm", "None");

} // namespace Debug


text:
#ifndef SHARE_VM_GC_IMPLEMENTATION_SHARED_GCHEAPSUMMARY_HPP
#define SHARE_VM_GC_IMPLEMENTATION_SHARED_GCHEAPSUMMARY_HPP

#include "memory/allocation.hpp"

class VirtualSpaceSummary : public StackObj {
  HeapWord* _start;
  HeapWord* _committed_end;
  HeapWord* _reserved_end;
public:
  VirtualSpaceSummary() :
      _start(NULL), _committed_end(NULL), _reserved_end(NULL) { }
  VirtualSpaceSummary(HeapWord* start, HeapWord* committed_end, HeapWord* reserved_end) :
      _start(start), _committed_end(committed_end), _reserved_end(reserved_end) { }

  HeapWord* start() const { return _start; }
  HeapWord* committed_end() const { return _committed_end; }
  HeapWord* reserved_end() const { return _reserved_end; }
  size_t committed_size() const { return (uintptr_t)_committed_end - (uintptr_t)_start;  }
  size_t reserved_size() const { return (uintptr_t)_reserved_end - (uintptr_t)_start; }
};

class SpaceSummary : public StackObj {
  HeapWord* _start;
  HeapWord* _end;
  size_t    _used;
public:
  SpaceSummary() :
      _start(NULL), _end(NULL), _used(0) { }
  SpaceSummary(HeapWord* start, HeapWord* end, size_t used) :
      _start(start), _end(end), _used(used) { }

  HeapWord* start() const { return _start; }
  HeapWord* end() const { return _end; }
  size_t used() const { return _used; }
  size_t size() const { return (uintptr_t)_end - (uintptr_t)_start; }
};

class GCHeapSummary;
class PSHeapSummary;

class GCHeapSummaryVisitor {
 public:
  virtual void visit(const GCHeapSummary* heap_summary) const = 0;
  virtual void visit(const PSHeapSummary* heap_summary) const {}
};

class GCHeapSummary : public StackObj {
  VirtualSpaceSummary _heap;
  size_t _used;

 public:
   GCHeapSummary() :
       _heap(), _used(0) { }
   GCHeapSummary(VirtualSpaceSummary& heap_space, size_t used) :
       _heap(heap_space), _used(used) { }

  const VirtualSpaceSummary& heap() const { return _heap; }
  size_t used() const { return _used; }

   virtual void accept(GCHeapSummaryVisitor* visitor) const {
     visitor->visit(this);
   }
};

class PSHeapSummary : public GCHeapSummary {
  VirtualSpaceSummary  _old;
  SpaceSummary         _old_space;
  VirtualSpaceSummary  _young;
  SpaceSummary         _eden;
  SpaceSummary         _from;
  SpaceSummary         _to;
 public:
   PSHeapSummary(VirtualSpaceSummary& heap_space, size_t heap_used, VirtualSpaceSummary old, SpaceSummary old_space, VirtualSpaceSummary young, SpaceSummary eden, SpaceSummary from, SpaceSummary to) :
       GCHeapSummary(heap_space, heap_used), _old(old), _old_space(old_space), _young(young), _eden(eden), _from(from), _to(to) { }
   const VirtualSpaceSummary& old() const { return _old; }
   const SpaceSummary& old_space() const { return _old_space; }
   const VirtualSpaceSummary& young() const { return _young; }
   const SpaceSummary& eden() const { return _eden; }
   const SpaceSummary& from() const { return _from; }
   const SpaceSummary& to() const { return _to; }

   virtual void accept(GCHeapSummaryVisitor* visitor) const {
     visitor->visit(this);
   }
};

class PermGenSummary : public StackObj {
  VirtualSpaceSummary _perm_space;
  SpaceSummary        _object_space;

 public:
  PermGenSummary() :
       _perm_space(), _object_space() { }
  PermGenSummary(const VirtualSpaceSummary& perm_space, const SpaceSummary& object_space) :
       _perm_space(perm_space), _object_space(object_space) { }

  const VirtualSpaceSummary& perm_space() const { return _perm_space; }
  const SpaceSummary& object_space() const { return _object_space; }
};

#endif // SHARE_VM_GC_IMPLEMENTATION_SHARED_GCHEAPSUMMARY_HPP


text:
findSubStr :: String -> String -> Bool
findSubStr ns hs
  | length ns > length hs       = False
  | (take (length ns) hs) == ns = True
  | otherwise                   = findSubStr ns (drop 1 hs)

runTestCase :: Int -> IO ()
runTestCase 0 = return ()
runTestCase n = do
  haystack <- getLine
  needle <- getLine
  let ans = findSubStr needle haystack
  putStrLn $ if ans == True then "YES" else "NO"
  runTestCase (n-1)

main :: IO ()
main = do
  tc <- getLine
  runTestCase (read tc)


text:
chef_gem "versionomy"

major_version = Versionomy.parse(node["libreoffice"]["version"]).major
minor_version = Versionomy.parse(node["libreoffice"]["version"]).minor

case node["platform"]
when "ubuntu"
  unless node["libreoffice"]["version"]
    return "No Libreoffice version set"
  end

  apt_repository "libreoffice-#{major_version}.#{minor_version}" do
    uri "http://ppa.launchpad.net/libreoffice/libreoffice-#{major_version}-#{minor_version}/ubuntu"
    distribution node['lsb']['codename']
    components ["main"]
    keyserver "keyserver.ubuntu.com"
    key "1378B444"
  end
end


text:
package org.kuali.kra.s2s.generator.impl;

import gov.grants.apply.system.globalLibraryV10.AddressDataType;
import gov.grants.apply.system.globalLibraryV10.AddressRequireCountryDataType;
import gov.grants.apply.system.globalLibraryV10.ContactPersonDataType;
import gov.grants.apply.system.globalLibraryV10.HumanNameDataType;
import gov.grants.apply.system.universalCodesV10.CountryCodeType;
import org.kuali.kra.bo.Rolodex;
import org.kuali.kra.proposaldevelopment.bo.ProposalPerson;
import org.kuali.kra.s2s.generator.bo.DepartmentalPerson;
import org.kuali.kra.s2s.generator.bo.KeyPersonInfo;

public class GlobalLibraryV1_0Generator {

    /**
     * Create AddressDataType from ProposalPerson
     *
     * @param person ProposalPerson
     * @return AddressDataType corresponding to the ProposalPerson object.
     */
    public AddressDataType getAddressDataType(ProposalPerson person) {

        AddressDataType addressType = AddressDataType.Factory.newInstance();
        if (person != null) {

            String street1 = person.getAddressLine1();
            addressType.setStreet1(street1);
            String street2 = person.getAddressLine2();
            if (street2 != null && !street2.equals("")) {
                addressType.setStreet2(street2);
            }
            String city = person.getCity();
            addressType.setCity(city);

            String state = person.getState();
            if (state != null && !state.equals("")) {
                addressType.setState(state);
            }
            String zipcode = person.getPostalCode();
            if (zipcode != null && !zipcode.equals("")) {
                addressType.setZipCode(zipcode);
            }
            String county = person.getCounty();
            if (county != null && !county.equals("")) {
                addressType.setCounty(county);
            }
            String country = person.getCountryCode();
            CountryCodeType.Enum countryCode = null;
            if (country != null && !country.equals("")) {
                countryCode = CountryCodeType.Enum.forString(country);
            }
            addressType.setCountry(countryCode);
        }
        return addressType;
    }

    /**
     * Create AddressDataType from rolodex entry
     *
     * @param rolodex Rolodex entry
     * @return The AddressDataType corresponding to the rolodex entry.
     */

    public AddressDataType getAddressDataType(Rolodex rolodex) {
        AddressDataType addressType = AddressDataType.Factory.newInstance();
        if (rolodex != null) {

            String street1 = rolodex.getAddressLine1();
            addressType.setStreet1(street1);
            String street2 = rolodex.getAddressLine2();
            if (street2 != null && !street2.equals("")) {
                addressType.setStreet2(street2);
            }
            addressType.setCity(rolodex.getCity());
            String state = rolodex.getState();
            if (state != null && !state.equals("")) {
                addressType.setState(state);
            }
            String zipcode = rolodex.getPostalCode();
            if (zipcode != null && !zipcode.equals("")) {
                addressType.setZipCode(zipcode);
            }
            String county = rolodex.getCounty();
            if (county != null && !county.equals("")) {
                addressType.setCounty(county);
            }
            String country = rolodex.getCountryCode();
            if (country != null && !country.equals("")) {
                CountryCodeType.Enum countryCode = CountryCodeType.Enum.forString(country);
                addressType.setCountry(countryCode);
            }
        }
        return addressType;
    }

    /**
     * Create AddressRequireCountryDataType from rolodex object
     *
     * @param rolodex Rolodex object
     * @return AddressRequireCountryDataType corresponding to the rolodex object.
     */
    public AddressRequireCountryDataType getAddressRequireCountryDataType(Rolodex rolodex) {

        AddressRequireCountryDataType address = AddressRequireCountryDataType.Factory.newInstance();
        if (rolodex != null) {

            String street1 = rolodex.getAddressLine1();
            address.setStreet1(street1);
            String street2 = rolodex.getAddressLine2();
            if (street2 != null && !street2.equals("")) {
                address.setStreet2(street2);
            }
            String city = rolodex.getCity();
            address.setCity(city);
            String county = rolodex.getCounty();
            if (county != null && !county.equals("")) {
                address.setCounty(county);
            }
            String state = rolodex.getState();
            if (state != null && !state.equals("")) {
                address.setState(state);
            }
            String zipcode = rolodex.getPostalCode();
            if (zipcode != null && !zipcode.equals("")) {
                address.setZipCode(zipcode);
            }
            String country = rolodex.getCountryCode();
            address.setCountry(CountryCodeType.Enum.forString(country));

        }
        return address;
    }

    /**
     * Create AddressRequireCountryDataType from ProposalPerson object
     *
     * @param person ProposalPerson Object
     * @return AddressRequireCountryDataType corresponding to the ProposalPerson object
     */
    public AddressRequireCountryDataType getAddressRequireCountryDataType(ProposalPerson person) {

        AddressRequireCountryDataType address = AddressRequireCountryDataType.Factory.newInstance();
        if (person != null) {

            String street1 = person.getAddressLine1();
            address.setStreet1(street1);
            String street2 = person.getAddressLine2();
            if (street2 != null && !street2.equals("")) {
                address.setStreet2(street2);
            }
            String city = person.getCity();
            address.setCity(city);
            String county = person.getCounty();
            if (county != null && !county.equals("")) {
                address.setCounty(county);
            }
            String state = person.getState();
            if (state != null && !state.equals("")) {
                address.setState(state);
            }
            String zipcode = person.getPostalCode();
            if (zipcode != null && !zipcode.equals("")) {
                address.setZipCode(zipcode);
            }
            String country = person.getCountryCode();
            address.setCountry(CountryCodeType.Enum.forString(country));

        }
        return address;
    }

    /**
     * Create AddressRequireCountryDataType from DepartmentalPerson object
     *
     * @param person DepartmentalPerson
     * @return AddressRequireCountryDataType corresponding to the DepartmentalPerson object.
     */
    public AddressRequireCountryDataType getAddressRequireCountryDataType(DepartmentalPerson person) {

        AddressRequireCountryDataType address = AddressRequireCountryDataType.Factory.newInstance();
        if (person != null) {

            String street1 = person.getAddress1();
            address.setStreet1(street1);
            String street2 = person.getAddress2();
            if (street2 != null && !street2.equals("")) {
                address.setStreet2(street2);
            }
            String city = person.getCity();
            address.setCity(city);
            String county = person.getCounty();
            if (county != null && !county.equals("")) {
                address.setCounty(county);
            }
            String state = person.getState();
            if (state != null && !state.equals("")) {
                address.setState(state);
            }
            String zipcode = person.getPostalCode();
            if (zipcode != null && !zipcode.equals("")) {
                address.setZipCode(zipcode);
            }
            String country = person.getCountryCode();
            address.setCountry(CountryCodeType.Enum.forString(country));

        }
        return address;
    }

    /**
     * Create HumanNameDataType from ProposalPerson object
     *
     * @param person ProposalPerson
     * @return HumanNameDataType corresponding to the ProposalPerson object.
     */
    public HumanNameDataType getHumanNameDataType(ProposalPerson person) {

        HumanNameDataType humanName = HumanNameDataType.Factory.newInstance();
        if (person != null) {
            humanName.setFirstName(person.getFirstName());
            humanName.setLastName(person.getLastName());
            String middleName = person.getMiddleName();
            if (middleName != null && !middleName.equals("")) {
                humanName.setMiddleName(middleName);
            }

        }
        return humanName;
    }

    /**
     * Create HumanNameDataType from DepartmentalPerson object
     *
     * @param person DepartmentalPerson
     * @return HumanNameDataType corresponding to the DepartmentalPerson object
     */

    public HumanNameDataType getHumanNameDataType(DepartmentalPerson person) {

        HumanNameDataType humanName = HumanNameDataType.Factory.newInstance();
        if (person != null) {
            humanName.setFirstName(person.getFirstName());
            humanName.setLastName(person.getLastName());
            String middleName = person.getMiddleName();
            if (middleName != null && !middleName.equals("")) {
                humanName.setMiddleName(middleName);
            }

        }
        return humanName;
    }

    /**
     * Create HumanNameDataType from explanation string. The string is expected to be comma separated values of firstname, lastname,
     * in order.
     *
     * @param explanation Comma separated string of first name and last name
     * @return HumanNameDataType created from the string explanation
     */
    public HumanNameDataType getHumanNameDataType(String explanation) {

        HumanNameDataType humanNameDataType = HumanNameDataType.Factory.newInstance();
        String firstName = null;
        String lastName = null;
        String formerName = explanation;
        int commaPos = 0;
        if (formerName != null) {
            commaPos = formerName.indexOf(",");

            if (commaPos > 0) {
                lastName = formerName.substring(0, commaPos);
                firstName = formerName.substring(commaPos + 1);
            }
            else {
                lastName = formerName;
            }
        }
        humanNameDataType.setLastName(lastName);
        humanNameDataType.setFirstName(firstName);
        return humanNameDataType;
    }

    /**
     * Create a HumanNameDataType from Rolodex object
     *
     * @param rolodex Rolodex object
     * @return HumanNameDataType corresponding to the rolodex object.
     */
    public HumanNameDataType getHumanNameDataType(Rolodex rolodex) {

        HumanNameDataType humanName = HumanNameDataType.Factory.newInstance();
        if (rolodex != null) {
            humanName.setFirstName(rolodex.getFirstName());
            humanName.setLastName(rolodex.getLastName());
            String middleName = rolodex.getMiddleName();
            if (middleName != null && !middleName.equals("")) {
                humanName.setMiddleName(middleName);
            }

        }
        return humanName;
    }

    /**
     * Create HumanNameDataType from KeyPersonInfo object
     *
     * @param keyPerson KeyPersonInfo
     * @return HumanNameDataType corresponding to the KeyPersonInfo object
     */
    public HumanNameDataType getHumanNameDataType(KeyPersonInfo keyPerson) {

        HumanNameDataType humanName = HumanNameDataType.Factory.newInstance();
        humanName.setFirstName(keyPerson.getFirstName());
        humanName.setLastName(keyPerson.getLastName());
        String middleName = keyPerson.getMiddleName();
        if (middleName != null && !middleName.equals("")) {
            humanName.setMiddleName(middleName);
        }
        return humanName;
    }

    /**
     * Create ContactPersonDataType from ProposalPerson object
     *
     * @param person Proposalperson
     * @return ContactPersonDataType created from ProposalPerson object
     */
    public ContactPersonDataType getContactPersonDataType(ProposalPerson person) {
        ContactPersonDataType contactPerson = ContactPersonDataType.Factory.newInstance();
        if (person != null) {
            contactPerson.setName(getHumanNameDataType(person));
            contactPerson.setPhone(person.getOfficePhone());
            String email = person.getEmailAddress();
            if (email != null && !email.equals("")) {
                contactPerson.setEmail(email);
            }
            String title = person.getDirectoryTitle();
            if (title != null && !title.equals("")) {
                contactPerson.setTitle(title);
            }
            String fax = person.getFaxNumber();
            if (fax != null && !fax.equals("")) {
                contactPerson.setFax(fax);
            }
            contactPerson.setAddress(getAddressDataType(person));
        }
        return contactPerson;
    }

}


text:
<?xml version="1.0" encoding="UTF-8"?>
<container>
  <alias id="alias_1" service="service_1" public="true"/>
  <definition id="definition_1" class="Full\Qualified\Class1" public="true" synthetic="false" lazy="true" shared="true" abstract="true" autowired="false" autoconfigured="false" file="">
    <factory class="Full\Qualified\FactoryClass" method="get"/>
    <argument type="service" id=".definition_2"/>
    <argument>%parameter%</argument>
    <argument>
      <definition class="inline_service" public="false" synthetic="false" lazy="false" shared="true" abstract="false" autowired="false" autoconfigured="false" file="">
        <argument>arg1</argument>
        <argument>arg2</argument>
      </definition>
    </argument>
    <argument type="collection">
      <argument>foo</argument>
      <argument type="service" id=".definition_2"/>
      <argument>
        <definition class="inline_service" public="false" synthetic="false" lazy="false" shared="true" abstract="false" autowired="false" autoconfigured="false" file=""/>
      </argument>
    </argument>
    <argument type="iterator">
      <argument type="service" id="definition_1"/>
      <argument type="service" id=".definition_2"/>
    </argument>
  </definition>
  <definition id="service_container" class="Symfony\Component\DependencyInjection\ContainerInterface" public="true" synthetic="true" lazy="false" shared="true" abstract="false" autowired="false" autoconfigured="false" file="">
    <description><![CDATA[ContainerInterface is the interface implemented by service container classes.]]></description>
  </definition>
</container>


text:
    <md-card class="autoCard">
      <md-card-title>Particulier</md-card-title>

      <md-card-content>

    View details »

           <button class="autoBtn"  md-raised-button color="none">AUTO - RC & Garanties Accessoires</button>

           <button class="autoBtn"  md-raised-button color="none">AUTO - Responsabilté Civile</button>

           <button class="autoBtn"  md-raised-button color="none">AUTO - Garanties Accessoires</button>

           <button class="autoBtn"  md-raised-button color="none">Mondial Assistance</button>

           <button class="autoBtn"  md-raised-button color="none">Circulation</button>

           <button class="autoBtn"  md-raised-button color="none">Incendie Habitation</button>

           <button class="autoBtn"  md-raised-button color="none">Incendie Commerce / PME</button>

      </md-card-content>

    </md-card>

    <md-card class="IndustrieCard">
      <md-card-title>Industrie</md-card-title>

     <md-card-content>

           <button class="autoBtn"  md-raised-button color="none"> RC & Garanties Accessoires</button>

           <button class="autoBtn"  md-raised-button color="none">Risques Personels</button>

           <button class="autoBtn"  md-raised-button color="none">Garanties Accessoires</button>

           <button class="autoBtn"  md-raised-button color="none">Mondial Assistance</button>

      </md-card-content>

    </md-card>

     <md-card class="IndustrieCard">
      <md-card-title>Professionnels  Construction</md-card-title>

     <md-card-content>

           <button class="autoBtn"  md-raised-button color="none">Risques Personels</button>

           <button class="autoBtn"  md-raised-button color="none">Risques d'entreprise</button>

           <button class="autoBtn"  md-raised-button color="none">Investir</button>

           <button class="autoBtn"  md-raised-button color="none">Assistance</button>

      </md-card-content>

    </md-card>

      <md-card class="IndustrieCard">
      <md-card-title>Professionnels  Construction</md-card-title>

     <md-card-content>

           <button class="autoBtn"  md-raised-button color="none">Risques Personels</button>

           <button class="autoBtn"  md-raised-button color="none">Risques d'entreprise</button>

           <button class="autoBtn"  md-raised-button color="none">Investir</button>

           <button class="autoBtn"  md-raised-button color="none">Assistance</button>

      </md-card-content>

    </md-card>


text:
'use strict';
require('mor-command-test');


text:
<!DOCTYPE html>

    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link href="../dist/all.min.css" rel="stylesheet" type="text/css">
    <title>getElementBy</title>

getElementBy

<input id="getElementById" name="getElementsByName" value="STALLOWN3D!">

        IE6/7
        IE8+/Chrome/Edge

        getElementById
        <input id="getElementByIdOld" type="text" />
        getElementById
        <input id="getElementByIdNew" type="text" />

        getElementsByName
        <input id="getElementsByNameOld" type="text" />
        getElementsByName
        <input id="getElementsByNameNew" type="text" />


text:
from suit.apps import DjangoSuitConfig
from suit.menu import ChildItem, ParentItem

class SuitConfig(DjangoSuitConfig):
    layout = 'vertical'

    menu = (
        ParentItem('Users', children=[
            ChildItem(model='users.user'),
            ChildItem(model='auth.group'),
        ], icon='fa fa-users'),
        ParentItem(app='countries', icon='fa fa-map-marker'),
    )


text:
package org.jboss.jandex.maven.filesets;

public class SomeClass {
}