text:
<?php
namespace TYPO3\CMS\Core\Localization\Parser;

use TYPO3\CMS\Core\Charset\CharsetConverter;
use TYPO3\CMS\Core\Localization\Exception\FileNotFoundException;
use TYPO3\CMS\Core\Localization\Exception\InvalidXmlFileException;
use TYPO3\CMS\Core\Utility\GeneralUtility;

/**
 * Abstract class for XML based parser.
 */
abstract class AbstractXmlParser implements \TYPO3\CMS\Core\Localization\Parser\LocalizationParserInterface
{
    /**
     * @var string
     */
    protected $sourcePath;

    /**
     * @var string
     */
    protected $languageKey;

    /**
     * @var string
     */
    protected $charset;

    /**
     * Returns parsed representation of XML file.
     *
     * @param string $sourcePath Source file path
     * @param string $languageKey Language key
     * @param string $charset File charset
     * @return array
     * @throws \TYPO3\CMS\Core\Localization\Exception\FileNotFoundException
     */
    public function getParsedData($sourcePath, $languageKey, $charset = '')
    {
        $this->sourcePath = $sourcePath;
        $this->languageKey = $languageKey;
        $this->charset = $this->getCharset($languageKey, $charset);
        if ($this->languageKey !== 'default') {
            $this->sourcePath = GeneralUtility::getFileAbsFileName(GeneralUtility::llXmlAutoFileName($this->sourcePath, $this->languageKey));
            if (!@is_file($this->sourcePath)) {
                // Global localization is not available, try split localization file
                $this->sourcePath = GeneralUtility::getFileAbsFileName(GeneralUtility::llXmlAutoFileName($sourcePath, $languageKey, true));
            }
            if (!@is_file($this->sourcePath)) {
                throw new FileNotFoundException('Localization file does not exist', 1306332397);
            }
        }
        $LOCAL_LANG = [];
        $LOCAL_LANG[$languageKey] = $this->parseXmlFile();
        return $LOCAL_LANG;
    }

    /**
     * Gets the character set to use.
     *
     * @param string $languageKey
     * @param string $charset
     * @return string
     */
    protected function getCharset($languageKey, $charset = '')
    {
        /** @var $charsetConverter CharsetConverter */
        if (is_object($GLOBALS['LANG'])) {
            $charsetConverter = $GLOBALS['LANG']->csConvObj;
        } elseif (is_object($GLOBALS['TSFE'])) {
            $charsetConverter = $GLOBALS['TSFE']->csConvObj;
        } else {
            $charsetConverter = GeneralUtility::makeInstance(CharsetConverter::class);
        }
        if ($charset !== '') {
            $targetCharset = $charsetConverter->parse_charset($charset);
        } else {
            $targetCharset = 'utf-8';
        }
        return $targetCharset;
    }

    /**
     * Loads the current XML file before processing.
     *
     * @return array An array representing parsed XML file (structure depends on concrete parser)
     * @throws \TYPO3\CMS\Core\Localization\Exception\InvalidXmlFileException
     */
    protected function parseXmlFile()
    {
        $xmlContent = file_get_contents($this->sourcePath);
        // Disables the functionality to allow external entities to be loaded when parsing the XML, must be kept
        $previousValueOfEntityLoader = libxml_disable_entity_loader(true);
        $rootXmlNode = simplexml_load_string($xmlContent, 'SimpleXMLElement', LIBXML_NOWARNING);
        libxml_disable_entity_loader($previousValueOfEntityLoader);
        if (!isset($rootXmlNode) || $rootXmlNode === false) {
            throw new InvalidXmlFileException('The path provided does not point to existing and accessible well-formed XML file.', 1278155988);
        }
        return $this->doParsingFromRoot($rootXmlNode);
    }

    /**
     * Returns array representation of XML data, starting from a root node.
     *
     * @param \SimpleXMLElement $root A root node
     * @return array An array representing the parsed XML file
     */
    abstract protected function doParsingFromRoot(\SimpleXMLElement $root);
}


text:
<!DOCTYPE html>

  <meta charset="UTF-8">
  <title>Infa-Mon</title>
  <link rel="stylesheet" type="text/css" href="http://www.jeasyui.com/easyui/themes/default/easyui.css">
  <link rel="stylesheet" type="text/css" href="http://www.jeasyui.com/easyui/themes/icon.css">
  <link rel="stylesheet" type="text/css" href="http://www.jeasyui.com/easyui/themes/color.css">
  <link rel="stylesheet" type="text/css" href="http://www.jeasyui.com/easyui/demo/demo.css">
  <link rel="stylesheet" href="{{ url_for('static', filename='bootstrap/css/bootstrap.min.css') }}">

Infa-Mon

    CollapseAll
    ExpandAll
    ExpandTo
    GetSelected

        <input type="text" placeholder="Search...">
        <ul id='object-tree' class="easyui-tree" data-options="lines:true,                    formatter:function(node){
                        var s = node.text;
                        if (node.children /*&& node.parent.text != 'DEV'*/){
                            s += ' (' + node.children.length + ')';
                        }
                        return s;
                    }">

            SOR_BLUEBOX

                Sources

TABLE1

TABLE2

TABLE3

TABLE4

                Targets

TABLE1

TABLE2

TABLE3

TABLE4

                Mappings

m_baw_target

m_baw_target2

m_baw_target23

                Sessions

s_baw_target

s_baw_target2

s_baw_target23

                Workflows

w_baw_target

w_baw_target2

w_baw_target23

        <ul id='object-tree2' class="easyui-tree" data-options="url:'object_tree.json',lines:true,                    formatter:function(node){
                        var s = node.text;
                        if (node.children /*&& node.parent.text != 'DEV'*/){
                            s += ' (' + node.children.length + ')';
                        }
                        return s;
                    }">

          tab1

          tab2

          tab3

redpajama_set_name: RedPajamaGithub


text:
function histogramD3() {
  var margin = {top: 30, right: 20, bottom: 20, left: 50},
      width = 200,
      height = 100,
      defaults = {outliers:true,averageLine:true},
      xValue = function(d) { return d[0]; },
      yValue = function(d) { return d[1]; },
      x = d3.scale.linear(),
      y = d3.scale.linear(),
      xAxis = d3.svg.axis().scale(x).orient("bottom"),
      yAxis = d3.svg.axis().scale(y).orient("left").ticks(6),
      brush = d3.svg.brush().x(x);

  function chart(selection, options) {
    // merge options and defaults
    options = $.extend(defaults,options);
    var innerHeight = height - margin.top - margin.bottom;
    selection.each(function(data) {
       // set svg element
       var svg = d3.select(this);

      // Convert data to standard representation greedily;
      // this is needed for nondeterministic accessors.
      data = data.map(function(d, i) {return [xValue.call(data, d, i), yValue.call(data, d, i)];});

      // Remove outliers if wanted.
      if ( !options.outliers )
         data = removeOutliers(data);

      // Calculate average.
      var avg = [];
      if (options.averageLine) {
         var totalValue = 0, numValues = 0;
         for (var i=0, len = data.length; i < len; i++) { totalValue += data[i][0]*data[i][1]; numValues += data[i][1]; }
         avg = [totalValue / numValues];
      }

      // Update the x-scale.
      x  .domain(d3.extent(data, function(d) { return d[0]; }));
      x  .range([0, width - margin.left - margin.right]);

      // Check for single value x axis.
      if (x.domain()[0] == x.domain()[1]) { var v = x.domain()[0]; x.domain([v-5,v+5]);}

      // Update the y-scale.
      y  .domain([0, d3.max(data, function(d) { return d[1]; })])
      y  .range([innerHeight , 0]);

      // Select the g element, if it exists.
      var g = svg.selectAll("g").data([0]);

      // Otherwise, create the skeletal chart.
      var gEnter = g.enter().append("g");
      gEnter.append("g").attr("class", "x axis").attr("transform", "translate(0," + y.range()[0] + ")");
      gEnter.append("g").attr("class", "y axis");
      gEnter.append("g").attr("class", "x brush")
      if (options.title != undefined) {
        gEnter.append("text")
        .attr("class", "title").text(options.title)
        .attr("text-anchor", "middle")
        .attr("transform", "translate(" + parseInt((width-margin.left-margin.right)/2) + "," + parseInt(height+margin.bottom) + ")");
      }

      // Update the outer dimensions.
      svg .attr("width", width)
          .attr("height", height);

      // Update the inner dimensions.
      g.attr("transform", "translate(" + margin.left + "," + margin.top + ")");

      // Add avg line and text
      var half = x(x.domain()[0]+1) / 2;
      var avgLineG = gEnter.selectAll(".avg")
                .data(avg)
             .enter().append("g")
                .attr("class", "avg")
                .style("z-index", 100)
                .attr("transform", function(d) { return "translate(" + parseInt(x(d)+half) + "," + 0 + ")"; });

          avgLineG.append("line")
             .attr("x1", 0)
             .attr("x2", 0)
             .attr("y1", innerHeight)
             .attr("y2", -8);

          avgLineG.append("text")
                .text("avg")
                .attr("y", "-10");

      // Add new bars groups.
      var bar = g.selectAll(".bar").data(data)
      var barEnter = bar.enter().append("g")
            .attr("class", "bar")
            .attr("transform", function(d) { return "translate(" + x(d[0]) + "," + innerHeight + ")"; });

      //  Add new bars.
      barEnter.append("rect")
         .attr("x", 1)
         .style("z-index", 5)
         .attr("width", Math.max(x(x.domain()[0]+1),1))
         .attr("height", 0)
         .on("mouseover", function(d) {
            div.transition()
               .duration(200)
               .style("opacity", .9);
            div.html(d[0] + ", " + d[1])
         .style("left", (d3.event.pageX) + "px")
         .style("text-align", 'left')
         .style("top", (d3.event.pageY - 24) + "px");
         })
         .on("mouseout", function(d) {
            div.transition()
               .duration(500)
               .style("opacity", 0);
         });

      // Remove extra bar groups.
      bar.exit().remove();

      // Update bars groups.
      bar.transition()
         .duration(200)
         .attr("transform", function(d) {
            return "translate(" + parseInt(x(d[0])) + "," + Math.floor(y(d[1])) + ")";
         });

      // Update bars.
      bar.select("rect").transition()
         .duration(200)
         .attr("width", Math.max(Math.ceil(x(x.domain()[0]+1)),1))
         .attr("height", function(d) {
            return parseInt(d[0]) >= x.domain()[0] ? innerHeight - parseInt(y(d[1])) : 0;
         });

      // Update the x-axis.
      g.select(".x.axis").transition()
          .duration(200)
          .call(xAxis);

      // Update the y-axis.
      g.select(".y.axis").transition()
         .duration(200)
         .call(yAxis);

      // Update avg line and text
      svg.selectAll(".avg").transition()
         .duration(200)
         .attr("transform", function(d) { return "translate(" + parseInt(x(d)+half) + "," + 0 + ")"; })
         .call(moveToFront);

      // Update brush if event has been set.
      if( brush.on("brushend") || brush.on("brushstart") || brush.on("brush")) {
         g.select(".x.brush").call(brush).call(moveToFront)
             .selectAll("rect")
               .attr("y", -6)
               .attr("height", innerHeight + 6);
      }

    });
    // moves selection to front of svg
    function moveToFront(selection) {
      return selection.each(function(){
         this.parentNode.appendChild(this);
      });
    }

   function removeOutliers(data) {
      var q1 = quantile(data, 0.25);
      var q3 = quantile(data, 0.75);
      var iqr = (q3-q1) * 1.5; //
      return data.filter(function(d) { return (d[0]>=(Math.max(q1-iqr,0)) && d[0]<=(q3+iqr)) });
   }

   function quantile(arr, p) {
      var length = arr.reduce(function(previousValue, currentValue, index, array){
         return previousValue + currentValue[1];
      }, 0) - 1;
      var H = length * p + 1,
      h = Math.floor(H);

      var hValue, hMinus1Value, currValue = 0;
      for (var i=0; i < arr.length; i++) {
         currValue += arr[i][1];
         if (hMinus1Value == undefined && currValue >= (h-1))
            hMinus1Value = arr[i][0];
         if (hValue == undefined && currValue >= h) {
            hValue = arr[i][0];
            break;
         }
      }
      var v = +hMinus1Value, e = H - h;
      return e ? v + e * (hValue - v) : v;
   }

  }

  chart.margin = function(_) {
    if (!arguments.length) return margin;
    margin = _;
    return chart;
  };

  chart.width = function(_) {
    if (!arguments.length) return width;
    width = _;
    return chart;
  };

  chart.height = function(_) {
    if (!arguments.length) return height;
    height = _;
    return chart;
  };

  chart.xValue = function(_) {
    if (!arguments.length) return xValue;
    xValue = _;
    return chart;
  };

  chart.yValue = function(_) {
    if (!arguments.length) return yValue;
    yValue = _;
    return chart;
  };

  chart.x = function(_) {
    if (!arguments.length) return x;
    x = _;
    return chart;
  };

  chart.y = function(_) {
    if (!arguments.length) return y;
    y = _;
    return chart;
  };

  chart.xAxis = function(_) {
    if (!arguments.length) return xAxis;
    xAxis = _;
    return chart;
  };

  chart.yAxis = function(_) {
    if (!arguments.length) return yAxis;
    yAxis = _;
    return chart;
  };

  chart.brush = function(_) {
    if (!arguments.length) return brush;
    brush = _;
    return chart;
  };

  return chart;
}


