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
h1. 入厝準備 | |
h2. 準備物品 | |
* 雞腿飯(7-11) | |
* 包著紅包紙袋的白蘿蔔 | |
- 紅包 (7-11) | |
- 白蘿蔔 (菜市場) | |
* 一杯白開水 | |
- 紙杯(7-11) |
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
#!/usr/bin/env ruby | |
# coding: utf-8 | |
require 'sinatra' | |
set :server, 'thin' | |
set :sessions, true | |
streams = Hash.new {|k, v| k[v] = [] } | |
helpers do | |
def session_id |
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
package | |
{ | |
public class ChkRepeatedValue | |
{ | |
/** | |
* 檢查陣列中的值是否有重複值,只能是一維陣列,例[0,1,2,3,4,5,6],常用於表單檢查 | |
* 例[0,1,1,3,3]將回傳[[1, 2], [3, 4]] | |
* @param _array 待檢查之陣列 | |
* @return 陣列,例如 [[0, 1], [2, 3, 4]] 代表 第0,1個相同,第2,3,4個值相同 | |
*/ |
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
# encoding: utf-8 | |
def company_serial_no_checker(serial) | |
# 共八位,全部為數字型態 | |
at_least_8_digits = /^\d{8}$/ | |
return false unless at_least_8_digits.match(serial) | |
# 各數字分別乘以 1,2,1,2,1,2,4,1 | |
# 例:統一編號為 53212539 |