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
package test; | |
import java.io.File; | |
import java.io.IOException; | |
import java.nio.file.Files; | |
import java.nio.file.Path; | |
import java.util.concurrent.Callable; | |
import java.util.function.Consumer; | |
import java.util.function.Function; |
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
package org.example; | |
import java.io.IOException; | |
import java.nio.file.*; | |
import java.nio.file.attribute.BasicFileAttributes; | |
import java.util.EnumSet; | |
public class Main { | |
public static void main(String[] args) { | |
Path rootDir; |
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 fileinput | |
import z3 | |
import sys | |
def solve(sizes, prices, capacity): | |
coeffs = list() | |
solver = z3.Optimize() | |
price = 0 | |
weight = 0 | |
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
<plugin> | |
<groupId>com.github.eirslett</groupId> | |
<artifactId>frontend-maven-plugin</artifactId> | |
<version>1.12.0</version> | |
<executions> | |
<execution> | |
<id>install node and npm</id> | |
<goals> | |
<goal>install-node-and-npm</goal> | |
</goals> |
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 math | |
import sys | |
BAC = 2.920050977316134 | |
def primes_BAC(): | |
item = BAC | |
while True: | |
next_prime = int(math.floor(item)) | |
yield next_prime |
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 argparse | |
import subprocess | |
from jira import JIRA | |
from getpass import getpass | |
import requests | |
EXCLUDE_BRANCHES = {"master", "develop"} | |
COMMON_BRANCH_PREFIX = "feature/" | |
COMMON_BRANCH_SUFFIX = "-epic" | |
HEADS_PREFIX = "refs/heads/" |
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 requests | |
import argparse | |
REVIEWS_LIST_PATH = "{host}/~rpc/getReviews" | |
CLOSE_REVIEW_PATH = "{host}/~rpc/closeReview" | |
REVIEWS_REQUEST = "(state: open) and (accepted-by: 1 or (not (updated: {this month})))" | |
def parse_args(): |
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.apache.kafka.clients.consumer.ConsumerConfig | |
import org.apache.kafka.common.TopicPartition | |
import org.apache.kafka.common.serialization.StringDeserializer | |
import org.apache.spark.streaming.kafka010.KafkaUtils | |
import org.apache.spark.streaming.{Seconds, StreamingContext} | |
import org.apache.spark.{SparkConf, SparkContext, SparkEnv} | |
import org.apache.spark.streaming.kafka010._ | |
import org.apache.spark.streaming.kafka010.LocationStrategies.PreferConsistent | |
import org.apache.spark.streaming.kafka010.ConsumerStrategies.Subscribe |
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
//works with 0.3.10 but fails with OOM with 0.4.4 | |
//see https://github.com/flipkart-incubator/zjsonpatch/issues/77 | |
import com.fasterxml.jackson.databind.JsonNode; | |
import com.fasterxml.jackson.databind.ObjectMapper; | |
import com.flipkart.zjsonpatch.JsonDiff; | |
import java.io.IOException; | |
public class Main { |
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 com.typesafe.config.ConfigFactory | |
import scala.util.Try | |
object TestDuration extends App { | |
val strings = Seq("1s", "2s", "2m", "2h", "2d", "2y", "1h30m", "86000000ms") | |
def getISOPrefix(duration: String): String = if (Set('y', 'd').contains(duration.last)) "P" else "PT" | |
val parseAndProcessDuration: Map[String, String => String] = Map( |
NewerOlder