text:
#if ! defined _pres_form_h
#define _pres_form_h 1

#include <basic/bool.h>

/* $Id: pres_form.h,v 1.1.1.1 2004/09/13 21:07:48 mstrout Exp $ */

#if ! defined _pres_gen_h
#include <omega/pres_gen.h>
#endif

namespace omega {

typedef enum {Op_Relation, Op_Not, Op_And, Op_Or,
	      Op_Conjunct, Op_Forall, Op_Exists}  Node_Type;

//
// Presburger Formula base class
//

class Formula {
public:
    virtual Node_Type node_type()=0;

        F_Forall *add_forall();
        F_Exists *add_exists();
virtual F_And    *and_with();
        F_And    *add_and();
        F_Or     *add_or();
        F_Not    *add_not();
        void      add_unknown();

    virtual void finalize();
    virtual void print(FILE *output_file);

    inline Rel_Body *relation() { return myRelation; }

protected:
    virtual ~Formula();
private:
    Formula(Formula *, Rel_Body *);

    // The relational operations need to work with formula trees
    friend class Relation;
    friend_rel_ops;
    // as do the functions that build DNF's
    friend  class DNF;
    // or other parts of the tree
    friend class Conjunct;
    friend class F_Declaration;
    friend class F_Exists;
    friend class F_Forall;
    friend class F_Or;
    friend class F_And;
    friend class F_Not;
    friend class Rel_Body;

    // Operations needed for manipulation of formula trees:

                void remove_child(Formula *);
                void replace_child(Formula *child, Formula *new_child);
        virtual bool can_add_child();
                void add_child(Formula *);

           Conjunct *add_conjunct();
   virtual Conjunct *find_available_conjunct() = 0;

    virtual Formula *copy(Formula *parent, Rel_Body *reln);
           F_Exists *add_exists(Variable_ID_Tuple &S);
    virtual     void push_exists(Variable_ID_Tuple &S);

    // Accessor functions for tree building

    inline List<Formula*>    &children()
        {return myChildren;}
    inline int                n_children() const
        {return myChildren.length();}
    inline const List<Formula*> &get_children() const
        {return myChildren;}

    inline Formula           &parent()                 {return *myParent;}
    inline void               set_parent(Formula *p)   {myParent = p;}

    virtual    int priority();

    void verify_tree();  // should be const, but iterators are used

    virtual void reverse_leading_dir_info();
    virtual void invalidate_leading_info(int changed = -1);
    virtual void enforce_leading_info(int guaranteed, int possible, int dir);

    virtual void remap();
    virtual DNF* DNFize() = 0;
    virtual void beautify();
    virtual void rearrange();
    virtual void setup_names();

    virtual void print_separator(FILE *output_file);
    virtual void combine_columns();
    virtual void prefix_print(FILE *output_file, int debug = 1);
            void print_head(FILE *output_file);

            void set_relation(Rel_Body *r);
            void set_parent(Formula *parent, Rel_Body *reln);

            void assert_not_finalized();

    virtual Conjunct *really_conjunct();  // until we get RTTI

private:
    List<Formula*>     myChildren;
    Formula           *myParent;
    Rel_Body          *myRelation;

};

} // end of namespace omega

#endif


text:
@interface DPTakePhotosViewController () <AVCapturePhotoCaptureDelegate>

@property (nonatomic, retain) AVCaptureSession *session;
@property (nonatomic, retain) AVCaptureDeviceInput *input;
@property (nonatomic, retain) AVCaptureDevice *device;
@property (nonatomic, retain) AVCapturePhotoOutput *imageOutput;
@property (nonatomic, retain) AVCaptureVideoPreviewLayer *preview;
@property (nonatomic, retain) AVCapturePhotoSettings *outputSettings;

@property (strong, nonatomic) IBOutlet UIButton *backButton;
@property (strong, nonatomic) IBOutlet UIButton *shutterButton;

@end

@implementation DPTakePhotosViewController

#pragma mark - Life Cycle
- (void)viewDidLoad {
  [super viewDidLoad];
  [self configBaseUI];
}

- (void)configBaseUI {
  [self.shutterButton.titleLabel setFont:[UIFont fontWithName:@"dp_iconfont" size:40.f]];
  [self.shutterButton setTitle:@"\U0000ea56" forState:UIControlStateNormal];
  [self createCameraInPosition:YES];
}

- (void)createCameraInPosition:(BOOL)isBack {
  self.session = [AVCaptureSession new];
  [self.session setSessionPreset:AVCaptureSessionPresetHigh];

  AVCaptureDeviceDiscoverySession *captureDeviceDiscoverySession
  = [AVCaptureDeviceDiscoverySession discoverySessionWithDeviceTypes:@[AVCaptureDeviceTypeBuiltInWideAngleCamera]
                                                           mediaType:AVMediaTypeVideo
                                                            position:AVCaptureDevicePositionBack];
  NSArray *devices = [captureDeviceDiscoverySession devices];

  for (AVCaptureDevice *device in devices) {
    if (isBack) {
      if ([device position] == AVCaptureDevicePositionBack) {
        _device = device;
        break;
      }
    } else {
      if ([device position] == AVCaptureDevicePositionFront) {
        _device = device;
        break;
      }
    }
  }

  NSError *error;

  self.input = [[AVCaptureDeviceInput alloc] initWithDevice:self.device error:&error];
  if ([self.session canAddInput:self.input]) {
    [self.session addInput:self.input];
  }

  self.imageOutput = [[AVCapturePhotoOutput alloc] init];
  NSDictionary *setDic = @{AVVideoCodecKey:AVVideoCodecJPEG};
  _outputSettings = [AVCapturePhotoSettings photoSettingsWithFormat:setDic];
  [self.imageOutput setPhotoSettingsForSceneMonitoring:_outputSettings];
  [self.session addOutput:self.imageOutput];
  self.preview = [[AVCaptureVideoPreviewLayer alloc] initWithSession:self.session];
  [self.preview setVideoGravity:AVLayerVideoGravityResizeAspectFill];
  [self.preview setFrame:CGRectMake(0, 0,
                                    UIScreen.mainScreen.bounds.size.width,
                                    UIScreen.mainScreen.bounds.size.height)];
  [self.view.layer insertSublayer:self.preview atIndex:0];
  [self.session startRunning];
}

- (IBAction)takePhoto:(id)sender {
  NSDictionary *setDic = @{AVVideoCodecKey:AVVideoCodecJPEG};
  AVCapturePhotoSettings *outputSettings = [AVCapturePhotoSettings photoSettingsWithFormat:setDic];
  [self.imageOutput capturePhotoWithSettings:outputSettings delegate:self];
}

- (IBAction)backAction:(id)sender {
  [self.navigationController popViewControllerAnimated:YES];
}

#pragma mark AVCapturePhotoCaptureDelegate
- (void)captureOutput:(AVCapturePhotoOutput *)captureOutput didFinishProcessingPhotoSampleBuffer:(nullable CMSampleBufferRef)photoSampleBuffer previewPhotoSampleBuffer:(nullable CMSampleBufferRef)previewPhotoSampleBuffer resolvedSettings:(AVCaptureResolvedPhotoSettings *)resolvedSettings bracketSettings:(nullable AVCaptureBracketedStillImageSettings *)bracketSettings error:(nullable NSError *)error {
  NSData *rawData = [AVCapturePhotoOutput JPEGPhotoDataRepresentationForJPEGSampleBuffer:photoSampleBuffer previewPhotoSampleBuffer:previewPhotoSampleBuffer];
  NSData *compressedImageData = [DPImageUtils compressImage:[UIImage imageWithData:rawData]];
  if ([DPMainManager sharedDPMainManager].collectState == DPCollectStateNormal) {
    [[DPMainManager sharedDPMainManager] createCacheOnDiskWithImageData:compressedImageData];
  }
  if ([DPMainManager sharedDPMainManager].collectState == DPCollectStateEdit) {
    DPPageViewModel *selectedPageViewModel = [DPMainManager sharedDPMainManager].selectedPageViewModelInEditMode;
    NSString *imageName = selectedPageViewModel.imageName;
    [[DPMainManager sharedDPMainManager] replaceCachedImageDataWithImageData:compressedImageData
                                                                   imageName:imageName];
  }
  if ([DPMainManager sharedDPMainManager].takePhotoActionCallBack) {
    [DPMainManager sharedDPMainManager].takePhotoActionCallBack();
    [self.shutterButton setEnabled:YES];
    [self.shutterButton setAlpha:1.f];
  }
}

- (void)startRunning {
  [_session startRunning];
}

- (void)stopRunning {
  [_session stopRunning];
}

@end


text:
using System;
using System.Collections.Generic;

namespace ApiTools
{
    public class BusinessLogicException : Exception
    {
        public List<string> Errors { get; set; } = new List<string>();

        public BusinessLogicException() { }

        public BusinessLogicException(string message)
        {
            Errors.Add(message);
        }

        public void AddError(string message)
        {
            if (!Errors.Contains(message))
                Errors.Add(message);
        }

        public override string Message
        {
            get
            {
                return string.Join("", Errors);
            }
        }
    }
}


text:
bool BookmarkManager::AddBookmark( const CStringW& strURL, const CStringW& strTitle, const CStringW& strFaviconURL )
{
	Bookmark bookmark;
	bookmark.m_strURL = strURL;
	bookmark.m_strTitle = strTitle;
	bookmark.m_strFaviconURL = strFaviconURL;

	m_Bookmarks.insert(BookmarkPair(strURL, bookmark));
	m_Storage.AddBookmark(&bookmark);
	return true;
}

bool BookmarkManager::CheckIsAdded( const CStringW& strURL )
{
	return m_Bookmarks.find(strURL) != m_Bookmarks.end();
}

void BookmarkManager::DeleteBookmark( const CStringW& strURL )
{
	BookmarkMap::iterator iter = m_Bookmarks.find(strURL);
	if (iter != m_Bookmarks.end()){
		m_Storage.DeleteBookmark(&(iter->second));
		m_Bookmarks.erase(iter);
	}
}

void BookmarkManager::GetBookmarksJson( CStringW& strBookmarks )
{
	strBookmarks =L"[";
	BookmarkMap::iterator iter = m_Bookmarks.begin();
	for (; iter != m_Bookmarks.end(); ++iter){
		CStringW strURL, strTitle, strFaviconURL;
		Util::Stringify(iter->second.m_strURL, strURL);
		Util::Stringify(iter->second.m_strTitle, strTitle);
		Util::Stringify(iter->second.m_strFaviconURL, strFaviconURL);
		if (iter != m_Bookmarks.begin()){
			strBookmarks += L",";
		}

		strBookmarks += L"{\"url\":\"";
		strBookmarks += strURL;
		strBookmarks += L"\", \"title\":\"";
		strBookmarks += strTitle;
		strBookmarks += L"\", \"icon\":\"";
		strBookmarks += strFaviconURL;
		strBookmarks += L"\"}";
	}
	strBookmarks += L"]";
}

