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
Program: | |
class Program | |
{ | |
string myString; | |
private Program() | |
{ | |
myString = "foo"; | |
} |
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
#include<iostream> | |
#include<signal.h> | |
#include<limits.h> | |
/** g++'s -ftrapv flag provides some protection against integer overflows. It | |
* is a little awkward to use, though. All it will do is "trap" -- you must | |
* provide a signal handler to deal with it. | |
* | |
* (You must compile with -ftrapv for this to work) | |
*/ |
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
Table of names of MemoryManagerMXBean and MemoryPoolMXBean instances under | |
different GC algorithms in Oracle HotSpot VM. Memory managers list the pools | |
they manage in square brackets; memory pools show their maximum sizes for -Xmx200M setting. | |
$ java -version | |
java version "1.6.0_24" | |
Java(TM) SE Runtime Environment (build 1.6.0_24-b07) | |
Java HotSpot(TM) 64-Bit Server VM (build 19.1-b02, mixed mode) | |
SerialGC: |
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
// XXX should be standard (and named clone, after Java?) | |
Object.prototype.copy = function () { | |
let o = {} | |
for (let i in this) | |
o[i] = this[i] | |
return o | |
} | |
// Containment testing for arrays and strings that should be coherent with their iterator. | |
Array.prototype.contains = String.prototype.contains = function (e) { |
OlderNewer