Skip to content

Instantly share code, notes, and snippets.

View martijnhoekstra's full-sized avatar

Martijn Hoekstra martijnhoekstra

View GitHub Profile
<?xml version="1.0" encoding="UTF-8"?>
<!-- Copyright © 2020 Unicode, Inc. -->
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" targetNamespace="http://www.unicode.org/ns/2003/ucd/1.0" xmlns:ucd="http://www.unicode.org/ns/2003/ucd/1.0">
<!-- default; datatypes xsd = "http://www.w3.org/2001/XMLSchema-datatypes" -->
<xs:simpleType name="single-code-point">
<xs:restriction base="xs:string">
<xs:pattern value="(|[1-9A-F]|(10))[0-9A-F]{4}"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="one-or-more-code-points">
@martijnhoekstra
martijnhoekstra / 212_1_pre_async
Created June 24, 2019 13:25
twitter-util benchmarks
[
{
"jmhVersion" : "1.21",
"benchmark" : "com.twitter.concurrent.AsyncSemaphoreBenchmark.acquireAndRelease",
"mode" : "avgt",
"threads" : 10,
"forks" : 1,
"jvm" : "C:\\Program Files\\Java\\jdk1.8.0_201\\jre\\bin\\java.exe",
"jvmArgs" : [
],
[
{
"jmhVersion" : "1.21",
"benchmark" : "com.twitter.concurrent.AsyncQueueBenchmark.allocation",
"mode" : "avgt",
"threads" : 10,
"forks" : 1,
"jvm" : "C:\\Program Files\\Java\\jdk1.8.0_201\\jre\\bin\\java.exe",
"jvmArgs" : [
],
java.lang.IllegalArgumentException: Could not find proxy for val rw: com.twitter.io.Pipe in List(value rw, method $anonfun$new$15, value <local PipeTest>, class PipeTest, package io, package twitter, package com, package <root>) (currentOwner= value stabilizer$2 )
[error] at scala.tools.nsc.transform.LambdaLift$LambdaLifter.searchIn$1(LambdaLift.scala:318)
[error] at scala.tools.nsc.transform.LambdaLift$LambdaLifter.$anonfun$proxy$4(LambdaLift.scala:323)
[error] at scala.tools.nsc.transform.LambdaLift$LambdaLifter.searchIn$1(LambdaLift.scala:323)
[error] at scala.tools.nsc.transform.LambdaLift$LambdaLifter.$anonfun$proxy$4(LambdaLift.scala:323)
[error] at scala.tools.nsc.transform.LambdaLift$LambdaLifter.searchIn$1(LambdaLift.scala:323)
[error] at scala.tools.nsc.transform.LambdaLift$LambdaLifter.$anonfun$proxy$4(LambdaLift.scala:323)
[error] at scala.tools.nsc.transform.LambdaLift$LambdaLifter.searchIn$1(LambdaLift.scala:323)
[error] at scala.t
@martijnhoekstra
martijnhoekstra / viewboundfix.scala
Last active May 24, 2018 02:57
a scalafix for viewbounds
package fix
import scalafix._
import scala.meta._
case object Viewbounds_v1_0 extends Rule("Viewbounds_v1_0") {
def eliminateViewBound(defn: Defn.Def): Option[Defn.Def] = {
def makeimplicit(i: Int, from: Name, to: Type): Term.Param = {
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" />
<PropertyGroup Label="Configuration">
<AssemblyName>XSharpx</AssemblyName>
<RootNamespace>XSharpx</RootNamespace>
</PropertyGroup>
<PropertyGroup>
<TargetFramework>netstandard1.4</TargetFramework>
</PropertyGroup>
<ItemGroup>
Loading /c/Program Files (x86)/sbt/bin/sbt-launch-lib.bash
[info] Loading global plugins from C:\Users\Martijn.Hoekstra\.sbt\0.13\plugins
[info] Set current project to spray-cookies (in build file:/C:/Users/Martijn.Hoekstra/Scala/spray-cookies-test/)
[info] Updating {file:/C:/Users/Martijn.Hoekstra/Scala/spray-cookies-test/}spray-cookies-test...
[info] Resolving org.scala-lang#scala-library;2.10.3 ...
[info] Resolving io.spray#spray-client;[1.0.1,1.3.1] ...
[info] Resolving io.spray#spray-can;1.3.1 ...
[info] Resolving io.spray#spray-io;1.3.1 ...
[info] Resolving io.spray#spray-util;1.3.1 ...
[info] Resolving io.spray#spray-http;1.3.1 ...
class FallbackEnumerable<T> : IEnumerable<T> {
private IEnumerable<T> src;
private Func<T> fallback;
public FallbackEnumerable(IEnumerable<T> src) : this(src, () => default(T)) { }
public FallbackEnumerable(IEnumerable<T> src, T fallback) : this(src, () => fallback ) { }
public FallbackEnumerable(IEnumerable<T> src, Func<T> fallback) {
@martijnhoekstra
martijnhoekstra / sbt test result
Created June 7, 2013 10:56
full result of test build fail
root > last spray-http/test:compile
[debug]
[debug] Initial source changes:
[debug] removed:Set()
[debug] added: Set(C:\Users\Martijn.Hoekstra\Scala\spray\spray-http\src\test\scala\spray\http\HttpModelSerializabilitySpec.scala, C:\Users\Martijn.Hoekstra\Scala\spray\spray-http\src\test\scala\spray\http\CharPredicateSpec.scala, C:\Users\Martijn.Hoekstra\Scala\spray\spray-http\src\test\scala\spray\http\DateTimeSpec.scala, C:\Users\Martijn.Hoekstra\Scala\spray\spray-http\src\test\scala\spray\http\HttpHeaderSpec.scala, C:\Users\Martijn.Hoekstra\Scala\spray\spray-http\src\test\scala\spray\http\UriSpec.scala)
[debug] modified: Set()
[debug] Removed products: Set()
[debug] Modified external sources: Set()
[debug] Modified binary dependencies: Set()
[debug] Initial directly invalidated sources: Set(C:\Users\Martijn.Hoekstra\Scala\spray\spray-http\src\test\scala\spray\http\HttpModelSerializabilitySpec.scala, C:\Users\Martijn.Hoekstra\Scala\spray\spray-http\src\test\scala\spray\http\CharPredicateSpec.scala,
@martijnhoekstra
martijnhoekstra / gist:4566337
Last active December 11, 2015 07:28
hashset
static void Main(string[] args)
{
bool success = false;
HashSet<DataObject> set = new HashSet<DataObject>();
DataObject myDataObject = new DataObject { foo = 1, bar = "bar" };
success = set.Add(myDataObject);
Console.WriteLine(set.Contains(myDataObject));
myDataObject.foo = 2;
Console.WriteLine(set.Contains(myDataObject));
DataObject taken = set.First();