BookmarkManager::BookmarkManager()
{
	m_Storage.GetBookmarks(m_Bookmarks);
}

BookmarkManager::~BookmarkManager()
{

}


text:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <parent>
        <artifactId>viaversion-parent</artifactId>
        <groupId>us.myles</groupId>
        <version>1.1.1-SNAPSHOT</version>
    </parent>
    <modelVersion>4.0.0</modelVersion>

    <artifactId>viaversion-sponge-legacy</artifactId>
    <packaging>jar</packaging>

    <properties>
        <maven.compiler.source>1.8</maven.compiler.source>
        <maven.compiler.target>1.8</maven.compiler.target>
    </properties>

    <repositories>
        <repository>
            <id>sponge</id>
            <url>http://repo.spongepowered.org/maven</url>
        </repository>
    </repositories>

    <build>
        <resources>
            <resource>
                <targetPath>.</targetPath>
                <filtering>true</filtering>
                <directory>src/main/resources/</directory>
                <includes>
                    <include>*</include>
                </includes>
            </resource>
        </resources>
    </build>

    <dependencies>
        <!-- Common Module -->
        <dependency>
            <groupId>us.myles</groupId>
            <artifactId>viaversion-common</artifactId>
            <version>${project.parent.version}</version>
            <scope>provided</scope>
        </dependency>

        <!-- Sponge API API 4 -->
        <dependency>
            <groupId>org.spongepowered</groupId>
            <artifactId>spongeapi</artifactId>
            <version>4.0.0-SNAPSHOT</version>
            <scope>provided</scope>
        </dependency>
    </dependencies>

</project>


text:
package com.thoughtworks.selenium.corebased;

import com.thoughtworks.selenium.InternalSelenseTestBase;

import org.junit.Test;

public class TestFunkEventHandling extends InternalSelenseTestBase {
  @Test
  public void testFunkEventHandling() throws Exception {
    selenium.open("../tests/html/test_funky_event_handling.html");
    selenium.click("clickMe");
    Thread.sleep(1000);
    verifyFalse(selenium.isTextPresent("You shouldn't be here!"));
  }
}


text:
package org.apache.eagle.jpm.util.resourcefetch.model;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;

import java.io.Serializable;

@JsonSerialize(include = JsonSerialize.Inclusion.NON_NULL)
@JsonIgnoreProperties(ignoreUnknown = true)
public class ClusterInfo implements Serializable {
    private static final long serialVersionUID = 1L;

    private long id;
    private long startedOn;
    private String state;
    private String haState;
    private String resourceManagerVersion;
    private String resourceManagerBuildVersion;
    private String resourceManagerVersionBuiltOn;
    private String hadoopVersion;
    private String hadoopBuildVersion;
    private String hadoopVersionBuiltOn;

    public long getId() {
        return id;
    }

    public void setId(long id) {
        this.id = id;
    }

    public long getStartedOn() {
        return startedOn;
    }

    public void setStartedOn(long startedOn) {
        this.startedOn = startedOn;
    }

    public String getState() {
        return state;
    }

    public void setState(String state) {
        this.state = state;
    }

    public String getHaState() {
        return haState;
    }

    public void setHaState(String haState) {
        this.haState = haState;
    }

    public String getResourceManagerVersion() {
        return resourceManagerVersion;
    }

    public void setResourceManagerVersion(String resourceManagerVersion) {
        this.resourceManagerVersion = resourceManagerVersion;
    }

    public String getResourceManagerBuildVersion() {
        return resourceManagerBuildVersion;
    }

    public void setResourceManagerBuildVersion(String resourceManagerBuildVersion) {
        this.resourceManagerBuildVersion = resourceManagerBuildVersion;
    }

    public String getResourceManagerVersionBuiltOn() {
        return resourceManagerVersionBuiltOn;
    }

    public void setResourceManagerVersionBuiltOn(String resourceManagerVersionBuiltOn) {
        this.resourceManagerVersionBuiltOn = resourceManagerVersionBuiltOn;
    }

    public String getHadoopVersion() {
        return hadoopVersion;
    }

    public void setHadoopVersion(String hadoopVersion) {
        this.hadoopVersion = hadoopVersion;
    }

    public String getHadoopBuildVersion() {
        return hadoopBuildVersion;
    }

    public void setHadoopBuildVersion(String hadoopBuildVersion) {
        this.hadoopBuildVersion = hadoopBuildVersion;
    }

    public String getHadoopVersionBuiltOn() {
        return hadoopVersionBuiltOn;
    }

    public void setHadoopVersionBuiltOn(String hadoopVersionBuiltOn) {
        this.hadoopVersionBuiltOn = hadoopVersionBuiltOn;
    }

    @Override
    public String toString() {
        return "ClusterInfo{"
                + "id=" + id
                + ", startedOn=" + startedOn
                + ", state='" + state + '\''
                + ", haState='" + haState + '\''
                + ", resourceManagerVersion='" + resourceManagerVersion + '\''
                + ", resourceManagerBuildVersion='" + resourceManagerBuildVersion + '\''
                + ", resourceManagerVersionBuiltOn='" + resourceManagerVersionBuiltOn + '\''
                + ", hadoopVersion='" + hadoopVersion + '\''
                + ", hadoopBuildVersion='" + hadoopBuildVersion + '\''
                + ", hadoopVersionBuiltOn='" + hadoopVersionBuiltOn + '\''
                + '}';
    }
}


text:
<?php

namespace ZPB\Admin\CommonBundle\Controller;

use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use ZPB\Admin\CommonBundle\Entity\Email;
use ZPB\Admin\CommonBundle\Entity\User;

class DefaultController extends BaseController
{
    public function indexAction()
    {
        return $this->render('ZPBAdminCommonBundle:Default:index.html.twig');
    }
}


text:
package ex01.pyrmont;

import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.net.InetAddress;
import java.net.ServerSocket;
import java.net.Socket;

/**
 * @since 2016-08-23
 */
public class HttpServer {

  public static final String WEB_ROOT =
      System.getProperty("user.dir") + File.separator + "webroot";

  public static final String SHUTDOWN_COMMAND = "/SHUTDOWN";

  private boolean shutdown = false;

  public static void main (String[] args) {
    HttpServer server = new HttpServer();
    server.await();
  }

  public void await(){
    ServerSocket serverSocket = null;
    int port = 8080;
    try {
      serverSocket = new ServerSocket(port,1, InetAddress.getByName("127.0.0.1"));
    } catch (IOException e) {
      e.printStackTrace();
      System.exit(1);
    }

    while(!shutdown){
      Socket socket = null;
      InputStream input = null;
      OutputStream output = null;

      try {
        socket = serverSocket.accept();
        input = socket.getInputStream();
        output = socket.getOutputStream();

        Request request = new Request(input);
        /*
         * 注意,parse方法没有使用while循环取数据,
         * 因为socket没有断开,如果使用while取数据
         * 会导致线程一直阻塞在这里,直到socket断开
         * 导致下面的response一直不能写数据
         */
        request.parse();

        Response response = new Response(output);
        response.setRequest(request);
        response.sendStaticResource();

        socket.close();

        shutdown = request.getUri().equals(SHUTDOWN_COMMAND);
      } catch (IOException e) {
        e.printStackTrace();
        continue;
      }
    }
  }
}


text:
Bug #32427 (Interfaces are not allowed 'static' access modifier)
--FILE--
<?php

interface Example {
	public static function sillyError();
}

class ExampleImpl implements Example {
	public static function sillyError() {
		echo "I am a silly error\n";
	}
}

ExampleImpl::sillyError();
?>
--EXPECT--
I am a silly error


text:
using Demic.Enums;
using Demic.Managers;
using System;
using System.Linq;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Demic.Classes;

namespace DemicTest
{
    [TestClass]
    public class BoardStateManagerTests
    {
        [TestMethod]
        public void TotalCubesStartAtZero()
        {
            var testLocationManager = new TestLocationManager();
            var boardManager = new BoardStateManager(testLocationManager);
            var totalCubes = 0;
            foreach (DiseaseColour colour in Enum.GetValues(typeof(DiseaseColour)))
            {
                totalCubes += boardManager.totalCubes(colour);
            }
            Assert.AreEqual<int>(0, totalCubes, "Initial count for Cubes is non-zero");
        }

        [TestMethod]
        public void AddCube()
        {
            var testLocationManager = new TestSingleLocationManager();
            var loc = testLocationManager.GetLocations().First();
            var boardManager = new BoardStateManager(testLocationManager);
            boardManager.AddCubes(loc, 2);
            Assert.AreEqual<int>(2, boardManager.totalCubes(loc.Colour), "Adding cubes doesn't increase total cubes");
        }

        [TestMethod]
        public void SetCubesToThreeFromZero()
        {
            var testLocationManager = new TestSingleLocationManager();
            var loc = testLocationManager.GetLocations().First();
            var boardManager = new BoardStateManager(testLocationManager);
            boardManager.SetCubes(loc, 3);
            Assert.AreEqual<int>(3, boardManager.totalCubes(loc.Colour), "Setting cubes to 3 doesn't result in correct number");
        }

        [TestMethod]
        public void SetCubesToThreeFromTwo()
        {
            var testLocationManager = new TestSingleLocationManager();
            var loc = testLocationManager.GetLocations().First();
            var boardManager = new BoardStateManager(testLocationManager);
            boardManager.AddCubes(loc, 2);
            boardManager.SetCubes(loc, 3);
            Assert.AreEqual<int>(3, boardManager.totalCubes(loc.Colour), "Increasing cubes to 3 from 2 doesn't result in correct number");
        }

        [TestMethod]
        public void OutbreakCountStartsAtZero()
        {
            var testLocationManager = new TestSingleLocationManager();
            var boardManager = new BoardStateManager(testLocationManager);
            Assert.AreEqual<int>(0, boardManager.OutbreakCount);
        }

        [TestMethod]
        public void OutputCubesForOnlyTwoPlaces()
        {
            var testLocationManager = new TestLocationManager();
            var boardManager = new BoardStateManager(testLocationManager);
            foreach (Location loc in testLocationManager.GetLocations().Take(2))
            {
                boardManager.AddCubes(loc, 2);
            }
            Assert.AreEqual(2, boardManager.OutputLocationsAndDiseaseCounts().Count);
        }
    }
}


text:
package io.github.hidroh.materialistic.widget;

import android.app.Dialog;
import android.content.Intent;
import android.view.GestureDetector;
import android.view.MotionEvent;
import android.view.View;

import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.robolectric.RuntimeEnvironment;
import org.robolectric.annotation.LooperMode;
import org.robolectric.shadows.ShadowDialog;
import org.robolectric.shadows.ShadowGestureDetector;

import androidx.appcompat.view.ContextThemeWrapper;
import io.github.hidroh.materialistic.Navigable;
import io.github.hidroh.materialistic.R;
import io.github.hidroh.materialistic.test.TestRunner;

import static junit.framework.Assert.assertNotNull;
import static junit.framework.Assert.assertTrue;
import static org.assertj.android.api.Assertions.assertThat;
import static org.mockito.ArgumentMatchers.eq;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.verify;
import static org.robolectric.Shadows.shadowOf;

@RunWith(TestRunner.class)
public class NavFloatingActionButtonTest {
    private NavFloatingActionButton button;
    private Navigable navigable;
    private GestureDetector.SimpleOnGestureListener gestureListener;

    @Before
    public void setUp() {
        button = new NavFloatingActionButton(new ContextThemeWrapper(RuntimeEnvironment.application,
                R.style.AppTheme));
        shadowOf(button).getOnTouchListener().onTouch(button,
                MotionEvent.obtain(0, 0, MotionEvent.ACTION_CANCEL, 0, 0, 0));
        gestureListener = (GestureDetector.SimpleOnGestureListener)
                shadowOf(ShadowGestureDetector.getLastActiveDetector()).getListener();
        navigable = mock(Navigable.class);
        button.setNavigable(navigable);
        assertTrue(gestureListener.onDown(null));
    }

    @Test(expected = UnsupportedOperationException.class)
    public void testNoTouchOverride() {
        button.setOnTouchListener(mock(View.OnTouchListener.class));
    }

