text:
package com.intellij.vcs.log.ui.render;

import com.intellij.openapi.util.text.StringUtil;
import com.intellij.openapi.vcs.changes.issueLinks.IssueLinkRenderer;
import com.intellij.ui.SimpleColoredComponent;
import com.intellij.ui.SimpleColoredRenderer;
import com.intellij.ui.SimpleTextAttributes;
import com.intellij.util.ObjectUtils;
import com.intellij.util.ui.JBUI;
import com.intellij.util.ui.UIUtil;
import com.intellij.vcs.log.VcsRef;
import com.intellij.vcs.log.data.VcsLogData;
import com.intellij.vcs.log.graph.EdgePrintElement;
import com.intellij.vcs.log.graph.PrintElement;
import com.intellij.vcs.log.paint.GraphCellPainter;
import com.intellij.vcs.log.paint.PaintParameters;
import com.intellij.vcs.log.ui.frame.VcsLogGraphTable;
import com.intellij.vcs.log.ui.tables.GraphTableModel;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

import javax.swing.*;
import java.awt.*;
import java.awt.image.BufferedImage;
import java.util.Collection;

public class GraphCommitCellRenderer extends TypeSafeTableCellRenderer<GraphCommitCell> {
  private static final int MAX_GRAPH_WIDTH = 6;
  private static final int VERTICAL_PADDING = JBUI.scale(7);

  @NotNull private final VcsLogData myLogData;
  @NotNull private final VcsLogGraphTable myGraphTable;

  @NotNull private final MyComponent myComponent;
  @NotNull private final MyComponent myTemplateComponent;
  @NotNull private final LabelPainter myTooltipPainter;

  public GraphCommitCellRenderer(@NotNull VcsLogData logData,
                                 @NotNull GraphCellPainter painter,
                                 @NotNull VcsLogGraphTable table,
                                 boolean compact,
                                 boolean showTagNames) {
    myLogData = logData;
    myGraphTable = table;

    myTooltipPainter = new LabelPainter(myLogData, compact, showTagNames);
    myComponent = new MyComponent(logData, painter, table, compact, showTagNames);
    myTemplateComponent = new MyComponent(logData, painter, table, compact, showTagNames);
  }

  @Override
  protected SimpleColoredComponent getTableCellRendererComponentImpl(@NotNull JTable table,
                                                                     @NotNull GraphCommitCell value,
                                                                     boolean isSelected,
                                                                     boolean hasFocus,
                                                                     int row,
                                                                     int column) {
    myComponent.customize(value, isSelected, hasFocus, row, column);
    return myComponent;
  }

  @Nullable
  public JComponent getTooltip(@NotNull Object value, @NotNull Point point, int row) {
    GraphCommitCell cell = getValue(value);
    Collection<VcsRef> refs = cell.getRefsToThisCommit();
    if (!refs.isEmpty()) {
      myTooltipPainter.customizePainter(myComponent, refs, myComponent.getBackground(), myComponent.getForeground(),
                                        true/*counterintuitive, but true*/, getColumnWidth());
      if (myTooltipPainter.isLeftAligned()) {
        double distance = point.getX() - myTemplateComponent.getGraphWidth(cell.getPrintElements());
        if (distance > 0 && distance <= getReferencesWidth(row, cell)) {
          return new TooltipReferencesPanel(myLogData, myTooltipPainter, refs);
        }
      }
      else {
        if (getColumnWidth() - point.getX() <= getReferencesWidth(row, cell)) {
          return new TooltipReferencesPanel(myLogData, myTooltipPainter, refs);
        }
      }
    }
    return null;
  }

  public int getPreferredHeight() {
    return myComponent.getPreferredHeight();
  }

  private int getReferencesWidth(int row) {
    return getReferencesWidth(row, getValue(myGraphTable.getModel().getValueAt(row, GraphTableModel.COMMIT_COLUMN)));
  }

  private int getReferencesWidth(int row, @NotNull GraphCommitCell cell) {
    Collection<VcsRef> refs = cell.getRefsToThisCommit();
    if (!refs.isEmpty()) {
      myTemplateComponent.customize(cell, myGraphTable.isRowSelected(row), myGraphTable.hasFocus(),
                                    row, GraphTableModel.COMMIT_COLUMN);
      return myTemplateComponent.getReferencePainter().getSize().width;
    }

    return 0;
  }

  private int getGraphWidth(int row) {
    GraphCommitCell cell = getValue(myGraphTable.getModel().getValueAt(row, GraphTableModel.COMMIT_COLUMN));
    return myTemplateComponent.getGraphWidth(cell.getPrintElements());
  }

  public int getTooltipXCoordinate(int row) {
    int referencesWidth = getReferencesWidth(row);
    if (referencesWidth != 0) {
      if (myComponent.getReferencePainter().isLeftAligned()) return getGraphWidth(row) + referencesWidth / 2;
      return getColumnWidth() - referencesWidth / 2;
    }
    return getColumnWidth() / 2;
  }

  private int getColumnWidth() {
    return myGraphTable.getColumnModel().getColumn(GraphTableModel.COMMIT_COLUMN).getWidth();
  }

  public void setCompactReferencesView(boolean compact) {
    myComponent.getReferencePainter().setCompact(compact);
    myTemplateComponent.getReferencePainter().setCompact(compact);
  }

  public void setShowTagsNames(boolean showTagNames) {
    myComponent.getReferencePainter().setShowTagNames(showTagNames);
    myTemplateComponent.getReferencePainter().setShowTagNames(showTagNames);
  }

  private static class MyComponent extends SimpleColoredRenderer {
    private static final int FREE_SPACE = 20;
    @NotNull private final VcsLogData myLogData;
    @NotNull private final VcsLogGraphTable myGraphTable;
    @NotNull private final GraphCellPainter myPainter;
    @NotNull private final IssueLinkRenderer myIssueLinkRenderer;
    @NotNull private final LabelPainter myReferencePainter;

    @NotNull protected GraphImage myGraphImage = new GraphImage(UIUtil.createImage(1, 1, BufferedImage.TYPE_INT_ARGB), 0);
    @NotNull private Font myFont;
    private int myHeight;

    public MyComponent(@NotNull VcsLogData data,
                       @NotNull GraphCellPainter painter,
                       @NotNull VcsLogGraphTable table,
                       boolean compact,
                       boolean showTags) {
      myLogData = data;
      myPainter = painter;
      myGraphTable = table;

      myReferencePainter = new LabelPainter(myLogData, compact, showTags);

      myIssueLinkRenderer = new IssueLinkRenderer(myLogData.getProject(), this);
      myFont = RectanglePainter.getFont();
      myHeight = calculateHeight();
    }

    @NotNull
    @Override
    public Dimension getPreferredSize() {
      Dimension preferredSize = super.getPreferredSize();
      int referencesSize = myReferencePainter.isLeftAligned() ? 0 : myReferencePainter.getSize().width;
      return new Dimension(preferredSize.width + referencesSize, getPreferredHeight());
    }

    @Override
    public void paintComponent(Graphics g) {
      super.paintComponent(g);

      int graphImageWidth = myGraphImage.getWidth();

      if (!myReferencePainter.isLeftAligned()) {
        int start = Math.max(graphImageWidth, getWidth() - myReferencePainter.getSize().width);
        myReferencePainter.paint((Graphics2D)g, start, 0, getHeight());
      }
      else {
        myReferencePainter.paint((Graphics2D)g, graphImageWidth, 0, getHeight());
      }

      UIUtil.drawImage(g, myGraphImage.getImage(), 0, 0, null);
    }

    public void customize(@NotNull GraphCommitCell cell, boolean isSelected, boolean hasFocus, int row, int column) {
      clear();
      setPaintFocusBorder(false);
      acquireState(myGraphTable, isSelected, hasFocus, row, column);
      getCellState().updateRenderer(this);
      setBorder(null);

      myGraphImage = getGraphImage(cell.getPrintElements());

      SimpleTextAttributes style = myGraphTable.applyHighlighters(this, row, column, hasFocus, isSelected);

      Collection<VcsRef> refs = cell.getRefsToThisCommit();
      Color baseForeground = ObjectUtils.assertNotNull(myGraphTable.getBaseStyle(row, column, hasFocus, isSelected).getForeground());

      append(""); // appendTextPadding wont work without this
      if (myReferencePainter.isLeftAligned()) {
        myReferencePainter.customizePainter(this, refs, getBackground(), baseForeground, isSelected,
                                            getAvailableWidth(column));

        appendTextPadding(myGraphImage.getWidth() + myReferencePainter.getSize().width + LabelPainter.RIGHT_PADDING);
        appendText(cell, style);
      }
      else {
        appendTextPadding(myGraphImage.getWidth());
        appendText(cell, style);
        myReferencePainter.customizePainter(this, refs, getBackground(), baseForeground, isSelected,
                                            getAvailableWidth(column));
      }
    }

    private void appendText(@NotNull GraphCommitCell cell, @NotNull SimpleTextAttributes style) {
      myIssueLinkRenderer.appendTextWithLinks(StringUtil.replace(cell.getText(), "\t", " "), style);
    }

    private int getAvailableWidth(int column) {
      int columnWidth = myGraphTable.getColumnModel().getColumn(column).getWidth();
      int freeSpace = columnWidth - super.getPreferredSize().width;
      if (myReferencePainter.isCompact()) {
        return Math.min(freeSpace, columnWidth / 3);
      }
      else {
        return Math.max(freeSpace, columnWidth / 2);
      }
    }

    private int calculateHeight() {
      return Math.max(myReferencePainter.getSize().height, getFontMetrics(myFont).getHeight() + VERTICAL_PADDING);
    }

    public int getPreferredHeight() {
      Font font = RectanglePainter.getFont();
      if (myFont != font) {
        myFont = font;
        myHeight = calculateHeight();
      }
      return myHeight;
    }

    @NotNull
    private GraphImage getGraphImage(@NotNull Collection<? extends PrintElement> printElements) {
      double maxIndex = getMaxGraphElementIndex(printElements);
      BufferedImage image = UIUtil.createImage((int)(PaintParameters.getNodeWidth(myGraphTable.getRowHeight()) * (maxIndex + 2)),
                                               myGraphTable.getRowHeight(),
                                               BufferedImage.TYPE_INT_ARGB);
      Graphics2D g2 = image.createGraphics();
      myPainter.draw(g2, printElements);

      int width = (int)(maxIndex * PaintParameters.getNodeWidth(myGraphTable.getRowHeight()));
      return new GraphImage(image, width);
    }

    private int getGraphWidth(@NotNull Collection<? extends PrintElement> printElements) {
      double maxIndex = getMaxGraphElementIndex(printElements);
      return (int)(maxIndex * PaintParameters.getNodeWidth(myGraphTable.getRowHeight()));
    }

    private double getMaxGraphElementIndex(@NotNull Collection<? extends PrintElement> printElements) {
      double maxIndex = 0;
      for (PrintElement printElement : printElements) {
        maxIndex = Math.max(maxIndex, printElement.getPositionInCurrentRow());
        if (printElement instanceof EdgePrintElement) {
          maxIndex = Math.max(maxIndex,
                              (printElement.getPositionInCurrentRow() + ((EdgePrintElement)printElement).getPositionInOtherRow()) / 2.0);
        }
      }
      maxIndex++;

      maxIndex = Math.max(maxIndex, Math.min(MAX_GRAPH_WIDTH, myGraphTable.getVisibleGraph().getRecommendedWidth()));
      return maxIndex;
    }

    @NotNull
    public LabelPainter getReferencePainter() {
      return myReferencePainter;
    }
  }

  private static class GraphImage {
    private final int myWidth;
    @NotNull private final Image myImage;

    GraphImage(@NotNull Image image, int width) {
      myImage = image;
      myWidth = width;
    }

    @NotNull
    Image getImage() {
      return myImage;
    }

    /**
     * Returns the "interesting" width of the painted image, i.e. the width which the text in the table should be offset by. <br/>
     * It can be smaller than the width of {@link #getImage() the image}, because we allow the text to cover part of the graph
     * (some diagonal edges, etc.)
     */
    int getWidth() {
      return myWidth;
    }
  }
}


