01 (define push
02 (lambda (element stack)
03 (append stack (cons element '()))))
04
05 (push 'd '(a b c)) ; => (a b c d)
Though putting element before stack is a little weird XD.
01 (define push
02 (lambda (element stack)
03 (append stack (cons element '()))))
04
05 (push 'd '(a b c)) ; => (a b c d)
(define-param supercell-x 5)
(define-param supercell-y 11)
(set! num-bands (+ 2 (* supercell-x supercell-y)))
01 class Array
02 def split(part)
03 num = self.length/part.to_i
04 result = Array.new
05 for row in 0..(part-1)
06 result[row] = self[num*row...num*(row+1)]
07 end
08 result
09 end
10 end
a = [1,2,3,4,5,6,7,8,9]
a.split(3).inspect # => [[1, 2, 3], [4, 5, 6], [7, 8, 9]]
$ apt-get build-dep package
$ fakeroot apt-get source -b package
$ dpkg -i package
alias ls="ls -G"
export LSCOLORS="ExFxCxDxBxEGEDABAGACAD"
01 #!/usr/bin/env ruby
02
03 require 'rubygems'
04 require 'applescript'
05
06 AppleScript.execute("set volume #{ARGV[0]}")
01 #!/usr/bin/osascript
02
03 set volume [1-7]
01 set title "band of te mode"
02 set term png
03 set output "te.png"
04
05 plot \
06 "te" using 2:7 title "band 1" with linespoints, \
07 "te" using 2:8 title "band 2" with linespoints, \
08 "te" using 2:9 title "band 3" with linespoints, \
09 "te" using 2:10 title "band 4" with linespoints, \
10 "te" using 2:11 title "band 5" with linespoints, \
11 "te" using 2:12 title "band 6" with linespoints, \
12 "te" using 2:13 title "band 7" with linespoints, \
13 "te" using 2:14 title "band 8" with linespoints