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 CountBytes { | |
public static void main(String[] args) throws IOException { | |
InputStream in; | |
if (args.length == 0){ | |
in = System.in; | |
}else | |
in = new FileInputStream(args[0]); | |
byte[] buff = new byte[10]; | |
int total = 0; |
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
module ClassModule | |
#all successors excluding self | |
def successors(klass=self.name.to_s) | |
descendants = [] | |
begin | |
ObjectSpace.each_object(class << eval(klass);self;end) do |found| | |
descendants << found | |
end | |
rescue Exception=>e |
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
#!/usr/bin/env ruby | |
# encoding: utf-8 | |
# irb3 - Runs an IRB-esque prompt (but it's NOT really IRB!) over multiple | |
# versions of Ruby at once (using RVM) | |
# | |
# By Peter Cooper, BSD licensed | |
# | |
# Main dependency is term-ansicolor for each impl: | |
# rvm exec gem install term-ansicolor |
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
(1..255).each_with_index do |x,i| | |
print x, " "*(5-x.to_s.size), x.chr.inspect, "\t" | |
print "\n" if (i+1)%10 == 0 | |
end | |
1 "\x01" 2 "\x02" 3 "\x03" 4 "\x04" 5 "\x05" 6 "\x06" 7 "\a" 8 "\b" 9 "\t" 10 "\n" | |
11 "\v" 12 "\f" 13 "\r" 14 "\x0E" 15 "\x0F" 16 "\x10" 17 "\x11" 18 "\x12" 19 "\x13" 20 "\x14" | |
21 "\x15" 22 "\x16" 23 "\x17" 24 "\x18" 25 "\x19" 26 "\x1A" 27 "\e" 28 "\x1C" 29 "\x1D" 30 "\x1E" | |
31 "\x1F" 32 " " 33 "!" 34 "\"" 35 "#" 36 "$" 37 "%" 38 "&" 39 "'" 40 "(" |
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
$ brew install boost | |
==> Downloading http://downloads.sourceforge.net/project/boost/boost/1.49.0/boost_1_49_0.tar.bz2 | |
Already downloaded: /Library/Caches/Homebrew/boost-1.49.0.tar.bz2 | |
==> ./bootstrap.sh --prefix=/usr/local/Cellar/boost/1.49.0 --libdir=/usr/local/Cellar/boost/1.49.0/lib | |
-n Building Boost.Build engine with toolset darwin... | |
Failed to build Boost.Build build engine | |
Consult 'bootstrap.log' for more details | |
==> Build Environment | |
HOMEBREW_VERSION: 0.9.2 |
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
This file contains any messages produced by compilers while | |
running configure, to aid debugging if configure makes a mistake. | |
It was created by gc configure 7.2, which was | |
generated by GNU Autoconf 2.68. Invocation command line was | |
$ ./configure --disable-debug --disable-dependency-tracking --prefix=/usr/local/Cellar/bdw-gc/7.2 --enable-cplusplus | |
## --------- ## | |
## Platform. ## |
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
$ cat bootstrap.log | |
### | |
### Using 'darwin' toolset. | |
### | |
rm -rf bootstrap | |
mkdir bootstrap | |
cc -o bootstrap/jam0 command.c compile.c debug.c expand.c glob.c hash.c hdrmacro.c headers.c jam.c jambase.c jamgram.c lists.c make.c make1.c newstr.c option.c output.c parse.c pathunix.c pathvms.c regexp.c rules.c scan.c search.c subst.c timestamp.c variable.c modules.c strings.c filesys.c builtins.c pwd.c class.c native.c md5.c w32_getreg.c modules/set.c modules/path.c modules/regex.c modules/property-set.c modules/sequence.c modules/order.c execunix.c fileunix.c | |
expand.c:85:28: warning: field precision should have type 'int', but argument has type 'long' [-Wformat] | |
printf( "expand '%.*s'\n", end - in, in ); | |
~~^~ ~~~~~~~~ |
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
global_variables.each do |x| | |
print x," ===> ", eval(x.to_s), "\n" | |
end |
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
require 'fileutils' | |
REJECTED = ['.', '..', '.git'] | |
(Dir.entries('.') - REJECTED).each do |e| | |
e.scan /^(\.)(.*)/ | |
FileUtils.mv e, $2 if $1 && File.file?(e) | |
end |
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
97.chr => 'a' | |
'a'.ord => 97 |