This file contains hidden or 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
This generates a win 32bit exe with of ~48 KB (~35 KB after upx compression). Tested with rust nightly of May 16th 2015 | |
https://static.rust-lang.org/dist/2015-05-16/rust-nightly-i686-pc-windows-gnu.msi | |
Command line: | |
cargo clean && cargo build -v --release | |
Cargo.toml: | |
[package] | |
name = "msgbox" | |
version = "0.1.0" |
This file contains hidden or 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 java.io.IOException; | |
/** | |
* Class that copies stdin to stdout, as compained about as not being cleanly | |
* writable in Java on Hacker News. | |
* In real code, you would just write IOUtils.copy(System.in, System.out), | |
* which does basically the same thing. | |
* This does not catch any exceptions as a) this is just an "exercise" and | |
* b) all we could do with them is pretty-print them. So let the runtime | |
* print them for you. |
This file contains hidden or 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
class TypeErasureIsReallyWeird { | |
private static class AndNowWithGenerics<LongActually> { | |
LongActually UhOh(Object o) { | |
try { | |
@SuppressWarnings("unchecked") | |
LongActually longish = (LongActually) o; | |
System.out.println( | |
"In a generic class, casting String to Long seems ok. Long value is: " + | |
longish); |
This file contains hidden or 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 main | |
import ( | |
"fmt" | |
"net" | |
"bufio" | |
"sync" | |
"os/signal" | |
) |