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 class Main { | |
/** | |
* Test Eq<T> interface | |
*/ | |
public static void main(String[] args) { | |
Color color1 = new Color(ColorType.Red); | |
Color color2 = new Color(ColorType.Green); | |
System.out.println("Red == Green -> " + color1.eq(color1, color2)); |
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
enum ColorType { | |
Red, | |
Yellow, | |
Green | |
} | |
interface Eq<T> { | |
Boolean eq(T a, T b); | |
} |
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
data Color = Red | Yellow | Green | |
instance Eq Color where | |
Red == Red = True | |
Yellow == Yellow = True | |
Green == Green = True | |
_ == _ = False |
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 config | |
%%%--------------------------------------------------------------------- | |
%%% mod_poker plugin's config | |
%%%--------------------------------------------------------------------- | |
%%% Exports | |
%%%--------------------------------------------------------------------- | |
%%% create_foobar(Parent, Type) | |
%%% returns a new foobar object | |
%%% etc etc etc |
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
cd lib-src; make all \ | |
CC='gcc' CFLAGS='-g -O2 -Wno-pointer-sign ' CPPFLAGS='-D_BSD_SOURCE ' \ | |
LDFLAGS='-Wl,-znocombreloc ' MAKE='make' | |
make[1]: Entering directory `/home/shk/emacs-22.1/lib-src' | |
Makefile:148: *** commands commence before first target. Stop. | |
make[1]: Leaving directory `/home/shk/emacs-22.1/lib-src' | |
make: *** [lib-src] Error 2 | |
[shk@myhost emacs-22.1]$ make | |
cd lib-src; make all \ | |
CC='gcc' CFLAGS='-g -O2 -Wno-pointer-sign ' CPPFLAGS='-D_BSD_SOURCE ' \ |
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
(setq load-path (cons "/usr/lib/erlang/lib/tools-2.6.6.1/emacs" load-path)) | |
(add-to-list 'auto-mode-alist '("\\.erl?$" . erlang-mode)) | |
(add-to-list 'auto-mode-alist '("\\.hrl?$" . erlang-mode)) | |
(setq erlang-root-dir "/usr/lib/erlang") | |
(add-to-list 'exec-path "/usr/lib/erlang/bin") | |
(setq erlang-man-root-dir "/usr/lib/erlang/man") | |
(defun my-erlang-mode-hook () |
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 GNU Emacs. | |
# Copyright (C) 1985, 1987, 1988, 1993, 1994, 1995, 1999, 2000, 2001, 2002, | |
# 2003, 2004, 2005, 2006, 2007, 2008 | |
# Free Software Foundation, Inc. | |
# This file is part of GNU Emacs. | |
# GNU Emacs is free software; you can redistribute it and/or modify | |
# it under the terms of the GNU General Public License as published by | |
# the Free Software Foundation; either version 3, or (at your option) |
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
start(Pid) -> | |
register(my_process, spawn(module, loop, [Pid])). | |
loop(Pid) -> | |
receive | |
{From, give_pid} -> | |
From ! Pid | |
end, | |
loop(Pid). |
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
{"src/*", [debug_info, {d, debug}, {outdir, "ebin"}, {i, "include"}]}. |
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
T2 = erlang:now(), | |
A = timer:now_diff(T2, T1), | |
?INFO_MSG("T2 - T1 -- " ++ integer_to_list(A), []), | |