    @Test
    public void testSwipeUp() {
        gestureListener.onFling(null, null, 0f, -1f); // up
        verify(navigable).onNavigate(eq(Navigable.DIRECTION_UP));
    }

    @Test
    public void testSwipeDown() {
        gestureListener.onFling(null, null, 0f, 1f); // down
        verify(navigable).onNavigate(eq(Navigable.DIRECTION_DOWN));
    }

    @Test
    public void testSwipeLeft() {
        gestureListener.onFling(null, null, -1f, 0f); // left
        verify(navigable).onNavigate(eq(Navigable.DIRECTION_LEFT));
    }

    @Test
    public void testSwipeRight() {
        gestureListener.onFling(null, null, 1f, 0f); // right
        verify(navigable).onNavigate(eq(Navigable.DIRECTION_RIGHT));
    }

    @LooperMode(LooperMode.Mode.LEGACY)
    @Test
    public void testKonami() {
        gestureListener.onFling(null, null, 0f, 1f); // down, invalid, should ignore

        gestureListener.onFling(null, null, 0f, -1f); // up
        gestureListener.onFling(null, null, 0f, 1f); // down, invalid, should reset

        gestureListener.onFling(null, null, 0f, -1f); // up
        gestureListener.onFling(null, null, 0f, -1f); // up
        gestureListener.onFling(null, null, 0f, 1f); // down
        gestureListener.onFling(null, null, 0f, 1f); // down
        gestureListener.onFling(null, null, -1f, 0f); // left
        gestureListener.onFling(null, null, 1f, 0f); // right
        gestureListener.onFling(null, null, -1f, 0f); // left
        gestureListener.onFling(null, null, 1f, 0f); // right
        gestureListener.onDoubleTap(null);
        Dialog dialog = ShadowDialog.getLatestDialog();
        assertNotNull(dialog);
        shadowOf(dialog).clickOn(android.R.id.button1); // BUTTON_POSITIVE
        assertThat(shadowOf(RuntimeEnvironment.application).getNextStartedActivity())
                .hasAction(Intent.ACTION_VIEW);
    }
}


text:
<?php
/**
 * WPSEO plugin file.
 *
 * @package WPSEO\Internals
 */

if ( ! defined( 'WPSEO_VERSION' ) ) {
	header( 'Status: 403 Forbidden' );
	header( 'HTTP/1.1 403 Forbidden' );
	exit();
}

/**
 * Adds an SEO admin bar menu with several options. If the current user is an admin he can also go straight to several settings menu's from here.
 */
