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
# -*- coding: utf-8-unix -*- | |
# | |
# Tested on : | |
# - Ruby 1.9.2-p180 (2011-02-18 revision 30909) [x86_64-darwin10.7.0] | |
# | |
# Usage : $ ruby TwitterBackup.rb [user name] | |
# | |
require 'date' | |
require 'net/http' | |
require 'rexml/document' |
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 python | |
# -*- coding: utf-8 -*- | |
# USAGE : $ ./HoughCircles.py Media/foo.jpg | |
import cv | |
import sys | |
if __name__ == "__main__": | |
image = cv.LoadImage(sys.argv[1], cv.CV_LOAD_IMAGE_GRAYSCALE) | |
src = cv.LoadImage(sys.argv[1]) |
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 <algorithm> | |
#include <tr1/functional> | |
#include <vector> | |
struct Contact | |
{ | |
Vec3 Position; | |
// ... | |
}; |
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
; Example: | |
; * M-x dec2bin -> Decimal: 10 [Enter] -> 1010 | |
; * (dec2bin 10) -> "1010" | |
; * C-u 10 M-x dec2bin -> 1010 | |
; Ref.: | |
; * Basic syntax : http://xahlee.org/emacs/elisp_basics.html | |
; * concat : http://www.gnu.org/software/emacs/manual/html_node/elisp/Creating-Strings.html | |
; * called-interactively-p : http://www.gnu.org/software/emacs/manual/html_node/elisp/Distinguish-Interactive.html | |
(defun dec2bin (n) | |
"Returns binary expression of decimal number N." |
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
;; (autoload 'markdown-mode "markdown-mode.el" "Major mode for editing Markdown files" t) | |
;; 箇条書き入力支援 | |
;; Ref.: Emacs Lisp Idioms (for writing interactive commands) - Get Current Word or Line | |
;; http://xahlee.org/emacs/elisp_idioms.html | |
;; Inconsistent Behavior for 'line | |
;; http://xahlee.blogspot.com/2011/02/emacs-lisp-using-thing-at-point.html | |
(setq markdown-aux-unordered-list-item-string "* ") | |
(defun markdown-aux-insert-unordered-list-item () | |
"Insert `markdown-aux-unordered-list-item-string'." |
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
;;; -*- mode: emacs-lisp; coding: iso-2022-7bit -*- | |
(defvar unnamed-memo-default-filename "~/memo/%Y/%Y-%m-%d-%H%M%S.") | |
(defvar unnamed-memo-default-suffix "mdwn") | |
(defvar unnamed-memo-default-header "<!-- -*- mode:markdown; coding:utf-8; -*- -->\n\n") | |
(defvar unnamed-memo-default-time-format "[%Y-%m-%d %H:%M:%S(%a)]") | |
(defun unnamed-memo-aux-new-file-sequence (time) | |
(setq buffer-file-coding-system 'utf-8) | |
(insert unnamed-memo-default-header) |
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
/* lv.c */ | |
#define GREP_COMMAND "lgrep" | |
/* ... */ | |
private void LvInit( byte **argv ) | |
{ | |
/* ... */ |
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
diff -u src_orig/conf.c src/conf.c | |
--- src_orig/conf.c 2004-01-05 16:23:29.000000000 +0900 | |
+++ src/conf.c 2012-02-24 00:20:06.000000000 +0900 | |
@@ -285,6 +285,7 @@ | |
case 'd': casefold_search = TRUE; s++; continue; | |
case 'i': casefold_search = TRUE; s++; continue; | |
case 'f': regexp_search = FALSE; s++; continue; | |
+ case 'F': show_filename = TRUE; s++; continue; | |
case 'g': grep_mode = TRUE; s++; continue; |
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
# -*- coding: utf-8 -*- | |
require 'date' | |
require 'uri' | |
require 'net/http' | |
USAGE = <<EOL | |
Converts math formula (written in TeX language) into PNG file via Google Chart API. | |
USAGE: $ ruby #{__FILE__} "Formula_in_TeX_language" | |
ex.) ruby chartapi.rb "x = \\frac{-b\\pm\\sqrt{b^2-4ac}}{2a}" | |
EOL |
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
<html> | |
<head> | |
<script type="text/javascript"> | |
function reload_formula(tex_math) | |
{ | |
// Ref.: Comparing escape(), encodeURI(), and encodeURIComponent() | |
// http://xkr.us/articles/javascript/encode-compare/ | |
document.getElementById("formula_image").src = "https://chart.googleapis.com/chart?cht=tx&chl=" + encodeURIComponent(tex_math); | |
} | |
</script> |
OlderNewer