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 | |
# author: Reinier Zwitserloot | |
# this script is in the public domain. I relinquish all rights. | |
# source: http://gist.github.com/210643 | |
# Plays various radio channels, using VLC. Run me from a terminal to see radio station options. | |
# If your radio skips a lot, you need to suid 'renice'. If you don't know what that means, don't try it yourself; it has serious security implications. | |
# For this to work, you need VLC. On debian / ubuntu: apt-get install vnc |
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 | |
#Sets mouse tracking speed on Mac OS X; capable of faster speeds than the selection dialog. | |
#Unfortunately, you will have to log out and back in again for changes to propagate. | |
#My tracking speed is at 4.8. | |
if [ "$1" == "" ]; then | |
echo Sets the tracking speed of the mouse. "3.0" is the fastest setting in the mouse settings pane. | |
echo Your current tracking speed is: `defaults read -g com.apple.mouse.scaling` | |
exit 0 | |
fi |
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 lombok.parboiled; | |
import java.math.BigDecimal; | |
import java.util.ArrayList; | |
import java.util.Collections; | |
import java.util.List; | |
import java.util.Scanner; | |
import java.util.Stack; | |
import org.parboiled.BaseActions; |
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
(Total guess based on eating a parsnip oven dish at a restaurant and chatting with the chef about what's in it). | |
Enough as a primi dish for 4 persons. | |
- 300g Parsnips (in dutch: Pastinaak) | |
- truffle aroma (real truffles, or truffle oil, or truffle cream) | |
- creme fraiche (100g) | |
- aged cheese, rasped or cut to slivers. | |
- chicken broth (concentrated, 125ml) | |
- 50g diced onion (or leek) |
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 | |
# | |
# Copyright © 2009-2013 Reinier Zwitserloot and Roel Spilker. | |
# | |
# Permission is hereby granted, free of charge, to any person obtaining a copy | |
# of this software and associated documentation files (the "Software"), to deal | |
# in the Software without restriction, including without limitation the rights | |
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
# copies of the Software, and to permit persons to whom the Software is |
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
public int nextInt(int n) { | |
if (n <= 0) | |
throw new IllegalArgumentException("n must be positive"); | |
if ((n & -n) == n) // i.e., n is a power of 2 | |
return (int)((n * (long)next(31)) >> 31); | |
int bits, val; | |
do { | |
bits = next(31); |
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
List<Kiwi> listOfKiwis = new ArrayList<Kiwi>(); | |
list.add(new Kiwi()); | |
List<Fruit> listofFruits = listOfKiwis; // This line would actually fail to compile. | |
listOfFruits.add(new Apple()); | |
for (Kiwi kiwi : listOfKiwis) { | |
// ... this will blow up, there's an apple in my kiwis. | |
} |
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.google.common.collect.ImmutableMap; | |
import com.google.common.collect.ImmutableBiMap; | |
import com.google.common.collect.ImmutableSortedMap; | |
class BuilderSingletonGuavaMaps<K, V> { | |
private ImmutableMap<K, V> battleaxes; | |
private ImmutableSortedMap<Integer, ? extends V> vertices; | |
private ImmutableBiMap rawMap; | |
@java.lang.SuppressWarnings("all") | |
BuilderSingletonGuavaMaps(final ImmutableMap<K, V> battleaxes, final ImmutableSortedMap<Integer, ? extends V> vertices, final ImmutableBiMap rawMap) { | |
this.battleaxes = battleaxes; |
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
public class Test<C extends Test<C>> { | |
void foo() { | |
Test<?> t = bar(); | |
} | |
public static <V extends Test<V>> Test<V> bar() { | |
return null; | |
} | |
} |
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
Don't do this: | |
switch (foo) { | |
case 5: | |
x = "Hello"; | |
break; | |
case 10: | |
x = "Hi"; | |
break; | |
} |
OlderNewer