- ubuntu 16.04
- php 7.1
- apache 2.4
- mysql 5.7
- git & composer
This file contains 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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Game of Life</title> | |
<script src="https://d3js.org/d3.v3.min.js"></script> | |
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.0/jquery.min.js"></script> | |
</head> | |
<body> | |
<style> | |
button { |
This file contains 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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Bubbles</title> | |
<style> | |
#A1 { | |
margin: 0; | |
background: #0f0f0f; | |
max-width: 600px; | |
} |
This file contains 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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Eating Snake</title> | |
<script src="https://d3js.org/d3.v3.min.js"></script> | |
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.0/jquery.min.js"></script> | |
</head> | |
<body> | |
<style> | |
button { |
This file contains 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
// ... | |
// 一些預處理,抓地點、時間、氣象關鍵字等 | |
// ... | |
} else if (isWeatherKeyword) { // 如果是要回應「天氣」況狀,例如:天氣、濕度、溫度 | |
let replyMsg = ""; // 將回傳給使用者的資訊 | |
// ... | |
if (isTimeKeyword) { // 如果有時間關鍵字,並且不是現在,就採用預報 | |
replyMsg = await getForecast(); // 取得氣象預報資料 | |
} else { // 不然就回答現在天氣 | |
replyMsg = await getWeather(); // 取得現在氣象狀況 |
This file contains 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
async function platformReplyImage(context, url) { | |
if (process.env.chatroomPlatform == 'messenger') { | |
await context.sendImage(url) | |
} else { | |
await context.replyImage(url); | |
} | |
} |
This file contains 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
var PATTERN = new RegExp( | |
'(而家|立(?:刻|即)|即刻)|' + | |
'(今|明|前|大前|後|大後|聽|昨|尋|琴)(早|朝|晚)|' + | |
'(上(?:午|晝)|朝(?:早)|早(?:上)|下(?:午|晝)|晏(?:晝)|晚(?:上)|夜(?:晚)?|中(?:午)|凌(?:晨))|' + | |
'(今|明|前|大前|後|大後|聽|昨|尋|琴)(?:日|天)' + | |
'(?:[\\s|,|,]*)' + | |
'(?:(上(?:午|晝)|朝(?:早)|早(?:上)|下(?:午|晝)|晏(?:晝)|晚(?:上)|夜(?:晚)?|中(?:午)|凌(?:晨)))?', 'i'); |
This file contains 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
// ..... | |
} else if (match[DAY_GROUP_1]) { // 處理中文字有關於「天」的部分 | |
var day1 = match[DAY_GROUP_1]; | |
var time1 = match[TIME_GROUP_1]; | |
if (day1 == '明' || day1 == '聽') { | |
// 如果半夜說明天,通常是今天的概念 | |
if(refMoment.hour() > 1) { | |
startMoment.add(1, 'day'); | |
} |
This file contains 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
/// Make CPUs usage as a sin wave | |
#include <math.h> | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <sys/time.h> | |
#include <unistd.h> | |
const float PI = 3.1415926; | |
const int TIME_SLICE = 40000; // 40 ms |
This file contains 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
# ------------------------------------------------------------------------------- | |
# SIR Model | |
# Author: Liu An Chi @tigercosmos | |
# ------------------------------------------------------------------------------- | |
from pylab import * | |
from scipy import interpolate | |
# Parameters | |
Beta = 1 | |
Gamma = 0.5 |
OlderNewer