text:
/*
 * 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.
 */
/*
 * This code was generated by https://github.com/googleapis/google-api-java-client-services/
 * Modify at your own risk.
 */

package com.google.api.services.contentwarehouse.v1.model;

/**
 * Model definition for QualityPreviewSnippetExperimentalFeatures.
 *
 *
 This is the Java data model class that specifies how to parse/serialize into the JSON that is
 * transmitted over HTTP when working with the contentwarehouse API. For a detailed explanation see:
 * https://developers.google.com/api-client-library/java/google-http-java-client/json
 *

 *
 * @author Google, Inc.
 */
@SuppressWarnings("javadoc")
public final class QualityPreviewSnippetExperimentalFeatures extends com.google.api.client.json.GenericJson {

  /**
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.lang.Boolean isLikelyHomepage;

  /**
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.lang.Long numQueryItems;

  /**
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.lang.Long numTidbits;

  /**
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.lang.Long numVisibleTokens;

  /**
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private QualityPreviewSnippetRadishFeatures radish;

  /**
   * @return value or {@code null} for none
   */
  public java.lang.Boolean getIsLikelyHomepage() {
    return isLikelyHomepage;
  }

  /**
   * @param isLikelyHomepage isLikelyHomepage or {@code null} for none
   */
  public QualityPreviewSnippetExperimentalFeatures setIsLikelyHomepage(java.lang.Boolean isLikelyHomepage) {
    this.isLikelyHomepage = isLikelyHomepage;
    return this;
  }

  /**
   * @return value or {@code null} for none
   */
  public java.lang.Long getNumQueryItems() {
    return numQueryItems;
  }

  /**
   * @param numQueryItems numQueryItems or {@code null} for none
   */
  public QualityPreviewSnippetExperimentalFeatures setNumQueryItems(java.lang.Long numQueryItems) {
    this.numQueryItems = numQueryItems;
    return this;
  }

  /**
   * @return value or {@code null} for none
   */
  public java.lang.Long getNumTidbits() {
    return numTidbits;
  }

  /**
   * @param numTidbits numTidbits or {@code null} for none
   */
  public QualityPreviewSnippetExperimentalFeatures setNumTidbits(java.lang.Long numTidbits) {
    this.numTidbits = numTidbits;
    return this;
  }

  /**
   * @return value or {@code null} for none
   */
  public java.lang.Long getNumVisibleTokens() {
    return numVisibleTokens;
  }

  /**
   * @param numVisibleTokens numVisibleTokens or {@code null} for none
   */
  public QualityPreviewSnippetExperimentalFeatures setNumVisibleTokens(java.lang.Long numVisibleTokens) {
    this.numVisibleTokens = numVisibleTokens;
    return this;
  }

  /**
   * @return value or {@code null} for none
   */
  public QualityPreviewSnippetRadishFeatures getRadish() {
    return radish;
  }

  /**
   * @param radish radish or {@code null} for none
   */
  public QualityPreviewSnippetExperimentalFeatures setRadish(QualityPreviewSnippetRadishFeatures radish) {
    this.radish = radish;
    return this;
  }

  @Override
  public QualityPreviewSnippetExperimentalFeatures set(String fieldName, Object value) {
    return (QualityPreviewSnippetExperimentalFeatures) super.set(fieldName, value);
  }

  @Override
  public QualityPreviewSnippetExperimentalFeatures clone() {
    return (QualityPreviewSnippetExperimentalFeatures) super.clone();
  }

}

redpajama_set_name: RedPajamaGithub


text:
package com.gluonhq.codevault.git;

import org.eclipse.jgit.api.Git;
import org.eclipse.jgit.api.errors.GitAPIException;
import org.eclipse.jgit.lib.Repository;
import org.eclipse.jgit.storage.file.FileRepositoryBuilder;

import java.io.File;
import java.io.IOException;
import java.util.*;
import java.util.stream.Collectors;
import java.util.stream.StreamSupport;

public class GitRepository {

    private static final String GIT_FOLDER_NAME = ".git";

    private Repository repo;
    private Git git;
    private final File location;

