Skip to content

Instantly share code, notes, and snippets.

~階

日語中的「~階」用來形容建築物的樓層,「幾層/幾樓」的日語則為「何階」。

10階
一階二階三階四階5階
いっかいにかいさんがいよんかいごかい
六階7階8階9階
ろっかいななかいはっかいきゅうかいじゅっかい
@thomasjao
thomasjao / japanese-sentence-pattern.json
Last active October 5, 2019 15:30
Key Japanese Sentence Patterns
{
"chapter": "Part 2",
"句型": [
{
"keyword": "...までに",
"desc": "【體言】+までに。接在表示時間的名詞後面,表示動作的截止日期或期限。中文的意思是「在···之前」、「到···為止」。",
"sentences": [
{
"jp": "この車は、土曜日までに治りますか?",
"tw": "這台車在星期迌前能修好嗎?"
@thomasjao
thomasjao / ASCII_Table.c
Created August 7, 2017 05:38
Generate ASCII Table in 4 columns
#include <stdio.h>
int main(void)
{
int i, col, code;
char* char_name[32];
char_name[0] = "NUL";
char_name[1] = "SOH";
char_name[2] = "STX";
char_name[3] = "ETX";
@thomasjao
thomasjao / mergeToJSON.js
Last active January 2, 2019 01:38
A brief method of converting CSV data to JSON data format
// Suppose we import CSV files (e.g. Excel output) into our application,
// How we transfer data into JSON format
var data = data.rows;
var jsonData = [];
var titles = data.splice(0,1)[0].split(',').map( function(item) { // this line should place in the function
return item.trim(); // split raw data into "title" part and "data" part
});
// title contains first-line title
// data contains data
@thomasjao
thomasjao / svg_shapes.xml
Created April 24, 2016 08:13
Basic SVG Shapes Attributes in XML
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<svg>
<shapes>
<shape element="rect">
<name>rect</name>
<attributes>
<attribute attr="x">
<key>x</key>
<type>coordinate</type>
<animatable>yes</animatable>
@thomasjao
thomasjao / nodelist2array
Created April 24, 2016 07:53
Transfer node list to array
var node_array = Array.prototype.slice.call( node_list )
<?php
header('Content-type: application/vnd.ms-excel');
header('Content-Disposition: attachment; filename="file.xlsx"');
// PHPExcel 置於 DocumentRoot 的上一層目錄
$path = dirname(dirname(__FILE__)).'/Classes/';
require_once($path.'PHPExcel.php');
require_once($path.'PHPExcel/Writer/Excel2007.php');
$objPHPExcel = new PHPExcel();
<?php
// PHPWord 在 DocumentRoot 的上一層目錄
$path = dirname(dirname(__FILE__))."/PHPWord/";
require_once($path."PHPWord.php");
$doc = new PHPWord();
// 以 section 物件加入內容
$sec = $doc->createSection();
$sec->addText("ABC");
$sec->addText("藉由 PHPWord 程式庫建立 .docx, .odt, .rtf 檔", array("name"=>"Arial", "size"=>14, "bold"=>true));
@thomasjao
thomasjao / welfare.html
Last active September 9, 2015 02:35
Draw welfare icons with svg
<svg xmlns="http://www.w3.org/2000/svg" width="64" height="64">
<g id="handicap">
<circle cx="32" cy="12" r="5" />
<path d="m32,19 l0,14 14,0 9,14" style="stroke-width: 3; fill: none; stroke: black;" />
<path d="M32,25 l12,0 4,-4" style="stroke-width: 3; fill: none; stroke: black;" />
<path d="M28,28 A10 10 0 1 0 40 37" style="stroke-width: 3; fill: transparent; stroke: #000;" />
</g>
</svg>
@thomasjao
thomasjao / svg_utilities.js
Created August 4, 2015 17:02
Dynamically Add Shape/Path in SVG area
// Following snippet is the basice to add a new shape to an SVG area
var svg = document.getElementById('svg');
var rect = document.createElementNS('http://www.w3.org/2000/svg'); // Note: Using createElementNS() instead of createElement()
rect.setAttributeNS(null, 'x', xValue );
rect.setAttributeNS(null, 'y', yValue );
rect.setAttributeNS(null, 'width', widthValue );
rect.setAttributeNS(null, 'height', heightValue );
rect.setAttributeNS(null, 'style', 'fill: none; stroke: blue; stroke-width: 1px;');
svg.appendChild( rect );