text:
from neutron_lib.db import constants as db_const
from neutron_lib.db import model_base
import sqlalchemy as sa
from sqlalchemy import sql

from neutron.agent.common import utils

class Agent(model_base.BASEV2, model_base.HasId):
    """Represents agents running in neutron deployments."""

    __table_args__ = (
        sa.UniqueConstraint('agent_type', 'host',
                            name='uniq_agents0agent_type0host'),
        model_base.BASEV2.__table_args__
    )

    # L3 agent, DHCP agent, OVS agent, LinuxBridge
    agent_type = sa.Column(sa.String(255), nullable=False)
    binary = sa.Column(sa.String(255), nullable=False)
    # TOPIC is a fanout exchange topic
    topic = sa.Column(sa.String(255), nullable=False)
    # TOPIC.host is a target topic
    host = sa.Column(sa.String(255), nullable=False, index=True)
    availability_zone = sa.Column(sa.String(255))
    admin_state_up = sa.Column(sa.Boolean, default=True,
                               server_default=sql.true(), nullable=False)
    # the time when first report came from agents
    created_at = sa.Column(sa.DateTime, nullable=False)
    # the time when first report came after agents start
    started_at = sa.Column(sa.DateTime, nullable=False)
    # updated when agents report
    heartbeat_timestamp = sa.Column(sa.DateTime, nullable=False)
    # description is note for admin user
    description = sa.Column(sa.String(db_const.DESCRIPTION_FIELD_SIZE))
    # configurations: a json dict string, I think 4095 is enough
    configurations = sa.Column(sa.String(4095), nullable=False)
    # resource_versions: json dict, 8191 allows for ~256 resource versions
    #                    assuming ~32byte length "'name': 'ver',"
    #                    the whole row limit is 65535 bytes in mysql
    resource_versions = sa.Column(sa.String(8191))
    # load - number of resources hosted by the agent
    load = sa.Column(sa.Integer, server_default='0', nullable=False)
    # resources_synced: nullable boolean, success of last sync to Placement
    resources_synced = sa.Column(
        sa.Boolean, default=None, server_default=None, nullable=True)

    @property
    def is_active(self):
        return not utils.is_agent_down(self.heartbeat_timestamp)

redpajama_set_name: RedPajamaGithub


text:
/**
 * @file DiscoveryResponse.cpp
 * @brief
 *
 */

#include "util/logging/Logging.hpp"
#include "util/logging/LogMacros.hpp"
#include "util/logging/ConsoleLogSystem.hpp"

#include "discovery/DiscoveryResponse.hpp"

#define LOG_TAG_DISCOVERY_RESPONSE "[Discovery Response]"

namespace awsiotsdk {
	const util::String awsiotsdk::DiscoveryResponse::GROUP_ARRAY_KEY = "GGGroups";
	const util::String awsiotsdk::DiscoveryResponse::GROUP_ID_KEY = "GGGroupId";
	const util::String awsiotsdk::DiscoveryResponse::GGC_ARRAY_KEY = "Cores";
	const util::String awsiotsdk::DiscoveryResponse::GGC_THING_ARN_KEY = "thingArn";
	const util::String awsiotsdk::DiscoveryResponse::ROOT_CA_KEY = "CAs";
	const util::String awsiotsdk::DiscoveryResponse::CONNECTIVITY_INFO_ARRAY_KEY = "Connectivity";
	const util::String awsiotsdk::DiscoveryResponse::ID_KEY = "Id";
	const util::String awsiotsdk::DiscoveryResponse::HOST_ADDRESS_KEY = "HostAddress";
	const util::String awsiotsdk::DiscoveryResponse::PORT_KEY = "PortNumber";
	const util::String awsiotsdk::DiscoveryResponse::METADATA_KEY = "Metadata";
	const util::String awsiotsdk::DiscoveryResponse::DEFAULT_DISCOVERY_RESPONSE_FILE_NAME = "discovery_response.json";

	util::JsonDocument DiscoveryResponse::GetResponseDocument() {
		util::JsonDocument response;
		response.CopyFrom(response_document_, response.GetAllocator());
		return std::move(response);
	}

	void DiscoveryResponse::SetResponseDocument(util::JsonDocument response_document) {
		response_document_ = std::move(response_document);
	}

	DiscoveryResponse::DiscoveryResponse(util::JsonDocument response_document) {
		response_document_ = std::move(response_document);
	}

	DiscoveryResponse::~DiscoveryResponse() {
	}

	ResponseCode DiscoveryResponse::WriteToPath(util::String output_file_absolute_path) {
		return util::JsonParser::WriteToFile(response_document_, output_file_absolute_path);
	}

	// The runtime for this is O(n) where n is the total number of individual Connectivity Information sets in the
	// response json over ALL groups and GGCs
	ResponseCode DiscoveryResponse::GetParsedResponse(util::Vector<ConnectivityInfo> &connectivity_info_list,
													  util::Map<util::String,
																util::Vector<util::String>> &root_ca_map) {
		util::String group_name;
		util::String core_name;
		util::String ca_string;
		util::String id;
		util::String host_name;
		util::String metadata;
		uint16_t port;
		ResponseCode parsing_response = ResponseCode::SUCCESS;

		const char *group_array_key = GROUP_ARRAY_KEY.c_str();
		const char *group_id_key = GROUP_ID_KEY.c_str();
		const char *ggc_array_key = GGC_ARRAY_KEY.c_str();
		const char *root_ca_key = ROOT_CA_KEY.c_str();
		const char *connectivity_info_array_key = CONNECTIVITY_INFO_ARRAY_KEY.c_str();
		const char *id_key = ID_KEY.c_str();
		const char *host_address_key = HOST_ADDRESS_KEY.c_str();
		const char *port_key = PORT_KEY.c_str();
		const char *metadata_key = METADATA_KEY.c_str();
		const char *ggc_thing_arn_key = GGC_THING_ARN_KEY.c_str();

		for (auto &group_itr : response_document_[group_array_key].GetArray()) {
			if (!group_itr.HasMember(group_id_key)
				|| !group_itr.HasMember(ggc_array_key)
				|| !group_itr.HasMember(root_ca_key)) {
				parsing_response = ResponseCode::DISCOVER_RESPONSE_UNEXPECTED_JSON_STRUCTURE_ERROR;
				break;
			}

			group_name = util::String(group_itr[group_id_key].GetString());

			for (auto &core_itr : group_itr[ggc_array_key].GetArray()) {
				if (!core_itr.HasMember(ggc_thing_arn_key)
					|| !core_itr.HasMember(connectivity_info_array_key)) {
					parsing_response = ResponseCode::DISCOVER_RESPONSE_UNEXPECTED_JSON_STRUCTURE_ERROR;
					break;
				}
				core_name = util::String(core_itr[ggc_thing_arn_key].GetString());
				for (auto &connectivity_info_itr : core_itr[connectivity_info_array_key].GetArray()) {
					if (!connectivity_info_itr.HasMember(id_key)
						|| !connectivity_info_itr.HasMember(host_address_key)
						|| !connectivity_info_itr.HasMember(port_key)) {
						parsing_response = ResponseCode::DISCOVER_RESPONSE_UNEXPECTED_JSON_STRUCTURE_ERROR;
						break;
					}

					id = util::String(connectivity_info_itr[id_key].GetString());

					host_name = util::String(connectivity_info_itr[host_address_key].GetString());

					if (connectivity_info_itr.HasMember(metadata_key)) {
						metadata = util::String(connectivity_info_itr[metadata_key].GetString());
					} else {
						metadata = util::String("");
					}

					port = static_cast<uint16_t>(connectivity_info_itr[port_key].GetInt());

					ConnectivityInfo connectivity_info(group_name, core_name, id, host_name, port, metadata);

					connectivity_info_list.push_back(connectivity_info);
					util::Vector<util::String> ca_list;
					for (auto &ca_itr : group_itr[root_ca_key].GetArray()) {
						ca_string = util::String(ca_itr.GetString());
						ca_list.push_back(ca_string);
					}
					root_ca_map.insert(std::pair<util::String, util::Vector<util::String>>(group_name, ca_list));
				}
			}
			if (ResponseCode::SUCCESS != parsing_response) {
				break;
			}
		}
		return parsing_response;
	}
}


text:
package com.dream.android.sample.lib.executor;

import rx.Scheduler;
import rx.android.schedulers.AndroidSchedulers;

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

/**
 * MainThread (UI Thread) implementation based on a {@link Scheduler}
 * which will execute actions on the Android UI thread
 */
@Singleton
public class UIThread {

  @Inject
  public UIThread() {}

  public Scheduler getScheduler() {
    return AndroidSchedulers.mainThread();
  }
}


text:
ActiveRecord::Schema.define(:version => 20111110182430) do

  create_table "categories", :force => true do |t|
    t.string   "name"
    t.datetime "created_at"
    t.datetime "updated_at"
  end

  create_table "products", :force => true do |t|
    t.string   "name"
    t.decimal  "price"
    t.integer  "category_id"
    t.datetime "created_at"
    t.datetime "updated_at"
  end

end


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

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
              android:layout_width="match_parent"
              android:layout_height="match_parent">

    <ProgressBar android:indeterminate="true"
                 android:layout_width="wrap_content"
                 android:layout_height="50dip"
                 android:id="@+id/com_facebook_login_activity_progress_bar"
                 android:layout_centerInParent="true"
                 android:visibility="gone"
                 android:indeterminateOnly="true"
            />
</RelativeLayout>
<!-- From: file:/home/dometec/git/OsysBravodriverMobileApp/platforms/android/phonegap-facebook-plugin/osysbravodrivermobileapp214299-FacebookLib/res/layout/com_facebook_login_activity_layout.xml -->


text:
package ee.ria.xroad.common.conf.globalconf;

import ee.ria.xroad.common.CodedException;
import ee.ria.xroad.common.conf.ConfProvider;

import lombok.Getter;
import lombok.Setter;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.io.FileUtils;
import org.joda.time.DateTime;

import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.nio.file.DirectoryStream;
import java.nio.file.FileVisitResult;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.nio.file.SimpleFileVisitor;
import java.nio.file.attribute.BasicFileAttributes;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.function.Consumer;

import static ee.ria.xroad.common.ErrorCodes.X_INTERNAL_ERROR;
import static ee.ria.xroad.common.ErrorCodes.X_OUTDATED_GLOBALCONF;
import static ee.ria.xroad.common.conf.globalconf.ConfigurationUtils.escapeInstanceIdentifier;

/**
 * Class for reading global configuration directory. The directory must
 * have sub directory per instance identifier. Each sub directory must contain
 * private and/or shared parameters.
 *
 * When querying the parameters from this class, the parameters XML is checked
 * for modifications and if the XML has been modified, the parameters are
 * reloaded from the XML.
 */
@Slf4j
public class ConfigurationDirectoryV1 implements ConfigurationDirectory {

  public static final String PRIVATE_PARAMETERS_XML = "private-params.xml";
  public static final String SHARED_PARAMETERS_XML = "shared-params.xml";
  public static final String INSTANCE_IDENTIFIER_FILE =
      "instance-identifier";

  private static final String METADATA_SUFFIX = ".metadata";

  @Getter
  @Setter
  private Path path;
  private final boolean reloadIfChanged;

  private String instanceIdentifier;

  private Map<String, PrivateParametersV1> privateParameters = new HashMap<>();
  private Map<String, SharedParametersV1> sharedParameters = new HashMap<>();

  // ------------------------------------------------------------------------

  /**
   * Constructs new directory from the given path.
   * @param directoryPath the path to the directory.
   * @throws Exception if loading configuration fails
   */
  public ConfigurationDirectoryV1(String directoryPath) throws Exception {
    this(directoryPath, false);
  }

  /**
   * Constructs new directory from the given path.
   * @param directoryPath the path to the directory.
   * @param reloadIfChanged if true, automatic reload and detection of
   * parameters is performed.
   * @throws Exception if loading configuration fails
   */
  public ConfigurationDirectoryV1(String directoryPath,
                                  boolean reloadIfChanged) throws Exception {
    this.path = Paths.get(directoryPath);
    this.reloadIfChanged = reloadIfChanged;
    reload();
  }

