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
;; Mac の Dictionary.app を、 Emacs の popwin.el から使う | |
;; dict.py is from http://sakito.jp/mac/dictionary.html | |
(defun dictionary () | |
"dictionary.app" | |
(interactive) | |
(let ((word (if (and transient-mark-mode mark-active) | |
(buffer-substring-no-properties (region-beginning) (region-end)) | |
(read-string "Dictionary: "))) | |
(cur-buffer (current-buffer)) | |
(tmpbuf " * dict-process *")) |
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
(defmacro worker-elisp (output-stream &rest lisp) | |
"Evaluate the LISP in a child Emacs sending output to OUTPUT-STREAM. | |
The child Emacs has a 'load-path' exactly as the 'load-path' of | |
the parent Emacs at execution. | |
The OUTPUT-STREAM could be a buffer, a function or a process. | |
If the OUTPUT-STREAM is a process it may have a process property |
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
(defun dired-hide-dotfiles() | |
"reload current dired buffer, hiding dotfiles" | |
(interactive) | |
(dired-unmark-all-marks) | |
(dired-mark-files-regexp "^\\.") | |
(dired-do-kill-lines)) | |
(add-hook 'dired-mode-hook | |
'(lambda () | |
(local-set-key "h" 'dired-hide-dotfiles))) |
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
using System; | |
using System.Collections.Generic; | |
using System.IO; | |
using System.Linq; | |
using System.Reflection; | |
using NUnit.Framework; | |
namespace MyProject | |
{ | |
[TestFixture] |
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
module Main where | |
import qualified Data.ByteString.Char8 as B | |
import Data.Tree.NTree.TypeDefs | |
import Data.Maybe | |
import Text.XML.HXT.XPath | |
import Text.XML.HXT.Core | |
import Control.Monad | |
import Control.Monad.Trans |
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
# Makefile for F# lexing and parsing example from | |
# http://en.wikibooks.org/wiki/F_Sharp_Programming/Lexing_and_Parsing | |
# Sources available at https://github.com/obeleh/FsYacc-Example | |
# | |
# http://laufer.cs.luc.edu/teaching/372 | |
# | |
# Prerequisites | |
# make | |
# http://fsharppowerpack.codeplex.com/ for fslex, fsyacc | |
# http://fsxplat.codeplex.com/ for fsharpc (and fsharpi) |
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 jp.sf.amateras.scala.util.Imports._ | |
using(DriverManager.getConnection("")){ implicit conn => | |
withTransaction { conn => | |
// update | |
val rows = conn.execute( | |
"INSERT INTO USER_INFO (USER_ID, USER_NAME) VALUES (?, ?)", | |
1, "takezoe") | |
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
{-# LANGUAGE BangPatterns #-} | |
{-# LANGUAGE ForeignFunctionInterface #-} | |
module Bench where | |
import Control.Monad | |
import Criterion.Main | |
import Foreign | |
import Foreign.C.Types |
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
public static class AssemblyInformationalVersionExtensions { | |
public static string GetInformationalVersionString(this Assembly assembly) { | |
return assembly | |
.GetCustomAttributes(typeof(AssemblyInformationalVersionAttribute), false) | |
.Cast<AssemblyInformationalVersionAttribute>() | |
.Select(t=>t.InformationalVersion) | |
.FirstOrDefault(); | |
} | |
} |
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
-- http://blog.moertel.com/articles/2004/03/13/concurrent-port-scanner-in-haskell | |
module Main (main) where | |
import Control.Concurrent | |
import Control.Exception | |
import Data.Maybe | |
import Network | |
import Network.BSD | |
import System.Environment |