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
(if (>= emacs-major-version 24) | |
(electric-pair-mode t) | |
;; Setup the alternative manually. | |
(progn | |
;; ... | |
)) | |
(require 'ruby-electric) | |
(add-hook 'ruby-mode-hook | |
'(lambda () |
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 main | |
import ( | |
"fmt" | |
"math" | |
) | |
const Delta = 0.0001 | |
func isConverged(d float64) bool { |
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 main | |
import ( | |
"code.google.com/p/go-tour/wc" | |
"strings" | |
) | |
func WordCount(s string) map[string]int { | |
m := make(map[string]int) | |
a := strings.Fields(s) |
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 main | |
import "code.google.com/p/go-tour/pic" | |
func Pic(dx, dy int) [][]uint8 { | |
// Allocate two-dimensioanl array. | |
a := make([][]uint8, dy) | |
for i := 0; i < dy; i++ { | |
a[i] = make([]uint8, dx) | |
} |
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 main | |
import "fmt" | |
// Very naive answer. | |
// fibonacci is a function that returns | |
// a function that returns an int. | |
func fibonacci() func() int { | |
n := 0 | |
a := 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
package main | |
import ( | |
"fmt" | |
"math/cmplx" | |
) | |
// FIXME: | |
// Currently calculate only real part of the input | |
// complex number. |
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 | |
# A script to generate reduced EPS files. | |
# Taken from http://electron.mit.edu/~gsteele/pdf/ | |
# | |
epsfile=$1 | |
pngfile=${epsfile/eps/png} | |
jpgfile=${epsfile/eps/jpg} | |
new_epsfile=reduced_${epsfile} | |
echo $new_epsfile |
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 <cstdlib> | |
struct Entry { | |
unsigned char key; | |
std::size_t value; | |
}; | |
template <typename EntryT> | |
class Klass { | |
public: |
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
// Clang does not compile the code, but gcc does. | |
// See e.g., | |
// http://www.mail-archive.com/[email protected]/msg08044.html | |
template <typename T> | |
class Foo { | |
public: | |
Foo() {} | |
~Foo() {} | |
void func(int a); |
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
# Change colors of elements in Gnuplot | |
# change a color of border. | |
set border lw 3 lc rgb "white" | |
# change text colors of tics | |
set xtics textcolor rgb "white" | |
set ytics textcolor rgb "white" | |
# change text colors of labels |
OlderNewer