    public GitRepository(File location) throws GitRepoException {

        this.location = Objects.requireNonNull(location);

        if ( !isGitRepo(location)) {
            throw new GitRepoException("Git repository not found at " + location);
        }

        File gitDir =
                GIT_FOLDER_NAME.equals(location.getName()) ? location : new File(location, GIT_FOLDER_NAME);

        try {
            repo = new FileRepositoryBuilder()
                    .setGitDir(gitDir)
                    .readEnvironment() // scan environment GIT_* variables
                    .findGitDir()      // scan up the file system tree
                    .build();

            git = new Git(repo);

        } catch (IOException e) {
            e.printStackTrace();
        }
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        GitRepository that = (GitRepository) o;

        return location.equals(that.location);

    }

    public void close() {
        repo.close();
    }

    @Override
    public int hashCode() {
        return location.hashCode();
    }

    private boolean isGitRepo( File location ) {
        return (location.exists() && location.getName().endsWith(GIT_FOLDER_NAME)) ||
                (new File( location, GIT_FOLDER_NAME).exists());
    }

    public File getLocation() {
        return location;
    }

    public String getName() {
        return location.getName();
    }

    public Collection<GitCommit> getLog() {
        try {
            Collection<GitRef> refs = new HashSet<>(getBranches());
            refs.addAll(getTags());

            Map<String, List<GitRef>> refMap = refs
                    .stream()
                    .collect(Collectors.groupingBy(GitRef::getId));

            return StreamSupport
                    .stream(git.log().all().call().spliterator(), false)
                    .map( c -> new GitCommit(c, refMap.getOrDefault(c.getId().getName(), Collections.emptyList())))
                    .collect(Collectors.toList());
        } catch (GitAPIException | IOException e) {
            e.printStackTrace();
            return new ArrayList<>();
        }
    }

    public Collection<GitBranch> getBranches() {
        try {
            return StreamSupport
                    .stream(git.branchList().call().spliterator(), false)
                    .map(ref -> new GitBranch(ref))
                    .collect(Collectors.toSet());
        } catch (GitAPIException e) {
            e.printStackTrace();
            return new HashSet<>();
        }
    }

    public Collection<GitTag> getTags() {
        try {
            return StreamSupport
                    .stream(git.tagList().call().spliterator(), false)
                    .map(ref -> new GitTag(!ref.isPeeled() ? ref : repo.peel(ref)))
                    .collect(Collectors.toSet());
        } catch (GitAPIException e) {
            e.printStackTrace();
            return new HashSet<>();
        }
    }
}


text:
// ==++==
//
//   Copyright (c) Microsoft Corporation.  All rights reserved.
//
// ==--==
/*============================================================
**
** Type: SerialData
**
** Purpose: Describes the types of receive events.
**
** Date:  August 2002
**
**
===========================================================*/

namespace System.IO.Ports
{
    public enum SerialData
    {
        Chars = 0x01, // NativeMethods.EV_RXCHAR,
        Eof   = 0x02, // NativeMethods.EV_RXFLAG,
    }

    public class SerialDataReceivedEventArgs : EventArgs
    {
        internal SerialData receiveType;

        internal SerialDataReceivedEventArgs( SerialData eventCode )
        {
            receiveType = eventCode;
        }

        public SerialData EventType
        {
            get { return receiveType; }
        }
    }

    public delegate void SerialDataReceivedEventHandler( object sender, SerialDataReceivedEventArgs e );
}


text:
using System;
using System.Collections.Generic;
using System.Text;
using GMap.NET;
using SuperMap.Connector.Utility;

namespace GMap.SuperMapProvider
{
    public class SuperMapProjection : PureProjection
    {
        #region fields
        private double[] _mapScales;
        private double[] _resolutions;
        private double _minX;
        private double _minY;
        private double _maxX;
        private double _maxY;
        private double _axis;
        private double _flattening;
        private GSize _tileSize = new GSize(256, 256);

        #endregion

