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
| # Project Policy | |
| This policy provides a single, authoritative, and machine-readable source of truth for AI coding agents and humans, ensuring that all work is governed by clear, unambiguous rules and workflows. It aims to eliminate ambiguity, reduce supervision needs, and facilitate automation while maintaining accountability and compliance with best practices. | |
| # 1. Introduction | |
| > Rationale: Sets the context, actors, and compliance requirements for the policy, ensuring all participants understand their roles and responsibilities. | |
| ## 1.1 Actors |
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
| #include <stdio.h> | |
| // Example using GCC's inline assembler. | |
| // Compute the sum of 1 to 10. | |
| // GCCのインラインアセンブラを使った例。 | |
| // 1から10までの総和を計算する。 | |
| // use compiler option -masm=intel |
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
| ===Makefile=== | |
| default: native | |
| native: | |
| ocamlbuild -use-ocamlfind -yaccflags --explain main.native | |
| clean: | |
| ocamlbuild -clean | |
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
| %token VAL1 EOF | |
| %start <int option> prog | |
| %% | |
| prog: | |
| | VAL1 { Some 1} | |
| | EOF { None } | |
| ; |
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
| import Data.List(sortBy) | |
| myLength :: [a] -> Int | |
| myLength [] = 0 | |
| -- myLength (x:xs) = 1 + myLength xs | |
| myLength (_:xs) = 1 + myLength xs | |
| -- sumList :: [Double] -> Double | |
| -- sumList [] = 0 |
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
| (defn prime? [n] | |
| (cond | |
| (== n 1) false | |
| (== n 2) true | |
| (even? n) false | |
| :else (->> (range 3 (inc (Math/sqrt n)) 2) | |
| (every? #(pos? (rem n %)))))) | |
| (def m-prime? (memoize prime?)) |
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
| (require '[clojure.xml :as xml]) | |
| (defn twitter-followers [user-name] | |
| (->> (str "https://api.twitter.com/1/users/show.xml?screen_name=" user-name) | |
| xml/parse | |
| :content | |
| (filter (comp #{:followers_count} :tag)) | |
| first | |
| :content | |
| first |
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
| ;; Clojure logger example | |
| (defn print-logger [writer] | |
| #(binding [*out* writer] | |
| (println %))) | |
| (def *out*-logger (print-logger *out*)) | |
| (def writer (java.io.StringWriter.)) |
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
| * common-lisp: format: | |
| ~a aesthetic | |
| ~s readで読める形式 | |
| ~:a nil → () で出力 | |
| ~% 改行 | |
| ~& 先頭でないときに改行 | |
| ~5% 5個改行 | |
| ~~ ~を出力 | |
| ~5~ 5個出力 | |
| ~c 文字 |