| Author: | draftcode |
|---|---|
| Date: | 2011-11-11T13:18:07+09:00 |
| ID: | 289a0136-0c1c-11e1-a06b-040ccee352e6 |
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
| ; $ sbcl --load a.cl --eval '(sb-ext:save-lisp-and-die "a.out" :toplevel #'\''main :executable t)' && time ( echo 100000000 | ./a.out > /dev/null ) | |
| ; ( echo 100000000 | ./a.out > /dev/null; ) 10.75s user 0.15s system 99% cpu 10.931 total | |
| ; $ sbcl --version | |
| ; SBCL 1.2.6 | |
| (defun main () | |
| (declare (optimize (speed 3) (debug 0) (safety 0) (compilation-speed 0))) | |
| (let* ((n (1+ (the fixnum (read)))) | |
| (is-prime (make-array n :element-type 'boolean :initial-element t))) |
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 clang.cindex | |
| from clang.cindex import Index | |
| def gen_stream_operator(cur): | |
| if cur.kind.name == "STRUCT_DECL": | |
| print("std::ostream& operator<<(std::ostream& os, const %s& rhs) {" % cur.displayname) | |
| for child in cur.get_children(): | |
| if child.kind.name == "FIELD_DECL": | |
| print(' os << "{member}:" << rhs.{member} << std::endl;'.format(member=child.displayname)) |
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 javax.imageio.*; | |
| import javax.imageio.stream.ImageOutputStream; | |
| import java.awt.image.BufferedImage; | |
| import java.io.File; | |
| import java.io.IOException; | |
| public class GifWriter { | |
| ImageWriter iw = ImageIO.getImageWritersByFormatName("gif").next(); | |
| BufferedImage buffer; | |
| boolean finish = false; |