This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using Microsoft.VisualStudio.TestTools.UnitTesting; | |
public class Flight | |
{ | |
public string FeatureArea { get; private set; } | |
public int TrafficPercent { get; private set; } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[TestMethod] | |
public void FlightsIsolatedOnMultipleFeatureAreas() | |
{ | |
var abFlight = new Flight(new[] { "A", "B" }, trafficPercent: 100); | |
var bcFlight = new Flight(new[] { "B", "C" }, trafficPercent: 100); | |
var cFlight = new Flight(new[] { "C" }, trafficPercent: 100); | |
_assignmentService.Add(abFlight); | |
_assignmentService.Add(bcFlight); | |
_assignmentService.Add(cFlight); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Test | |
public void testPrefix() throws IOException { | |
ClassPath cp = ClassPath.from(ClassLoader.getSystemClassLoader()); | |
Set<ClassPath.ClassInfo> classes = cp.getAllClasses(); | |
int prefixed = 0; | |
int unPrefixed = 0; | |
for (ClassPath.ClassInfo classInfo : classes) { | |
Class<?> clazz; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from __future__ import absolute_import | |
import logging | |
import apache_beam as beam | |
from apache_beam.utils.options import PipelineOptions | |
from apache_beam.utils.options import SetupOptions | |
from apache_beam.utils.options import StandardOptions | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
WITH pull_requests AS ( | |
SELECT | |
e.repo.name AS repo, | |
COUNT(*) AS pr_count | |
FROM `githubarchive.day.2016*` AS e | |
WHERE e.type = 'PullRequestEvent' AND STARTS_WITH(e.payload, '{"action":"opened"') | |
GROUP BY e.repo.name | |
) | |
SELECT | |
pr.repo, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import org.junit.Test; | |
import org.junit.runner.RunWith; | |
import org.junit.runners.JUnit4; | |
@RunWith(JUnit4.class) | |
public class GenericPipelineOptions { | |
public interface PipelineOptions<T extends PipelineOptions<T>> {} | |
public interface OptionsA<T extends OptionsA<T>> extends PipelineOptions<T> { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<project xmlns="http://maven.apache.org/POM/4.0.0" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> | |
<modelVersion>4.0.0</modelVersion> | |
<groupId>org.apache.beam</groupId> | |
<artifactId>beam-examples-java</artifactId> | |
<version>2.5.0-SNAPSHOT</version> | |
<packaging>pom</packaging> | |
<name>Apache Beam :: Examples :: Java</name> | |
<description>Apache Beam :: Examples :: Java</description> | |
<url>http://beam.apache.org</url> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
SITE_BRANCH=website-migration-beamsite | |
BEAM_BRANCH=website-migration | |
WEBSITE_UPSTREAM=upstream-site/asf-site | |
# WEBSITE_UPSTREAM=swegner-site/apache_headers | |
cd ~/beam | |
git reset --hard | |
git clean -fdx |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
> time git clone https://github.com/apache/beam-site.git . | |
Cloning into '.'... | |
remote: Counting objects: 43337, done. | |
remote: Compressing objects: 100% (34/34), done. | |
remote: Total 43337 (delta 38), reused 54 (delta 33), pack-reused 43269 | |
Receiving objects: 100% (43337/43337), 73.35 MiB | 21.67 MiB/s, done. | |
Resolving deltas: 100% (33037/33037), done. | |
Checking out files: 100% (26933/26933), done. | |
real 0m7.982s |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
> git init | |
Initialized empty Git repository in /usr/local/google/home/swegner/scratch/beam-site-clone/.git/ | |
> git remote add origin https://github.com/apache/beam-site.git | |
> git remote add swegner https://github.com/swegner/beam-site.git | |
> time git fetch swegner one-week-ago | |
remote: Counting objects: 43284, done. | |
remote: Compressing objects: 100% (13/13), done. |
OlderNewer