Skip to content

Instantly share code, notes, and snippets.

import java.util.ArrayList;
import java.util.Arrays;
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
int n = scanner.nextInt();
import java.awt.Rectangle;
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
int night = scanner.nextInt();
int count = 1;
while (night != 0) {
@Yi-Tseng
Yi-Tseng / Main.java
Created June 26, 2013 11:01
ITSA32P4
import java.util.ArrayList;
import java.util.Scanner;
public class Main {
static class LL {
public ArrayList<Integer> list;
public LL() {
list = new ArrayList<Integer>();
public String search(String longitude, String latitude, int radius) {
String res = null;
try {
HttpClient client = new DefaultHttpClient();
HttpGet get = new HttpGet("http://ym.takeshi.tw:8080/search?long="
+ longitude + "&lat=" + latitude + "&radius=" + radius);
HttpResponse response = client.execute(get);
int len = (int) response.getEntity().getContentLength();
byte[] responseBody = new byte[len];
@Yi-Tseng
Yi-Tseng / ttucap.py
Created July 22, 2013 17:25
用於辨識數字用
# -*- encoding: utf-8 -*-
import Image
import ImageDraw
import sys
pattern = (
(),
(0, 0, 1, 0, 0, 1, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0),
@Yi-Tseng
Yi-Tseng / leaptest.html
Created July 24, 2013 17:06
可用 10 跟手指頭在 canvas 上作畫的簡單小程式
<html>
<head>
</head>
<body>
<canvas id='leapCanvas' height='600' width='800' />
</body>
<script src="http://js.leapmotion.com/0.2.0-beta6/leap.min.js"></script>
<script>
var c = document.getElementById("leapCanvas");
import requests
import csv
import uniout
from os.path import exists
from os.path import basename
from pprint import pprint
def save(url, path=None):
@Yi-Tseng
Yi-Tseng / gist:6099337
Created July 28, 2013 17:20
大同 101上 UI4 開課表
[['G3020A',
u' 專題實驗 ',
u'李良德',
u'必修',
'1',
'2',
' 0',
u'專任 '],
['G3020B',
u' 專題實驗 ',
iTerm 2 - 取代 Terminal 用的工具
zsh - zshell, 加強 shell 在使用上的體驗
oh-my-zsh - zsh 的 plugin, 讓 zsh 更好用
Xampp - 整合 apache http server, mysql 等軟體包
Sparrow - 郵件軟體, 9.99$
keka - 檔案壓縮程式
Snagit - 螢幕擷取程式
Sublime Text 2 - 強大的文字編輯程式支援許多 plugin(已經要出第 3 代了)
Package Control - Sublime 的 plugin, 主要是用來管理套件用(用 Sublime 必裝)
Subliminter - Sublime 的 plugin, 用於支援程式撰寫
for(i = 0; i < 5; i++){
for(j = 0; j < 4 - i; j++){
if(a[j] < a[j + 1]){
swap(a[j], a[j+1]);
}
}
}