Original link: http://www.concentric.net/~Ttwang/tech/inthash.htm
Taken from: http://web.archive.org/web/20071223173210/http://www.concentric.net/~Ttwang/tech/inthash.htm
Reformatted using pandoc
Thomas Wang, Jan 1997
last update Mar 2007
Original link: http://www.concentric.net/~Ttwang/tech/inthash.htm
Taken from: http://web.archive.org/web/20071223173210/http://www.concentric.net/~Ttwang/tech/inthash.htm
Reformatted using pandoc
Thomas Wang, Jan 1997
last update Mar 2007
/* | |
* Copyright (C) 2018 Simon Schmidt | |
*/ | |
package webidee.cmistests.serializers.old; | |
import com.esotericsoftware.kryo.Kryo; | |
import com.esotericsoftware.kryo.Serializer; | |
import com.esotericsoftware.kryo.io.Input; | |
import com.esotericsoftware.kryo.io.Output; | |
import java.util.List; |
import "sort" | |
/* | |
Generates n unique numbers mod m. v is used as deterministic source. | |
*/ | |
func Inthash(v, n, m int) []int { | |
if n>m { panic("less unique numbers than slots") } | |
r := make([]int,n) | |
for i := range r { |
// TODO: insert your package name here! | |
package your.packag.e.name.here; | |
/* | |
* The ZLIB license (with two restrictions removed). | |
* | |
* Copyright 2018 Simon Schmidt. | |
* | |
* This software is provided 'as-is', without any express or implied | |
* warranty. In no event will the authors be held liable for any damages | |
* arising from the use of this software. |
Stuff regarding java's invokedynamic
Method signature
public static CallSite bootstrap(
MethodHandles.Lookup caller,
package main | |
import "fmt" | |
import "math" | |
func log2(f float64) (float64) { | |
frac, exp := math.Frexp(f) | |
exp-- | |
frac*=2 | |
log := float64(0) |
package main | |
import "context" | |
import "github.com/paulmach/osm" | |
import "github.com/paulmach/osm/osmpbf" | |
import "github.com/paulmach/osm/osmxml" | |
import "encoding/xml" | |
import "fmt" |
/* | |
Copyright (c) 2019 Simon Schmidt | |
This software is provided 'as-is', without any express or implied | |
warranty. In no event will the authors be held liable for any damages | |
arising from the use of this software. | |
Permission is granted to anyone to use this software for any purpose, | |
including commercial applications, and to alter it and redistribute it | |
freely, subject to the following restrictions: |
// Public Domain! | |
import java.util.Map; | |
import java.util.concurrent.ConcurrentHashMap; | |
import java.util.function.IntFunction; | |
import java.util.function.IntPredicate; | |
import org.jparsec.Parser; | |
import org.jparsec.Parsers; | |
import org.jparsec.pattern.CharPredicate; | |
import org.jparsec.pattern.Pattern; | |
import org.jparsec.pattern.Patterns; |
// Public Domain! | |
import io.netty.bootstrap.Bootstrap; | |
import io.netty.bootstrap.ServerBootstrap; | |
import io.netty.channel.Channel; | |
import io.netty.channel.ChannelHandler; | |
import io.netty.channel.EventLoopGroup; | |
import io.netty.channel.ServerChannel; | |
import io.netty.channel.nio.NioEventLoopGroup; | |
import io.netty.channel.socket.nio.NioServerSocketChannel; | |
import io.netty.channel.socket.nio.NioSocketChannel; |