Skip to content

Instantly share code, notes, and snippets.

🐢
I may be slow to respond.

M. Fürstenau mfuerstenau

🐢
I may be slow to respond.
  • Germany/Deutschland, Duisburg, Essen, Gelsenkirchen
Block or report user

Report or block mfuerstenau

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@mfuerstenau
mfuerstenau / StreamAsIterable.java
Last active Aug 21, 2016
Streams can be iterated over in Java 8
View StreamAsIterable.java
public class StreamAsIterable
{
public static void main (String[] args)
{
for (String s : (Iterable<String>) Stream.of ("This", "is", "a", "stream")::iterator)
{
System.out.println (s);
}
}
}
@mfuerstenau
mfuerstenau / zigzag-encoding.README
Last active Aug 2, 2019
ZigZag encoding/decoding explained
View zigzag-encoding.README
ZigZag-Encoding
---------------
Maps negative values to positive values while going back and
forth (0 = 0, -1 = 1, 1 = 2, -2 = 3, 2 = 4, -3 = 5, 3 = 6 ...)
(i >> bitlength-1) ^ (i << 1)
with "i" being the number to be encoded, "^" being
XOR-operation and ">>" would be arithemtic shifting-operation
You can’t perform that action at this time.