Sublime Text 2는 subl(왜 sublime이 아닌지는 의문)이라는 CLI(Command-lime interface)을 갖고있다. 이 유틸리티는 디폴트로 설치되는 다음과 같은 폴더에 위치한다.
open /Applications/Sublime\ Text\ 2.app/Contents/SharedSupport/bin/subl
물론 저 폴터에 있는 subl을 바로 사용하면 되겠지만 편리하게 사용할 수 있는 두가지 방법을 적어본다.
// 스칼라의 문법인 케이스 클래스와 패턴 매칭 코드로 살펴보기 | |
// regular, non-encapsulated data structures 가 필요할 때 케이스 클래스 사용 | |
// Programming In Scala 15장 예제 코드로 구성 됨 | |
abstract class Expr | |
case class Var(name: String) extends Expr | |
case class Number(num: Double) extends Expr | |
case class UnOp(operator: String, arg: Expr) extends Expr | |
case class BinOp(operator: String, left: Expr, right: Expr) extends Expr |
case class Dummy(a: Int, b: Double) | |
val obj1 = Dummy(1, 10.0) | |
val obj2 = Dummy(2, 20.0) | |
val obj3 = Dummy(1, 10.0) | |
obj1 == obj2 | |
obj1 equals obj2 | |
obj1 == obj3 |
public class EqualTest{ | |
public static void main(String []args){ | |
new EqualTest().test(); | |
} | |
private void test() { | |
Dummy obj1 = new Dummy(1, 10.0); | |
Dummy obj2 = new Dummy(2, 20.0); | |
Dummy obj3 = new Dummy(1, 10.0); | |
System.out.println("obj1 == obj2: " + (obj1 == obj2) + " / obj1.equals(obj2): " + obj1.equals(obj2) ); |
int _twoExponential(int exponent, int acc) { | |
if ( exponent == 0 ) { | |
return acc; | |
} | |
acc *= 2; | |
return _twoExponential(--exponent, acc); | |
} | |
int exponential(int num) { |
package nfm.ex06 | |
/** | |
* Programming In Scala 2/e List 6.5 코드 | |
* 분수 Class | |
* @param n 분자 | |
* @param d 분모 | |
*/ | |
/* 스칼라에 있는 문법: Class에서 기본 생성자 선언 가능 |
float tempC; | |
int reading; | |
int tempPin = 0; | |
void setup() | |
{ | |
Serial.begin(9600); | |
analogReference(INTERNAL); | |
} | |
void loop() | |
{ |
//Arduino Sample Code for SHT1x Humidity and Temperature Sensor | |
//www.DFRobot.com | |
//Version 1.0 | |
#include <SHT1x.h> | |
// Specify data and clock connections and instantiate SHT1x object | |
#define dataPin 10 | |
#define clockPin 11 | |
SHT1x sht1x(dataPin, clockPin); |
# coding: utf-8 | |
from xlwt import Workbook | |
book = Workbook() | |
sheet1 = book.add_sheet(u'Ex Sheet1') | |
sheet2 = book.add_sheet(u'Ex Sheet2') | |
sheet1.write(0,0, u'Name') | |
sheet1.write(0,1, u'Sex') |