  /**
   * @return the instance identifier of this configuration. The instance
   * identifier is lazy initialized.
   */
  public synchronized String getInstanceIdentifier() {
    if (instanceIdentifier == null) {
      loadInstanceIdentifier();
    }

    return instanceIdentifier;
  }

  /**
   * Reloads the configuration directory. Only files that are new or have
   * changed, are actually loaded.
   * @throws Exception if an error occurs during reload
   */
  public synchronized void reload() throws Exception {
    Map<String, PrivateParametersV1> privateParams = new HashMap<>();
    Map<String, SharedParametersV1> sharedParams = new HashMap<>();

    log.trace("Reloading configuration from {}", path);

    instanceIdentifier = null;

    try (DirectoryStream<Path> stream =
             Files.newDirectoryStream(path, Files::isDirectory)) {
      for (Path instanceDir : stream) {
        log.trace("Loading parameters from {}", instanceDir);

        loadPrivateParameters(instanceDir, privateParams);
        loadSharedParameters(instanceDir, sharedParams);
      }
    }

    this.privateParameters = privateParams;
    this.sharedParameters = sharedParams;
  }

  /**
   * Returns private parameters for a given instance identifier.
   * @param instanceId the instance identifier
   * @return private parameters or null, if no private parameters exist for
   * given instance identifier
   * @throws Exception if an error occurs while reading parameters
   */
  public synchronized PrivateParametersV1 getPrivate(String instanceId)
      throws Exception {
    String safeInstanceId = escapeInstanceIdentifier(instanceId);

    log.trace("getPrivate(instance = {}, directory = {})",
        instanceId, safeInstanceId);

    PrivateParametersV1 parameters = privateParameters.get(safeInstanceId);
    if (!reloadIfChanged) {
      return parameters;
    }

    if (parameters != null && parameters.hasChanged()) {
      parameters.reload();
    } else if (parameters == null) {
      // Parameters not cached, attempt to load it from disk.
      Path instanceDir = Paths.get(path.toString(), safeInstanceId);
      loadPrivateParameters(instanceDir, privateParameters);
    }

    return privateParameters.get(safeInstanceId);
  }

  /**
   * Returns shared parameters for a given instance identifier.
   * @param instanceId the instance identifier
   * @return shared parameters or null, if no shared parameters exist for
   * given instance identifier
   * @throws Exception if an error occurs while reading parameters
   */
  public synchronized SharedParametersV1 getShared(String instanceId) throws Exception {
    String safeInstanceId = escapeInstanceIdentifier(instanceId);

    log.trace("getShared(instance = {}, directory = {})",
        instanceId, safeInstanceId);

    SharedParametersV1 parameters = sharedParameters.get(safeInstanceId);
    if (!reloadIfChanged) {
      return parameters;
    }

    if (parameters != null && parameters.hasChanged()) {
      parameters.reload();
    } else if (parameters == null) {
      // Parameters not cached, attempt to load it from disk.
      Path instanceDir = Paths.get(path.toString(), safeInstanceId);
      loadSharedParameters(instanceDir, sharedParameters);
    }

    return sharedParameters.get(safeInstanceId);
  }

  /**
   * @return all known shared parameters
   */
  public synchronized List<SharedParametersV1> getShared() {
    return new ArrayList<>(sharedParameters.values());
  }

  /**
   * Applies the given function to all files belonging to
   * the configuration directory.
   * @param consumer the function instance that should be applied to
   * @throws Exception if an error occurs
   */
  protected synchronized void  eachFile(final Consumer<Path> consumer)
      throws Exception {
    Files.walkFileTree(path, new Walker(consumer));
  }

  private static class Walker extends SimpleFileVisitor<Path> {
    private final Consumer<Path> consumer;

    Walker(Consumer<Path> consumer) {
      this.consumer = consumer;
    }

    @Override
    public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IOException {
      if (shouldVisit(file, attrs)) {
        consumer.accept(file);
      }
      return FileVisitResult.CONTINUE;
    }

    @Override
    public FileVisitResult visitFileFailed(Path file, IOException exc) throws IOException {
      if (file.toString().endsWith(".tmp")) {
        return FileVisitResult.CONTINUE;
      }
      return super.visitFileFailed(file, exc);
    }

    private static boolean shouldVisit(Path file, BasicFileAttributes attrs) {
      return !file.toString().endsWith(".tmp")
          && attrs.isRegularFile()
          && !file.endsWith("files")
          && !file.endsWith(INSTANCE_IDENTIFIER_FILE)
          && !file.toString().endsWith(METADATA_SUFFIX);
    }
  }

  /**
   * Applies the given function to all files belonging to
   * the configuration directory.
   * @param consumer the function instance that should be applied to
   * all files belonging to the configuration directory.
   * @throws Exception if an error occurs
   */
  public synchronized void eachFile(FileConsumer consumer) throws Exception {
    eachFile(filepath -> {
      try (InputStream is = new FileInputStream(filepath.toFile())) {
        log.trace("Processing '{}'", filepath);
        ConfigurationPartMetadata metadata = null;
        try {
          metadata = getMetadata(filepath);
        } catch (Exception e) {
          log.error("Could not open configuration file '{}'"
              + " metadata: {}", filepath, e);
          throw e;
        }
        consumer.consume(metadata, is);
      } catch (RuntimeException e) {
        log.error("Error processing configuration file '{}': {}", filepath, e);
        throw e;
      } catch (Exception e) {
        log.error("Error processing configuration file '{}': {}", filepath, e);
        throw new RuntimeException(e);
      }
    });
  }

  /**
   * Returns true, if the file has expired. Returns false, if the file has
   * not expired or the expiration time-stamp cannot be found.
   * @param fileName the absolute file name
   * @return true, if the file has expired
   */
  public static final boolean isExpired(Path fileName) {
    try {
      DateTime expiresOn = getMetadata(fileName).getExpirationDate();
      if (expiresOn.isBeforeNow()) {
        log.info("{} expired on {}", fileName, expiresOn);
        return true;
      }
    } catch (Exception e) {
      log.error("Failed to get expiration date of file " + fileName, e);
    }

    return false;
  }

  /**
   * Throws exception with error code ErrorCodes.X_OUTDATED_GLOBALCONF if the
   * file is too old.
   * @param fileName the file name
   */
  public static final void verifyUpToDate(Path fileName) {
    if (isExpired(fileName)) {
      throw new CodedException(X_OUTDATED_GLOBALCONF, "%s is too old",
          fileName);
    }
  }

  /**
   * Throws exception with error code ErrorCodes.X_OUTDATED_GLOBALCONF if any of the
   * configuration files is too old.
   */
  public void verifyUpToDate() throws Exception {
    this.eachFile(ConfigurationDirectoryV1::verifyUpToDate);
  }

  /**
   * @param fileName the file name
   * @return the metadata for the given file.
   * @throws Exception if the metadata cannot be loaded
   */
  public static ConfigurationPartMetadata getMetadata(Path fileName)
      throws Exception {
    File file = new File(fileName.toString() + METADATA_SUFFIX);
    try (InputStream in = new FileInputStream(file)) {
      return ConfigurationPartMetadata.read(in);
    }
  }

  // ------------------------------------------------------------------------

  private void loadInstanceIdentifier() {
    Path file = Paths.get(path.toString(), INSTANCE_IDENTIFIER_FILE);

    log.trace("Loading instance identifier from {}", file);
    try {
      instanceIdentifier =
          FileUtils.readFileToString(file.toFile()).trim();
    } catch (Exception e) {
      log.error("Failed to read instance identifier from " + file, e);
      throw new CodedException(X_INTERNAL_ERROR,
          "Could not read instance identifier of "
              + "this security server");
    }
  }

  private void loadPrivateParameters(Path instanceDir,
                                     Map<String, PrivateParametersV1> privateParams)
      throws Exception {
    String instanceId = instanceDir.getFileName().toString();

    Path privateParametersPath =
        Paths.get(instanceDir.toString(), PRIVATE_PARAMETERS_XML);

    if (Files.exists(privateParametersPath)) {
      log.trace("Loading private parameters from {}",
          privateParametersPath);

      privateParams.put(instanceId,
          loadParameters(privateParametersPath,
              PrivateParametersV1.class,
              this.privateParameters.get(instanceId)));
    } else {
      log.trace("Not loading private parameters from {}, "
          + "file does not exist", privateParametersPath);
    }
  }

  private void loadSharedParameters(Path instanceDir,
                                    Map<String, SharedParametersV1> sharedParams) throws Exception {
    String instanceId = instanceDir.getFileName().toString();

    Path sharedParametersPath =
        Paths.get(instanceDir.toString(), SHARED_PARAMETERS_XML);
    if (Files.exists(sharedParametersPath)) {
      log.trace("Loading shared parameters from {}",
          sharedParametersPath);

      sharedParams.put(instanceId,
          loadParameters(sharedParametersPath,
              SharedParametersV1.class,
              this.sharedParameters.get(instanceId)));
    } else {
      log.trace("Not loading shared parameters from {}, "
          + "file does not exist", sharedParametersPath);
    }
  }

  // Loads the parameters from file if the file has changed.
  // Returns the parameters or null if the file does not exist.
  private static <T extends ConfProvider> T loadParameters(Path path,
                                                           Class<T> clazz, T existingInstance) throws Exception {
    T params = existingInstance != null
        ? existingInstance : (T) clazz.newInstance();

    if (params.hasChanged()) {
      log.trace("Loading {} from {}", clazz.getSimpleName(), path);

      params.load(path.toString());
    }

    return params;
  }

}


text:
package ru.gkpromtech.exhibition.utils;

import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;

public class Hash {
    private final static char[] hexArray = "0123456789ABCDEF".toCharArray();

    public static String hash(String str) throws NoSuchAlgorithmException {
        return bytesToHex(MessageDigest.getInstance("MD5").digest(str.getBytes()));
    }

    public static String bytesToHex(byte[] bytes) {
        char[] hexChars = new char[bytes.length * 2];
        for (int j = 0; j < bytes.length; ++j) {
            int v = bytes[j] & 0xFF;
            hexChars[j * 2] = hexArray[v >>> 4];
            hexChars[j * 2 + 1] = hexArray[v & 0x0F];
        }
        return new String(hexChars);
    }
}


text:
<?php

// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle.  If not, see <http://www.gnu.org/licenses/>.

defined('MOODLE_INTERNAL') || die();

$string['addgroup'] = 'Agregar al grupo';
$string['ajaxmore'] = 'Más...';
$string['assignrole'] = 'Asignar rol';
$string['cohort:config'] = 'Configurar instancias de cohortes';
$string['cohortsearch'] = 'Buscar';
$string['cohort:unenrol'] = 'Dar de baja usuarios suspendidos';
$string['instanceexists'] = 'Cohorte ya sincronizada con el rol seleccionado';
$string['pluginname'] = 'Sincronizar cohorte';
$string['pluginname_desc'] = 'El plugin de matriculación de cohortes sincroniza a los miembros de dicha cohorte con los participantes del curso.';
$string['status'] = 'Activa';