function wpseo_admin_bar_menu() {
	// If the current user can't write posts, this is all of no use, so let's not output an admin menu.
	if ( ! current_user_can( 'edit_posts' ) ) {
		return;
	}

	$options = WPSEO_Options::get_options( array( 'wpseo', 'wpseo_ms' ) );

	if ( $options['enable_admin_bar_menu'] !== true ) {
		return;
	}

	global $wp_admin_bar, $post;

	$focuskw = '';
	$score   = '';
	// By default, the top level menu item has no link.
	$seo_url = '';
	// By default, make the no-link top level menu item focusable.
	$top_level_link_tabindex = '0';

	$analysis_seo         = new WPSEO_Metabox_Analysis_SEO();
	$analysis_readability = new WPSEO_Metabox_Analysis_Readability();

	if ( ( is_singular() || ( is_admin() && WPSEO_Metabox::is_post_edit( $GLOBALS['pagenow'] ) ) ) && isset( $post ) && is_object( $post ) && apply_filters( 'wpseo_use_page_analysis', true ) === true
	) {
		$focuskw = WPSEO_Meta::get_value( 'focuskw', $post->ID );

		if ( $analysis_seo->is_enabled() ) {
			$score = wpseo_adminbar_seo_score();
		}
		elseif ( $analysis_readability->is_enabled() ) {
			$score = wpseo_adminbar_content_score();
		}
	}

	if ( is_category() || is_tag() || ( WPSEO_Taxonomy::is_term_edit( $GLOBALS['pagenow'] ) && ! WPSEO_Taxonomy::is_term_overview( $GLOBALS['pagenow'] ) ) || is_tax() ) {
		if ( $analysis_seo->is_enabled() ) {
			$score = wpseo_tax_adminbar_seo_score();
		}
		elseif ( $analysis_readability->is_enabled() ) {
			$score = wpseo_tax_adminbar_content_score();
		}
	}

	// Never display notifications for network admin.
	$counter     = '';
	$alert_popup = '';

	// Determine is user is admin or network admin.
	$can_manage_seo = WPSEO_Capability_Utils::current_user_can( 'wpseo_manage_options' );

	// Set the top level menu item content for admins and network admins.
	if ( $can_manage_seo ) {

		// Link the top level menu item to the Yoast Dashboard page.
		$seo_url = get_admin_url( null, 'admin.php?page=' . WPSEO_Admin::PAGE_IDENTIFIER );
		// Since admins will get a real link, there's no need for a tabindex attribute.
		$top_level_link_tabindex = false;

		if ( '' === $score ) {

			// Notification information.
			$notification_center     = Yoast_Notification_Center::get();
			$notification_count      = $notification_center->get_notification_count();
			$new_notifications       = $notification_center->get_new_notifications();
			$new_notifications_count = count( $new_notifications );

			if ( $notification_count > 0 ) {
				// Always show Alerts page when clicking on the main link.
				/* translators: %s: number of notifications */
				$counter_screen_reader_text = sprintf( _n( '%s notification', '%s notifications', $notification_count, 'wordpress-seo' ), number_format_i18n( $notification_count ) );

				$counter = sprintf( '
%d%s
', $notification_count, $counter_screen_reader_text );
			}

			if ( $new_notifications_count ) {
				$notification = sprintf(
					/* translators: %d resolves to the number of alerts being added. */
					_n( 'You have %d new issue concerning your SEO!', 'You have %d new issues concerning your SEO!', $new_notifications_count, 'wordpress-seo' ),
					$new_notifications_count
				);
				if ( $new_notifications_count === 1 ) {
					$notification = sprintf(
						__( 'You have a new issue concerning your SEO!', 'wordpress-seo' ),
						$new_notifications_count
					);
				}
				$alert_popup = '
' . $notification . '
';
			}
		}
	}

	$title = '
' . __( 'SEO', 'wordpress-seo' ) . '
';

	$wp_admin_bar->add_menu( array(
		'id'    => 'wpseo-menu',
		'title' => $title . $score . $counter . $alert_popup,
		'href'  => $seo_url,
		'meta'  => array( 'tabindex' => $top_level_link_tabindex ),
	) );
	if ( ! empty( $notification_count ) ) {
		$wp_admin_bar->add_menu( array(
			'parent' => 'wpseo-menu',
			'id'     => 'wpseo-notifications',
			'title'  => __( 'Notifications', 'wordpress-seo' ) . $counter,
			'href'   => $seo_url,
			'meta'   => array( 'tabindex' => $top_level_link_tabindex ),
		) );
	}

	if ( WPSEO_Capability_Utils::current_user_can( 'wpseo_manage_options' ) ) {
		$wp_admin_bar->add_menu( array(
			'parent' => 'wpseo-menu',
			'id'     => 'wpseo-configuration-wizard',
			'title'  => __( 'Configuration Wizard', 'wordpress-seo' ),
			'href'   => admin_url( 'admin.php?page=' . WPSEO_Configuration_Page::PAGE_IDENTIFIER ),
		) );
	}
	$wp_admin_bar->add_menu( array(
		'parent' => 'wpseo-menu',
		'id'     => 'wpseo-kwresearch',
		'title'  => __( 'Keyword Research', 'wordpress-seo' ),
		'meta'   => array( 'tabindex' => '0' ),
	) );
	$wp_admin_bar->add_menu( array(
		'parent' => 'wpseo-kwresearch',
		'id'     => 'wpseo-adwordsexternal',
		'title'  => __( 'AdWords External', 'wordpress-seo' ),
		'href'   => 'https://adwords.google.com/keywordplanner',
		'meta'   => array( 'target' => '_blank' ),
	) );
	$wp_admin_bar->add_menu( array(
		'parent' => 'wpseo-kwresearch',
		'id'     => 'wpseo-googleinsights',
		'title'  => __( 'Google Trends', 'wordpress-seo' ),
		'href'   => 'https://www.google.com/trends/explore#q=' . urlencode( $focuskw ),
		'meta'   => array( 'target' => '_blank' ),
	) );
	$wp_admin_bar->add_menu( array(
		'parent' => 'wpseo-kwresearch',
		'id'     => 'wpseo-wordtracker',
		'title'  => __( 'SEO Book', 'wordpress-seo' ),
		'href'   => 'http://tools.seobook.com/keyword-tools/seobook/?keyword=' . urlencode( $focuskw ),
		'meta'   => array( 'target' => '_blank' ),
	) );

	if ( ! is_admin() ) {
		$url = WPSEO_Frontend::get_instance()->canonical( false );

		if ( is_string( $url ) ) {
			$wp_admin_bar->add_menu( array(
				'parent' => 'wpseo-menu',
				'id'     => 'wpseo-analysis',
				'title'  => __( 'Analyze this page', 'wordpress-seo' ),
				'meta'   => array( 'tabindex' => '0' ),
			) );
			$wp_admin_bar->add_menu( array(
				'parent' => 'wpseo-analysis',
				'id'     => 'wpseo-inlinks-ose',
				'title'  => __( 'Check Inlinks (OSE)', 'wordpress-seo' ),
				'href'   => '//moz.com/researchtools/ose/links?site=' . urlencode( $url ),
				'meta'   => array( 'target' => '_blank' ),
			) );
			$wp_admin_bar->add_menu( array(
				'parent' => 'wpseo-analysis',
				'id'     => 'wpseo-kwdensity',
				'title'  => __( 'Check Keyword Density', 'wordpress-seo' ),
				// HTTPS not available.
				'href'   => 'http://www.zippy.co.uk/keyworddensity/index.php?url=' . urlencode( $url ) . '&keyword=' . urlencode( $focuskw ),
				'meta'   => array( 'target' => '_blank' ),
			) );
			$wp_admin_bar->add_menu( array(
				'parent' => 'wpseo-analysis',
				'id'     => 'wpseo-cache',
				'title'  => __( 'Check Google Cache', 'wordpress-seo' ),
				'href'   => '//webcache.googleusercontent.com/search?strip=1&q=cache:' . urlencode( $url ),
				'meta'   => array( 'target' => '_blank' ),
			) );
			$wp_admin_bar->add_menu( array(
				'parent' => 'wpseo-analysis',
				'id'     => 'wpseo-header',
				'title'  => __( 'Check Headers', 'wordpress-seo' ),
				'href'   => '//quixapp.com/headers/?r=' . urlencode( $url ),
				'meta'   => array( 'target' => '_blank' ),
			) );
			$wp_admin_bar->add_menu( array(
				'parent' => 'wpseo-analysis',
				'id'     => 'wpseo-structureddata',
				'title'  => __( 'Google Structured Data Test', 'wordpress-seo' ),
				'href'   => 'https://search.google.com/structured-data/testing-tool#url=' . urlencode( $url ),
				'meta'   => array( 'target' => '_blank' ),
			) );
			$wp_admin_bar->add_menu( array(
				'parent' => 'wpseo-analysis',
				'id'     => 'wpseo-facebookdebug',
				'title'  => __( 'Facebook Debugger', 'wordpress-seo' ),
				'href'   => '//developers.facebook.com/tools/debug/og/object?q=' . urlencode( $url ),
				'meta'   => array( 'target' => '_blank' ),
			) );
			$wp_admin_bar->add_menu( array(
				'parent' => 'wpseo-analysis',
				'id'     => 'wpseo-pinterestvalidator',
				'title'  => __( 'Pinterest Rich Pins Validator', 'wordpress-seo' ),
				'href'   => 'https://developers.pinterest.com/tools/url-debugger/?link=' . urlencode( $url ),
				'meta'   => array( 'target' => '_blank' ),
			) );
			$wp_admin_bar->add_menu( array(
				'parent' => 'wpseo-analysis',
				'id'     => 'wpseo-htmlvalidation',
				'title'  => __( 'HTML Validator', 'wordpress-seo' ),
				'href'   => '//validator.w3.org/check?uri=' . urlencode( $url ),
				'meta'   => array( 'target' => '_blank' ),
			) );
			$wp_admin_bar->add_menu( array(
				'parent' => 'wpseo-analysis',
				'id'     => 'wpseo-cssvalidation',
				'title'  => __( 'CSS Validator', 'wordpress-seo' ),
				'href'   => '//jigsaw.w3.org/css-validator/validator?uri=' . urlencode( $url ),
				'meta'   => array( 'target' => '_blank' ),
			) );
			$wp_admin_bar->add_menu( array(
				'parent' => 'wpseo-analysis',
				'id'     => 'wpseo-pagespeed',
				'title'  => __( 'Google Page Speed Test', 'wordpress-seo' ),
				'href'   => '//developers.google.com/speed/pagespeed/insights/?url=' . urlencode( $url ),
				'meta'   => array( 'target' => '_blank' ),
			) );
			$wp_admin_bar->add_menu( array(
				'parent' => 'wpseo-analysis',
				'id'     => 'wpseo-google-mobile-friendly',
				'title'  => __( 'Mobile-Friendly Test', 'wordpress-seo' ),
				'href'   => 'https://www.google.com/webmasters/tools/mobile-friendly/?url=' . urlencode( $url ),
				'meta'   => array( 'target' => '_blank' ),
			) );
		}
	}

	if ( $can_manage_seo ) {
		$wp_admin_bar->add_menu( array(
			'parent' => 'wpseo-menu',
			'id'     => 'wpseo-settings',
			'title'  => __( 'SEO Settings', 'wordpress-seo' ),
			'meta'   => array( 'tabindex' => '0' ),
		) );
		$wp_admin_bar->add_menu( array(
			'parent' => 'wpseo-settings',
			'id'     => 'wpseo-general',
			'title'  => __( 'General', 'wordpress-seo' ),
			'href'   => admin_url( 'admin.php?page=wpseo_dashboard' ),
		) );
		$wp_admin_bar->add_menu( array(
			'parent' => 'wpseo-settings',
			'id'     => 'wpseo-titles',
			'title'  => __( 'Search Appearance', 'wordpress-seo' ),
			'href'   => admin_url( 'admin.php?page=wpseo_titles' ),
		) );
		$wp_admin_bar->add_menu( array(
			'parent' => 'wpseo-settings',
			'id'     => 'wpseo-search-console',
			'title'  => __( 'Search Console', 'wordpress-seo' ),
			'href'   => admin_url( 'admin.php?page=wpseo_search_console' ),
		) );
		$wp_admin_bar->add_menu( array(
			'parent' => 'wpseo-settings',
			'id'     => 'wpseo-social',
			'title'  => __( 'Social', 'wordpress-seo' ),
			'href'   => admin_url( 'admin.php?page=wpseo_social' ),
		) );
		$wp_admin_bar->add_menu( array(
			'parent' => 'wpseo-settings',
			'id'     => 'wpseo-tools',
			'title'  => __( 'Tools', 'wordpress-seo' ),
			'href'   => admin_url( 'admin.php?page=wpseo_tools' ),
		) );
		$wp_admin_bar->add_menu( array(
			'parent' => 'wpseo-settings',
			'id'     => 'wpseo-licenses',
			'title'  => __( 'Premium', 'wordpress-seo' ),
			'href'   => admin_url( 'admin.php?page=wpseo_licenses' ),
		) );
	}
}

/**
 * Returns the SEO score element for the admin bar.
 *
 * @return string
 */
function wpseo_adminbar_seo_score() {
	$rating = WPSEO_Meta::get_value( 'linkdex', get_the_ID() );

	return wpseo_adminbar_score( $rating );
}

/**
 * Returns the content score element for the adminbar.
 *
 * @return string
 */
function wpseo_adminbar_content_score() {
	$rating = WPSEO_Meta::get_value( 'content_score', get_the_ID() );

	return wpseo_adminbar_score( $rating );
}

/**
 * Returns the SEO score element for the adminbar.
 *
 * @return string
 */
function wpseo_tax_adminbar_seo_score() {
	$rating = 0;

	if ( is_tax() || is_category() || is_tag() ) {
		$rating = WPSEO_Taxonomy_Meta::get_meta_without_term( 'linkdex' );
	}

	return wpseo_adminbar_score( $rating );
}

/**
 * Returns the Content score element for the adminbar.
 *
 * @return string
 */
function wpseo_tax_adminbar_content_score() {
	$rating = 0;

	if ( is_tax() || is_category() || is_tag() ) {
		$rating = WPSEO_Taxonomy_Meta::get_meta_without_term( 'content_score' );
	}

	return wpseo_adminbar_score( $rating );
}

/**
 * Takes The SEO score and makes the score icon for the adminbar with it.
 *
 * @param int $score The 0-100 rating of the score. Can be either SEO score or content score.
 *
 * @return string $score_adminbar_element
 */
function wpseo_adminbar_score( $score ) {
	$score = WPSEO_Utils::translate_score( $score );

	$score_adminbar_element = '

';

	return $score_adminbar_element;
}

add_action( 'admin_bar_menu', 'wpseo_admin_bar_menu', 95 );

/**
 * Enqueue CSS to format the Yoast SEO adminbar item.
 */
function wpseo_admin_bar_style() {
	if ( ! is_admin_bar_showing() || WPSEO_Options::get( 'enable_admin_bar_menu' ) !== true ) {
		return;
	}

	$asset_manager = new WPSEO_Admin_Asset_Manager();
	$asset_manager->register_assets();
	$asset_manager->enqueue_style( 'adminbar' );
}

add_action( 'wp_enqueue_scripts', 'wpseo_admin_bar_style' );
add_action( 'admin_enqueue_scripts', 'wpseo_admin_bar_style' );

/**
 * Allows editing of the meta fields through weblog editors like Marsedit.
 *
 * @param array $allcaps Capabilities that must all be true to allow action.
 * @param array $cap     Array of capabilities to be checked, unused here.
 * @param array $args    List of arguments for the specific cap to be checked.
 *
 * @return array $allcaps
 */
function allow_custom_field_edits( $allcaps, $cap, $args ) {
	// $args[0] holds the capability.
	// $args[2] holds the post ID.
	// $args[3] holds the custom field.
	// Make sure the request is to edit or add a post meta (this is usually also the second value in $cap,
	// but this is safer to check).
	if ( in_array( $args[0], array( 'edit_post_meta', 'add_post_meta' ), true ) ) {
		// Only allow editing rights for users who have the rights to edit this post and make sure
		// the meta value starts with _yoast_wpseo (WPSEO_Meta::$meta_prefix).
		if ( ( isset( $args[2] ) && current_user_can( 'edit_post', $args[2] ) ) && ( ( isset( $args[3] ) && $args[3] !== '' ) && strpos( $args[3], WPSEO_Meta::$meta_prefix ) === 0 ) ) {
			$allcaps[ $args[0] ] = true;
		}
	}

	return $allcaps;
}

add_filter( 'user_has_cap', 'allow_custom_field_edits', 0, 3 );

/********************** DEPRECATED FUNCTIONS **********************/

/**
 * Detects if the advanced settings are enabled.
 *
 * @deprecated 7.0
 */
function wpseo_advanced_settings_enabled() {
	_deprecated_function( __FUNCTION__, 'WPSEO 7.0', null );
}


text:
cask 'raw-photo-processor' do
  version '1876Beta'
  sha256 '458d9912db08ba1d874bed49242a51e2d01f32220ecc07cc7449fd5352e8bf3d'

  url "https://www.raw-photo-processor.com/RPP/RPP64_#{version}.zip"
  appcast 'https://www.raw-photo-processor.com/rpp_updates_64.xml'
  name 'Raw Photo Processor'
  homepage 'https://www.raw-photo-processor.com/RPP/Overview.html'

  app 'Raw Photo Processor 64.app'
end


text:
<!DOCTYPE html>

  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <title ng-bind="title + ' -- My CV reader'">une petite seconde</title>
  <meta name="description" content="">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <link rel="stylesheet" href="bower_components/html5-boilerplate/dist/css/normalize.css">
  <link rel="stylesheet" href="bower_components/html5-boilerplate/dist/css/main.css">
  <link rel="stylesheet" href="app.css">


text: export { ContainerSoftware32 as default } from "../../";


text:
from opencensus.stats import aggregation as aggregation_module
from opencensus.stats import measure as measure_module
from opencensus.stats import view as view_module

# docker error
DOCKER_ERROR_MEASURE = measure_module.MeasureInt(
    'docker_error', 'The number of docker errors.', 'Errors')
DOCKER_ERROR_VIEW = view_module.View(
    "docker_error_count",
    "The number of the docker errors",
    [],
    DOCKER_ERROR_MEASURE,
    aggregation_module.CountAggregation())

ALL_VIEWS = [
    DOCKER_ERROR_VIEW,
]


text:
/**
 * @file Support for rendering line annotations.
 */

import {Annotation, AnnotationType, AxisAlignedBoundingBox, Line} from 'neuroglancer/annotation';
import {getSelectedAssocatedSegment, PlaceTwoCornerAnnotationTool} from 'neuroglancer/annotation/annotation';
import {AnnotationLayerState} from 'neuroglancer/annotation/frontend';
import {AnnotationRenderContext, AnnotationRenderHelper, registerAnnotationTypeRenderHandler} from 'neuroglancer/annotation/type_handler';
import {MouseSelectionState} from 'neuroglancer/layer';
import {UserLayerWithAnnotations} from 'neuroglancer/ui/annotations';
import {registerTool} from 'neuroglancer/ui/tool';
import {tile2dArray} from 'neuroglancer/util/array';
import {mat4, projectPointToLineSegment, vec3} from 'neuroglancer/util/geom';
import {Uint64} from 'neuroglancer/util/uint64';
import {getMemoizedBuffer} from 'neuroglancer/webgl/buffer';
import {CircleShader, VERTICES_PER_CIRCLE} from 'neuroglancer/webgl/circles';
import {LineShader} from 'neuroglancer/webgl/lines';
import {emitterDependentShaderGetter, ShaderBuilder, ShaderProgram} from 'neuroglancer/webgl/shader';
import {glsl_hsvToRgb, glsl_rgbToHsv} from 'neuroglancer/webgl/shader_lib';

const ANNOTATE_LINE_TOOL_ID = 'annotateLine';
const FULL_OBJECT_PICK_OFFSET = 0;
const ENDPOINTS_PICK_OFFSET = FULL_OBJECT_PICK_OFFSET + 1;
const PICK_IDS_PER_INSTANCE = ENDPOINTS_PICK_OFFSET + 2;

function getEndpointIndexArray() {
  return tile2dArray(
      new Uint8Array([0, 1]), /*majorDimension=*/1, /*minorTiles=*/1,
      /*majorTiles=*/VERTICES_PER_CIRCLE);
}

class RenderHelper extends AnnotationRenderHelper {
  private lineShader = this.registerDisposer(new LineShader(this.gl, 1));
  private circleShader = this.registerDisposer(new CircleShader(this.gl, 2));

  defineShader(builder: ShaderBuilder) {
    super.defineShader(builder);
    // Position of endpoints in camera coordinates.
    builder.addAttribute('highp vec3', 'aEndpointA');
    builder.addAttribute('highp vec3', 'aEndpointB');
  }

  private edgeShaderGetter =
      emitterDependentShaderGetter(this, this.gl, (builder: ShaderBuilder) => {
        this.defineShader(builder);
        this.lineShader.defineShader(builder);
        builder.setVertexMain(`
emitLine(uProjection, aEndpointA, aEndpointB);
${this.setPartIndex(builder)};
`);
        builder.setFragmentMain(`
vec4 borderColor = vec4(1.0, 1.0, 1.0, 1.0);
emitAnnotation(vec4(borderColor.rgb, borderColor.a * getLineAlpha() * ${
            this.getCrossSectionFadeFactor()}));
`);
      });

  private endpointIndexBuffer =
      this
          .registerDisposer(getMemoizedBuffer(
              this.gl, WebGL2RenderingContext.ARRAY_BUFFER, getEndpointIndexArray))
          .value;

  private endpointShaderGetter =
      emitterDependentShaderGetter(this, this.gl, (builder: ShaderBuilder) => {
        this.defineShader(builder);
        this.circleShader.defineShader(builder, this.targetIsSliceView);
        builder.addAttribute('highp uint', 'aEndpointIndex');
        builder.addVertexCode(glsl_hsvToRgb);
        builder.addVertexCode(glsl_rgbToHsv);
        builder.setVertexMain(`
vec3 vertexPosition = mix(aEndpointA, aEndpointB, float(aEndpointIndex));
emitCircle(uProjection * vec4(vertexPosition, 1.0));
${this.setPartIndex(builder, 'aEndpointIndex + 1u')};
if (aEndpointIndex == 1u) {
  vec3 hsv = rgbToHsv(vColor.rgb);
  hsv.x = fract(hsv.x - 0.1667);  // rotate by 60°
  vColor.rgb = hsvToRgb(hsv);
}
`);
        builder.setFragmentMain(`
vec4 borderColor = vec4(0.0, 0.0, 0.0, 1.0);
emitAnnotation(getCircleColor(vColor, borderColor));
`);
      });

  enable(shader: ShaderProgram, context: AnnotationRenderContext, callback: () => void) {
    super.enable(shader, context, () => {
      const {gl} = shader;
      const aLower = shader.attribute('aEndpointA');
      const aUpper = shader.attribute('aEndpointB');

      context.buffer.bindToVertexAttrib(
          aLower, /*components=*/3, /*attributeType=*/WebGL2RenderingContext.FLOAT,
          /*normalized=*/false,
          /*stride=*/4 * 6, /*offset=*/context.bufferOffset);
      context.buffer.bindToVertexAttrib(
          aUpper, /*components=*/3, /*attributeType=*/WebGL2RenderingContext.FLOAT,
          /*normalized=*/false,
          /*stride=*/4 * 6, /*offset=*/context.bufferOffset + 4 * 3);

      gl.vertexAttribDivisor(aLower, 1);
      gl.vertexAttribDivisor(aUpper, 1);
      callback();
      gl.vertexAttribDivisor(aLower, 0);
      gl.vertexAttribDivisor(aUpper, 0);
      gl.disableVertexAttribArray(aLower);
      gl.disableVertexAttribArray(aUpper);
    });
  }

  drawEdges(context: AnnotationRenderContext) {
    const shader = this.edgeShaderGetter(context.renderContext.emitter);
    this.enable(shader, context, () => {
      this.lineShader.draw(shader, context.renderContext, /*lineWidth=*/1, 1.0, context.count);
    });
  }

  drawEndpoints(context: AnnotationRenderContext) {
    const shader = this.endpointShaderGetter(context.renderContext.emitter);
    this.enable(shader, context, () => {
      const aEndpointIndex = shader.attribute('aEndpointIndex');
      this.endpointIndexBuffer.bindToVertexAttribI(
          aEndpointIndex, /*components=*/1,
          /*attributeType=*/WebGL2RenderingContext.UNSIGNED_BYTE);
      this.circleShader.draw(
          shader, context.renderContext,
          {interiorRadiusInPixels: 6, borderWidthInPixels: 2, featherWidthInPixels: 1},
          context.count);
      shader.gl.disableVertexAttribArray(aEndpointIndex);
    });
  }

  draw(context: AnnotationRenderContext) {
    this.drawEdges(context);
    this.drawEndpoints(context);
  }
}

function snapPositionToLine(position: vec3, objectToData: mat4, endpoints: Float32Array) {
  const cornerA = vec3.transformMat4(vec3.create(), <vec3>endpoints.subarray(0, 3), objectToData);
  const cornerB = vec3.transformMat4(vec3.create(), <vec3>endpoints.subarray(3, 6), objectToData);
  projectPointToLineSegment(position, cornerA, cornerB, position);
}

function snapPositionToEndpoint(
    position: vec3, objectToData: mat4, endpoints: Float32Array, endpointIndex: number) {
  const startOffset = 3 * endpointIndex;
  const point = <vec3>endpoints.subarray(startOffset, startOffset + 3);
  vec3.transformMat4(position, point, objectToData);
}

registerAnnotationTypeRenderHandler(AnnotationType.LINE, {
  bytes: 6 * 4,
  serializer: (buffer: ArrayBuffer, offset: number, numAnnotations: number) => {
    const coordinates = new Float32Array(buffer, offset, numAnnotations * 6);
    return (annotation: Line, index: number) => {
      const {pointA, pointB} = annotation;
      const coordinateOffset = index * 6;
      coordinates[coordinateOffset] = pointA[0];
      coordinates[coordinateOffset + 1] = pointA[1];
      coordinates[coordinateOffset + 2] = pointA[2];
      coordinates[coordinateOffset + 3] = pointB[0];
      coordinates[coordinateOffset + 4] = pointB[1];
      coordinates[coordinateOffset + 5] = pointB[2];
    };
  },
  sliceViewRenderHelper: RenderHelper,
  perspectiveViewRenderHelper: RenderHelper,
  pickIdsPerInstance: PICK_IDS_PER_INSTANCE,
  snapPosition: (position, objectToData, data, offset, partIndex) => {
    const endpoints = new Float32Array(data, offset, 6);
    if (partIndex === FULL_OBJECT_PICK_OFFSET) {
      snapPositionToLine(position, objectToData, endpoints);
    } else {
      snapPositionToEndpoint(position, objectToData, endpoints, partIndex - ENDPOINTS_PICK_OFFSET);
    }
  },
  getRepresentativePoint: (objectToData, ann, partIndex) => {
    let repPoint = vec3.create();
    // if the full object is selected just pick the first point as representative
    if (partIndex === FULL_OBJECT_PICK_OFFSET) {
      vec3.transformMat4(repPoint, ann.pointA, objectToData);
    } else {
      if ((partIndex - ENDPOINTS_PICK_OFFSET) === 0) {
        vec3.transformMat4(repPoint, ann.pointA, objectToData);
      } else {
        vec3.transformMat4(repPoint, ann.pointB, objectToData);
      }
    }
    return repPoint;
  },
  updateViaRepresentativePoint: (oldAnnotation, position, dataToObject, partIndex) => {
    let newPt = vec3.transformMat4(vec3.create(), position, dataToObject);
    let baseLine = {...oldAnnotation};
    switch (partIndex) {
      case FULL_OBJECT_PICK_OFFSET:
        let delta = vec3.sub(vec3.create(), oldAnnotation.pointB, oldAnnotation.pointA);
        baseLine.pointA = newPt;
        baseLine.pointB = vec3.add(vec3.create(), newPt, delta);
        break;
      case FULL_OBJECT_PICK_OFFSET + 1:
        baseLine.pointA = newPt;
        baseLine.pointB = oldAnnotation.pointB;
        break;
      case FULL_OBJECT_PICK_OFFSET + 2:
        baseLine.pointA = oldAnnotation.pointA;
        baseLine.pointB = newPt;
    }
    return baseLine;
  }
});

export class PlaceLineTool extends PlaceTwoCornerAnnotationTool {
  get description() {
    return `annotate line`;
  }

  getInitialAnnotation(mouseState: MouseSelectionState, annotationLayer: AnnotationLayerState):
      Annotation {
    const result = super.getInitialAnnotation(mouseState, annotationLayer);
    result.segments = getSelectedAssocatedSegment(annotationLayer);
    return result;
  }

  getUpdatedAnnotation(
      oldAnnotation: Line|AxisAlignedBoundingBox, mouseState: MouseSelectionState,
      annotationLayer: AnnotationLayerState) {
    const result = super.getUpdatedAnnotation(oldAnnotation, mouseState, annotationLayer);
    const segments = result.segments;
    if (segments !== undefined && segments.length > 0) {
      segments.length = 1;
    }
    let newSegments = getSelectedAssocatedSegment(annotationLayer);
    if (newSegments && segments) {
      newSegments = newSegments.filter(x => segments.findIndex(y => Uint64.equal(x, y)) === -1);
    }
    result.segments = [...(segments || []), ...(newSegments || [])] || undefined;
    return result;
  }

  toJSON() {
    return ANNOTATE_LINE_TOOL_ID;
  }
}
PlaceLineTool.prototype.annotationType = AnnotationType.LINE;

registerTool(
    ANNOTATE_LINE_TOOL_ID,
    (layer, options) => new PlaceLineTool(<UserLayerWithAnnotations>layer, options));


text:
Malcolm is a collection of middleware for [Faraday](https://github.com/technoweenie/faraday),
the excellent HTTP client interface based on [Rack](http://rack.github.com/).

[Build Icon]: https://secure.travis-ci.org/site5/malcolm.png?branch=master
[Build Status]: https://travis-ci.org/site5/malcolm

## Note on Patches/Pull Requests

* Fork the project.
* Make your feature addition or bug fix.
* Add tests for it. This is important so I don't break it in a
  future version unintentionally.
* Commit, do not mess with rakefile, version, or history.
  (if you want to have your own version, that is fine but bump version in a
  commit by itself I can ignore when I pull)
* Send me a pull request. Bonus points for topic branches.

## Copyright

Copyright (c) 2012 Site5.com. See LICENSE for details.


text:
define([
    "declare",
    "mparser",
    "mainevents",
    "mainconfig",
    "mainui",
    "hashcontroller",
    "hash",
    "ioquery",
    "atlas/tools/Helper",
    "dijit/form/TextBox", //Call layout Widgets here
    "dijit/form/Button",
    "dijit/form/CheckBox",
    "dijit/layout/StackContainer",
    "dijit/layout/ContentPane",
    "dijit/layout/BorderContainer",
    "dijit/TitlePane",
    "dijit/form/SimpleTextarea",
    "dijit/Dialog"
], function(declare, mparser, mainevents, mainconfig, mainui, hashcontroller, hash, ioQuery, Helper) {

    return declare(null, {

        constructor: function(lang) {
            // Trigger Dojo's Parser
            mparser.parse();
            // Initialize the hash controller
            hashcontroller.initialize(true);
            // Parse out parts of the hash
            var url = window.location.href;
            var initHash = "v=atlas&l=" + lang;
            var urlArr = url.split("#");
            var query;

            // If there is a hash
            if (urlArr.length === 2) {
                var obj = ioQuery.queryToObject(urlArr[1]);
                // remove init=y, I don't know why this is even here but, I dont see a point to it,
                // when there is more time, I will try to remove this and see what breaks
                if (obj.init) {
                    delete obj.init;
                    query = ioQuery.objectToQuery(obj);
                    initHash = query; //Go to User hash,
                } else {
                    query = ioQuery.objectToQuery(obj);
                    initHash = query + "&init=y";
                }

            }

            hash(initHash); //Go to default hash
            Helper.enableLayout();

        }

    }); //end declare

}); //end define


text:
using SaturdayMP.NConstraints;

namespace TestClient
{
    /// <summary>
    ///     Class with properties used for testing the
    ///     <see cref="Is.EquivalentPropertyWiseTo"/> method.
    /// </summary>
    public class TestClass
    {
        /// <summary>
        ///      Simple integer property.
        /// </summary>
        public int IntegerProperty { get; set; }

    }
}


text:
layout: page
title: Burns 50th Anniversary
date: 2016-05-24
author: Kevin Moon
tags: weekly links, java
status: published
summary: Nunc nulla dolor, congue ac euismod id, semper sed sem.
banner: images/banner/meeting-01.jpg
booking:
  startDate: 10/03/2019
  endDate: 10/05/2019
  ctyhocn: TYSPMHX
  groupCode: B5A
published: true
---
Proin tortor risus, pulvinar eu dictum non, imperdiet vel leo. In pellentesque tempus tortor, ut malesuada nisi aliquet in. Maecenas nec orci vel risus euismod mollis eu ut felis. Etiam cursus sagittis erat, et ornare mauris laoreet interdum. Aliquam posuere hendrerit dolor, vel sollicitudin nisi finibus convallis. Curabitur pulvinar sodales condimentum. Maecenas mauris augue, imperdiet semper ante at, gravida ultricies nisi. Vivamus ut finibus felis. Proin ornare enim non elit tristique, vitae euismod nunc laoreet. Fusce lacus nulla, varius non imperdiet vitae, elementum eu nulla.

1 Nam faucibus arcu et turpis rhoncus lacinia
1 Sed sit amet elit tincidunt diam tempus blandit quis ac mauris.

Nullam ante enim, mollis id velit at, sagittis euismod justo. Proin urna lorem, posuere ut elit non, posuere sodales mauris. Morbi lectus justo, suscipit non volutpat nec, venenatis sit amet eros. Ut fringilla nulla sit amet sapien cursus porttitor. Mauris vestibulum tellus a lectus porta dictum. Sed eget varius risus, id blandit lorem. Fusce facilisis feugiat tincidunt.
Maecenas sed tincidunt dui, id fringilla ligula. Nam feugiat, orci sit amet varius commodo, nunc dui gravida dolor, vitae cursus nibh orci sed nulla. Morbi luctus erat eu nulla efficitur, in dictum purus semper. Nam posuere auctor odio, malesuada feugiat arcu aliquet vitae. Donec laoreet sed nibh nec consectetur. Mauris porttitor egestas risus quis blandit. Morbi nec mattis erat. Suspendisse potenti. Cras vitae auctor magna, a volutpat leo. Fusce efficitur ligula eget quam ornare suscipit ac id tellus. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Nam in consequat ipsum.


text:
title: Exercise Tracker
localeTitle: متتبع التمرين
---
## متتبع التمرين

هذا هو كعب. [ساعد مجتمعنا على توسيعه](https://github.com/freecodecamp/guides/tree/master/src/pages/certifications/apis-and-microservices/apis-and-microservices-projects/exercise-tracker/index.md) .

[سيساعدك دليل النمط السريع هذا على ضمان قبول طلب السحب](https://github.com/freecodecamp/guides/blob/master/README.md) .


text:
<?php

declare(strict_types=1);

namespace Doctrine\SkeletonMapper\Tests\Event;

use Doctrine\SkeletonMapper\Event\PreUpdateEventArgs;
use Doctrine\SkeletonMapper\ObjectManagerInterface;
use Doctrine\SkeletonMapper\UnitOfWork\Change;
use Doctrine\SkeletonMapper\UnitOfWork\ChangeSet;
use PHPUnit\Framework\MockObject\MockObject;
use PHPUnit\Framework\TestCase;
use stdClass;

class PreUpdateEventArgsTest extends TestCase
{
    /** @var ObjectManagerInterface */
    private $objectManager;

    /** @var stdClass */
    private $object;

    /** @var ChangeSet|MockObject */
    private $changeSet;

    /** @var PreUpdateEventArgs */
    private $event;

    public function testGetObjectChangeSet() : void
    {
        self::assertSame($this->changeSet, $this->event->getObjectChangeSet());
    }

    public function testHasChangedField() : void
    {
        $this->changeSet->expects(self::once())
            ->method('hasChangedField')
            ->with('username')
            ->will(self::returnValue(true));

        self::assertTrue($this->event->hasChangedField('username'));
    }

    public function testGetOldValue() : void
    {
        $change = new Change('username', 'jwage', 'jonwage');

        $this->changeSet->expects(self::once())
            ->method('getFieldChange')
            ->with('username')
            ->will(self::returnValue($change));

        self::assertEquals('jwage', $this->event->getOldValue('username'));
    }

    public function testGetOldValueReturnsNull() : void
    {
        $this->changeSet->expects(self::once())
            ->method('getFieldChange')
            ->with('username')
            ->will(self::returnValue(null));

        self::assertNull($this->event->getOldValue('username'));
    }

    public function testGetNewValue() : void
    {
        $change = new Change('username', 'jwage', 'jonwage');

        $this->changeSet->expects(self::once())
            ->method('getFieldChange')
            ->with('username')
            ->will(self::returnValue($change));

        self::assertEquals('jonwage', $this->event->getNewValue('username'));
    }

    public function testGetNewValueReturnsNull() : void
    {
        $this->changeSet->expects(self::once())
            ->method('getFieldChange')
            ->with('username')
            ->will(self::returnValue(null));

        self::assertNull($this->event->getNewValue('username'));
    }

    public function testSetNewValue() : void
    {
        $change = new Change('username', 'jwage', 'jonwage');

        $this->changeSet->expects(self::any())
            ->method('getFieldChange')
            ->with('username')
            ->will(self::returnValue($change));

        $this->event->setNewValue('username', 'jonathan');

        self::assertEquals('jonathan', $this->event->getNewValue('username'));
    }

    public function testSetNewValueForUnchangedField() : void
    {
        $change = new Change('username', null, 'jonwage');

        $this->changeSet->expects(self::once())
            ->method('getFieldChange')
            ->with('username')
            ->will(self::returnValue(null));

        $this->changeSet->expects(self::once())
            ->method('addChange')
            ->with($change);

        $this->event->setNewValue('username', 'jonwage');
    }

    protected function setUp() : void
    {
        $this->objectManager = $this->createMock(ObjectManagerInterface::class);

        $this->object = new stdClass();

        $this->changeSet = $this->createMock(ChangeSet::class);

        $this->event = new PreUpdateEventArgs($this->object, $this->objectManager, $this->changeSet);
    }
}


text:
package ec.edu.espe.isi.model;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.EmbeddedId;
import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;

/**
 * Clase que albergara la informacion respecto a los cursos que se tendra dentro de un programa.
 *
 * @author Solange
 * @author Jhonathan
 * @author Victoria
 * @version 02/07/2017
 *
 */
@Entity
@Table(name = "programa_curso")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "ProgramaCurso.findAll", query = "SELECT p FROM ProgramaCurso p")
    , @NamedQuery(name = "ProgramaCurso.findByCodPrograma", query = "SELECT p FROM ProgramaCurso p WHERE p.programaCursoPK.codPrograma = :codPrograma")
    , @NamedQuery(name = "ProgramaCurso.findByCodCurso", query = "SELECT p FROM ProgramaCurso p WHERE p.programaCursoPK.codCurso = :codCurso")
    , @NamedQuery(name = "ProgramaCurso.findByOrden", query = "SELECT p FROM ProgramaCurso p WHERE p.orden = :orden")
    , @NamedQuery(name = "ProgramaCurso.findByEstado", query = "SELECT p FROM ProgramaCurso p WHERE p.estado = :estado")})
public class ProgramaCurso implements Serializable
{

    private static final long serialVersionUID = 1L;
    @EmbeddedId
    protected ProgramaCursoPK programaCursoPK;
    @Basic(optional = false)
    @NotNull

    @Column(name = "ORDEN")
    private short orden;
    @Basic(optional = false)
    @NotNull

    @Size(min = 1, max = 3)
    @Column(name = "ESTADO")
    private String estado;

    @JoinColumn(name = "COD_CURSO", referencedColumnName = "COD_CURSO", insertable = false, updatable = false)
    @ManyToOne(optional = false)
    private Curso curso;

    @JoinColumn(name = "COD_PROGRAMA", referencedColumnName = "COD_PROGRAMA", insertable = false, updatable = false)
    @ManyToOne(optional = false)
    private Programa programa;

    public ProgramaCurso() {
    }

    public ProgramaCurso(ProgramaCursoPK programaCursoPK) {
        this.programaCursoPK = programaCursoPK;
    }

    public ProgramaCurso(ProgramaCursoPK programaCursoPK, short orden, String estado) {
        this.programaCursoPK = programaCursoPK;
        this.orden = orden;
        this.estado = estado;
    }

    public ProgramaCurso(String codPrograma, String codCurso) {
        this.programaCursoPK = new ProgramaCursoPK(codPrograma, codCurso);
    }

    public ProgramaCursoPK getProgramaCursoPK() {
        return programaCursoPK;
    }

    public void setProgramaCursoPK(ProgramaCursoPK programaCursoPK) {
        this.programaCursoPK = programaCursoPK;
    }

    public short getOrden() {
        return orden;
    }

    public void setOrden(short orden) {
        this.orden = orden;
    }

    public String getEstado() {
        return estado;
    }

    public void setEstado(String estado) {
        this.estado = estado;
    }

    public Curso getCurso() {
        return curso;
    }

    public void setCurso(Curso curso) {
        this.curso = curso;
    }

    public Programa getPrograma() {
        return programa;
    }

    public void setPrograma(Programa programa) {
        this.programa = programa;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (programaCursoPK != null ? programaCursoPK.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof ProgramaCurso)) {
            return false;
        }
        ProgramaCurso other = (ProgramaCurso) object;
        if ((this.programaCursoPK == null && other.programaCursoPK != null) || (this.programaCursoPK != null && !this.programaCursoPK.equals(other.programaCursoPK))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "ec.edu.espe.isi.ProgramaCurso[ programaCursoPK=" + programaCursoPK + " ]";
    }

}


text:
SitemapGenerator::Sitemap.create_index = :auto
SitemapGenerator::Sitemap.compress = false
SitemapGenerator::Sitemap.default_host  = "http://eol.org"

SitemapGenerator::Sitemap.create do
  #hard-coded links
  add discover_path    , priority: 1
  add help_path        , priority: 1
  add about_path       , priority: 1
  add news_path        , priority: 1
  add contact_path     , priority: 1
  add terms_of_use_path, priority: 1
  add citing_path      , priority: 1
  add privacy_path     , priority: 1
  add curators_path    , priority: 1

  #cms_page_urls
  names_which_have_routes = [ 'help', 'about', 'news', 'explore_biodiversity',
    'contact', 'terms_of_use', 'citing', 'privacy', 'curators' ]
  content_pages =  ContentPage.select(:content_pages => [ :id, :page_name ]).where(["active = ? AND page_name NOT IN (?)", true, names_which_have_routes])
  content_pages.each do |content_page|
    page_url = cms_page_path(content_page.page_name)
    page_url.gsub!(/%20/, '_') # turn %20 into _
    page_url.gsub!(/&/, '&') # turn & into &
    add page_url, changefreq: 'weekly', priority: 1
  end

  #community_page_urls
  communities = Community.select([:id, :updated_at]).where(published: true)
  communities.each do |community|
    add community_path(community.id), priority: 1, lastmod: community.updated_at
    add community_newsfeed_path(community.id), priority: 0.5
  end

  #collection_page_urls
  collections = Collection.select([:id, :updated_at]).where(published: true)
  collections.each do |collection|
    add collection_path(collection.id), priority: 1, lastmod: collection.updated_at if collection.updated_at
    add collection_newsfeed_path(collection.id), priority:0.5
  end

  #content_partneer_urls
  content_partners = ContentPartner.where(is_public: 1).select([:id, :updated_at])
  content_partners.each do |content_partner|
    add content_partner_path(content_partner.id), changefreq: 'weekly', priority: 1
  end

  #user_urls
  users = User.select([:id, :updated_at]).where("active = ? AND (hidden = 0 OR hidden IS NULL)", true)
  users.each do |user|
    add user_path(user.id),          priority: 1, lastmod: user.updated_at if user.updated_at
    add user_newsfeed_path(user.id), priority: 0.5
    add user_activity_path(user.id), priority: 0.5
  end

  #taxon_page_urls
  TaxonConcept.select(:id).where(published: true, supercedure_id: 0, vetted_id: Vetted.trusted.id).find_each do |tc|
    add "/pages/#{tc.id}/overview", priority: 1, changefreq: 'weekly'
  end
end


text:
<?php

/*
 StreamFilter interface from Swift Mailer.

 This program is free software: you can redistribute it and/or modify
 it under the terms of the GNU General Public License as published by
 the Free Software Foundation, either version 3 of the License, or
 (at your option) any later version.

 This program is distributed in the hope that it will be useful,
 but WITHOUT ANY WARRANTY; without even the implied warranty of
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 GNU General Public License for more details.

 You should have received a copy of the GNU General Public License
 along with this program.  If not, see <http://www.gnu.org/licenses/>.

 */

/**
 * Processes bytes as they pass through a stream and performs filtering.
 * @package Swift
 * @author Chris Corbyn
 */
interface Swift_StreamFilter
{

  /**
   * Based on the buffer given, this returns true if more buffering is needed.
   * @param mixed $buffer
   * @return boolean
   */
  public function shouldBuffer($buffer);

  /**
   * Filters $buffer and returns the changes.
   * @param mixed $buffer
   * @return mixed
   */
  public function filter($buffer);

}


text:
package user

import (
	"bytes"
	"fmt"
	"strings"

	"github.com/Unknwon/com"
	"github.com/Unknwon/paginater"

	"github.com/gogits/gogs/models"
	"github.com/gogits/gogs/modules/base"
	"github.com/gogits/gogs/modules/middleware"
	"github.com/gogits/gogs/modules/setting"
)

const (
	DASHBOARD base.TplName = "user/dashboard/dashboard"
	ISSUES    base.TplName = "user/dashboard/issues"
	STARS     base.TplName = "user/stars"
	PROFILE   base.TplName = "user/profile"
	ORG_HOME  base.TplName = "org/home"
)

func getDashboardContextUser(ctx *middleware.Context) *models.User {
	ctxUser := ctx.User
	orgName := ctx.Params(":org")
	if len(orgName) > 0 {
		// Organization.
		org, err := models.GetUserByName(orgName)
		if err != nil {
			if models.IsErrUserNotExist(err) {
				ctx.Handle(404, "GetUserByName", err)
			} else {
				ctx.Handle(500, "GetUserByName", err)
			}
			return nil
		}
		ctxUser = org
	}
	ctx.Data["ContextUser"] = ctxUser

	if err := ctx.User.GetOrganizations(); err != nil {
		ctx.Handle(500, "GetOrganizations", err)
		return nil
	}
	ctx.Data["Orgs"] = ctx.User.Orgs

	return ctxUser
}

func retrieveFeeds(ctx *middleware.Context, uid, offset int64, isProfile bool) {
	actions, err := models.GetFeeds(uid, offset, isProfile)
	if err != nil {
		ctx.Handle(500, "GetFeeds", err)
		return
	}

	// Check access of private repositories.
	feeds := make([]*models.Action, 0, len(actions))
	unameAvatars := make(map[string]string)
	for _, act := range actions {
		// Cache results to reduce queries.
		_, ok := unameAvatars[act.ActUserName]
		if !ok {
			u, err := models.GetUserByName(act.ActUserName)
			if err != nil {
				if models.IsErrUserNotExist(err) {
					continue
				}
				ctx.Handle(500, "GetUserByName", err)
				return
			}
			unameAvatars[act.ActUserName] = u.AvatarLink()
		}

		act.ActAvatar = unameAvatars[act.ActUserName]
		feeds = append(feeds, act)
	}
	ctx.Data["Feeds"] = feeds
}

func Dashboard(ctx *middleware.Context) {
	ctx.Data["Title"] = ctx.Tr("dashboard")
	ctx.Data["PageIsDashboard"] = true
	ctx.Data["PageIsNews"] = true

	ctxUser := getDashboardContextUser(ctx)
	if ctx.Written() {
		return
	}

	if !ctxUser.IsOrganization() {
		collaborateRepos, err := ctx.User.GetAccessibleRepositories()
		if err != nil {
			ctx.Handle(500, "GetAccessibleRepositories", err)
			return
		}

		for i := range collaborateRepos {
			if err = collaborateRepos[i].GetOwner(); err != nil {
				ctx.Handle(500, "GetOwner: "+collaborateRepos[i].Name, err)
				return
			}
		}
		ctx.Data["CollaborateCount"] = len(collaborateRepos)
		ctx.Data["CollaborativeRepos"] = collaborateRepos
	}

	repos, err := models.GetRepositories(ctxUser.Id, true)
	if err != nil {
		ctx.Handle(500, "GetRepositories", err)
		return
	}
	ctx.Data["Repos"] = repos

	// Get mirror repositories.
	mirrors := make([]*models.Repository, 0, 5)
	for _, repo := range repos {
		if repo.IsMirror {
			if err = repo.GetMirror(); err != nil {
				ctx.Handle(500, "GetMirror: "+repo.Name, err)
				return
			}
			mirrors = append(mirrors, repo)
		}
	}
	ctx.Data["MirrorCount"] = len(mirrors)
	ctx.Data["Mirrors"] = mirrors

	retrieveFeeds(ctx, ctx.User.Id, 0, false)
	if ctx.Written() {
		return
	}
	ctx.HTML(200, DASHBOARD)
}

func Issues(ctx *middleware.Context) {
	isPullList := ctx.Params(":type") == "pulls"
	if isPullList {
		ctx.Data["Title"] = ctx.Tr("pull_requests")
		ctx.Data["PageIsPulls"] = true
	} else {
		ctx.Data["Title"] = ctx.Tr("issues")
		ctx.Data["PageIsIssues"] = true
	}

	ctxUser := getDashboardContextUser(ctx)
	if ctx.Written() {
		return
	}

	// Organization does not have view type and filter mode.
	var (
		viewType   string
		sortType   = ctx.Query("sort")
		filterMode = models.FM_ALL
		assigneeID int64
		posterID   int64
	)
	if ctxUser.IsOrganization() {
		viewType = "all"
	} else {
		viewType = ctx.Query("type")
		types := []string{"assigned", "created_by"}
		if !com.IsSliceContainsStr(types, viewType) {
			viewType = "all"
		}

		switch viewType {
		case "assigned":
			filterMode = models.FM_ASSIGN
			assigneeID = ctxUser.Id
		case "created_by":
			filterMode = models.FM_CREATE
			posterID = ctxUser.Id
		}
	}

	repoID := ctx.QueryInt64("repo")
	isShowClosed := ctx.Query("state") == "closed"

	// Get repositories.
	repos, err := models.GetRepositories(ctxUser.Id, true)
	if err != nil {
		ctx.Handle(500, "GetRepositories", err)
		return
	}

	allCount := 0
	repoIDs := make([]int64, 0, len(repos))
	showRepos := make([]*models.Repository, 0, len(repos))
	for _, repo := range repos {
		if (isPullList && repo.NumPulls == 0) ||
			(!isPullList && repo.NumIssues == 0) {
			continue
		}

		repoIDs = append(repoIDs, repo.ID)

		if isPullList {
			allCount += repo.NumOpenPulls
			repo.NumOpenIssues = repo.NumOpenPulls
			repo.NumClosedIssues = repo.NumClosedPulls
		} else {
			allCount += repo.NumOpenIssues
		}

		if filterMode != models.FM_ALL {
			// Calculate repository issue count with filter mode.
			numOpen, numClosed := repo.IssueStats(ctxUser.Id, filterMode, isPullList)
			repo.NumOpenIssues, repo.NumClosedIssues = int(numOpen), int(numClosed)
		}

		if repo.ID == repoID ||
			(isShowClosed && repo.NumClosedIssues > 0) ||
			(!isShowClosed && repo.NumOpenIssues > 0) {
			showRepos = append(showRepos, repo)
		}
	}
	ctx.Data["Repos"] = showRepos

	issueStats := models.GetUserIssueStats(repoID, ctxUser.Id, repoIDs, filterMode, isPullList)
	issueStats.AllCount = int64(allCount)

	page := ctx.QueryInt("page")
	if page <= 1 {
		page = 1
	}

	var total int
	if !isShowClosed {
		total = int(issueStats.OpenCount)
	} else {
		total = int(issueStats.ClosedCount)
	}
	ctx.Data["Page"] = paginater.New(total, setting.IssuePagingNum, page, 5)

	// Get issues.
	issues, err := models.Issues(&models.IssuesOptions{
		UserID:     ctxUser.Id,
		AssigneeID: assigneeID,
		RepoID:     repoID,
		PosterID:   posterID,
		RepoIDs:    repoIDs,
		Page:       page,
		IsClosed:   isShowClosed,
		IsPull:     isPullList,
		SortType:   sortType,
	})
	if err != nil {
		ctx.Handle(500, "Issues: %v", err)
		return
	}

	// Get posters and repository.
	for i := range issues {
		issues[i].Repo, err = models.GetRepositoryByID(issues[i].RepoID)
		if err != nil {
			ctx.Handle(500, "GetRepositoryByID", fmt.Errorf("[#%d]%v", issues[i].ID, err))
			return
		}

		if err = issues[i].Repo.GetOwner(); err != nil {
			ctx.Handle(500, "GetOwner", fmt.Errorf("[#%d]%v", issues[i].ID, err))
			return
		}

		if err = issues[i].GetPoster(); err != nil {
			ctx.Handle(500, "GetPoster", fmt.Errorf("[#%d]%v", issues[i].ID, err))
			return
		}
	}
	ctx.Data["Issues"] = issues

	ctx.Data["IssueStats"] = issueStats
	ctx.Data["ViewType"] = viewType
	ctx.Data["SortType"] = sortType
	ctx.Data["RepoID"] = repoID
	ctx.Data["IsShowClosed"] = isShowClosed
	if isShowClosed {
		ctx.Data["State"] = "closed"
	} else {
		ctx.Data["State"] = "open"
	}

	ctx.HTML(200, ISSUES)
}

func ShowSSHKeys(ctx *middleware.Context, uid int64) {
	keys, err := models.ListPublicKeys(uid)
	if err != nil {
		ctx.Handle(500, "ListPublicKeys", err)
		return
	}

	var buf bytes.Buffer
	for i := range keys {
		buf.WriteString(keys[i].OmitEmail())
		buf.WriteString("\n")
	}
	ctx.PlainText(200, buf.Bytes())
}

func showOrgProfile(ctx *middleware.Context) {
	ctx.SetParams(":org", ctx.Params(":username"))
	middleware.HandleOrgAssignment(ctx)
	if ctx.Written() {
		return
	}

	org := ctx.Org.Organization
	ctx.Data["Title"] = org.FullName

	repos, err := models.GetRepositories(org.Id, ctx.IsSigned && (ctx.User.IsAdmin || org.IsOrgMember(ctx.User.Id)))
	if err != nil {
		ctx.Handle(500, "GetRepositories", err)
		return
	}
	ctx.Data["Repos"] = repos

	if err = org.GetMembers(); err != nil {
		ctx.Handle(500, "GetMembers", err)
		return
	}
	ctx.Data["Members"] = org.Members

	if err = org.GetTeams(); err != nil {
		ctx.Handle(500, "GetTeams", err)
		return
	}
	ctx.Data["Teams"] = org.Teams

	ctx.HTML(200, ORG_HOME)
}

func Profile(ctx *middleware.Context) {
	ctx.Data["Title"] = "Profile"
	ctx.Data["PageIsUserProfile"] = true

	uname := ctx.Params(":username")
	// Special handle for FireFox requests favicon.ico.
	if uname == "favicon.ico" {
		ctx.Redirect(setting.AppSubUrl + "/img/favicon.png")
		return
	} else if strings.HasSuffix(uname, ".png") {
		ctx.Error(404)
		return
	}

	isShowKeys := false
	if strings.HasSuffix(uname, ".keys") {
		isShowKeys = true
		uname = strings.TrimSuffix(uname, ".keys")
	}

	u, err := models.GetUserByName(uname)
	if err != nil {
		if models.IsErrUserNotExist(err) {
			ctx.Handle(404, "GetUserByName", err)
		} else {
			ctx.Handle(500, "GetUserByName", err)
		}
		return
	}

	// Show SSH keys.
	if isShowKeys {
		ShowSSHKeys(ctx, u.Id)
		return
	}

	if u.IsOrganization() {
		showOrgProfile(ctx)
		return
	}
	ctx.Data["Owner"] = u

	tab := ctx.Query("tab")
	ctx.Data["TabName"] = tab
	switch tab {
	case "activity":
		retrieveFeeds(ctx, u.Id, 0, true)
		if ctx.Written() {
			return
		}
	default:
		ctx.Data["Repos"], err = models.GetRepositories(u.Id, ctx.IsSigned && ctx.User.Id == u.Id)
		if err != nil {
			ctx.Handle(500, "GetRepositories", err)
			return
		}
	}

	ctx.HTML(200, PROFILE)
}

func Email2User(ctx *middleware.Context) {
	u, err := models.GetUserByEmail(ctx.Query("email"))
	if err != nil {
		if models.IsErrUserNotExist(err) {
			ctx.Handle(404, "GetUserByEmail", err)
		} else {
			ctx.Handle(500, "GetUserByEmail", err)
		}
		return
	}
	ctx.Redirect(setting.AppSubUrl + "/user/" + u.Name)
}