        public SuperMapProjection(double[] mapScales, MapParameter defaultMapParameter)
        {
            if (mapScales == null)
                throw new ArgumentNullException();
            if (defaultMapParameter == null)
            {
                throw new ArgumentNullException();
            }

            _mapScales = mapScales;

            if (defaultMapParameter.Bounds == null)
                throw new ArgumentNullException();
            _minX = defaultMapParameter.Bounds.LeftBottom.X;
            _minY = defaultMapParameter.Bounds.LeftBottom.Y;
            _maxX = defaultMapParameter.Bounds.RightTop.X;
            _maxY = defaultMapParameter.Bounds.RightTop.Y;

            if (defaultMapParameter.PrjCoordSys != null &&
                defaultMapParameter.PrjCoordSys.CoordSystem != null &&
                defaultMapParameter.PrjCoordSys.CoordSystem.Datum != null &&
                defaultMapParameter.PrjCoordSys.CoordSystem.Datum.Spheroid != null)
            {
                _axis = defaultMapParameter.PrjCoordSys.CoordSystem.Datum.Spheroid.Axis;
                _flattening = defaultMapParameter.PrjCoordSys.CoordSystem.Datum.Spheroid.Flatten;
            }

            double refMapScale = defaultMapParameter.Scale;
            double refResolution = (defaultMapParameter.ViewBounds.RightTop.X - defaultMapParameter.ViewBounds.LeftBottom.X) /
                (defaultMapParameter.Viewer.Width);

            double refResolutionY = (defaultMapParameter.ViewBounds.RightTop.Y - defaultMapParameter.ViewBounds.LeftBottom.Y) /
                (defaultMapParameter.Viewer.Height);

            _resolutions = new double[_mapScales.Length];
            for (int i = 0; i < _mapScales.Length; i++)
            {
                _resolutions[i] = refResolution * refMapScale / mapScales[i];
            }
        }

        #region Override

        public override GSize GetTileMatrixSizeXY(int zoom)
        {
            return base.GetTileMatrixSizeXY(zoom);
        }

        public override GPoint FromPixelToTileXY(GPoint p)
        {
            return base.FromPixelToTileXY(p);
        }

        public override GPoint FromTileXYToPixel(GPoint p)
        {
            return base.FromTileXYToPixel(p);
        }

        public override double GetGroundResolution(int zoom, double latitude)
        {
            if (zoom < 0)
            {
                zoom = 0;
            }
            return _resolutions[zoom];
        }

        public override GSize GetTileMatrixSizePixel(int zoom)
        {
            return base.GetTileMatrixSizePixel(zoom);
        }
        #endregion

        #region abstract

        public override GSize TileSize
        {
            get { return _tileSize; }
        }

        public override double Axis
        {
            get { return _axis; }
        }

        public override double Flattening
        {
            get { return _flattening; }
        }

        public override GPoint FromLatLngToPixel(double lat, double lng, int zoom)
        {
            GPoint ret = GPoint.Empty;

            lat = Clip(lat, _minY, _maxY);
            lng = Clip(lng, _minX, _maxX);
            double res = _resolutions[zoom];

            ret.X = (int)Math.Floor((lng - _minX) / res);
            ret.Y = (int)Math.Floor((_maxY - lat) / res);

            return ret;
        }

        public override PointLatLng FromPixelToLatLng(int x, int y, int zoom)
        {
            PointLatLng ret = new PointLatLng();

            double res = _resolutions[zoom];

            ret.Lat = _maxY - (y * res);
            ret.Lng = (x * res) + _minX;

            return ret;
        }

        public override GSize GetTileMatrixMinXY(int zoom)
        {
            return new GSize(0, 0);
        }

        public override GSize GetTileMatrixMaxXY(int zoom)
        {
            if (zoom < 0)
                zoom = 0;
            double resolution = _resolutions[zoom];
            double dWidth = _maxX - _minX;
            double dHeight = _maxY - _minY;
            int widht = (int)Math.Floor(dWidth / (_tileSize.Width * resolution));
            int height = (int)Math.Floor(dHeight / (_tileSize.Height * resolution));
            return new GSize(widht, height);
        }
        #endregion
    }
}