text:
1. **Portal pic display**: The portal image display is dynamic because the portal pics don't come in a standard orientation, some are portrait some are landscape. The following links helped in figuring out how to display the portal images:

    1. **CSS classes to handle portal pic orientations**: http://addedoptimization.com/css-styling-image-height-and-width-while-maintaining-aspect-ratio/

        The insight here was:

        ``` css
        img.resize{height:80px;width:auto;}

        img.resize{height:auto;width:80px;}
        ```

        The above example was the basis for creating 2 (responsive) classes used herein (which is highly reusable for any other project):

        ``` css
        .landscape {
          height: 75px;
          width: auto;
          height: auto;
          width: 75px;
        }

        .portrait {
          height: auto;
          width: 75px;
          height: 75px;
          width: auto;
        }
        ```
    2. **Javascript to dynamically add orientation classes**: http://stackoverflow.com/a/29218922/2145103

        The above Stack Overflow answer provided the script found in hitlist.html.

2. **The Hit List list numbering**: The Hit List uses a [CSS counter](https://developer.mozilla.org/en-US/docs/Web/Guide/CSS/Counters) to style the portal order number. This [CSS Tricks article](https://css-tricks.com/numbering-in-style/) was the main reference in achieving this.

3. **rotobs.txt**: We'd like to keep our URL out of search engine indexes. Of course, being on github makes us wide open to our data. But the source scripts are not (as of 2015-03-27) on github. The following links were helpful in adding the robots.txt file and the HTML `<meta>` data that have been included in our documents:
  1. http://www.robotstxt.org/robotstxt.html
  2. https://www.inmotionhosting.com/support/website/restricting-bots/how-to-stop-search-engines-from-crawling-your-website
  3. https://support.google.com/webmasters/answer/6062608?hl=en
  4. http://searchengineland.com/removing-pages-from-google-53086

4. **AP list level indicator image**: The web app [Ingressup](http://ingressup.appspot.com) was used to create the AP list image. Before using the app, a png file was made that was 600px by 600px with a transparent background. This png was then uploaded to Ingressup with the settings: Resistance, Level 16, and fully transparent background. The present image is the output of Ingressup.

5. **Random kitten-in-blue-blankey image generator**: [This Stack Overflow answer](http://stackoverflow.com/a/16428237/2145103) provided the solution for loading the randomly selected image of a kitten in a blue blankey at the top of the Fielding  list page. All images were retrieved from a google image search for "cat blue blanket".

6. **Corrected local dev permalinks & dynamic list navigation links**:
  1. Corrected local dev permalinks: (this is minor info for the group and site, but useful for anyone using Jekyll) The first couple weeks of using our new site, the local deveopment of the site required going to http://localhost:4000/hitlist.html instead of http://localhost:4000/hitlist/. The solution was to change the permalink build settings in _config.yml from `permalinks: pretty` to `permalink: pretty`. The discussion in [this Jeyll issue](https://github.com/jekyll/jekyll/issues/2399) helped me come to the solution.
  2. Dynamic list navigation links: There are many posts online discussing how to make navigation items dynamically receive a CSS class of `active` if the link represents the currently viewed page. Many of the examples are a bit complex. In the end, [this very simple explanation](http://jekyllsnippets.com/active-tabs-in-nav/) provided the solution that is at play in our current CURes.blue site.

7. **Javascript tabs for all lists displayed in one page**: [This tutorial on jquery tabs](http://www.jacklmoore.com/notes/jquery-tabs) provided the solution to hide all list data on one page except the currently selected list. This new list design was the content of a recent commit providing the new link http://CURes.blue/intel.


text:
<?php

require __DIR__ . '/../vendor/autoload.php';

use Auryn\Injector;
use Northwoods\Container\InjectorContainer;
use Northwoods\Container\Fixture\ClassWithoutParameters;

/**
 * Config object that acts like an array.
 */
class Configuration extends ArrayObject
{
    public function __construct()
    {
        parent::__construct(include __DIR__ . '/config.inc.php');
    }
}

// Set up the injector
$injector = new Injector();

// Container requires a "config" identifier, point it to our Configuration class.
$injector->alias('config', Configuration::class);

// Create the container
$container = new InjectorContainer($injector);

// The "config" identifier is now usable without a class named "config".
$config = $container->get('config');

var_dump($config['test']);

redpajama_set_name: RedPajamaGithub


text:
<!DOCTYPE html>

My Web Page

My first paragraph.
.

My first paragraph.


text:
using System.Collections.Generic;

namespace MediaManager.Library
{
    public static class MediaItemExtensions
    {
        public static IDictionary<string, object> ToDictionary(this IMediaItem mediaItem)
        {
            var mediaItemDict = new Dictionary<string, object>();
            foreach (var item in mediaItem.GetType().GetProperties())
            {
                var value = item.GetValue(mediaItem, null);
                if (value != null)
                    mediaItemDict.Add(item.Name, value);
            }
            return mediaItemDict;
        }

        public static string GetTitle(this IMediaItem mediaItem)
        {
            if (!string.IsNullOrEmpty(mediaItem.DisplayTitle))
                return mediaItem.DisplayTitle;
            else if (!string.IsNullOrEmpty(mediaItem.Title))
                return mediaItem.Title;
            else
                return string.Empty;
        }

        public static string GetContentTitle(this IMediaItem mediaItem)
        {
            if (!string.IsNullOrEmpty(mediaItem.DisplaySubtitle))
                return mediaItem.DisplaySubtitle;
            else if (!string.IsNullOrEmpty(mediaItem.Artist))
                return mediaItem.Artist;
            else if (!string.IsNullOrEmpty(mediaItem.AlbumArtist))
                return mediaItem.AlbumArtist;
            else if (!string.IsNullOrEmpty(mediaItem.Album))
                return mediaItem.Album;
            else
                return string.Empty;
        }

        public static string GetSubText(this IMediaItem mediaItem)
        {
            if (!string.IsNullOrEmpty(mediaItem.Album))
                return mediaItem.Album;
            else if (!string.IsNullOrEmpty(mediaItem.Artist))
                return mediaItem.Artist;
            else if (!string.IsNullOrEmpty(mediaItem.AlbumArtist))
                return mediaItem.AlbumArtist;
            else
                return string.Empty;
        }
    }
}


text:
"use strict";

/**
 * # builder(context, cache)
 *
 *
 * ### Params:
 *
 * * **AudioContext** *context*
 * * **Object** *cache* cached files
 *
 *
 * ### Return:
 *
 * * **Function** function with params files, duration and ready
 */

/*! */

// Start playing on right position
var playStart = function (context, source, file) {
  source.connect(context.destination);
  source.start(file.offset, file.time[0], file.time[1] - file.time[0]);
};

// Change play rate
var playRate = function (context, source, file) {
  if (typeof file.rate !== "undefined") {
    source.playbackRate.value = file.rate;
  }
};

// Start build source
var buildSource = function (context, cache, file) {
  var source = context.createBufferSource();
  source.buffer = cache[file.file];
  return source;
};

module.exports = function (context, cache, duration, ready) {
  return function (files) {
    return {

      /**
       * @method play
       * @return {Array} all buffer sources
       */

      play: function play() {
        var parts = files.filter(function (x) {
          return x.type === "file";
        }).map(function (x) {
          return x.parts;
        }).reduce(function (acc, x) {
          return acc.concat(x);
        }, []);

        return parts.map(function (x) {
          var source = buildSource(context, cache, x);

          playRate(context, source, x); // Choose play rate
          playStart(context, source, x); // Choose where to start playing

          return source;
        });
      },

      /**
       * Array containing all files
       *
       * @name files
       */

      files: files,

      /**
       * Duration of the whole file in seconds
       *
       * @method duration
       * @return {Number} duration in seconds
       */

      duration: duration,

      /**
       * @method ready
       * @return {Boolean} true if all files are loaded
       */

      ready: ready
    };
  };
};


text:
module HTML
  # This class represents an HTML ColGroup column (<col>).  Despite the
  # name, it is not a subclass of ColGroup or Table.
  #
  class Table::ColGroup::Col
    include AttributeHandler
    include HtmlHandler

    undef_method :configure, :content
    @indent_level = 6

    # Creates and returns a new ColGroup object.  Optionally takes a block.
    # Note that it does not accept an argument - col tags do not have content.
    #
    def initialize(&block)
      @html_begin = '<col'
      @html_body  = ''
      @html_end   = ''
      instance_eval(&block) if block_given?
    end

    # Returns the indentation level for the tags of this class.  The
    # default is 6.
    #
    class << self
       attr_reader :indent_level
     end

    # Sets the indentation level for the tags of this class.  The default
    # is 6.
    #
    def self.indent_level=(num)
      expect(num, Integer)
      raise ArgumentError, 'num must be >= 0' if num < 0
      @indent_level = num
    end

    alias to_s html
    alias to_str html
  end
end


text:
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xmlns="http://maven.apache.org/POM/4.0.0"
         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>

  <artifactId>kylo-job-repository-service</artifactId>
  <packaging>pom</packaging>
  <parent>
    <artifactId>kylo-services</artifactId>
    <groupId>com.thinkbiganalytics.datalake</groupId>
    <version>0.8.1-SNAPSHOT</version>
    <relativePath>../pom.xml</relativePath>
  </parent>
  <properties>
    <plugin.license.parentRelative>../../</plugin.license.parentRelative>
  </properties>
  <modules>
    <module>job-repository-rest-model</module>
    <module>job-repository-controller</module>
  </modules>

</project>


text:
#ifndef __itkLabelObject_h
#define __itkLabelObject_h

#include <deque>
#include "itkLightObject.h"
#include "itkLabelObjectLine.h"
#include "itkWeakPointer.h"
#include "itkObjectFactory.h"

namespace itk
{
/** \class LabelObject
 *  \brief The base class for the representation of an labeled binary object in an image.
 *
 * LabelObject is the base class to represent a labeled object in an image.
 * It should be used associated with the LabelMap.
 *
 * LabelObject store mainly 2 things: the label of the object, and a set of lines
 * which are part of the object.
 * No attribute is available in that class, so this class can be used as a base class
 * to implement a label object with attribute, or when no attribute is needed (see the
 * reconstruction filters for an example. If a simple attribute is needed,
 * AttributeLabelObject can be used directly.
 *
 * All the subclasses of LabelObject have to reinplement the CopyAttributesFrom() method.
 *
 * The pixels locations belonging to the LabelObject can be obtained using:
 * \code
 * for(unsigned int pixelId = 0; pixelId < labelObject->Size(); pixelId++)
 *   {
 *   std::cout << labelObject->GetIndex(pixelId);
 *   }
 * \endcode
 *
 * \author Gaetan Lehmann. Biologie du Developpement et de la Reproduction, INRA de Jouy-en-Josas, France.
 *
 * This implementation was taken from the Insight Journal paper:
 * http://hdl.handle.net/1926/584  or
 * http://www.insight-journal.org/browse/publication/176
 *
 * \sa LabelMapFilter, AttributeLabelObject
 * \ingroup DataRepresentation
 * \ingroup LabeledImageObject
 * \ingroup ITKLabelMap
 */
template< typename TLabel, unsigned int VImageDimension >
class LabelObject:public LightObject
{
public:
  /** Standard class typedefs */
  typedef LabelObject                Self;
  typedef LightObject                Superclass;
  typedef Self                       LabelObjectType;
  typedef SmartPointer< Self >       Pointer;
  typedef SmartPointer< const Self > ConstPointer;
  typedef WeakPointer< const Self >  ConstWeakPointer;

  /** Method for creation through the object factory. */
  itkNewMacro(Self);

  /** Run-time type information (and related methods). */
  itkTypeMacro(LabelObject, LightObject);

  itkStaticConstMacro(ImageDimension, unsigned int, VImageDimension);

  typedef Index< VImageDimension >           IndexType;
  typedef Offset< VImageDimension >          OffsetType;
  typedef TLabel                             LabelType;
  typedef LabelObjectLine< VImageDimension > LineType;
  typedef typename LineType::LengthType      LengthType;
  typedef unsigned int                       AttributeType;
  typedef itk::SizeValueType                 SizeValueType;

  itkStaticConstMacro(LABEL, AttributeType, 0);

  static AttributeType GetAttributeFromName(const std::string & s);

  static std::string GetNameFromAttribute(const AttributeType & a);

  /**
   * Set/Get the label associated with the object.
   */
  const LabelType & GetLabel() const;

  void SetLabel(const LabelType & label);

  /**
   * Return true if the object contain the given index and false otherwise.
   * Worst case complexity is O(L) where L is the number of lines in the object.
   */
  bool HasIndex(const IndexType & idx) const;

  /**
   * Add an index to the object. If the index is already in the object, the index can
   * be found several time in the object.
   */
  void AddIndex(const IndexType & idx);

  /**
   * Remove an index to the object. Depending on the configuration, it can either
   * reduce the size of the corresponding line, add one more line, remove the line
   * from the line container.
   */
  bool RemoveIndex(const IndexType & idx );

  /**
   * Add a new line to the object, without any check.
   */
  void AddLine(const IndexType & idx, const LengthType & length);

  /**
   * Add a new line to the object, without any check.
   */
  void AddLine(const LineType & line);

  SizeValueType GetNumberOfLines() const;

  const LineType & GetLine(SizeValueType i) const;

  LineType & GetLine(SizeValueType i);

  /**
   * Returns the number of pixels contained in the object.
   *
   * \warning To get an accurate result, you need to make sure
   * there is no duplication in the line container. One way to
   * ensure this (at a cost) is to call the Optimize method.
   */
  SizeValueType Size() const;

  /**
   * Returns true if there no line in the container (and thus no pixel in
   * the object.
   */
  bool Empty() const;

  void Clear();

  /**
   * Get the index of the ith pixel associated with the object.
   * Valid indices are from 0 to LabelObject->GetSize() - 1.
   */
  IndexType GetIndex(SizeValueType i) const;

  /** Copy the attributes of another node to this one */
  virtual void CopyAttributesFrom(const Self *src);

  /** Copy the lines, the label and the attributes from another node. */
  void CopyAllFrom(const Self *src);

  /** Reorder the lines, merge the touching lines and ensure that no
   * pixel is covered by two lines
   */
  void Optimize();

  /** Shift the object position */
  void Shift( OffsetType offset );

  /** \class ConstLineIterator
   * \brief A forward iterator over the lines of a LabelObject
   * \ingroup ITKLabelMap
   */
  class ConstLineIterator
  {
  public:

    ConstLineIterator() {}

    ConstLineIterator(const Self *lo)
    {
      m_Begin = lo->m_LineContainer.begin();
      m_End = lo->m_LineContainer.end();
      m_Iterator = m_Begin;
    }

    ConstLineIterator(const ConstLineIterator & iter)
    {
      m_Iterator = iter.m_Iterator;
      m_Begin = iter.m_Begin;
      m_End = iter.m_End;
    }

    ConstLineIterator & operator=(const ConstLineIterator & iter)
    {
      m_Iterator = iter.m_Iterator;
      m_Begin = iter.m_Begin;
      m_End = iter.m_End;
      return *this;
    }

    const LineType & GetLine() const
    {
      return *m_Iterator;
    }

    ConstLineIterator operator++(int)
    {
      ConstLineIterator tmp = *this;
      ++(*this);
      return tmp;
    }

    ConstLineIterator & operator++()
    {
      ++m_Iterator;
      return *this;
    }

  bool operator==(const ConstLineIterator & iter) const
    {
    return m_Iterator == iter.m_Iterator && m_Begin == iter.m_Begin && m_End == iter.m_End;
    }

  bool operator!=(const ConstLineIterator & iter) const
    {
    return !( *this == iter );
    }

  void GoToBegin()
    {
      m_Iterator = m_Begin;
    }

    bool IsAtEnd() const
    {
      return m_Iterator == m_End;
    }

  private:
    typedef typename std::deque< LineType >            LineContainerType;
    typedef typename LineContainerType::const_iterator InternalIteratorType;
    InternalIteratorType m_Iterator;
    InternalIteratorType m_Begin;
    InternalIteratorType m_End;
  };

  /** \class ConstLineIterator
   * \brief A forward iterator over the indexes of a LabelObject
   * \ingroup ITKLabelMap
   */
  class ConstIndexIterator
  {
  public:

    ConstIndexIterator():
      m_Iterator(),
      m_Begin(),
      m_End()
        {
        m_Index.Fill(0);
        }

    ConstIndexIterator(const Self *lo)
    {
      m_Begin = lo->m_LineContainer.begin();
      m_End = lo->m_LineContainer.end();
      GoToBegin();
    }

    ConstIndexIterator(const ConstIndexIterator & iter)
    {
      m_Iterator = iter.m_Iterator;
      m_Index = iter.m_Index;
      m_Begin = iter.m_Begin;
      m_End = iter.m_End;
    }

    ConstIndexIterator & operator=(const ConstIndexIterator & iter)
    {
      m_Iterator = iter.m_Iterator;
      m_Index = iter.m_Index;
      m_Begin = iter.m_Begin;
      m_End = iter.m_End;
      return *this;
    }

    const IndexType & GetIndex() const
    {
      return m_Index;
    }

    ConstIndexIterator & operator++()
    {
      m_Index[0]++;
      if( m_Index[0] >= m_Iterator->GetIndex()[0] + (OffsetValueType)m_Iterator->GetLength() )
        {
        // we've reached the end of the line - go to the next one
        ++m_Iterator;
        NextValidLine();
        }
      return *this;
    }

    ConstIndexIterator operator++(int)
    {
      ConstIndexIterator tmp = *this;
      ++(*this);
      return tmp;
    }

    bool operator==(const ConstIndexIterator & iter) const
    {
      return m_Index == iter.m_Index && m_Iterator == iter.m_Iterator && m_Begin == iter.m_Begin && m_End == iter.m_End;
    }

    bool operator!=(const ConstIndexIterator & iter) const
    {
      return !( *this == iter );
    }

    void GoToBegin()
    {
      m_Iterator = m_Begin;
      m_Index.Fill(0);
      NextValidLine();
    }

    bool IsAtEnd() const
    {
      return m_Iterator == m_End;
    }

  private:

    typedef typename std::deque< LineType >            LineContainerType;
    typedef typename LineContainerType::const_iterator InternalIteratorType;
    void NextValidLine()
    {
      // search for the next valid position
      while( m_Iterator != m_End && m_Iterator->GetLength() == 0 )
        {
        ++m_Iterator;
        }
      if( m_Iterator != m_End )
        {
        m_Index = m_Iterator->GetIndex();
        }
    }

    InternalIteratorType m_Iterator;
    InternalIteratorType m_Begin;
    InternalIteratorType m_End;
    IndexType            m_Index;
  };

protected:
  LabelObject();
  virtual void PrintSelf(std::ostream & os, Indent indent) const ITK_OVERRIDE;

private:
  LabelObject(const Self &);    //purposely not implemented
  void operator=(const Self &); //purposely not implemented

  typedef typename std::deque< LineType >    LineContainerType;

  LineContainerType m_LineContainer;
  LabelType         m_Label;
};
} // end namespace itk

#ifndef ITK_MANUAL_INSTANTIATION
#include "itkLabelObject.hxx"
#endif

#endif


text:
namespace {

// Pointer to singleton object (NULL if no bubble is open).
ManagePasswordsBubbleGtk* g_bubble = NULL;

// Need to manually set anchor width and height to ensure that the bubble shows
// in the correct spot the first time it is displayed when no icon is present.
const int kBubbleAnchorWidth = 20;
const int kBubbleAnchorHeight = 25;

}  // namespace

// static
void ManagePasswordsBubbleGtk::ShowBubble(content::WebContents* web_contents) {
  Browser* browser = chrome::FindBrowserWithWebContents(web_contents);
  DCHECK(browser && browser->window() && browser->fullscreen_controller());

  LocationBar* location_bar = browser->window()->GetLocationBar();
  GtkWidget* anchor = browser->window()->IsFullscreen() ?
      GTK_WIDGET(browser->window()->GetNativeWindow()) :
      static_cast<LocationBarViewGtk*>(location_bar)->
          manage_passwords_icon_widget();

  g_bubble = new ManagePasswordsBubbleGtk(anchor,
                                          web_contents,
                                          browser->fullscreen_controller());
}

// static
void ManagePasswordsBubbleGtk::CloseBubble() {
  if (g_bubble)
    g_bubble->Close();
}

// static
bool ManagePasswordsBubbleGtk::IsShowing() {
  return g_bubble != NULL;
}

ManagePasswordsBubbleGtk::ManagePasswordsBubbleGtk(
    GtkWidget* anchor,
    content::WebContents* web_contents,
    FullscreenController* fullscreen_controller)
    : web_contents_(web_contents) {
  GtkThemeService* theme_service = GtkThemeService::GetFrom(
      Profile::FromBrowserContext(web_contents_->GetBrowserContext()));

  GtkWidget* bubble_contents_ = gtk_vbox_new(FALSE, ui::kControlSpacing);
  gtk_container_set_border_width(GTK_CONTAINER(bubble_contents_),
                                 ui::kContentAreaBorder);
  GtkWidget* label = theme_service->BuildLabel(
      l10n_util::GetStringUTF8(IDS_SAVE_PASSWORD), ui::kGdkBlack);
  gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5);
  gtk_box_pack_start(GTK_BOX(bubble_contents_), label, FALSE, FALSE, 0);

  GtkWidget* button_container = gtk_hbox_new(FALSE, 0);
  GtkWidget* nope_button = gtk_button_new_with_label(l10n_util::GetStringUTF8(
      IDS_PASSWORD_MANAGER_CANCEL_BUTTON).c_str());
  g_signal_connect(nope_button, "clicked",
                   G_CALLBACK(OnNotNowButtonClickedThunk), this);
  GtkWidget* save_button = gtk_button_new_with_label(
      l10n_util::GetStringUTF8(IDS_PASSWORD_MANAGER_SAVE_BUTTON).c_str());
  g_signal_connect(save_button, "clicked",
                   G_CALLBACK(OnSaveButtonClickedThunk), this);

  gtk_box_pack_end(GTK_BOX(button_container), save_button, FALSE, FALSE, 4);
  gtk_box_pack_end(GTK_BOX(button_container), nope_button, FALSE, FALSE, 0);
  gtk_box_pack_start(GTK_BOX(bubble_contents_), button_container, FALSE, FALSE,
                     0);
  gtk_widget_grab_focus(save_button);

  gfx::Rect rect = gfx::Rect(kBubbleAnchorWidth, kBubbleAnchorHeight);
  BubbleGtk::FrameStyle frame_style = gtk_widget_is_toplevel(anchor) ?
      BubbleGtk::FIXED_TOP_RIGHT : BubbleGtk::ANCHOR_TOP_RIGHT;
  bubble_ = BubbleGtk::Show(anchor,
                            &rect,
                            bubble_contents_,
                            frame_style,
                            BubbleGtk::MATCH_SYSTEM_THEME |
                                BubbleGtk::POPUP_WINDOW |
                                BubbleGtk::GRAB_INPUT,
                            theme_service,
                            NULL);

  g_signal_connect(bubble_contents_, "destroy",
                   G_CALLBACK(&OnDestroyThunk), this);
}

ManagePasswordsBubbleGtk::~ManagePasswordsBubbleGtk() {
  DCHECK_EQ(g_bubble, this);
  // Set singleton pointer to NULL.
  g_bubble = NULL;
}

void ManagePasswordsBubbleGtk::Close() {
  DCHECK(bubble_);
  bubble_->Close();
}

void ManagePasswordsBubbleGtk::OnDestroy(GtkWidget* widget) {
  // Listen to the destroy signal and delete this instance when it is caught.
  delete this;
}

void ManagePasswordsBubbleGtk::OnSaveButtonClicked(GtkWidget* button) {
  ManagePasswordsBubbleUIController::FromWebContents(web_contents_)->
      SavePassword();
  Close();
}

void ManagePasswordsBubbleGtk::OnNotNowButtonClicked(GtkWidget* button) {
  Close();
}


text:
package com.zs.tcp.senddata;

import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.io.IOException;
import java.text.ParseException;
import java.text.SimpleDateFormat;

public class AnalysisFile {
	private static SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmss");

	public static void main(String[] args) throws IOException, ParseException {
		String provinceID = "23";
		String startDateTime = "20170225000000";
		String endDateTime = "201702251100000";

		if (args != null && args.length >= 2) {
			startDateTime = args[0];
			endDateTime = args[1];
		} else {
			System.out.println("请给出开始和结束时间参数(yyyyMMddHHmmss)");
		}

		// 文件时间提前和延后1小时
		//long start = sdf.parse(startDateTime).getTime() / 1000 - 600;
		long start = sdf.parse(startDateTime).getTime() / 1000;
		//long end = sdf.parse(endDateTime).getTime() / 1000 + 600;
		long end = sdf.parse(endDateTime).getTime() / 1000;
		System.out.println(startDateTime + ":" + start + "," + endDateTime + ":" + end);

		BufferedReader br = null;
		String filePath = null;
//		filePath = "/Users/chenyunjie/Downloads/securecrtdownload/data/EVQMWorkingDir/CacheRa";
		filePath = "/data/EVQMWorkingDir/CacheRa";

		File dir = new File(filePath);

		File[] files = dir.listFiles();
		System.out.println("总文件数:" + files.length);
		long fileCount = 0;
		for (File file : files) {
			String fileName = file.getName();
			if (!fileName.endsWith(".csv")) {
				continue;
			}
			if (fileName.length() != 17) {
				continue;
			}
			long timestamp = Long.parseLong(fileName.substring(fileName.indexOf("_") + 1, fileName.indexOf(".")));
			if (timestamp < start || timestamp > end) {
				continue;
			}
			System.out.println("Progress:第" + ++fileCount + "个文件:" + file.getName());

			br = new BufferedReader(new FileReader(file));
			if (br != null) {
				String tmp = null;
				while ((tmp = br.readLine()) != null) {
					//PlayAnalysis.processLine(tmp, provinceID, startDateTime, endDateTime, fileName);
//					InfoAnalysis.processLine(tmp, provinceID, startDateTime, endDateTime, fileName);
//					StateAnalysis.processLine(tmp, provinceID, startDateTime, endDateTime, fileName);
					char c = 0x7f;
					String[] s= tmp.split(String.valueOf(c));
					 if(s.length>40){
						   if("3".equals(s[0]) && "23".equals(s[7])){
							   String probeID= s[4];
							   /*String kpiutcsec= s[23];
							   String hasID= s[1];
							   String freezeTime= s[14];
							   String downSeconds= s[24];*/
							   if(probeID.length()!=8){
								   System.out.println("++++"+probeID);
							   }
				    	}
					   }
				}
			}
		}
		br.close();
	}
}


text:
package tools;

import static tools.FileHandler.debugPrint;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.net.URL;
import java.util.ConcurrentModificationException;
import java.util.stream.Collectors;

import server.ClientConnection;
import server.Server;
import server.User;

/*
 *
 * @author Ben Sixel
 * Command Parser for commands coming from both server and remote clients.
 */

public class CommandParser {

	private static final String initStr = "Connected users:";

	/**
	 * Gets the nth occurrence of a string c in another string str.
	 * @param str The string we are searching within.
	 * @param c The string for which we need the nth place of occurrence.
	 * @param n The number representing which occurrence we are looking for.
	 * @return An int representing the position at which the string occurs for the nth time.
	 */
	public static int nthOccurrence(String str, String c, int n) {
		int pos = str.indexOf(c, 0);
		while (n-- > 0 && pos != -1)
			pos = str.indexOf(c, pos + 1);
		return pos;
	}

	/**
	 * Parses commands coming from the server itself.
	 * @param input The string which we are parsing.
	 * @param server The server which we will be working with/manipulating using the commands.
	 * @throws Emergency exception. In the server launcher we provide a catch to stop this from completely breaking the server.
	 */
	public static void parse(String input, Server server) throws Exception {
		String[] args = input.split(" ");
		String command = args[0];

		if (command.equalsIgnoreCase("/admin")) {
			if (args.length < 2) {
				debugPrint("Unable to parse command. Correct syntax: /admin <user>");
				return;
			}
			server.getUsers().forEach(u -> {
				if (u.getDisplayName().equalsIgnoreCase(args[1])) {
					try {
						u.sendCommand("*!admind Morthaden");
						String currAdmins = FileHandler.getProperty("admins");
						if (currAdmins == null || currAdmins.equals("")) {
							currAdmins = "";
							FileHandler.setProperty("admins", u.getID());
							debugPrint("Added " + args[1] + " as admin!");
							u.setAdmin(true);
							return;
						}
						String newAdmins = String.format("%1$s,%2$s", currAdmins, u.getID());
						FileHandler.setProperty("admins", newAdmins);
						System.out.println("Added " + args[1] + " as admin!");
						u.setAdmin(true);
					} catch (Exception e) {
						e.printStackTrace();
						debugPrint("Failed to add " + args[1] + " as admin!");
						debugPrint(e.getStackTrace()[0].toString());
					}
				}
			});
		} else if (command.equalsIgnoreCase("/users")) {
			System.out.println("Connected users: ");
			server.getUsers().forEach(u -> {
				System.out.println(u.getDisplayName() + ":" + u.getID());
			});
		} else if (command.equalsIgnoreCase("/password")) {
			if (args.length == 2) {
				server.setPassword(args[1]);
				System.out.println("New password: " + args[1]);
			} else {
				System.out.println("Password: '" + server.getPassword() + "'");
			}
		} else if (command.equalsIgnoreCase("/stop")) {
			FileHandler.saveProperties(server);
			debugPrint("Shutting down server.");
			System.exit(0);
		} else if (command.equalsIgnoreCase("/kick")) {
			if (args.length < 3) {
				debugPrint("Unable to parse command. Correct syntax: /kick <user> <reason>");
				return;
			}
			try {
				//server.killUser(args[1], input.split("'")[1]);
				server.getUsers().forEach(u -> {
					if (u.getDisplayName().equalsIgnoreCase(args[1])) {
						u.sendCommand("*!kick '" + input.split("'")[1] + "'");
					}
				});
			} catch (Exception e) {
				debugPrint(e.getStackTrace()[0].toString());
				debugPrint("Error! Input = " + input);
			}
		} else if (command.equalsIgnoreCase("/IP")) {
			try {
				System.out.println(new BufferedReader(new InputStreamReader(new URL("http://agentgatech.appspot.com").openStream())).readLine());
			} catch (Exception e) {
				FileHandler.debugPrint("Unable to get current IP!");
			}
		} else if (command.equalsIgnoreCase("/updateusers")) {
			String users = buildUsers(server);
			debugPrint("Updating connected users for clients.");
			server.getUsers().forEach(u -> {
				try {
					u.sendCommand("/updateusers " + users);
				} catch (Exception e) {
					debugPrint("Error notifying of new connection: " + e.getStackTrace()[0].toString());
				}
			});
		} else if (command.equalsIgnoreCase("/port")) {
			System.out.println(server.getPortStart());
		} else if (command.equalsIgnoreCase("/admins")) {
			String admins = FileHandler.getProperty("admins");
			if (admins == null || admins.equals("")) {
				System.out.println("No registered admins.");
			} else {
				System.out.printf("Registered admins: %1$s%n", admins);
			}
		}

		System.out.print("> ");
	}

	/**
	 * Build a string containing connected users.
	 * @param server The server whose users are being organized.
	 * @return A string composed of 'Connected users:' plus the connected users with commas in between.
	 */
	public static String buildUsers(Server server) {
		String str = initStr;
		for (User u:server.getUsers()) {
			if (str.split(" ").length < 3) {
				str += " " + u.getDisplayName();
			} else {
				str += ", " + u.getDisplayName();
			}
		};
		return str;
	}

	/**
	 * Parses commands coming in from remote clients and redistributes or enacts them.
	 * @param input The command and arguments for the command which are being parsed.
	 * @param client The client which is receiving the command's effects.
	 * @param selfClient The client sending the command.
	 */
	public static void parse(String input, ClientConnection client, ClientConnection selfClient) {

		String[] args = input.split(" ");
		String command = args[0];
		FileHandler.debugPrint("Got command on server side! Received: " + input);

		if (command.equals("*!tell:")) {
			if (client.getClientName().equalsIgnoreCase(args[2]) || args[2].equals("all")) {
				try {
					System.out.println("Message sent from " + args[1] + " to " + args[2]);
					client.getSendingData().writeObject(new DataPacket("message", selfClient.getClientName(), client.getClientName(), "From " + "[" + args[1] + " ] " + SystemInfo.getDate() +  ": " + input.substring(nthOccurrence(input, " ", 2)), null));
					client.getSendingData().reset();
				} catch (IOException e) {
					debugPrint(e.getStackTrace()[0].toString());
				}
			}
		} else if (command.equalsIgnoreCase("*!link:")) {
			if (client.getClientName().equalsIgnoreCase(args[1]) || args[1].equals("all")) {
				try {
					client.getSendingData().writeObject(new DataPacket("command", selfClient.getClientName(), client.getClientName(), "/linkopen" + input.substring(input.indexOf(" ")), null));
				} catch (IOException e) {
					debugPrint(e.getStackTrace()[0].toString());
				}
			}
		} else if (command.equalsIgnoreCase("*!users:")) {
			if (client.getClientName().equalsIgnoreCase(args[1])) {
				try {
					client.getSendingData().writeObject(new DataPacket("message", selfClient.getClientName(), client.getClientName(), "Connected users: " + client.getServer().getUsers().stream().map(e -> e.getCC().getClientName()).collect(Collectors.toList()).toString(), null));
				} catch (IOException e) {
					debugPrint(e.getStackTrace()[0].toString());
				}
			}
		} else if (command.equalsIgnoreCase("*!declineDL")) {
			FileHandler.debugPrint("Server received a *!declineDL!");
			if (client.getClientName().equalsIgnoreCase(args[1])) {
				try {
					client.getSendingData().writeObject(new DataPacket("command", selfClient.getClientName(), client.getClientName(), "/declineDL" + input.substring(input.indexOf(" ")), null));
				} catch (IOException e) {
					debugPrint(e.getStackTrace()[0].toString());
				}
			}
		} else if (command.equalsIgnoreCase("*!declineimg:")) {
			if (client.getClientName().equalsIgnoreCase(args[1])) {
				try {
					client.getSendingData().writeObject(new DataPacket("command", selfClient.getClientName(), client.getClientName(), "/declineimg" + input.substring(input.indexOf(" ")), null));
				} catch (IOException e) {
					debugPrint(e.getStackTrace()[0].toString());
				}
			}
		} else if (command.equalsIgnoreCase("*!youtube")) {
			if (client.getClientName().equalsIgnoreCase(args[1]) || args[1] .equalsIgnoreCase("all")) {
				try {
					client.getSendingData().writeObject(new DataPacket("command", selfClient.getClientName(), client.getClientName(), "/youtubeplay" + input.substring(input.indexOf(" ")), null));
				} catch (IOException e) {
					debugPrint(e.getStackTrace()[0].toString());
				}
			}
		} else if (command.equalsIgnoreCase("*!kick") && (selfClient.getUser().isAdmin() || FileHandler.getProperty("admins").contains(selfClient.getUser().getID()))) {
			try {
				client.getServer().killUser(args[1], input.split("'")[1]);
			} catch (ConcurrentModificationException e) {
				debugPrint(e.getStackTrace()[0].toString());
				debugPrint("Unable to kill user - another thread had already done so!");
			}
		} else if (command.equalsIgnoreCase("*!disconnect")) {
			client.getServer().killUser(args[1], input.split("'")[1]);
		}
	}

}


text:
<!DOCTYPE HTML>

<meta charset="UTF-8"/>
<title> Quoi de neuf dans Barcode Scanner </title>
<link href="../style.css" rel="stylesheet" type="text/css"/>

 La fonction Historique peut être désactivée

 Corrections de bugs

Traduit par Google Translate.


text:
{% extends 'emails/root.html' %}

{% block preview_text %}
Your message is now on its way!
{% endblock %}

{% block content %}

Your message will be sent to {% with %}{% set legislators = context.legislators %}{% include 'snippets/leg_full_title_and_full_name_loop.html' %}{% endwith %}

            {% include 'emails/_thank_you.html' %}

{% endblock %}


text:
module ReviewHelper
  def last_updated(proposal)
    proposal.updated_at.strftime("%r %D")
  end

  def notes_for(proposal)
    notes = proposal.notes_for_user(current_user)
    if notes then "(#{ notes.content.truncate(50) })" else '' end
  end

  def scrub_vars_for(response)
    {
      scrub:       response.scrub || Scrub.new, #I'm so damn lazy.
      response_id: response.id,
      passed_blind_level: response.question.blind.level + 1
    }
  end
end


text:
/* TEMPLATE GENERATED TESTCASE FILE
Filename: CWE401_Memory_Leak__struct_twoIntsStruct_malloc_84_bad.cpp
Label Definition File: CWE401_Memory_Leak.c.label.xml
Template File: sources-sinks-84_bad.tmpl.cpp
*/
/*
 * @description
 * CWE: 401 Memory Leak
 * BadSource: malloc Allocate data using malloc()
 * GoodSource: Allocate data on the stack
 * Sinks:
 *    GoodSink: call free() on data
 *    BadSink : no deallocation of data
 * Flow Variant: 84 Data flow: data passed to class constructor and destructor by declaring the class object on the heap and deleting it after use
 *
 * */
#ifndef OMITBAD

#include "std_testcase.h"
#include "CWE401_Memory_Leak__struct_twoIntsStruct_malloc_84.h"

namespace CWE401_Memory_Leak__struct_twoIntsStruct_malloc_84
{
CWE401_Memory_Leak__struct_twoIntsStruct_malloc_84_bad::CWE401_Memory_Leak__struct_twoIntsStruct_malloc_84_bad(struct _twoIntsStruct * dataCopy)
{
    data = dataCopy;
    /* POTENTIAL FLAW: Allocate memory on the heap */
    data = (struct _twoIntsStruct *)malloc(100*sizeof(struct _twoIntsStruct));
    if (data == NULL) {exit(-1);}
    /* Initialize and make use of data */
    data[0].intOne = 0;
    data[0].intTwo = 0;
    printStructLine((twoIntsStruct *)&data[0]);
}

CWE401_Memory_Leak__struct_twoIntsStruct_malloc_84_bad::~CWE401_Memory_Leak__struct_twoIntsStruct_malloc_84_bad()
{
    /* POTENTIAL FLAW: No deallocation */
    ; /* empty statement needed for some flow variants */
}
}
#endif /* OMITBAD */


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.Filters;

namespace EasyRbac.Web.WebExtentions
{
    public class ModelVerifyFilter : ActionFilterAttribute
    {
        /// <inheritdoc />
        public override void OnActionExecuting(ActionExecutingContext context)
        {
            if (!context.ModelState.IsValid)
            {
                context.Result = new BadRequestObjectResult(context.ModelState);
            }
            else
            {
                base.OnActionExecuting(context);
            }
        }
    }
}


text:
//
//  CRWebViewController.h
//  TestWebView
//
//  Created by cocoaroger on 16/8/18.
//  Copyright © 2016年 cocoaroger. All rights reserved.
//

#import <UIKit/UIKit.h>
#import "CRBaseController.h"
#import "CRNavigationController.h"

/**
 *  自定义的带有关闭和返回按钮
 *  最好以navigationController承载
 */
@interface CRWebViewController : CRBaseController

- (instancetype)initWithTitle:(NSString *)title URL:(NSString *)URL;

+ (CRNavigationController *)webControllerWithTitle:(NSString *)title URL:(NSString *)URL;

@end


text:
import styled from 'styled-components';
import { DESKTOP_BREAKPOINT, LINE_HEIGHT, PAGE_COLUMNS_SPAN, TAB } from 'config';

const Page = styled.div`
  padding: 0 ${TAB} ${LINE_HEIGHT};

  @media screen and (min-width: ${DESKTOP_BREAKPOINT}) {
    display: grid;
    grid-column-gap: ${TAB};
    grid-template-columns: repeat(${PAGE_COLUMNS_SPAN}, 1fr);
  }
`;

export default Page;


text:
<!doctype html>

	<meta charset="utf-8">
	<meta http-equiv="X-UA-Compatible" content="IE=edge">
	<title>"core/on" | ninejs</title>
	<meta name="description" content="">
	<meta name="viewport" content="width=device-width, initial-scale=1">
	<link rel="stylesheet" href="../assets/css/main.css">

						Search
						<input id="tsd-search-field" type="text" />

Preparing search index...

The search index is not available

					ninejs

						Options

								All

Public

Public/Protected

All

							<input type="checkbox" id="tsd-filter-inherited" checked />
							Inherited
							<input type="checkbox" id="tsd-filter-only-exported" />
							Only exported

					Menu

					Globals

					"core/on"

External module "core/on"

Index

Classes

Event<wbr>Handler

IESignal

Interfaces

Pausable<wbr>Result

Removable<wbr>Type

Variables

_dojoIEListeners_

_window

dojo

emit

has

is<wbr>Node

j<wbr>Query

major

on

once

pausable

process

require

Functions

get<wbr>Selector

Variables

_dojoIEListeners_

_dojoIEListeners_: function[]

Defined in core/on.ts:64

Type declaration

(e?: any): void

Parameters

Optional e: any

Returns void

_window

_window: any

Defined in core/on.ts:65

dojo

dojo: any

Defined in core/on.ts:13

emit

emit: function

Defined in core/on.ts:699

Type declaration

(target: any, type: string, event: any): any

Parameters

target: any

type: string

event: any

Returns any

has

has: any

Defined in core/on.ts:57

is<wbr>Node

is<wbr>Node: boolean

Defined in core/on.ts:16

j<wbr>Query

j<wbr>Query: any

Defined in core/on.ts:12

major

major: any

Defined in core/on.ts:66

on

on: object

Defined in core/on.ts:137

Type declaration

(target: any, type: string, listener: function, dontFix?: boolean): RemovableType

Parameters

target: any

type: string

listener: function

(e: any): any

Parameters

e: any

Returns any

Optional dontFix: boolean

Returns RemovableType

_fix<wbr>Event: function

(evt: any, sender: any): any

Parameters

evt: any

sender: any

Returns any

_prevent<wbr>Default: function

(): void

Returns void

emit: function

(target: any, type: string, event: any): any

Parameters

target: any

type: string

event: any

Returns any

once: function

(target: any, type: string, listener: function, dontFix?: boolean): RemovableType

Parameters

target: any

type: string

listener: function

(e: any): any

Parameters

e: any

Returns any

Optional dontFix: boolean

Returns RemovableType

parse: function

(target: any, type: any, listener: function, addListener?: any, dontFix?: boolean, matchesTarget?: any): RemovableType

Parameters

target: any

type: any

listener: function

(e: any): any

Parameters

e: any

Returns any

Optional addListener: any

Optional dontFix: boolean

Optional matchesTarget: any

Returns RemovableType

pausable: function

(target: any, type: string, listener: function, dontFix?: boolean): PausableResult

Parameters

target: any

type: string

listener: function

(e: any): any

Parameters

e: any

Returns any

Optional dontFix: boolean

Returns PausableResult

selector: function

(selector: string, eventType: string, children?: boolean): function

Parameters

selector: string

eventType: string

Optional children: boolean

Returns function

(target: any, listener: function): RemovableType

Parameters

target: any

listener: function

(e?: any): any

Parameters

Optional e: any

Returns any

Returns RemovableType

once

once: function

Defined in core/on.ts:701

Type declaration

(target: any, type: string, listener: function, dontFix?: boolean): RemovableType

Parameters

target: any

type: string

listener: function

(e: any): any

Parameters

e: any

Returns any

Optional dontFix: boolean

Returns RemovableType

pausable

pausable: function

Defined in core/on.ts:700

Type declaration

(target: any, type: string, listener: function, dontFix?: boolean): PausableResult

Parameters

target: any

type: string

listener: function

(e: any): any

Parameters

e: any

Returns any

Optional dontFix: boolean

Returns PausableResult

process

process: any

Defined in core/on.ts:11

require

require: any

Defined in core/on.ts:14

Functions

get<wbr>Selector

get<wbr>Selector(): any

Defined in core/on.ts:17

Returns any

						Globals

						"core/on"

						Event<wbr>Handler

						IESignal

						Pausable<wbr>Result

						Removable<wbr>Type

						_dojoIEListeners_

						_window

						dojo

						emit

						has

						is<wbr>Node

						j<wbr>Query

						major

						on

						once

						pausable

						process

						require

						get<wbr>Selector

Legend

Module

Object literal

Variable

Function

Function with type parameter

Index signature

Type alias

Enumeration

Enumeration member

Property

Method

Interface

Interface with type parameter

Constructor

Property

Method

Index signature

Class

Class with type parameter

Constructor

Property

Method

Accessor

Index signature

Inherited constructor

Inherited property

Inherited method

Inherited accessor

Protected property

Protected method

Protected accessor

Private property

Private method

Private accessor

Static property

Static method

Generated using TypeDoc


text:
namespace chromeos {

// Dialog which embeds the Parent Access UI, which verifies a parent during
// a child session.
class ParentAccessDialog : public SystemWebDialogDelegate {
 public:
  // Error state returned by the Show() function.
  enum ShowError { kNone, kDialogAlreadyVisible, kNotAChildUser };

  // Shows the dialog; if the dialog is already displayed, this returns an
  // error.
  // TODO(b/200853161): Add parameter which is passed over the the Mojo bridge.
  static ShowError Show();

  static ParentAccessDialog* GetInstance();

  explicit ParentAccessDialog(const ParentAccessDialog&) = delete;
  ParentAccessDialog& operator=(const ParentAccessDialog&) = delete;

  // ui::WebDialogDelegate:
  ui::ModalType GetDialogModalType() const override;
  void GetDialogSize(gfx::Size* size) const override;
  bool ShouldCloseDialogOnEscape() const override;

 protected:
  // TODO(b/200853161): Add parameter which is passed over the the Mojo bridge.
  ParentAccessDialog();
  ~ParentAccessDialog() override;
};

}  // namespace chromeos

#endif  // CHROME_BROWSER_UI_WEBUI_CHROMEOS_PARENT_ACCESS_PARENT_ACCESS_DIALOG_H_


text:
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

namespace DefaultReverseEngineering
{
    [Table("ProductDescription", Schema = "Production")]
    public partial class ProductDescription
    {
        public ProductDescription()
        {
            ProductModelProductDescriptionCulture = new HashSet<ProductModelProductDescriptionCulture>();
        }

        public int ProductDescriptionID { get; set; }
        [Required]
        [MaxLength(400)]
        public string Description { get; set; }
        public DateTime ModifiedDate { get; set; }
        public Guid rowguid { get; set; }

        [InverseProperty("ProductDescription")]
        public virtual ICollection<ProductModelProductDescriptionCulture> ProductModelProductDescriptionCulture { get; set; }
    }
}


text:
package com.github.ambry.store;

import com.github.ambry.clustermap.DiskId;
import com.github.ambry.clustermap.PartitionId;
import com.github.ambry.clustermap.ReplicaId;
import com.github.ambry.clustermap.ReplicaStatusDelegate;
import com.github.ambry.config.DiskManagerConfig;
import com.github.ambry.config.StoreConfig;
import com.github.ambry.utils.Throttler;
import com.github.ambry.utils.Time;
import com.github.ambry.utils.Utils;
import java.io.File;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicInteger;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * Manages all the stores on a disk.
 */
class DiskManager {

  private final Map<PartitionId, BlobStore> stores = new HashMap<>();
  private final Map<PartitionId, ReplicaId> partitionToReplicaMap = new HashMap<>();
  private final DiskId disk;
  private final StorageManagerMetrics metrics;
  private final Time time;
  private final DiskIOScheduler diskIOScheduler;
  private final ScheduledExecutorService longLivedTaskScheduler;
  private final DiskSpaceAllocator diskSpaceAllocator;
  private final CompactionManager compactionManager;
  private final List<String> stoppedReplicas;
  private final ReplicaStatusDelegate replicaStatusDelegate;
  private final Set<String> expectedDirs = new HashSet<>();
  private boolean running = false;

  private static final Logger logger = LoggerFactory.getLogger(DiskManager.class);

  /**
   * Constructs a {@link DiskManager}
   * @param disk representation of the disk.
   * @param replicas all the replicas on this disk.
   * @param storeConfig the settings for store configuration.
   * @param diskManagerConfig the settings for disk manager configuration.
   * @param scheduler the {@link ScheduledExecutorService} for executing background tasks.
   * @param metrics the {@link StorageManagerMetrics} instance to use.
   * @param storeMainMetrics the {@link StoreMetrics} object used for store-related metrics.
   * @param storeUnderCompactionMetrics the {@link StoreMetrics} object used by stores created for compaction.
   * @param keyFactory the {@link StoreKeyFactory} for parsing store keys.
   * @param recovery the {@link MessageStoreRecovery} instance to use.
   * @param hardDelete the {@link MessageStoreHardDelete} instance to use.
   * @param time the {@link Time} instance to use.
   */
  DiskManager(DiskId disk, List<ReplicaId> replicas, StoreConfig storeConfig, DiskManagerConfig diskManagerConfig,
      ScheduledExecutorService scheduler, StorageManagerMetrics metrics, StoreMetrics storeMainMetrics,
      StoreMetrics storeUnderCompactionMetrics, StoreKeyFactory keyFactory, MessageStoreRecovery recovery,
      MessageStoreHardDelete hardDelete, ReplicaStatusDelegate replicaStatusDelegate, List<String> stoppedReplicas,
      Time time) {
    this.disk = disk;
    this.metrics = metrics;
    this.time = time;
    diskIOScheduler = new DiskIOScheduler(getThrottlers(storeConfig, time));
    longLivedTaskScheduler = Utils.newScheduler(1, true);
    File reserveFileDir = new File(disk.getMountPath(), diskManagerConfig.diskManagerReserveFileDirName);
    diskSpaceAllocator = new DiskSpaceAllocator(diskManagerConfig.diskManagerEnableSegmentPooling, reserveFileDir,
        diskManagerConfig.diskManagerRequiredSwapSegmentsPerSize, metrics);
    this.replicaStatusDelegate = replicaStatusDelegate;
    this.stoppedReplicas = stoppedReplicas;
    expectedDirs.add(reserveFileDir.getAbsolutePath());
    for (ReplicaId replica : replicas) {
      if (disk.equals(replica.getDiskId())) {
        BlobStore store =
            new BlobStore(replica, storeConfig, scheduler, longLivedTaskScheduler, diskIOScheduler, diskSpaceAllocator,
                storeMainMetrics, storeUnderCompactionMetrics, keyFactory, recovery, hardDelete, replicaStatusDelegate,
                time);
        stores.put(replica.getPartitionId(), store);
        partitionToReplicaMap.put(replica.getPartitionId(), replica);
        expectedDirs.add(replica.getReplicaPath());
      }
    }
    compactionManager = new CompactionManager(disk.getMountPath(), storeConfig, stores.values(), metrics, time);
  }

  /**
   * Starts all the stores on this disk.
   * @throws InterruptedException
   */
  void start() throws InterruptedException {
    long startTimeMs = time.milliseconds();
    final AtomicInteger numStoreFailures = new AtomicInteger(0);
    try {
      checkMountPathAccessible();

      List<Thread> startupThreads = new ArrayList<>();
      for (final Map.Entry<PartitionId, BlobStore> partitionAndStore : stores.entrySet()) {
        if (stoppedReplicas.contains(partitionAndStore.getKey().toPathString())) {
          logger.info("Skip the store {} because it is on the stopped list", partitionAndStore.getKey());
          continue;
        }
        Thread thread = Utils.newThread("store-startup-" + partitionAndStore.getKey(), () -> {
          try {
            partitionAndStore.getValue().start();
          } catch (Exception e) {
            numStoreFailures.incrementAndGet();
            logger.error("Exception while starting store for the partition" + partitionAndStore.getKey(), e);
          }
        }, false);
        thread.start();
        startupThreads.add(thread);
      }
      for (Thread startupThread : startupThreads) {
        startupThread.join();
      }
      if (numStoreFailures.get() > 0) {
        logger.error(
            "Could not start " + numStoreFailures.get() + " out of " + stores.size() + " stores on the disk " + disk);
      }

      // DiskSpaceAllocator startup. This happens after BlobStore startup because it needs disk space requirements
      // from each store.
      List<DiskSpaceRequirements> requirementsList = new ArrayList<>();
      for (BlobStore blobStore : stores.values()) {
        if (blobStore.isStarted()) {
          DiskSpaceRequirements requirements = blobStore.getDiskSpaceRequirements();
          if (requirements != null) {
            requirementsList.add(requirements);
          }
        }
      }
      diskSpaceAllocator.initializePool(requirementsList);
      compactionManager.enable();
      reportUnrecognizedDirs();
      running = true;
    } catch (StoreException e) {
      logger.error("Error while starting the DiskManager for " + disk.getMountPath()
          + " ; no stores will be accessible on this disk.", e);
    } finally {
      if (!running) {
        metrics.totalStoreStartFailures.inc(stores.size());
        metrics.diskDownCount.inc();
      } else {
        metrics.totalStoreStartFailures.inc(numStoreFailures.get());
      }
      metrics.diskStartTimeMs.update(time.milliseconds() - startTimeMs);
    }
  }

  /**
   * Shuts down all the stores on this disk.
   * @throws InterruptedException
   */
  void shutdown() throws InterruptedException {
    long startTimeMs = time.milliseconds();
    try {
      running = false;
      compactionManager.disable();
      diskIOScheduler.disable();
      final AtomicInteger numFailures = new AtomicInteger(0);
      List<Thread> shutdownThreads = new ArrayList<>();
      for (final Map.Entry<PartitionId, BlobStore> partitionAndStore : stores.entrySet()) {
        if (!partitionAndStore.getValue().isStarted()) {
          continue;
        }
        Thread thread = Utils.newThread("store-shutdown-" + partitionAndStore.getKey(), () -> {
          try {
            partitionAndStore.getValue().shutdown();
          } catch (Exception e) {
            numFailures.incrementAndGet();
            metrics.totalStoreShutdownFailures.inc();
            logger.error("Exception while shutting down store {} on disk {}", partitionAndStore.getKey(), disk, e);
          }
        }, false);
        thread.start();
        shutdownThreads.add(thread);
      }
      for (Thread shutdownThread : shutdownThreads) {
        shutdownThread.join();
      }
      if (numFailures.get() > 0) {
        logger.error(
            "Could not shutdown " + numFailures.get() + " out of " + stores.size() + " stores on the disk " + disk);
      }
      compactionManager.awaitTermination();
      longLivedTaskScheduler.shutdown();
      if (!longLivedTaskScheduler.awaitTermination(30, TimeUnit.SECONDS)) {
        logger.error("Could not terminate long live tasks after DiskManager shutdown");
      }
    } finally {
      metrics.diskShutdownTimeMs.update(time.milliseconds() - startTimeMs);
    }
  }

  /**
   * @param id the {@link PartitionId} to find the store for.
   * @return the associated {@link Store}, or {@code null} if the partition is not on this disk, or the store is not
   *         started.
   */
  Store getStore(PartitionId id) {
    BlobStore store = stores.get(id);
    return (running && store != null && store.isStarted()) ? store : null;
  }

  /**
   * @return {@code true} if the compaction thread is running. {@code false} otherwise.
   */
  boolean isCompactionExecutorRunning() {
    return compactionManager.isCompactionExecutorRunning();
  }

  /**
   * @return the {@link DiskId} that is managed by this {@link DiskManager}.
   */
  DiskId getDisk() {
    return disk;
  }

  /**
   * Schedules the {@link PartitionId} {@code id} for compaction next.
   * @param id the {@link PartitionId} of the {@link BlobStore} to compact.
   * @return {@code true} if the scheduling was successful. {@code false} if not.
   */
  boolean scheduleNextForCompaction(PartitionId id) {
    BlobStore store = (BlobStore) getStore(id);
    return store != null && compactionManager.scheduleNextForCompaction(store);
  }

  /**
   * Disable compaction on the {@link PartitionId} {@code id}.
   * @param id the {@link PartitionId} of the {@link BlobStore} on which compaction is disabled or enabled.
   * @param enabled whether to enable ({@code true}) or disable.
   * @return {@code true} if disabling was successful. {@code false} if not.
   */
  boolean controlCompactionForBlobStore(PartitionId id, boolean enabled) {
    BlobStore store = stores.get(id);
    return store != null && compactionManager.controlCompactionForBlobStore(store, enabled);
  }

  /**
   * Start the BlobStore with given {@link PartitionId} {@code id}.
   * @param id the {@link PartitionId} of the {@link BlobStore} which should be started.
   * @return {@code true} if start store was successful. {@code false} if not.
   */
  boolean startBlobStore(PartitionId id) {
    BlobStore store = stores.get(id);
    if (store == null || !running) {
      return false;
    } else if (store.isStarted()) {
      return true;
    } else {
      try {
        store.start();
      } catch (Exception e) {
        logger.error("Exception while starting store {} on disk {}", id, disk, e);
        return false;
      }
      return true;
    }
  }

  /**
   * Shutdown the BlobStore with given {@link PartitionId} {@code id}.
   * @param id the {@link PartitionId} of the {@link BlobStore} which should be shutdown.
   * @return {@code true} if shutdown store was successful. {@code false} if not.
   */
  boolean shutdownBlobStore(PartitionId id) {
    BlobStore store = stores.get(id);
    if (store == null || !running) {
      return false;
    } else if (!store.isStarted()) {
      return true;
    } else {
      try {
        store.shutdown();
      } catch (Exception e) {
        logger.error("Exception while shutting down store {} on disk {}", id, disk, e);
        return false;
      }
      return true;
    }
  }

  /**
   * Set the BlobStore stopped state with given {@link PartitionId} {@code id}.
   * @param partitionIds a list of {@link PartitionId} of the {@link BlobStore} whose stopped state should be set.
   * @param markStop whether to mark BlobStore as stopped ({@code true}) or started.
   * @return a list of {@link PartitionId} whose stopped state fails to be updated.
   */
  List<PartitionId> setBlobStoreStoppedState(List<PartitionId> partitionIds, boolean markStop) {
    Set<PartitionId> failToUpdateStores = new HashSet<>();
    List<ReplicaId> replicasToUpdate = new ArrayList<>();
    for (PartitionId id : partitionIds) {
      BlobStore store = stores.get(id);
      if (store == null) {
        // no need to check if the store is started because this method could be called after store is successfully shutdown.
        logger.error("store is not found on this disk when trying to update stoppedReplicas list");
        failToUpdateStores.add(id);
      } else {
        replicasToUpdate.add(partitionToReplicaMap.get(id));
      }
    }
    boolean updated = false;
    if (replicaStatusDelegate != null) {
      logger.trace("Setting replica stopped state via ReplicaStatusDelegate on replica {}",
          Arrays.toString(replicasToUpdate.toArray()));
      updated = markStop ? replicaStatusDelegate.markStopped(replicasToUpdate)
          : replicaStatusDelegate.unmarkStopped(replicasToUpdate);
    } else {
      logger.warn("The ReplicaStatusDelegate is not instantiated");
    }
    if (!updated) {
      // either mark/unmark operation fails or ReplicaStatusDelegate is not instantiated.
      failToUpdateStores.addAll(partitionIds);
    }
    return new ArrayList<>(failToUpdateStores);
  }

  /**
   * Gets all the throttlers that the {@link DiskIOScheduler} will be constructed with.
   * @param config the {@link StoreConfig} with configuration values.
   * @param time the {@link Time} instance to use in the throttlers
   * @return the throttlers that the {@link DiskIOScheduler} will be constructed with.
   */
  private Map<String, Throttler> getThrottlers(StoreConfig config, Time time) {
    Map<String, Throttler> throttlers = new HashMap<>();
    // compaction ops
    Throttler compactionOpsThrottler = new Throttler(config.storeCompactionOperationsBytesPerSec, -1, true, time);
    throttlers.put(BlobStoreCompactor.COMPACTION_CLEANUP_JOB_NAME, compactionOpsThrottler);
    // hard delete ops
    Throttler hardDeleteOpsThrottler = new Throttler(config.storeHardDeleteOperationsBytesPerSec, -1, true, time);
    throttlers.put(HardDeleter.HARD_DELETE_CLEANUP_JOB_NAME, hardDeleteOpsThrottler);
    // stats
    Throttler statsIndexScanThrottler = new Throttler(config.storeStatsIndexEntriesPerSecond, 1000, true, time);
    throttlers.put(BlobStoreStats.IO_SCHEDULER_JOB_TYPE, statsIndexScanThrottler);
    return throttlers;
  }

  /**
   * @throws StoreException if the disk's mount path is inaccessible.
   */
  private void checkMountPathAccessible() throws StoreException {
    File mountPath = new File(disk.getMountPath());
    if (!mountPath.exists()) {
      metrics.diskMountPathFailures.inc();
      throw new StoreException("Mount path does not exist: " + mountPath + " ; cannot start stores on this disk",
          StoreErrorCodes.Initialization_Error);
    }
  }

  /**
   * Check if all stores on this disk are down.
   * @return {@code true} if all stores are down. {@code false} at least one store is up.
   */
  boolean areAllStoresDown() {
    for (BlobStore store : stores.values()) {
      if (store.isStarted()) {
        return false;
      }
    }
    return true;
  }

  /**
   * Reports any unrecognized directories on disk
   */
  private void reportUnrecognizedDirs() {
    File[] dirs = new File(disk.getMountPath()).listFiles(File::isDirectory);
    if (dirs == null) {
      metrics.diskMountPathFailures.inc();
      logger.warn("Could not list the directories in {}", disk.getMountPath());
    } else {
      List<String> unexpectedDirs = new ArrayList<>();
      for (File dir : dirs) {
        String absPath = dir.getAbsolutePath();
        if (!expectedDirs.contains(absPath)) {
          unexpectedDirs.add(absPath);
        }
      }
      if (unexpectedDirs.size() > 0) {
        logger.warn("Encountered unexpected dirs in {} : {}", disk.getMountPath(), unexpectedDirs);
        metrics.unexpectedDirsOnDisk.inc(unexpectedDirs.size());
      }
    }
  }
}


text:
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <title>W29366_text</title>
        <link rel="stylesheet" type="text/css" href="style.css" />

                «

    <p class="styleSans6.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle>">9/9/2014

    <p class="styleSans7.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle>">WeIES on Pad: 2 Well Name: Rader 2-24H Rig: Nabors 829 Prospect: Williston Target: Middle Bakken Spacing: 1280

    <p class="styleSans313.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle>">E] Pre—Sta ked
Staked Rig Grade Elevation: 2211' KB: 25' RKB: 2236'

FORMATION Pierre Shale Greenhom
Dakota Group (fka Mowry) Basal Dakota Sand Dunham Salt Top Dunham Salt Base Pine Salt Top
Pine Salt Base Minnekahta Opeche Salt Top Opeche Salt Base Minnelusa Group
SUBS EA TVD
2,508 —2,880 —3,762 -4,080 -4,110 —5,1 10 -5,188 6,232 6,292 -5,330 -5,576 -5,705 -6,288 —6,435 -7,145 —7,356 —7,967 -8,689 —8,708 ~8,721 -8,771
4,744 5,116 5,998 6,316
7,346 7,424 7,468 7,528 7,566 7,812 7,941

_|
, a: (D 2'1
0p Charles
Base Last Charles Salt
Mission Canyon odgepoie
pper Bakken Shale
Middle Bakken Member
Middle Bakken Target
End of Lateral
8,671
9,592 10,203
C
10,944 10,957 11,007

    <p class="styleSans6.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle>">

    <p class="styleSans8.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle>">GEOLOGEC PROGNOSiS

    <p class="styleSans7.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle>">SHL: 599 FNL
Sec. 24 Williams BHL: 200 FSL Sec. 25
Williams

    <p class="styleSans7.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle>">

    <p class="styleSans7.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle>">1428' FWL
154N ~ 100W ND
660' FWL 154N 100W
ND


text:
import curry from 'lodash/curry';
import flow from 'lodash/flow';

import { throwInDev, throwTypeError } from '../throwInDev';
import { SizeRecord } from '../../constants/flowdesigner.model';
import { SizeRecord as SizeRecordType } from '../../customTypings/index.d';

/**
 * @desc Represent a size comprised of width and height
 * avoid reading directly, use the Size module api
 * Do not mutate it manually, use the Size module api
 * @example
Create a Size

 * const size = Size.create(100, 200);
 * @example
Read from Size

 * const width = Size.getWidth(size);
 * @example
transform a Size

 * const size = Size.setWidth(100, size);
 * @typedef {Immutable.Record} SizeRecord
 */

/**
 * check if parameter is SizeRecord
 * @param {*} size
 * @return {bool}
 */
export function isSize(size: SizeRecordType) {
	if (size && size instanceof SizeRecord) {
		return true;
	}
	return false;
}

/**
 * check if parameter is SizeRecord else throw in dev mode
 * @param {*} size
 * @return {bool}
 */
export function isSizeElseThrow(size: SizeRecordType) {
	const test = isSize(size);
	if (!test) {
		throwTypeError('SizeRecord', size, 'Size');
	}
	return test;
}

/**
 * return width of SizeRecord
 * @param {SizeRecord} size
 * @return {number}
 */
export function getWidth(size: SizeRecordType) {
	if (isSizeElseThrow(size)) {
		return size.get('width');
	}
	return null;
}

/**
 * set width of given SizeRecord
 * @function
 * @param {number} width
 * @param {SizeRecord} size
 * @return {SizeRecord}
 */
export const setWidth = curry((width: number, size: SizeRecordType) => {
	if (isSizeElseThrow(size) && typeof width === 'number') {
		return size.set('width', width);
	}
	throwInDev(`width should be a number, was given ${width.toString()}  of type ${typeof width}`);
	return size;
});

/**
 * return height of the SizeRecord
 * @param {SizeRecord} size
 * @return {number}
 */
export function getHeight(size: SizeRecordType) {
	if (isSizeElseThrow(size)) {
		return size.get('height');
	}
	return null;
}

/**
 * set height of given SizeRecord
 * @function
 * @param {number} height
 * @param {SizeRecord} size
 * @returns {SizeRecord}
 */
export const setHeight = curry((height: number, size: SizeRecordType) => {
	if (isSizeElseThrow(size) && typeof height === 'number') {
		return size.set('height', height);
	}
	throwInDev(
		`height should be a number, was given ${height.toString()}  of type ${typeof height}`,
	);
	return size;
});

/**
 * given width and height create a SizeRecord
 * @function
 * @param {number} width
 * @param {number} height
 * @return {SizeRecord}
 */
export const create = curry((width: number, height: number) =>
	flow([setWidth(width), setHeight(height)])(new SizeRecord()),
);


text:
import compareAttributes from './attributes';
import compareEvents from './events';
import compareProperties from './properties';

export default function (src, tar) {
  if (src.localName === tar.localName) {
    return compareAttributes(src, tar)
      .concat(compareEvents(src, tar))
      .concat(compareProperties(src, tar));
  }
}


text:
package de.fau.cs.mad.yasme.android.storage.dao;

import de.fau.cs.mad.yasme.android.entities.User;

import java.util.List;

/**
 * Created by Benedikt Lorch <benedikt.lorch@studium.fau.de> on 10.07.14.
 */
public interface UserDAO extends DAO<User> {

    /**
     * Create a new row in the database from an object. The id field will be modified and set with the corresponding id
     * from the database.
     * @param user to insert
     * @return user object after insertion or null if an error occurs
     */
    public User add(User user);

    /**
     * This is a convenience method to creating a data item but only if the ID does not already exist in the table. This
     * extracts the id from the data parameter, queries for the id, returning the data if it
     * exists. If it does not exist addIfNotExists will be called with the parameter.
     *
     * @param user to be added
     * @return Either the data parameter if it was inserted (now with the ID field set via the create method) or the
     *         data element that existed already in the database.
     */
    public User addIfNotExists(User user);

    /**
     * This is a convenience method for creating an item in the database if it does not exist. The id is extracted from
     * the data parameter and a query-by-id is made on the database. If a row in the database with the same id exists
     * then all of the columns in the database will be updated from the fields in the data parameter. If the id is null
     * (or 0 or some other default value) or doesn't exist in the database then the object will be created in the
     * database. This also means that your data item <i>must</i> have an id field defined.
     * @param user to be inserted
     * @return
     */
    public User addOrUpdate(User user);

    /**
     * Store the fields from an object to the database row corresponding to the id from the data parameter. If you have
     * made changes to an object, this is how you persist those changes to the database. You cannot use this method to
     * update the id field
     * @param user item to be updated
     * @return the given user or null if an error occurs
     */
    public User update(User user);

    /**
     * Retrieves an object associated with a specific id
     * @param id of the user to be found
     * @return user or null if not found
     */
    public User get(long id);

    /**
     * Query for all of the items in the object table
     * @return list of users or null in case an error occurs
     */
    public List<User> getAll();

    /**
     * Retrieves all participants with contactFlag = 1
     * @return list of users or null on error
     */
    public List<User> getContacts();

    /**
     * Reset the contactFlag so that the given user is removed from the contact list
     * @param user whose contact flag is to be reset
     * @return true on success, false otherwise
     */
    public boolean removeFromContacts(User user);

    /**
     * Delete the database row corresponding to the id from the data parameter.
     * @param user to be deleted
     * @return true on success, false otherwise
     */
    public boolean delete(User user);
}


text:
package org.apache.catalina.startup;

import java.io.File;
import java.io.FileInputStream;
import java.io.InputStream;
import java.net.URL;
import java.util.Enumeration;
import java.util.Properties;

/**
 * Utility class to read the bootstrap Catalina configuration.
 *
 * @author Remy Maucherat
 *
 */

public class CatalinaProperties {

    // ------------------------------------------------------- Static Variables

    private static org.apache.juli.logging.Log log=
        org.apache.juli.logging.LogFactory.getLog( CatalinaProperties.class );

    private static Properties properties = null;

    static {

        loadProperties();

    }

    // --------------------------------------------------------- Public Methods

    /**
     * Return specified property value.
     */
    public static String getProperty(String name) {

        return properties.getProperty(name);

    }

    /**
     * Return specified property value.
     */
    public static String getProperty(String name, String defaultValue) {

        return properties.getProperty(name, defaultValue);

    }

    // --------------------------------------------------------- Public Methods

    /**
     * Load properties.
     */
    private static void loadProperties() {

        InputStream is = null;
        Throwable error = null;

        try {
            String configUrl = getConfigUrl();
            if (configUrl != null) {
                is = (new URL(configUrl)).openStream();
            }
        } catch (Throwable t) {
            // Ignore
        }

        if (is == null) {
            try {
                File home = new File(getCatalinaBase());
                File conf = new File(home, "conf");
                File properties = new File(conf, "catalina.properties");
                is = new FileInputStream(properties);
            } catch (Throwable t) {
                // Ignore
            }
        }

        if (is == null) {
            try {
                is = CatalinaProperties.class.getResourceAsStream
                    ("/org/apache/catalina/startup/catalina.properties");
            } catch (Throwable t) {
                // Ignore
            }
        }

        if (is != null) {
            try {
                properties = new Properties();
                properties.load(is);
                is.close();
            } catch (Throwable t) {
                error = t;
            }
        }

        if ((is == null) || (error != null)) {
            // Do something
            log.warn("Failed to load catalina.properties", error);
            // That's fine - we have reasonable defaults.
            properties=new Properties();
        }

        // Register the properties as system properties
        Enumeration enumeration = properties.propertyNames();
        while (enumeration.hasMoreElements()) {
            String name = (String) enumeration.nextElement();
            String value = properties.getProperty(name);
            if (value != null) {
                System.setProperty(name, value);
            }
        }

    }

    /**
     * Get the value of the catalina.home environment variable.
     */
    private static String getCatalinaHome() {
        return System.getProperty("catalina.home",
                                  System.getProperty("user.dir"));
    }

    /**
     * Get the value of the catalina.base environment variable.
     */
    private static String getCatalinaBase() {
        return System.getProperty("catalina.base", getCatalinaHome());
    }

    /**
     * Get the value of the configuration URL.
     */
    private static String getConfigUrl() {
        return System.getProperty("catalina.config");
    }

}


text:
using System.Linq;
using Umbraco.Cms.Core.Models;
using Umbraco.Cms.Infrastructure.Persistence.Dtos;

namespace Umbraco.Cms.Infrastructure.Persistence.Factories
{
    internal static class PublicAccessEntryFactory
    {
        public static PublicAccessEntry BuildEntity(AccessDto dto)
        {
            var entity = new PublicAccessEntry(dto.Id, dto.NodeId, dto.LoginNodeId, dto.NoAccessNodeId,
                dto.Rules.Select(x => new PublicAccessRule(x.Id, x.AccessId)
                {
                    RuleValue = x.RuleValue,
                    RuleType = x.RuleType,
                    CreateDate = x.CreateDate,
                    UpdateDate = x.UpdateDate
                }))
            {
                CreateDate = dto.CreateDate,
                UpdateDate = dto.UpdateDate
            };

            // reset dirty initial properties (U4-1946)
            entity.ResetDirtyProperties(false);
            return entity;
        }

        public static AccessDto BuildDto(PublicAccessEntry entity)
        {
            var dto = new AccessDto
            {
                Id = entity.Key,
                NoAccessNodeId = entity.NoAccessNodeId,
                LoginNodeId = entity.LoginNodeId,
                NodeId = entity.ProtectedNodeId,
                CreateDate = entity.CreateDate,
                UpdateDate = entity.UpdateDate,
                Rules = entity.Rules.Select(x => new AccessRuleDto
                {
                    AccessId = x.AccessEntryId,
                    Id = x.Key,
                    RuleValue = x.RuleValue,
                    RuleType = x.RuleType,
                    CreateDate = x.CreateDate,
                    UpdateDate = x.UpdateDate
                }).ToList()
            };

            return dto;
        }
    }
}


text:
/*! Fuel, Version 1.0.0 (2014/10/24) */
this.Fuel = (function (global) {

	var document = global.document,
	    root = document.documentElement,
		addEvent = root.addEventListener
			? function(element, event, callback) {
				if (event === "focusin") {
					element.addEventListener("focus", callback, true);
				}
				else if (event === "focusout") {
					element.addEventListener("blur", callback, true);
				}
				else {
					element.addEventListener(event, callback, false);
				}
			}
			: function (element, event, callback) {
				element.attachEvent("on" + event, callback);
			},
		delay = function(millis, callback, args) {
			args = args instanceof Array ? args :[args];

			setTimeout(function() {
				callback.apply(null, args);
				callback = args = null;
			}, millis);
		},
		focusEnd = function(element) {
			element.focus();

			if ("selectionStart" in element) {
				element.selectionStart = element.selectionEnd = element.value.length;
			}
			else if ("selection" in document) {
				var range = document.selection.createRange();

				range.moveStart("character", element.value.length);
				range.moveEnd("character", element.value.length);
				range.select();
			}
		},
		getMaxLength = function(element) {
			// Some browsers return -1 for the maxlength when it's not specified,
			// others return the max value for JavaScript Number's.
			return Number(element.getAttribute("maxlength") || "0");
		},
		hasSelection = function(element) {
			if ("selectionStart" in element) {
				return element.selectionStart != element.selectionEnd;
			}
			else if ("selection" in document) {
				element.focus();
				var range = document.selection.createRange();

				return ("toString" in range)
					? !!range.toString()
					: !!range.text;
			}
			else {
				return false;
			}
		},
		preventDefault = function(event) {
			if (event.preventDefault) {
				event.preventDefault();
			}
			else {
				event.returnValue = false;
			}
		},
		filters = {
				alpha: /[a-zA-Z]/,
				alphaUpper: /[A-Z]/,
				alphaLower: /[a-z]/,
				alphaNumeric: /[a-zA-Z0-9]/,
				date: /[-\/0-9]/,
				decimal: /[\d\.]/,
				email: /[-%@\w\.]/i,
				numeric: /[\d]/,
				phone: /[-0-9\(\) ]/,
				taxId: /[-0-9]/,
				words: /[a-zA-Z0-9 ]/
			},
		metaKeyCodes = {
				8: "Backspace",
				9: "Tab",
				13: "Enter",
				37: "Left",
				38: "Up",
				39: "Right",
				40: "Down",
				46: "Del"
			},
		metaKeys = {
				Backspace: 8,
				Tab: 9,
				Enter: 13,
				Left: 37,
				Up: 38,
				Right: 39,
				Down: 40,
				Del: 46
			};

	function handleAutoTab(event) {
		event = event || global.event;

		var target = event.target || event.srcElement,
			series = target.getAttribute("data-autotab"),
			code = event.code || event.keyCode || event.which || -1,
			elements, i, maxLength, nextElement;

		if (!series || target.nodeName !== "INPUT" || target.type !== "text") {
			return;
		}
		else if (code in metaKeyCodes && code != metaKeys.Backspace) {
			return;
		}

		maxLength = getMaxLength(target);
		elements = target.parentNode.querySelectorAll("input[data-autotab=" + series + "]");

		if (code === metaKeys.Backspace) {
			if (event.type == "keyup" && !target.value.length) {
				// Move focus to previous field when value is empty
				i = elements.length;

				while (i--) {
					if (target == elements[i] && i - 1 >= 0) {
						focusEnd(elements[i - 1]);
					}
				}
			}
		}
		else if (event.type == "keypress" && (target.value.length === maxLength || target.value.length + 1 === maxLength) && !hasSelection(target)) {
			if (target.value.length === maxLength) {
				preventDefault(event);
			}

			// Move focus to next field
			for (i = 0; i < elements.length; i++) {
				if (target === elements[i] && i + 1 < elements.length) {
					nextElement = elements[i + 1];

					if (!nextElement.value && target.value.length === maxLength) {
						nextElement.value = String.fromCharCode(code);
					}

					// Delay the call to focusEnd because IE will apply the new character
					// to the next text box if the focus is set inside the event handler
					// for the previous text box.
					delay(0, focusEnd, nextElement);

					break;
				}
			}
		}
	}

	function handleTextBoxMaxLength(event) {
		event = event || global.event;

		var target = event.target || event.srcElement,
			maxLength = -1;

		if (target.nodeName !== "TEXTAREA" || (target.nodeName !== "INPUT" || target.type !== "text") || target.disabled) {
			return true;
		}

		maxLength = getMaxLength(target);

		if (maxLength && target.value.length > maxLength) {
			target.value = target.value.substring(0, maxLength);
		}
	}

	function handleTextBoxFilter(event) {
		event = event || global.event;

		var target = event.target || event.srcElement,
			code = event.code || event.keyCode || event.which,
			key = event.key || String.fromCharCode(code),
			filter, regex;

		if (target.nodeName !== "INPUT" || target.type !== "text" || code in metaKeyCodes) {
			return;
		}

		filter = target.getAttribute("data-filter");

		if (filter) {
			regex = filters[filter]
				 // Memoize custom filters so the cached RegExp object is used next time
			     || (filters[filter] = new RegExp(filter));

			if (!regex.test(key)) {
				preventDefault(event);
			}
		}
	}

	addEvent(root, "keypress", handleTextBoxFilter);
	addEvent(root, "keypress", handleAutoTab);
	addEvent(root, "keyup", handleAutoTab);
	addEvent(root, "focusout", handleTextBoxMaxLength);

	return {
		Filters: filters
	};

})(this);


text:
#include "coopgame.h"
#include "CoopTypes.h"
#include "NativeBaseCharacter.h"

FTakeHitInfo::FTakeHitInfo()
	: ActualDamageTaken(0.0f)
	, DamageTypeClass(nullptr)
	, InstigatorPawn(nullptr)
	, DamageCauser(nullptr)
	, DamageStyleID(0)
	, HitResult(EHitResult::Wounded)
	, m_ensureReplicationByte(0)
{
}

const FDamageEvent& FTakeHitInfo::GetDamageEvent()
{
	switch (DamageStyleID)
	{
	case FPointDamageEvent::ClassID:
		if (m_pointDamageEvent.DamageTypeClass == nullptr)
			m_pointDamageEvent.DamageTypeClass = DamageTypeClass ? DamageTypeClass : UDamageType::StaticClass();
		return m_pointDamageEvent;
	case FRadialDamageEvent::ClassID:
		if (m_radialDamageEvent.DamageTypeClass == nullptr)
			m_radialDamageEvent.DamageTypeClass = DamageTypeClass ? DamageTypeClass : UDamageType::StaticClass();
		return m_radialDamageEvent;
	default:
		if (m_generalDamageEvent.DamageTypeClass == nullptr)
			m_generalDamageEvent.DamageTypeClass = DamageTypeClass ? DamageTypeClass : UDamageType::StaticClass();
		return m_generalDamageEvent;
	}
}

void FTakeHitInfo::SetDamageEvent(const FDamageEvent& damageEvent)
{
	DamageStyleID = damageEvent.GetTypeID();
	switch(DamageStyleID)
	{
	case FPointDamageEvent::ClassID:
		m_pointDamageEvent = *((const FPointDamageEvent*)(&damageEvent));
		break;
	case FRadialDamageEvent::ClassID:
		m_radialDamageEvent = *((const FRadialDamageEvent*)(&damageEvent));
		break;
	default:
		m_generalDamageEvent = damageEvent;
		break;
	}

	DamageTypeClass = damageEvent.DamageTypeClass;
}

void FTakeHitInfo::ForceReplication()
{
	++m_ensureReplicationByte;
}


text:
import {
  Color,
  DistanceDisplayCondition,
  NearFarScalar,
  ConstantProperty,
  PointGraphics,
  HeightReference,
} from "../../index.js";

describe("DataSources/PointGraphics", function () {
  it("creates expected instance from raw assignment and construction", function () {
    const options = {
      color: Color.RED,
      pixelSize: 1,
      outlineColor: Color.BLUE,
      outlineWidth: 2,
      show: false,
      scaleByDistance: new NearFarScalar(3, 4, 5, 6),
      heightReference: HeightReference.RELATIVE_TO_GROUND,
      distanceDisplayCondition: new DistanceDisplayCondition(10.0, 100.0),
      disableDepthTestDistance: 10.0,
    };

    const point = new PointGraphics(options);
    expect(point.color).toBeInstanceOf(ConstantProperty);
    expect(point.pixelSize).toBeInstanceOf(ConstantProperty);
    expect(point.outlineColor).toBeInstanceOf(ConstantProperty);
    expect(point.outlineWidth).toBeInstanceOf(ConstantProperty);
    expect(point.show).toBeInstanceOf(ConstantProperty);
    expect(point.scaleByDistance).toBeInstanceOf(ConstantProperty);
    expect(point.heightReference).toBeInstanceOf(ConstantProperty);
    expect(point.distanceDisplayCondition).toBeInstanceOf(ConstantProperty);
    expect(point.disableDepthTestDistance).toBeInstanceOf(ConstantProperty);

    expect(point.color.getValue()).toEqual(options.color);
    expect(point.pixelSize.getValue()).toEqual(options.pixelSize);
    expect(point.outlineColor.getValue()).toEqual(options.outlineColor);
    expect(point.outlineWidth.getValue()).toEqual(options.outlineWidth);
    expect(point.show.getValue()).toEqual(options.show);
    expect(point.scaleByDistance.getValue()).toEqual(options.scaleByDistance);
    expect(point.heightReference.getValue()).toEqual(options.heightReference);
    expect(point.distanceDisplayCondition.getValue()).toEqual(
      options.distanceDisplayCondition
    );
    expect(point.disableDepthTestDistance.getValue()).toEqual(
      options.disableDepthTestDistance
    );
  });

  it("merge assigns unassigned properties", function () {
    const source = new PointGraphics();
    source.color = new ConstantProperty(Color.WHITE);
    source.pixelSize = new ConstantProperty(1);
    source.outlineColor = new ConstantProperty(Color.WHITE);
    source.outlineWidth = new ConstantProperty(1);
    source.show = new ConstantProperty(true);
    source.scaleByDistance = new ConstantProperty(new NearFarScalar());
    source.heightReference = new ConstantProperty(
      HeightReference.RELATIVE_TO_GROUND
    );
    source.distanceDisplayCondition = new ConstantProperty(
      new DistanceDisplayCondition(10.0, 100.0)
    );
    source.disableDepthTestDistance = new ConstantProperty(10.0);

    const target = new PointGraphics();
    target.merge(source);
    expect(target.color).toBe(source.color);
    expect(target.pixelSize).toBe(source.pixelSize);
    expect(target.outlineColor).toBe(source.outlineColor);
    expect(target.outlineWidth).toBe(source.outlineWidth);
    expect(target.show).toBe(source.show);
    expect(target.scaleByDistance).toBe(source.scaleByDistance);
    expect(target.heightReference).toBe(source.heightReference);
    expect(target.distanceDisplayCondition).toBe(
      source.distanceDisplayCondition
    );
    expect(target.disableDepthTestDistance).toBe(
      source.disableDepthTestDistance
    );
  });

  it("merge does not assign assigned properties", function () {
    const source = new PointGraphics();
    source.color = new ConstantProperty(Color.WHITE);
    source.pixelSize = new ConstantProperty(1);
    source.outlineColor = new ConstantProperty(Color.WHITE);
    source.outlineWidth = new ConstantProperty(1);
    source.show = new ConstantProperty(true);
    source.scaleByDistance = new ConstantProperty(new NearFarScalar());
    source.heightReference = new ConstantProperty(
      HeightReference.RELATIVE_TO_GROUND
    );
    source.distanceDisplayCondition = new ConstantProperty(
      new DistanceDisplayCondition(10.0, 100.0)
    );
    source.disableDepthTestDistance = new ConstantProperty(10.0);

    const color = new ConstantProperty(Color.WHITE);
    const pixelSize = new ConstantProperty(1);
    const outlineColor = new ConstantProperty(Color.WHITE);
    const outlineWidth = new ConstantProperty(1);
    const show = new ConstantProperty(true);
    const heightReference = new ConstantProperty(
      HeightReference.CLAMP_TO_GROUND
    );
    const distanDisplayCondition = new ConstantProperty(
      new DistanceDisplayCondition(10.0, 100.0)
    );
    const disableDepthTestDistance = new ConstantProperty(20.0);

    const target = new PointGraphics();
    target.color = color;
    target.pixelSize = pixelSize;
    target.outlineColor = outlineColor;
    target.outlineWidth = outlineWidth;
    target.show = show;
    target.scaleByDistance = show;
    target.heightReference = heightReference;
    target.distanceDisplayCondition = distanDisplayCondition;
    target.disableDepthTestDistance = disableDepthTestDistance;

    target.merge(source);
    expect(target.color).toBe(color);
    expect(target.pixelSize).toBe(pixelSize);
    expect(target.outlineColor).toBe(outlineColor);
    expect(target.outlineWidth).toBe(outlineWidth);
    expect(target.show).toBe(show);
    expect(target.scaleByDistance).toBe(show);
    expect(target.heightReference).toBe(heightReference);
    expect(target.distanceDisplayCondition).toBe(distanDisplayCondition);
    expect(target.disableDepthTestDistance).toBe(disableDepthTestDistance);
  });

  it("clone works", function () {
    const source = new PointGraphics();
    source.color = new ConstantProperty(Color.WHITE);
    source.pixelSize = new ConstantProperty(1);
    source.outlineColor = new ConstantProperty(Color.WHITE);
    source.outlineWidth = new ConstantProperty(1);
    source.show = new ConstantProperty(true);
    source.scaleByDistance = new ConstantProperty(new NearFarScalar());
    source.heightReference = new ConstantProperty(
      HeightReference.RELATIVE_TO_GROUND
    );
    source.distanceDisplayCondition = new ConstantProperty(
      new DistanceDisplayCondition(10.0, 100.0)
    );
    source.disableDepthTestDistance = new ConstantProperty(10.0);

    const result = source.clone();
    expect(result.color).toBe(source.color);
    expect(result.pixelSize).toBe(source.pixelSize);
    expect(result.outlineColor).toBe(source.outlineColor);
    expect(result.outlineWidth).toBe(source.outlineWidth);
    expect(result.show).toBe(source.show);
    expect(result.scaleByDistance).toBe(source.scaleByDistance);
    expect(result.heightReference).toBe(source.heightReference);
    expect(result.distanceDisplayCondition).toBe(
      source.distanceDisplayCondition
    );
    expect(result.disableDepthTestDistance).toBe(
      source.disableDepthTestDistance
    );
  });

  it("merge throws if source undefined", function () {
    const target = new PointGraphics();
    expect(function () {
      target.merge(undefined);
    }).toThrowDeveloperError();
  });
});


text:
package org.springframework.cglib;

/**
 * Empty class used to ensure that the {@code org.springframework.cglib}
 * package is processed during javadoc generation.
 *
 *
See package-level javadocs for more
 * information on {@code org.springframework.cglib}.
 *
 * @author Chris Beams
 * @since 3.2
 */
public final class SpringCglibInfo {

}


text:
/**@file tz_mc_stack.h
 * @brief multi-channel stack
 * @author Ting Zhao
 * @date 20-Nov-2008
 */

#ifndef _TZ_MC_STACK_H_
#define _TZ_MC_STACK_H_

#include "tz_cdefs.h"
#include "tz_image_lib_defs.h"

__BEGIN_DECLS

#ifdef _MSC_VER
typedef struct __Mc_Stack {
#else
typedef struct _Mc_Stack {
#endif
  int kind;
  int width;
  int height;
  int depth;
  int nchannel;
  uint8* array;
} Mc_Stack;

size_t Mc_Stack_Asize(size_t size);

Mc_Stack *Make_Mc_Stack(int kind, int width, int height, int depth,
			int nchannel);
void Default_Mc_Stack(Mc_Stack *mc_stack);

/* Functions defined in the macros */
Mc_Stack* New_Mc_Stack();
Mc_Stack *Mc_Stack_Frame(int kind, int width, int height, int depth,
       int nchannel);
Mc_Stack* Copy_Mc_Stack(const Mc_Stack *mc_stack);
void   Pack_Mc_Stack(Mc_Stack *mc_stack);
void   Free_Mc_Stack(Mc_Stack *mc_stack);
void   Kill_Mc_Stack(Mc_Stack *mc_stack);
void   Reset_Mc_Stack();
int    Mc_Stack_Usage();

int Save_Mc_Stack(Mc_Stack *mc_stack, char *file_path);
Mc_Stack* Load_Mc_Stack(char *file_path);
/***********************************/

Stack Mc_Stack_Channel(const Mc_Stack *mc_stack, int chan);
void Mc_Stack_Copy_Channel(Mc_Stack *mc_stack, int chan, const Stack *stack);

/**@brief combine two multi-channel stack to one
 * Combine_Mc_Stack() appends the channels of mc_stack2 to mc_stack1 and returns
 * the new combined mc_stack
 */
Mc_Stack* Combine_Mc_Stack(const Mc_Stack *mc_stack1, const Mc_Stack *mc_stack2);

void Print_Mc_Stack_Info(const Mc_Stack *mc_stack);

/**@brief multi-channel stack to stack
 *
 * Mc_Stack_To_Stack() returns the stack that is converted from \a mc_stack.
 * It can be the same as \a stack if \a stack is not NULL, but \a stack should
 * preallocated to have sufficient space to hold the result. \a kind specifies
 * the kind of result. It can be -1 for default kind, which is the same as the
 * kind of \a mc_stack.
 */
Stack* Mc_Stack_To_Stack(const Mc_Stack *mc_stack, int kind, Stack *stack);

/**@brief Stack to a multi-channel stack.
 *
 * Mc_Stack_Rewrap_Stack() turns <stack> into a multi-channel stack and
 * returns the result. <stack> is killed after the function call.
 */
Mc_Stack* Mc_Stack_Rewrap_Stack(Stack *stack);

Mc_Stack *Mc_Stack_Merge(Mc_Stack **stack, int n, int **offset, int option);

Mc_Stack *Mc_Stack_Merge_F(char **filepath, int n, int **offset, int option,
			   const int *ds);

void Mc_Stack_Grey16_To_8(Mc_Stack *mc_stack, int option);

Mc_Stack* Mc_Stack_Downsample_Mean(Mc_Stack *mc_stack, int wintv,
				   int hintv, int dintv, Mc_Stack *out);

Mc_Stack* Mc_Stack_Upsample(const Mc_Stack *mc_stack, int wintv,
				  int hintv, int dintv, Mc_Stack *out);

/**@brief Maximum intensity projection.
 *
 * Mc_Stack_Mip() returns the maximum intensity projection of <mc_stack>.
 */
Mc_Stack* Mc_Stack_Mip(Mc_Stack *mc_stack);

void Mc_Stack_Binarize(Mc_Stack *mc_stack, double low, double high);

size_t  Mc_Stack_Voxel_Number(const Mc_Stack *mc_stack);

Mc_Stack* Mc_Stack_Flip_Y(const Mc_Stack *stack, Mc_Stack *out);
Mc_Stack *Mc_Stack_Mask(Mc_Stack *stack1, const Stack *stack2, Mc_Stack *out);

void Mc_Stack_Set_Zero(Mc_Stack *stack);
__END_DECLS

#endif


text:
namespace WebServer.ByTheCakeApp.Helpers
{
    using System.Collections.Generic;
    using System.IO;
    using System.Linq;

    using Views;
    using Server.Enums;
    using Server.HTTP.Contracts;
    using Server.HTTP.Response;

    public abstract class Controller
    {
        public const string DefaultPath = @"..\..\..\ByTheCakeApp\Resources\{0}.html";
        public const string ConentPlaceHolder = "{{{content}}}";

        protected IDictionary<string, string> ViewData { get; private set; }

        protected Controller()
        {
            this.ViewData = new Dictionary<string, string>()
            {
                ["showError"] = "none",
                ["authDisplay"] = "block"
            };
        }

        protected void AddError(string errorMessage)
        {
            this.ViewData["showError"] = "block";
            this.ViewData["error"] = errorMessage;
        }

        private string ProcessFileHtml(string fileName)
        {
            var layout = File.ReadAllText(string.Format(DefaultPath, "Layout"));

            var fileHtml = File.ReadAllText(string.Format(DefaultPath, fileName));

            var result = layout.Replace("{{{content}}}", fileHtml);

            return result;
        }

        public IHttpResponse FileViewResponse(string fileName)
        {
            var result = this.ProcessFileHtml(fileName);

            if (this.ViewData.Any())
            {
                foreach (var value in ViewData)
                {
                    result = result.Replace($"{{{{{{{value.Key}}}}}}}", value.Value);
                }
            }

            return new ViewResponse(HttpStatusCode.OK, new FileView(result));
        }

    }
}


text:
//  Copyright 2018 Twitter. All rights reserved.
//
//  Licensed under the Apache License, Version 2.0 (the "License");
//  you may not use this file except in compliance with the License.
//  You may obtain a copy of the License at
//
//  http://www.apache.org/licenses/LICENSE-2.0
//
//  Unless required by applicable law or agreed to in writing, software
//  distributed under the License is distributed on an "AS IS" BASIS,
//  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
//  See the License for the specific language governing permissions and
//  limitations under the License.
package com.twitter.heron.streamlet.scala

import com.twitter.heron.streamlet.scala.impl.BuilderImpl

/**
  * Builder is used to register all sources. Builder thus keeps track
  * of all the starting points of the computation dag and uses this
  * information to build the topology
  */
object Builder {
  def newBuilder(): Builder =
    new BuilderImpl(com.twitter.heron.streamlet.Builder.newBuilder())
}

/**
  * Builder is used to register all sources. Builder thus keeps track
  * of all the starting points of the computation dag and uses this
  * information to build the topology
  */
trait Builder {

  /**
    * All sources of the computation should register using addSource.
    *
    * @param supplier The supplier function that is used to create the streamlet
    * @return a Streamlet representation of the supplier object
    */
  def newSource[R](supplier: () => R): Streamlet[R]

  /**
    * Creates a new Streamlet using the underlying generator
    *
    * @param generator The generator that generates the tuples of the streamlet
    * @return  a Streamlet representation of the source object
    */
  def newSource[R](generator: Source[R]): Streamlet[R]
}