text:
<!DOCTYPE doc
[
<!ELEMENT doc (#PCDATA)>
<!ENTITYge "replacement text">
]>
<doc/>


text:
CURRENT_PATH=`dirname "$0"`
export $CASSANDRA_CONF=$CURRENT_PATH/cassandra-conf


text:
{-# OPTIONS_HADDOCK show-extensions #-}

{-# LANGUAGE DataKinds #-}
{-# LANGUAGE KindSignatures #-}
{-# LANGUAGE DeriveFunctor #-}
{-# LANGUAGE DeriveFoldable #-}
{-# LANGUAGE DeriveTraversable #-}
{-# LANGUAGE TypeOperators #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}

{-|
Module      : Data.FixedSize.Matrix
Description : fixed-size matrices
Copyright   : (c) Lars Brünjes, 2016
License     : MIT
Maintainer  : brunjlar@gmail.com
Stability   : experimental
Portability : portable

This module defines fixed-size /matrices/ and some basic typeclass instances and operations for them.
-}

module Data.FixedSize.Matrix
    ( Matrix(..)
    , (<%%>)
    , row
    , column
    , transpose
    ) where

import Data.MyPrelude
import Data.FixedSize.Class
import Data.FixedSize.Vector
import GHC.TypeLits

-- | @'Matrix' m n a@ is the type of /matrices/ with @m@ rows, @n@ columns and entries of type @a@.
--
newtype Matrix (m :: Nat) (n :: Nat) a = Matrix (Vector m (Vector n a))
    deriving (Eq, Show, Functor, Foldable, Traversable, NFData)

instance (KnownNat m, KnownNat n) => Applicative (Matrix m n) where

    pure x = Matrix $ pure (pure x)

    Matrix fs <*> Matrix xs = Matrix $ (<*>) <$> fs <*> xs

instance (KnownNat m, KnownNat n) => FixedSize (Matrix m n) where

    type Index (Matrix m n) = (Int, Int)

    type Size (Matrix m n) = m * n

    m !? (i, j) = row m i >>= (!? j)

    generate f = Matrix $ generate (\i -> generate (\j -> f (i, j)))

-- | Multiplication of a /matrix/ by a (column-)/vector/.
--
-- >>> :set -XDataKinds
-- >>> (pure 1 :: Matrix 1 2 Int) <%%> cons 1 (cons 2 nil)
-- [3]
--
(<%%>) :: Num a => Matrix m n a -> Vector n a -> Vector m a
Matrix rows <%%> v = (v <%>) <$> rows

-- | Gives the matrix row with the specified index (starting at zero) if the index is valid,
--   otherwise 'Nothing'.
--
-- >>> :set -XDataKinds
-- >>> row (pure 42 :: Matrix 2 4 Int) 0
-- Just [42,42,42,42]
--
-- >>> row (pure 42 :: Matrix 2 4 Int) 2
-- Nothing
--
row :: KnownNat m => Matrix m n a -> Int -> Maybe (Vector n a)
row (Matrix rows) = (rows !?)

-- | Gives the matrix column with the specified index (starting at zero) if the index is valid,
--   otherwise 'Nothing'.
--
-- >>> :set -XDataKinds
-- >>> column (pure 42 :: Matrix 2 4 Int) 3
-- Just [42,42]
--
-- >>> column (pure 42 :: Matrix 2 4 Int) 4
-- Nothing
--
column :: KnownNat n => Matrix m n a -> Int -> Maybe (Vector m a)
column (Matrix rows) j = sequenceA $ (!? j) <$> rows

-- | Transposes a matrix.
--
-- >>> transpose (Matrix $ cons (cons 'a' nil) (cons (cons 'b' nil) nil))
-- Matrix ["ab"]
--
transpose :: (KnownNat m, KnownNat n) => Matrix m n a -> Matrix n m a
transpose m = generate $ \(i, j) -> fromJust $ m !? (j, i)


text:
#include "TheMain.h"
#include "OdbcObj.h"
using namespace Helix::Glob;

#include "GetSQLWork.h"
using namespace Helix::Logic::admin;

#include "Statics.h"
using namespace Helix::Logic::util;

#include <Log.h>
#include <dptr.h>
#include <File.h>
#include <EnEx.h>
#include <AnException.h>
#include <XmlHelpers.h>
using namespace SLib;

// Include local data objects here
#include "SQLWork.h"

// This adds us to the global ActionClass Registry:
ActionClassRegister<GetSQLWork> GetSQLWork::reg("GetSQLWork", 1, "/logic/admin/GetSQLWork");

// Used for auto generating the API on the javascript side:
// LOGICCODEGEN API=/logic/admin/GetSQLWork Input=SQLWork

GetSQLWork::GetSQLWork(xmlNodePtr action)
{
	EnEx ee(FL, "GetSQLWork::GetSQLWork(xmlNodePtr action)");

}

GetSQLWork::GetSQLWork(const GetSQLWork& c)
{
	EnEx ee(FL, "GetSQLWork::GetSQLWork(const GetSQLWork& c)");

}

GetSQLWork& GetSQLWork::operator=(const GetSQLWork& c)
{
	EnEx ee(FL, "GetSQLWork::operator=(const GetSQLWork& c)");

	return *this;
}

GetSQLWork::~GetSQLWork()
{
	EnEx ee(FL, "GetSQLWork::~GetSQLWork()");

}

void GetSQLWork::ExecuteRequest(IOConn& ioc)
{
	// The "true" parameter at the end here indicates to the entry/exit timing
	// mechanism that it should copy this thread's stats to the global collection.
	// This should not be done everywhere, but is appropriate to do at this point.
	EnEx ee(FL, "GetSQLWork::ExecuteRequest(IOConn& ioc)", true);

	// Set up the response document name
	ioc.initializeResponseDocument("GetSQLWork");

	SQLWork local( XmlHelpers::FindChild( ioc.GetRequestRoot(), SQLWork::Name()() ) );

	twine folder = (local.Type == "aci") ? "./sqlwork/aci/" : "./sqlwork/";
	twine fileName = folder + local.FileName;

	sptr<xmlDoc, xmlFreeDoc> doc = xmlParseFile( fileName() );

	if(doc == NULL){
		throw AnException(0, FL, "Invalid XML document requested.");
	}

	xmlNodePtr root = xmlDocGetRootElement( doc );
	SQLWork work( root );
	work.createXmlNode( ioc.getResponseRoot() );

	// Send the response back to the caller and close the connection.
	ioc.SendReturn();
	ioc.Close();
}


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace ProjectEulerWeb.ProblemViews
{
    public partial class LargestPrimeFactor : System.Web.UI.UserControl
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void LargestPrimeFactorClick(object sender, EventArgs e)
        {
            String inputText = LargestPrimeFactorInput.Text;
            if (inputText == null)
                throw new InvalidOperationException("Input cannot be null");

            Problems.LargestPrimeFactor problem = new Problems.LargestPrimeFactor();
            long startTime = DateTime.Now.Millisecond;
            LargestPrimeFactorResponse.Text = problem.getLargestPrimeFactor(Int64.Parse(inputText)).ToString();
            LargestPrimeFactorResponseTime.Text = (DateTime.Now.Millisecond - startTime).ToString();

        }

    }
}


text:
package com.impetus.kundera.datakeeper.utils;

import javax.faces.context.FacesContext;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;

/**
 * The Class FacesUtils has method for getting session variables and request
 * variables.
 */
public class FacesUtils
{

    /**
     * getSession method used for getting session variable.
     *
     * @return the session
     */
    public static HttpSession getSession()
    {
        return (HttpSession) FacesContext.getCurrentInstance().getExternalContext().getSession(true);
    }

    /**
     * getRequest method used for getting request variable.
     *
     * @return the request
     */
    public static HttpServletRequest getRequest()
    {
        return (HttpServletRequest) FacesContext.getCurrentInstance().getExternalContext().getRequest();
    }
}


text:
package hu.scelight.gui.setting;

import hu.scelight.service.env.Env;
import hu.scelight.service.extmod.ModEnv;
import hu.scelightapibase.bean.settings.ISettingsBean;
import hu.scelightapibase.bean.settings.type.INodeSetting;
import hu.sllauncher.gui.setting.LSettingsDialog;
import hu.sllauncher.gui.setting.LSettingsNodePage;

import java.awt.Frame;
import java.util.ArrayList;
import java.util.List;

/**
 * A dialog to view/edit settings of the application.
 *
 * @author Andras Belicza
 */
@SuppressWarnings( "serial" )
public class SettingsDialog extends LSettingsDialog {

	/**
	 * Returns an array of all settings beans. These include the settings beans of loaded external modules.
	 *
	 * @return an array of all settings beans
	 */
	private static ISettingsBean[] getAllSettingss() {
		final List< ISettingsBean > settingsList = new ArrayList<>();
		settingsList.add( Env.BOOT_SETTINGS );
		settingsList.add( Env.LAUNCHER_SETTINGS );
		settingsList.add( Env.APP_SETTINGS );

		for ( final ModEnv modEnv : Env.EXT_MOD_MANAGER.getStartedExtModEnvList() )
			settingsList.addAll( modEnv.getSettingsBeanList() );

		return settingsList.toArray( new ISettingsBean[ settingsList.size() ] );
	}

	/**
	 * Creates a new {@link SettingsDialog}.
	 *
	 *

	 * Does not make the dialog visible!
	 *

	 *
	 * @param owner reference to the owner frame
	 * @param defaultNodeSetting optional node setting to select by default
	 */
	public SettingsDialog( final Frame owner, final INodeSetting defaultNodeSetting ) {
		super( owner, defaultNodeSetting, getAllSettingss() );
	}

	/**
	 * Overridden to return a new instance of {@link SettingsNodePage}.
	 */
	@Override
	protected LSettingsNodePage createNewSettingsNodePage( final INodeSetting nodeSetting ) {
		return new SettingsNodePage( nodeSetting );
	}

}


text:
void LadderExtension( game_info_t *game, int color, bool *ladder_pos );
// 戦術的特徴用の関数
bool CheckLadderExtension( game_info_t *game, int color, int pos );
#endif


text:
package org.hibernate.ejb.criteria.expression;

import java.io.Serializable;

import org.hibernate.ejb.criteria.CriteriaBuilderImpl;
import org.hibernate.ejb.criteria.CriteriaQueryCompiler;
import org.hibernate.ejb.criteria.ParameterRegistry;
import org.hibernate.ejb.criteria.ValueHandlerFactory;

/**
 * Represents a literal expression.
 *
 * @author Steve Ebersole
 */
public class LiteralExpression<T> extends ExpressionImpl<T> implements Serializable {
	private Object literal;

	@SuppressWarnings({ "unchecked" })
	public LiteralExpression(CriteriaBuilderImpl criteriaBuilder, T literal) {
		this( criteriaBuilder, (Class<T>) determineClass( literal ), literal );
	}

	private static Class determineClass(Object literal) {
		return literal == null ? null : literal.getClass();
	}

	public LiteralExpression(CriteriaBuilderImpl criteriaBuilder, Class<T> type, T literal) {
		super( criteriaBuilder, type );
		this.literal = literal;
	}

	@SuppressWarnings({ "unchecked" })
	public T getLiteral() {
		return (T) literal;
	}

	public void registerParameters(ParameterRegistry registry) {
		// nothing to do
	}

	@SuppressWarnings({ "unchecked" })
	public String render(CriteriaQueryCompiler.RenderingContext renderingContext) {
		if ( ValueHandlerFactory.isNumeric( literal ) ) {
			return ValueHandlerFactory.determineAppropriateHandler( (Class) literal.getClass() ).render( literal );
		}

		// else...
		final String parameterName = renderingContext.registerLiteralParameterBinding( getLiteral(), getJavaType() );
		return ':' + parameterName;
	}

	@SuppressWarnings({ "unchecked" })
	public String renderProjection(CriteriaQueryCompiler.RenderingContext renderingContext) {
		// some drivers/servers do not like parameters in the select clause
		final ValueHandlerFactory.ValueHandler handler =
				ValueHandlerFactory.determineAppropriateHandler( literal.getClass() );
		if ( ValueHandlerFactory.isCharacter( literal ) ) {
			return '\'' + handler.render( literal ) + '\'';
		}
		else {
			return handler.render( literal );
		}
	}

	@Override
	@SuppressWarnings({ "unchecked" })
	protected void resetJavaType(Class targetType) {
		super.resetJavaType( targetType );
		ValueHandlerFactory.ValueHandler valueHandler = getValueHandler();
		if ( valueHandler == null ) {
			valueHandler = ValueHandlerFactory.determineAppropriateHandler( targetType );
			forceConversion( valueHandler );
		}

		if ( valueHandler != null ) {
			literal = valueHandler.convert( literal );
		}
	}
}


text:
package org.apache.hadoop.hdfs;

import java.io.*;
import java.net.*;

import org.apache.hadoop.fs.*;
import org.apache.hadoop.hdfs.protocol.DatanodeInfo;
import org.apache.hadoop.hdfs.protocol.FSConstants;
import org.apache.hadoop.hdfs.protocol.FSConstants.UpgradeAction;
import org.apache.hadoop.hdfs.server.common.UpgradeStatusReport;
import org.apache.hadoop.conf.Configuration;

/**
 * An implementation of ChecksumFileSystem over DistributedFileSystem.
 * Note that as of now (May 07), DistributedFileSystem natively checksums
 * all of its data. Using this class is not be necessary in most cases.
 * Currently provided mainly for backward compatibility and testing.
 */
public class ChecksumDistributedFileSystem extends ChecksumFileSystem {

  public ChecksumDistributedFileSystem() {
    super( new DistributedFileSystem() );
  }

  /** @deprecated */
  public ChecksumDistributedFileSystem(InetSocketAddress namenode,
                                       Configuration conf) throws IOException {
    super( new DistributedFileSystem(namenode, conf) );
  }

  /** Any extra interface that DistributeFileSystem provides can be
   * accessed with this.*/
  DistributedFileSystem getDFS() {
    return (DistributedFileSystem)fs;
  }

  /** Return the total raw capacity of the filesystem, disregarding
   * replication .*/
  public long getRawCapacity() throws IOException{
    return getDFS().getRawCapacity();
  }

  /** Return the total raw used space in the filesystem, disregarding
   * replication .*/
  public long getRawUsed() throws IOException{
    return getDFS().getRawUsed();
  }

  /** Return statistics for each datanode. */
  public DatanodeInfo[] getDataNodeStats() throws IOException {
    return getDFS().getDataNodeStats();
  }

  /**
   * Enter, leave or get safe mode.
   *
   * @see org.apache.hadoop.hdfs.protocol.ClientProtocol#setSafeMode(FSConstants.SafeModeAction)
   */
  public boolean setSafeMode(FSConstants.SafeModeAction action)
    throws IOException {
    return getDFS().setSafeMode(action);
  }

  /*
   * Refreshes the list of hosts and excluded hosts from the configured
   * files.
   */
  public void refreshNodes() throws IOException {
    getDFS().refreshNodes();
  }

  /**
   * Finalize previously upgraded files system state.
   */
  public void finalizeUpgrade() throws IOException {
    getDFS().finalizeUpgrade();
  }

  public UpgradeStatusReport distributedUpgradeProgress(UpgradeAction action
                                                        ) throws IOException {
    return getDFS().distributedUpgradeProgress(action);
  }

  /*
   * Dumps dfs data structures into specified file.
   */
  public void metaSave(String pathname) throws IOException {
    getDFS().metaSave(pathname);
  }

  /**
   * We need to find the blocks that didn't match.  Likely only one
   * is corrupt but we will report both to the namenode.  In the future,
   * we can consider figuring out exactly which block is corrupt.
   */
  public boolean reportChecksumFailure(Path f,
                                       FSDataInputStream in, long inPos,
                                       FSDataInputStream sums, long sumsPos) {
    return getDFS().reportChecksumFailure(f, in, inPos, sums, sumsPos);
  }

  /**
   * Returns the stat information about the file.
   */
  @Override
  public FileStatus getFileStatus(Path f) throws IOException {
    return getDFS().getFileStatus(f);
  }

}


text:
package org.jabref.logic.importer.fetcher;

import java.util.Optional;

import org.jabref.logic.importer.FetcherException;
import org.jabref.logic.importer.ImportFormatPreferences;
import org.jabref.model.entry.BibEntry;
import org.jabref.model.entry.BiblatexEntryTypes;
import org.jabref.testutils.category.FetcherTest;

import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.mockito.Answers;

import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.mockito.Mockito.mock;

@FetcherTest
public class IsbnViaEbookDeFetcherTest extends AbstractIsbnFetcherTest {

    @BeforeEach
    public void setUp() {
        bibEntry = new BibEntry();
        bibEntry.setType(BiblatexEntryTypes.BOOK);
        bibEntry.setField("bibtexkey", "9780134685991");
        bibEntry.setField("title", "Effective Java");
        bibEntry.setField("publisher", "Addison Wesley");
        bibEntry.setField("year", "2018");
        bibEntry.setField("author", "Bloch, Joshua");
        bibEntry.setField("date", "2018-01-11");
        bibEntry.setField("ean", "9780134685991");
        bibEntry.setField("isbn", "0134685997");
        bibEntry.setField("url", "https://www.ebook.de/de/product/28983211/joshua_bloch_effective_java.html");

        fetcher = new IsbnViaEbookDeFetcher(mock(ImportFormatPreferences.class, Answers.RETURNS_DEEP_STUBS));
    }

    @Test
    @Override
    public void testName() {
        assertEquals("ISBN (ebook.de)", fetcher.getName());
    }

    @Test
    @Override
    public void testHelpPage() {
        assertEquals("ISBNtoBibTeX", fetcher.getHelpPage().getPageName());
    }

    @Test
    @Override
    public void searchByIdSuccessfulWithShortISBN() throws FetcherException {
        Optional<BibEntry> fetchedEntry = fetcher.performSearchById("0134685997");
        assertEquals(Optional.of(bibEntry), fetchedEntry);
    }

    @Test
    @Override
    public void searchByIdSuccessfulWithLongISBN() throws FetcherException {
        Optional<BibEntry> fetchedEntry = fetcher.performSearchById("9780134685991");
        assertEquals(Optional.of(bibEntry), fetchedEntry);
    }

    @Test
    @Override
    public void authorsAreCorrectlyFormatted() throws Exception {
        BibEntry bibEntry = new BibEntry();
        bibEntry.setType(BiblatexEntryTypes.BOOK);
        bibEntry.setField("bibtexkey", "9783642434730");
        bibEntry.setField("title", "Fundamentals of Business Process Management");
        bibEntry.setField("publisher", "Springer Berlin Heidelberg");
        bibEntry.setField("year", "2015");
        bibEntry.setField("author", "Dumas, Marlon and Rosa, Marcello La and Mendling, Jan and Reijers, Hajo A.");
        bibEntry.setField("date", "2015-04-12");
        bibEntry.setField("ean", "9783642434730");
        bibEntry.setField("isbn", "3642434738");
        bibEntry.setField("pagetotal", "428");
        bibEntry.setField("url", "https://www.ebook.de/de/product/23955263/marlon_dumas_marcello_la_rosa_jan_mendling_hajo_a_reijers_fundamentals_of_business_process_management.html");

        Optional<BibEntry> fetchedEntry = fetcher.performSearchById("3642434738");
        assertEquals(Optional.of(bibEntry), fetchedEntry);
    }

    /**
     * This test searches for a valid ISBN. See https://www.amazon.de/dp/3728128155/?tag=jabref-21
     * However, this ISBN is not available on ebook.de. The fetcher should return nothing rather than throwing an exeption.
     */
    @Test
    public void searchForValidButNotFoundISBN() throws Exception {
        Optional<BibEntry> fetchedEntry = fetcher.performSearchById("3728128155");
        assertEquals(Optional.empty(), fetchedEntry);
    }

}


text:
package org.cfr.capsicum.user;

import java.util.Iterator;
import java.util.List;

import org.apache.cayenne.CayenneException;
import org.apache.cayenne.CayenneRuntimeException;
import org.apache.cayenne.ObjectContext;
import org.apache.cayenne.query.QueryChain;
import org.apache.cayenne.query.SQLTemplate;
import org.cfr.capsicum.ICayenneRuntimeContext;
import org.cfr.capsicum.domain.user.Address;
import org.cfr.capsicum.domain.user.User;
import org.cfr.capsicum.spring.support.CayenneTemplate;
import org.cfr.capsicum.spring.support.ICayenneCallback;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import com.google.common.collect.Lists;

@Component
@Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
public class UserStore extends CayenneTemplate implements IUserStore {

    private static UserStore store;

    @Autowired
    public UserStore(ICayenneRuntimeContext cayenneRuntimeFactory) {
        super(cayenneRuntimeFactory);
        store = this;
    }

    @Override
    public List<User> findAllUser() {
        return this.find(User.class);
    }

    @Override
    @Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
    public void insertTestUsersInTransaction(boolean rollback) {
        Creator.create("Neal", "Adams");
        Creator.create("Jim", "Steranko");
        Creator.create("Bruce", "Wayne");
        this.commitChanges();
        if (rollback) {
            throw new RuntimeException("expection");
        }
    }

    @Override
    @Transactional(propagation = Propagation.REQUIRES_NEW, rollbackFor = Exception.class)
    public void insertTestUsersInRequiresNewTransaction(boolean rollback) {
        Creator.create("Will", "Smith");
    }

    @Override
    public void deleteAll() {
        this.execute(new ICayenneCallback() {

            @Override
            public Object doInCayenne(ObjectContext context) throws CayenneException, CayenneRuntimeException {
                QueryChain query = new QueryChain();
                query.addQuery(new SQLTemplate(User.class, "DELETE FROM USER_TABLE"));
                context.performGenericQuery(query);
                return null;
            }
        });

    }

    public abstract static class Builder {

        protected String firstname;

        protected String lastname;

        protected List<Address> addresses;

        public Builder firstName(String lastname) {
            this.firstname = lastname;
            return this;
        }

        public Builder lastName(String lastName) {
            this.lastname = lastName;
            return this;
        }

        public Builder address(Address address) {
            if (addresses == null)
                this.addresses = Lists.newArrayList();
            this.addresses.add(address);
            return this;
        }

        public Builder addresses(Iterable<Address> addresses) {
            this.addresses = Lists.newArrayList(addresses);
            return this;
        }

        public Builder addresses(Iterator<Address> addresses) {
            this.addresses = Lists.newArrayList(addresses);
            return this;
        }

        public Builder addresses(Address[] addresses) {
            this.addresses = Lists.newArrayList(addresses);
            return this;
        }

        protected abstract User newInstance();

        public User build() {
            User item = newInstance();
            item.setFirstName(firstname);
            item.setLastName(lastname);
            if (this.addresses != null) {
                for (Address addr : this.addresses) {
                    item.addToAddresses(addr);
                }
            }

            return item;
        }
    }

    public static class Creator extends Builder {

        public static User create(String firstName, String lastName, Address... addresses) {
            return ((Creator) new Creator().firstName(firstName).lastName(lastName).addresses(addresses)).build();
        }

        @Override
        protected User newInstance() {
            return store.createInstance(User.class);
        }

    }

}


text:
<?xml version="1.0" encoding="utf-8"?>
<resources>
    <!-- From: file:/Users/gangam/repos/androidauto_new/barinov_voicenotify/app/src/main/res/values-hu-rHU/strings.xml -->
    <eat-comment/>
    <string-array name="device_states">
		<item>Screen Off</item>
		<item>Screen On</item>
		<item>Headset Off</item>
		<item>Headset On</item>
		<item>Néma és rezgő módban</item>
	</string-array>
    <string-array name="stream_name">
		<item>Média</item>
		<item>Üzenet</item>
		<item>Voice</item>
		<item>Ring</item>
		<item>Alarm</item>
	</string-array>
    <string-array name="support_items">
		<item>@string/donate</item>
		<item>Értékelés és megjegyzések</item>
		<item>Kapcsolat a fejlesztővel</item>
		<item>Translations</item>
		<item>Source Code</item>
	</string-array>
    <string name="app_is_ignored">%s is ignored</string>
    <string name="app_is_not_ignored">%s is not ignored</string>
    <string name="app_list">Program Lista</string>
    <string name="app_list_summary">Jelöld be melyik program üzeneteit kezeljem.</string>
    <string name="app_name">Voice Notify</string>
    <string name="device_state">Beszélő Állapotok</string>
    <string name="device_state_dialog_title">Jelöld be, hogy mikor kell beszélnem.</string>
    <string name="device_state_summary">Válaszd ki, hogy mikor kell beszélnem?</string>
    <string name="donate">Adomány</string>
    <string name="donate_wallet_title">Adomány - Google Wallet</string>
    <string name="error_email">Error: Nem találok levelezőprogramot.</string>
    <string name="error_market">Error: Nem találom az installált verziót.</string>
    <string name="filter">Filter</string>
    <string name="ignore_all">Az összes ki</string>
    <string name="ignore_app">Ignore %s?</string>
    <string name="ignore_none">Az összes be</string>
    <string name="ignore_repeat">Ismétlések</string>
    <string name="ignore_repeat_dialog_msg">Add meg másodpercben, hogy ha ugyanattól a programtól több üzenet érkezik, hány másodpercen túl beszéljek újra.</string>
    <string name="ignore_repeat_summary">Add meg, hogy hány másodpercen belül ne ismételjem ugyanazt az eseményt.</string>
    <string name="ignore_strings">Szövegek, Amit Nem Mondok.</string>
    <string name="ignore_strings_dialog_msg">Írj új sorba minden szövegrészt.</string>
    <string name="ignore_strings_summary">Ignore notifications that contain certain text in the message.</string>
    <string name="notify_log">Üzenet Események</string>
    <string name="notify_log_summary">List last 20 notifications. Displays time, app name, message, and ignore reasons.</string>
    <string name="quiet_end">Csendes Időszak Vége</string>
    <string name="quiet_end_summary">Ha egyforma időket adsz meg\nakkor a csendes üzemmód kikapcsolódik.</string>
    <string name="quiet_start">Néma Időszak Kezdete</string>
    <string name="quiet_start_summary">Ha egyforma időket adsz meg, akkor a csendes üzemmód kikapcsolódik.</string>
    <string name="reason_app">Ignored app</string>
    <string name="reason_call">Active or ringing call</string>
    <string name="reason_empty_msg">Empty message</string>
    <string name="reason_headset_off">Headset off</string>
    <string name="reason_headset_on">Headset on</string>
    <string name="reason_identical">Identical message within {0,choice,-1#infinite seconds|1#{0} second|1<{0} seconds}</string>
    <string name="reason_quiet">Quiet time</string>
    <string name="reason_screen_off">Screen off</string>
    <string name="reason_screen_on">Screen on</string>
    <string name="reason_shake">Silenced by shake</string>
    <string name="reason_silent">Silent or vibrate mode</string>
    <string name="reason_string">Ignored text</string>
    <string name="reason_suspended">VN suspended by widget</string>
    <string name="service_desc">A státusz üzenetek felolvasása.</string>
    <string name="service_disabled">VN service is disabled</string>
    <string name="service_running">VN service is running</string>
    <string name="service_suspended">VN service is suspended</string>
    <string name="shake_to_silence">Shake-To-Silence</string>
    <string name="shake_to_silence_dialog_msg">Lower values are more sensitive.\n\nDefault: 100\nBlank to disable.</string>
    <string name="shake_to_silence_summary">Adjust the sensitivity threshold of Shake-To-Silence.</string>
    <string name="speak_toasts">Speak Toasts</string>
    <string name="speak_toasts_summary">Also speak toast (bubble) notifications.</string>
    <string name="status_summary_accessibility">Open the Android Accessibility settings to enable or disable VN.</string>
    <string name="status_summary_suspended">Select to activate VN.</string>
    <string name="support">Támogatás</string>
    <string name="support_summary">Adomány, értékelés, kapcsolat a fejlesztővel. Problémák, javaslatok.</string>
    <string name="test">Teszt</string>
    <string name="test_ignored">A Voice Notify inaktív a programlistában.\nÍgy a tesztüzenet nem fog megszólalni.</string>
    <string name="test_notify_msg">Ez egy tesztüzenet.</string>
    <string name="test_summary">Teszt üzenet elküldése (késleltetve 5 másodperccel).</string>
    <string name="tts_delay">Beszéd Késleltetés</string>
    <string name="tts_delay_dialog_msg">Hány másodpercig várjak a megszólalással?</string>
    <string name="tts_delay_summary">Add meg másodpercben mennyi legyen a várakozás a megszólalásig.</string>
    <string name="tts_message">Mit Mondjak?</string>
    <string name="tts_message_dialog">%t = programnév\n%m = üzenet</string>
    <string name="tts_message_summary">Mit mondjak?</string>
    <string name="tts_repeat">Az Üzenet Ismétlése</string>
    <string name="tts_repeat_dialog_msg">Addig ismétli amíg a beállított értékkel amíg a képernyő ki van kapcsolva.\nPercekben kell megadni. Ha 0 vagy üres akkor a funkció kikapcsolva.</string>
    <string name="tts_repeat_summary">Folyamatos ismétlés amíg a képernyő ki van kapcsolva.</string>
    <string name="tts_settings">Szövegfelolvasó Beállítás</string>
    <string name="tts_settings_summary">Open the Android Text-To-Speech settings.</string>
    <string name="tts_settings_summary_fail">Szövefelolvasó nincs telepítve Ha biztos vagy benne, hogy létezik, kérlek vedd fel a kapcsolatot a fejlesztővel.</string>
    <string name="tts_stream">Szövegfelolvasó Hangkimenet</string>
    <string name="tts_stream_summary">Melyik hangkimenetet használjam?</string>
    <string name="unignore_app">Unignore %s?</string>
    <string name="yes">Yes</string>
</resources>


text:
#include "clustersviewwidget.h"
#include <QWheelEvent>

ClustersViewWidget::ClustersViewWidget(QWidget *parent): QGraphicsView(parent)
{
    scene = new QGraphicsScene;
    setScene(scene);
}

ClustersViewWidget::~ClustersViewWidget()
{

}

void ClustersViewWidget::wheelEvent(QWheelEvent *event)
{
    const qreal scaleFactor = 1.15;
        if(event->delta() > 0)
        {
            // Zoom in
            scale(scaleFactor, scaleFactor);
        }
        else
        {
            // Zooming out
            scale(1.0 / scaleFactor, 1.0 / scaleFactor);
        }
    centerOn(mapToScene(event->pos()));
}

void ClustersViewWidget::setClustersWidgetInfo(const ClustersViewWidgetInfo& info)
{
    clustersWidgetInfo = info;
    update();
}

void ClustersViewWidget::update()
{
    QGraphicsView::update();
    scene->clear();
    //scene->addPixmap(QPixmap::fromImage(*clustersWidgetInfo.image));
    foreach (Cluster cluster, clustersWidgetInfo.info) {
        if(cluster.center.x() >= 0 && cluster.center.y() >= 0)
            /*scene->addEllipse(cluster.center.x() - 2.5,
                              cluster.center.y() - 2.5, 5, 5, QPen(QColor(0, 255, 0)), QBrush(QColor(0, 255, 0)));*/
            clustersWidgetInfo.image.setPixel(cluster.center.x(), cluster.center.y(),
                                               QColor(0xff, 0xff, 0xff).rgb());
        foreach(QPointF point, cluster.pointsCluster){
            /*scene->addEllipse(point.x() - 2.5,
                              point.y() - 2.5, 5, 5, QPen(QColor(255, 0, 0)), QBrush(QColor(255, 0, 0)));*/
            clustersWidgetInfo.image.setPixel(point.x(), point.y(),
                                               QColor(0xff, 0xff, 0xff).rgb());
        }
    }
    scene->addPixmap(QPixmap::fromImage(clustersWidgetInfo.image));
}


text:
/****************************************************************************
**
** Definition of QInputContextFactory class
**
** Copyright (C) 2003-2004 immodule for Qt Project.  All rights reserved.
**
** This file is written to contribute to Nokia Corporation and/or its subsidiary(-ies) under their own
** license. You may use this file under your Qt license. Following
** description is copied from their original file headers. Contact
** immodule-qt@freedesktop.org if any conditions of this licensing are
** not clear to you.
**
****************************************************************************/

#ifndef QINPUTCONTEXTFACTORY_H
#define QINPUTCONTEXTFACTORY_H

#include <QtCore/qstringlist.h>

QT_BEGIN_HEADER

QT_BEGIN_NAMESPACE

QT_MODULE(Gui)

#ifndef QT_NO_IM

class QInputContext;
class QWidget;

class Q_GUI_EXPORT QInputContextFactory
{
public:
    static QStringList keys();
    static QInputContext *create( const QString &key, QObject *parent ); // should be a toplevel widget
    static QStringList languages( const QString &key );
    static QString displayName( const QString &key );
    static QString description( const QString &key );
};

#endif // QT_NO_IM

QT_END_NAMESPACE

QT_END_HEADER

#endif // QINPUTCONTEXTFACTORY_H


text:
package org.quartz;

/**
 * The interface to be implemented by {@link Job}s that provide a
 * mechanism for having their execution interrupted.  It is NOT a requirement
 * for jobs to implement this interface - in fact, for most people, none of
 * their jobs will.
 *
 *
Interrupting a Job is very analogous in concept and
 * challenge to normal interruption of a Thread in Java.
 *
 *

 * The means of actually interrupting the Job must be implemented within the
 * Job itself (the interrupt() method of this
 * interface is simply a means for the scheduler to inform the Job
 * that a request has been made for it to be interrupted). The mechanism that
 * your jobs use to interrupt themselves might vary between implementations.
 * However the principle idea in any implementation should be to have the
 * body of the job's execute(..) periodically check some flag to
 * see if an interruption has been requested, and if the flag is set, somehow
 * abort the performance of the rest of the job's work.  An example of
 * interrupting a job can be found in the java source for the  class
 * org.quartz.examples.DumbInterruptableJob.  It is legal to use
 * some combination of wait() and notify()
 * synchronization within interrupt() and execute(..)
 * in order to have the interrupt() method block until the
 * execute(..) signals that it has noticed the set flag.
 *

 *
 *

 * If the Job performs some form of blocking I/O or similar functions, you may
 * want to consider having the Job.execute(..) method store a
 * reference to the calling Thread as a member variable.  Then the
 * Implementation of this interfaces interrupt() method can call
 * interrupt() on that Thread.   Before attempting this, make
 * sure that you fully understand what java.lang.Thread.interrupt()
 * does and doesn't do.  Also make sure that you clear the Job's member
 * reference to the Thread when the execute(..) method exits (preferably in a
 * finally block.
 *

 *
 *

 * See Example 7 (org.quartz.examples.example7.DumbInterruptableJob) for a simple
 * implementation demonstration.
 *

 * @see Job
 * @see StatefulJob
 * @see Scheduler#interrupt(JobKey)
 * @see Scheduler#interrupt(String)
 *
 * @author James House
 */
public interface InterruptableJob extends Job {

    /*
     * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     *
     * Interface.
     *
     * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     */

    /**
     *

     * Called by the {@link Scheduler} when a user
     * interrupts the Job.
     *

     *
     * @throws UnableToInterruptJobException
     *           if there is an exception while interrupting the job.
     */
    void interrupt()
        throws UnableToInterruptJobException;
}


text:
/**
 * @memberOf Jymfony.Component.HttpFoundation.Websocket
 */
export default class Message {
    /**
     * Constructor.
     *
     * @param {Buffer|string} data
     * @param {string} type
     */
    __construct(data, type = undefined) {
        if (undefined === type) {
            type = isString(data) ? __self.TYPE_TEXT : __self.TYPE_BINARY;
        }

        /**
         * @type {Buffer}
         *
         * @private
         */
        this._buffer = Buffer.from(data);

        /**
         * @type {string}
         *
         * @private
         */
        this._type = type;
    }

    /**
     * The message type.
     *
     * @returns {string}
     */
    get type() {
        return this._type;
    }

    /**
     * Gets the message data as buffer.
     *
     * @returns {Buffer}
     */
    asBuffer() {
        return Buffer.from(this._buffer);
    }

    /**
     * Gets the message data as string.
     *
     * @param {string} encoding
     *
     * @returns {string}
     */
    asString(encoding = 'utf8') {
        return this._buffer.toString(encoding);
    }
}

Message.TYPE_TEXT = 'text';
Message.TYPE_BINARY = 'binary';
Message.TYPE_PING = 'ping';


text:
use events;
use winapi;

pub fn vkeycode_to_element(code: winapi::WPARAM) -> Option<events::VirtualKeyCode> {
    Some(match code {
        //winapi::VK_LBUTTON => events::VirtualKeyCode::Lbutton,
        //winapi::VK_RBUTTON => events::VirtualKeyCode::Rbutton,
        //winapi::VK_CANCEL => events::VirtualKeyCode::Cancel,
        //winapi::VK_MBUTTON => events::VirtualKeyCode::Mbutton,
        //winapi::VK_XBUTTON1 => events::VirtualKeyCode::Xbutton1,
        //winapi::VK_XBUTTON2 => events::VirtualKeyCode::Xbutton2,
        winapi::VK_BACK => events::VirtualKeyCode::Back,
        winapi::VK_TAB => events::VirtualKeyCode::Tab,
        //winapi::VK_CLEAR => events::VirtualKeyCode::Clear,
        winapi::VK_RETURN => events::VirtualKeyCode::Return,
        //winapi::VK_SHIFT => events::VirtualKeyCode::Shift,
        //winapi::VK_CONTROL => events::VirtualKeyCode::Control,
        //winapi::VK_MENU => events::VirtualKeyCode::Menu,
        winapi::VK_PAUSE => events::VirtualKeyCode::Pause,
        winapi::VK_CAPITAL => events::VirtualKeyCode::Capital,
        winapi::VK_KANA => events::VirtualKeyCode::Kana,
        //winapi::VK_HANGUEL => events::VirtualKeyCode::Hanguel,
        //winapi::VK_HANGUL => events::VirtualKeyCode::Hangul,
        //winapi::VK_JUNJA => events::VirtualKeyCode::Junja,
        //winapi::VK_FINAL => events::VirtualKeyCode::Final,
        //winapi::VK_HANJA => events::VirtualKeyCode::Hanja,
        winapi::VK_KANJI => events::VirtualKeyCode::Kanji,
        winapi::VK_ESCAPE => events::VirtualKeyCode::Escape,
        winapi::VK_CONVERT => events::VirtualKeyCode::Convert,
        //winapi::VK_NONCONVERT => events::VirtualKeyCode::Nonconvert,
        //winapi::VK_ACCEPT => events::VirtualKeyCode::Accept,
        //winapi::VK_MODECHANGE => events::VirtualKeyCode::Modechange,
        winapi::VK_SPACE => events::VirtualKeyCode::Space,
        winapi::VK_PRIOR => events::VirtualKeyCode::PageUp,
        winapi::VK_NEXT => events::VirtualKeyCode::PageDown,
        winapi::VK_END => events::VirtualKeyCode::End,
        winapi::VK_HOME => events::VirtualKeyCode::Home,
        winapi::VK_LEFT => events::VirtualKeyCode::Left,
        winapi::VK_UP => events::VirtualKeyCode::Up,
        winapi::VK_RIGHT => events::VirtualKeyCode::Right,
        winapi::VK_DOWN => events::VirtualKeyCode::Down,
        //winapi::VK_SELECT => events::VirtualKeyCode::Select,
        //winapi::VK_PRINT => events::VirtualKeyCode::Print,
        //winapi::VK_EXECUTE => events::VirtualKeyCode::Execute,
        winapi::VK_SNAPSHOT => events::VirtualKeyCode::Snapshot,
        winapi::VK_INSERT => events::VirtualKeyCode::Insert,
        winapi::VK_DELETE => events::VirtualKeyCode::Delete,
        //winapi::VK_HELP => events::VirtualKeyCode::Help,
        0x30 => events::VirtualKeyCode::Key0,
        0x31 => events::VirtualKeyCode::Key1,
        0x32 => events::VirtualKeyCode::Key2,
        0x33 => events::VirtualKeyCode::Key3,
        0x34 => events::VirtualKeyCode::Key4,
        0x35 => events::VirtualKeyCode::Key5,
        0x36 => events::VirtualKeyCode::Key6,
        0x37 => events::VirtualKeyCode::Key7,
        0x38 => events::VirtualKeyCode::Key8,
        0x39 => events::VirtualKeyCode::Key9,
        0x41 => events::VirtualKeyCode::A,
        0x42 => events::VirtualKeyCode::B,
        0x43 => events::VirtualKeyCode::C,
        0x44 => events::VirtualKeyCode::D,
        0x45 => events::VirtualKeyCode::E,
        0x46 => events::VirtualKeyCode::F,
        0x47 => events::VirtualKeyCode::G,
        0x48 => events::VirtualKeyCode::H,
        0x49 => events::VirtualKeyCode::I,
        0x4A => events::VirtualKeyCode::J,
        0x4B => events::VirtualKeyCode::K,
        0x4C => events::VirtualKeyCode::L,
        0x4D => events::VirtualKeyCode::M,
        0x4E => events::VirtualKeyCode::N,
        0x4F => events::VirtualKeyCode::O,
        0x50 => events::VirtualKeyCode::P,
        0x51 => events::VirtualKeyCode::Q,
        0x52 => events::VirtualKeyCode::R,
        0x53 => events::VirtualKeyCode::S,
        0x54 => events::VirtualKeyCode::T,
        0x55 => events::VirtualKeyCode::U,
        0x56 => events::VirtualKeyCode::V,
        0x57 => events::VirtualKeyCode::W,
        0x58 => events::VirtualKeyCode::X,
        0x59 => events::VirtualKeyCode::Y,
        0x5A => events::VirtualKeyCode::Z,
        //winapi::VK_LWIN => events::VirtualKeyCode::Lwin,
        //winapi::VK_RWIN => events::VirtualKeyCode::Rwin,
        winapi::VK_APPS => events::VirtualKeyCode::Apps,
        winapi::VK_SLEEP => events::VirtualKeyCode::Sleep,
        winapi::VK_NUMPAD0 => events::VirtualKeyCode::Numpad0,
        winapi::VK_NUMPAD1 => events::VirtualKeyCode::Numpad1,
        winapi::VK_NUMPAD2 => events::VirtualKeyCode::Numpad2,
        winapi::VK_NUMPAD3 => events::VirtualKeyCode::Numpad3,
        winapi::VK_NUMPAD4 => events::VirtualKeyCode::Numpad4,
        winapi::VK_NUMPAD5 => events::VirtualKeyCode::Numpad5,
        winapi::VK_NUMPAD6 => events::VirtualKeyCode::Numpad6,
        winapi::VK_NUMPAD7 => events::VirtualKeyCode::Numpad7,
        winapi::VK_NUMPAD8 => events::VirtualKeyCode::Numpad8,
        winapi::VK_NUMPAD9 => events::VirtualKeyCode::Numpad9,
        winapi::VK_MULTIPLY => events::VirtualKeyCode::Multiply,
        winapi::VK_ADD => events::VirtualKeyCode::Add,
        //winapi::VK_SEPARATOR => events::VirtualKeyCode::Separator,
        winapi::VK_SUBTRACT => events::VirtualKeyCode::Subtract,
        winapi::VK_DECIMAL => events::VirtualKeyCode::Decimal,
        winapi::VK_DIVIDE => events::VirtualKeyCode::Divide,
        winapi::VK_F1 => events::VirtualKeyCode::F1,
        winapi::VK_F2 => events::VirtualKeyCode::F2,
        winapi::VK_F3 => events::VirtualKeyCode::F3,
        winapi::VK_F4 => events::VirtualKeyCode::F4,
        winapi::VK_F5 => events::VirtualKeyCode::F5,
        winapi::VK_F6 => events::VirtualKeyCode::F6,
        winapi::VK_F7 => events::VirtualKeyCode::F7,
        winapi::VK_F8 => events::VirtualKeyCode::F8,
        winapi::VK_F9 => events::VirtualKeyCode::F9,
        winapi::VK_F10 => events::VirtualKeyCode::F10,
        winapi::VK_F11 => events::VirtualKeyCode::F11,
        winapi::VK_F12 => events::VirtualKeyCode::F12,
        winapi::VK_F13 => events::VirtualKeyCode::F13,
        winapi::VK_F14 => events::VirtualKeyCode::F14,
        winapi::VK_F15 => events::VirtualKeyCode::F15,
        /*winapi::VK_F16 => events::VirtualKeyCode::F16,
        winapi::VK_F17 => events::VirtualKeyCode::F17,
        winapi::VK_F18 => events::VirtualKeyCode::F18,
        winapi::VK_F19 => events::VirtualKeyCode::F19,
        winapi::VK_F20 => events::VirtualKeyCode::F20,
        winapi::VK_F21 => events::VirtualKeyCode::F21,
        winapi::VK_F22 => events::VirtualKeyCode::F22,
        winapi::VK_F23 => events::VirtualKeyCode::F23,
        winapi::VK_F24 => events::VirtualKeyCode::F24,*/
        winapi::VK_NUMLOCK => events::VirtualKeyCode::Numlock,
        winapi::VK_SCROLL => events::VirtualKeyCode::Scroll,
        /*winapi::VK_LSHIFT => events::VirtualKeyCode::Lshift,
        winapi::VK_RSHIFT => events::VirtualKeyCode::Rshift,
        winapi::VK_LCONTROL => events::VirtualKeyCode::Lcontrol,
        winapi::VK_RCONTROL => events::VirtualKeyCode::Rcontrol,
        winapi::VK_LMENU => events::VirtualKeyCode::Lmenu,
        winapi::VK_RMENU => events::VirtualKeyCode::Rmenu,
        winapi::VK_BROWSER_BACK => events::VirtualKeyCode::Browser_back,
        winapi::VK_BROWSER_FORWARD => events::VirtualKeyCode::Browser_forward,
        winapi::VK_BROWSER_REFRESH => events::VirtualKeyCode::Browser_refresh,
        winapi::VK_BROWSER_STOP => events::VirtualKeyCode::Browser_stop,
        winapi::VK_BROWSER_SEARCH => events::VirtualKeyCode::Browser_search,
        winapi::VK_BROWSER_FAVORITES => events::VirtualKeyCode::Browser_favorites,
        winapi::VK_BROWSER_HOME => events::VirtualKeyCode::Browser_home,
        winapi::VK_VOLUME_MUTE => events::VirtualKeyCode::Volume_mute,
        winapi::VK_VOLUME_DOWN => events::VirtualKeyCode::Volume_down,
        winapi::VK_VOLUME_UP => events::VirtualKeyCode::Volume_up,
        winapi::VK_MEDIA_NEXT_TRACK => events::VirtualKeyCode::Media_next_track,
        winapi::VK_MEDIA_PREV_TRACK => events::VirtualKeyCode::Media_prev_track,
        winapi::VK_MEDIA_STOP => events::VirtualKeyCode::Media_stop,
        winapi::VK_MEDIA_PLAY_PAUSE => events::VirtualKeyCode::Media_play_pause,
        winapi::VK_LAUNCH_MAIL => events::VirtualKeyCode::Launch_mail,
        winapi::VK_LAUNCH_MEDIA_SELECT => events::VirtualKeyCode::Launch_media_select,
        winapi::VK_LAUNCH_APP1 => events::VirtualKeyCode::Launch_app1,
        winapi::VK_LAUNCH_APP2 => events::VirtualKeyCode::Launch_app2,
        winapi::VK_OEM_1 => events::VirtualKeyCode::Oem_1,
        winapi::VK_OEM_PLUS => events::VirtualKeyCode::Oem_plus,
        winapi::VK_OEM_COMMA => events::VirtualKeyCode::Oem_comma,
        winapi::VK_OEM_MINUS => events::VirtualKeyCode::Oem_minus,
        winapi::VK_OEM_PERIOD => events::VirtualKeyCode::Oem_period,
        winapi::VK_OEM_2 => events::VirtualKeyCode::Oem_2,
        winapi::VK_OEM_3 => events::VirtualKeyCode::Oem_3,
        winapi::VK_OEM_4 => events::VirtualKeyCode::Oem_4,
        winapi::VK_OEM_5 => events::VirtualKeyCode::Oem_5,
        winapi::VK_OEM_6 => events::VirtualKeyCode::Oem_6,
        winapi::VK_OEM_7 => events::VirtualKeyCode::Oem_7,
        winapi::VK_OEM_8 => events::VirtualKeyCode::Oem_8,
        winapi::VK_OEM_102 => events::VirtualKeyCode::Oem_102,
        winapi::VK_PROCESSKEY => events::VirtualKeyCode::Processkey,
        winapi::VK_PACKET => events::VirtualKeyCode::Packet,
        winapi::VK_ATTN => events::VirtualKeyCode::Attn,
        winapi::VK_CRSEL => events::VirtualKeyCode::Crsel,
        winapi::VK_EXSEL => events::VirtualKeyCode::Exsel,
        winapi::VK_EREOF => events::VirtualKeyCode::Ereof,
        winapi::VK_PLAY => events::VirtualKeyCode::Play,
        winapi::VK_ZOOM => events::VirtualKeyCode::Zoom,
        winapi::VK_NONAME => events::VirtualKeyCode::Noname,
        winapi::VK_PA1 => events::VirtualKeyCode::Pa1,
        winapi::VK_OEM_CLEAR => events::VirtualKeyCode::Oem_clear,*/
        _ => return None
    })
}


text:
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<!-- Generated Jul 17, 2013 11:31:02 AM by Hibernate Tools 3.4.0.CR1 -->
<hibernate-mapping>
    <class name="core.classes.pharmacy.TrnDrugsSupplied" table="pharm_drugssupplied" lazy="false">
        <composite-id name="id" class="core.classes.pharmacy.TrnDrugsSuppliedId" >
            <key-many-to-one name="drugs" class="core.classes.pharmacy.MstDrugsNew" lazy="false" >
        		<column name="drug_supplied_srno" not-null="true" />
        	</key-many-to-one>
            <key-property name="dBatchNo" type="string">
                <column name="drug_supplied_batchno" length="200" />
            </key-property>
        </composite-id>

        <property name="dName" type="string">
            <column name="drug_supplied_name" length="130" not-null="true" />
        </property>
        <property name="dQty" type="java.lang.Integer">
            <column name="drug_supplied_qty" />
        </property>
        <property name="dManufacturer" type="string">
            <column name="drug_supplied_manufactrure" length="500" />
        </property>
        <property name="dManufactDate" type="timestamp">
            <column name="drug_supplied_manufact_date" length="19" />
        </property>
        <property name="dExpiryDate" type="timestamp">
            <column name="drug_supplied_expirydate" length="19" />
        </property>
        <property name="dCreateDate" type="timestamp">
            <column name="drug_supplied_create_date" length="19" />
        </property>
        <property name="dCreateUser" type="int">
            <column name="drug_supplied_create_user"  />
        </property>
        <property name="dLastUpdate" type="timestamp">
            <column name="drug_supplied_lastupdate_date" length="19" />
        </property>
        <property name="dLastUpdateUser" type="int">
            <column name="drug_supplied_lastupdate_user"  />
        </property>
        <property name="batchStatus" type="string">
            <column name="drug_supplied_status" />
        </property>
    </class>
</hibernate-mapping>


text:
.class public interface abstract Lo/zk;
.super Ljava/lang/Object;

# interfaces
.implements Landroid/os/IInterface;

# annotations
.annotation system Ldalvik/annotation/MemberClasses;
    value = {
        Lo/zk$if;
    }
.end annotation

# virtual methods
.method public abstract ˊ(Lcom/google/android/gms/common/api/Status;)V
.end method

.method public abstract ˊ(Lcom/google/android/gms/common/data/DataHolder;)V
.end method

.method public abstract ˊ(Lcom/google/android/gms/wearable/internal/ab;)V
.end method

.method public abstract ˊ(Lcom/google/android/gms/wearable/internal/ap;)V
.end method

.method public abstract ˊ(Lcom/google/android/gms/wearable/internal/at;)V
.end method

.method public abstract ˊ(Lcom/google/android/gms/wearable/internal/aw;)V
.end method

.method public abstract ˊ(Lcom/google/android/gms/wearable/internal/p;)V
.end method

.method public abstract ˊ(Lcom/google/android/gms/wearable/internal/r;)V
.end method

.method public abstract ˊ(Lcom/google/android/gms/wearable/internal/t;)V
.end method

.method public abstract ˊ(Lcom/google/android/gms/wearable/internal/v;)V
.end method

.method public abstract ˊ(Lcom/google/android/gms/wearable/internal/x;)V
.end method

.method public abstract ˊ(Lcom/google/android/gms/wearable/internal/z;)V
.end method


text:
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
	<modelVersion>4.0.0</modelVersion>
	<parent>
		<groupId>edu.ucdenver.ccp</groupId>
		<artifactId>ccp-nlp</artifactId>
		<version>3.5.3</version>
	</parent>
	<artifactId>ccp-nlp-evaluation</artifactId>

	<properties>
		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
	</properties>

	<dependencies>
		<dependency>
			<groupId>org.projectlombok</groupId>
			<artifactId>lombok</artifactId>
		</dependency>
		<dependency>
			<groupId>edu.ucdenver.ccp</groupId>
			<artifactId>ccp-nlp-core</artifactId>
			<version>${project.version}</version>
		</dependency>
		<dependency>
			<groupId>junit</groupId>
			<artifactId>junit</artifactId>
		</dependency>
		<dependency>
			<groupId>org.hamcrest</groupId>
			<artifactId>hamcrest</artifactId>
			<version>2.1</version>
			<scope>test</scope>
		</dependency>
	</dependencies>

	<build>
		<plugins>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-shade-plugin</artifactId>
				<version>3.2.1</version>
				<configuration>
					<outputFile>target/${project.name}-onejar-${project.version}.jar</outputFile>
				</configuration>
				<executions>
					<execution>
						<phase>package</phase>
						<goals>
							<goal>shade</goal>
						</goals>
					</execution>
				</executions>
			</plugin>
		</plugins>
	</build>

</project>


text:
:man_page: mongoc_uri_set_read_prefs_t

mongoc_uri_set_read_prefs_t()
=============================

Synopsis
--------

.. code-block:: c

  void
  mongoc_uri_set_read_prefs_t (mongoc_uri_t *uri,
                               const mongoc_read_prefs_t *prefs);

Parameters
----------

* ``uri``: A :symbol:`mongoc_uri_t`.
* ``rc``: A :symbol:`mongoc_read_prefs_t`.

Description
-----------

Sets a MongoDB URI's read preferences, after the URI has been parsed from a string.


text:
.class Lcom/fasterxml/jackson/databind/introspect/POJOPropertyBuilder$1;
.super Ljava/lang/Object;
.source ""

# interfaces
.implements Lcom/fasterxml/jackson/databind/introspect/POJOPropertyBuilder$WithMember;

# annotations
.annotation system Ldalvik/annotation/EnclosingMethod;
    value = Lcom/fasterxml/jackson/databind/introspect/POJOPropertyBuilder;->findViews()[Ljava/lang/Class;
.end annotation

.annotation system Ldalvik/annotation/InnerClass;
    accessFlags = 0x0
    name = null
.end annotation

.annotation system Ldalvik/annotation/Signature;
    value = {
        "Ljava/lang/Object;Lcom/fasterxml/jackson/databind/introspect/POJOPropertyBuilder$WithMember<[Ljava/lang/Class<*>;>;"
    }
.end annotation

# instance fields
.field final synthetic this$0:Lcom/fasterxml/jackson/databind/introspect/POJOPropertyBuilder;

# direct methods
.method constructor <init>(Lcom/fasterxml/jackson/databind/introspect/POJOPropertyBuilder;)V
    .locals 0

    .line 319
    iput-object p1, p0, Lcom/fasterxml/jackson/databind/introspect/POJOPropertyBuilder$1;->this$0:Lcom/fasterxml/jackson/databind/introspect/POJOPropertyBuilder;

    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    return-void
.end method

# virtual methods
.method public bridge synthetic withMember(Lcom/fasterxml/jackson/databind/introspect/AnnotatedMember;)Ljava/lang/Object;
    .locals 1

    .line 319
    invoke-virtual {p0, p1}, Lcom/fasterxml/jackson/databind/introspect/POJOPropertyBuilder$1;->withMember(Lcom/fasterxml/jackson/databind/introspect/AnnotatedMember;)[Ljava/lang/Class;

    move-result-object v0

    return-object v0
.end method

.method public withMember(Lcom/fasterxml/jackson/databind/introspect/AnnotatedMember;)[Ljava/lang/Class;
    .locals 1
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(Lcom/fasterxml/jackson/databind/introspect/AnnotatedMember;)[Ljava/lang/Class<*>;"
        }
    .end annotation

    .line 322
    iget-object v0, p0, Lcom/fasterxml/jackson/databind/introspect/POJOPropertyBuilder$1;->this$0:Lcom/fasterxml/jackson/databind/introspect/POJOPropertyBuilder;

    iget-object v0, v0, Lcom/fasterxml/jackson/databind/introspect/POJOPropertyBuilder;->_annotationIntrospector:Lcom/fasterxml/jackson/databind/AnnotationIntrospector;

    invoke-virtual {v0, p1}, Lcom/fasterxml/jackson/databind/AnnotationIntrospector;->findViews(Lcom/fasterxml/jackson/databind/introspect/Annotated;)[Ljava/lang/Class;

    move-result-object v0

    return-object v0
.end method


text:
from django.template.defaultfilters import striptags
from django.contrib.syndication.views import Feed

from events.models import Event

class UpcomingEvents(Feed):
    title = 'Events'
    link = '/events/'
    description = 'Upcoming events'

    def items(self):
        return Event.upcoming.all()[:30]

    def item_pubdate(self, item):
        return item.created

    def item_title(self, item):
        return striptags(item.name)

    def item_description(self, item):
        return item.description


text:
import * as React from "react"
import getLogger from "common/log/Logger"
import {NestedStyles, StyleDeclaration} from "renderer/styles/ThemedStyles"

import {useEffect, useRef, useState} from "react"

const log = getLogger(__filename)

function baseStyles(theme: Theme): StyleDeclaration {
  const
    {palette} = theme,
    {primary, secondary} = palette

  return {
    root: []
  }
}

interface P<T> {
  promise:Promise<T>
  unresolvedComponent?: () => (React.ReactNode | JSX.Element)
  children: (data:T | null, err?: Error | null) => (React.ReactNode | JSX.Element)
}

export default function PromisedData<T = any>(props: P<T>): React.ReactElement<P<T>> {
  const
    {promise,unresolvedComponent, children} = props,
    promiseIndex = useRef(0),
    [results, setResults] = useState<T | null>(null),
    [error, setError] = useState<Error | null>(null)

  useEffect(() => {
    promiseIndex.current++
    const thisPromiseIndex = promiseIndex.current
    if (!promise)
      return () => {
        promiseIndex.current = 0
      }

    if (results !== null)
      setResults(null)
    promise
      .then(results => {
        if (promiseIndex.current !== thisPromiseIndex) {
          log.warn("Promise has changed, ignoring result", promiseIndex.current, thisPromiseIndex)
        } else {
          setResults(results)
        }
      })
      .catch(err => {
        log.error("Promise failed to resolve", err)
        setError(err)
      })
    return () => {
      promiseIndex.current = 0
    }
  }, [promise])

  return (results || error ? children(results,error) : unresolvedComponent ? unresolvedComponent() : null) as any
}


text:
orion.collections.onCreated(function() {
  var self = this;
  Meteor.publish('adminGetOne.' + this.name, function (_id) {
    check(_id, String);
    return self.find(_id);
  }, { is_auto: true });
});


text:
<?php

namespace MillerVein\Component\Form\Extension;

use MillerVein\Component\Form\DataTransformer\TwentyFourToTwelveHourArray;
use Symfony\Component\Form\AbstractTypeExtension;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolverInterface;

/**
 *
 * @author Nick Fenzan <nickf@millervein.com>
 */
class TwelveHourTimeExtension extends AbstractTypeExtension {

    public function buildForm(FormBuilderInterface $builder, array $options) {
        $builder->add('ampm', 'choice', [
            'choices' => ['AM'=>'AM', 'PM'=>'PM']
        ]);
        $builder->addViewTransformer(new TwentyFourToTwelveHourArray());
    }

    public function setDefaultOptions(OptionsResolverInterface $resolver) {
        $resolver->setDefaults(array(
            'hours' => range(1, 12)
                )
        );
    }

    public function getExtendedType() {
        return "time";
    }

}