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
#lang racket | |
;; 20170402 - stagecoach-problem.rkt used to solve stagecoach problem. | |
;; license: MIT license | |
;; by Yoxem | |
;; cost table from O to D with cost in 2D hash-tables | |
(define cost-table |
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 python3 | |
#under MIT license | |
#by yoxem 2017-04-02 | |
import cairo | |
#設定寬高 | |
#setting the width and height in inches. | |
#width of a4 = 8.3 inch = 8.3*72px | |
#height of a4 = 8.3 inch = 8.3*72px | |
WIDTH, HEIGHT = (8.3 * 72), (11.7 * 72) |
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
<!DOCTYPE html> | |
<html> | |
<!-- ref.: http://sozi.baierouge.fr/pages/tutorial-embedding.html --> | |
<meta charset="utf-8"> | |
<body style="color:rgb(10,10,100)"> | |
<h1 style="color:rgb(30,30,230);">高橋流 Sozi 簡報內嵌於網頁的測試</h1> | |
<strong>想像的共同體心得(?)</strong><p/> | |
請用滑鼠點選方框內切換頁面。 | |
<p/> | |
<object height="400px" width="50%" style="box-shadow: 2px 2px 4px 2px rgba(0,0,150,0.4);margin-left:25%;" |
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
def add(a,b): | |
return a + b | |
def exe(x): | |
if type(x) in [int, float, bool]: | |
return x | |
elif x[0] == "if_": | |
if exe(x[1]) == True: | |
return exe(x[2]) | |
else: |
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
;; #lang r5rs -> scheme R5Rs | |
;; scheme 系 (define-syntax) (syntax-rule) 的用法舉隅(有關巨集 macro) | |
;;; 求算平方和,sqrt-num 是巨集名稱 | |
;; 期望輸出結果 | |
; (sqrt-sum 2) => 4 (回傳值,= 2^2) | |
; (sqrt-sum 1 3) => 10 (=1^2+3^2) | |
; (sqrt-sum 1 3 5) => 35 (=1^2+3^2+5^2) | |
(define-syntax sqrt-sum | |
(syntax-rules () |
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
/* huge_number_calc.rs - a program to count (add/sub/mul/div (quotient)/remainder) with signed huge numbers. | |
Copyright (C) 2018 Yoxem Chen <chenjt30 #AT# gmail {DoT} com> | |
This program is free software: you can redistribute it and/or modify | |
it under the terms of the GNU General Public License as published by | |
the Free Software Foundation, either version 3 of the License, or | |
(at your option) any later version. | |
This program is distributed in the hope that it will be useful, | |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
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 python3 | |
#-*-coding:utf-8-*- | |
from PIL import ImageFont | |
font_path = "/usr/share/fonts/truetype/freefont/FreeSerif.ttf" | |
font_size = 15 | |
line_width = 360 # in px | |
font = ImageFont.truetype(font_path, font_size) |
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
(define (g x) | |
(display "萬歲") | |
(cos (x 18))(x 20) | |
(display "ura") | |
72 | |
) | |
(call-with-current-continuation g) | |
;; prints 萬歲; then returns 18 | |
(g cos) |
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
;; a demo of continuation-pass-style by finding the n-th number of fibonacci series. | |
;; works in R5RS scheme | |
(define +& | |
(lambda (a b y) | |
(y (+ a b) | |
))) | |
(define <& | |
(lambda (a b y) |
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
\begin[class=jplain]{document} % test.sil,註跤建議用「半型空白+%」做起頭,佮 LaTeX 仝款。用 jplain 逝kap逝的空間才會大 | |
\font[family=AR PL UMing TW,language=ja] % 假使有安裝 AR PL UMing TW 這个字型。中文主動換逝的功能無支援,姑不而將用日語ê | |
\script[src=packages/ruby] %試ruby 加注音 | |
%巴克禮聖經(漢羅轉寫) | |
\font[size=24pt]{創世紀}\par | |
原起頭上帝創造天kap地。地是空空混沌,深淵ê面上烏暗;上帝ê神運動tī水面。 | |
上帝講,tio̍h有光,就有光。上帝看光,是好;上帝將光暗分開。上帝叫hit ê光做日,叫暗做暝。有下昏有早起,是頭一日。 |