第4回 Scala 関西ビギナーズ (session|LT)
の提案.
Scala はその人気の高まりとともに世界的には普及期に入りつつある. 日本においても,東京都心の D 社や D 社などを中心に Scala プログラマーが増えつつある. しかし,関西を含むほとんどの地域では Scala プログラマーお人口密度が低く,
(let [m (BattleMap. "Ironbottom Sound") | |
f (Fleet. "Center Fleet")] | |
(loop [] | |
(doto f .repair .supply) | |
(when (and (.isFullyRepaired f) | |
(.isFullySupplied f) | |
(>= (.morale f) 40)) | |
(.attack f m) | |
(if (-> m .gauges pos?) | |
(recur)))) |
import scala.annotation.tailrec | |
object BinarySearch { | |
def lowerBound(xs: Array[Int], x: Int): Int = { | |
@tailrec | |
def loop(first: Int, count: Int): Int = | |
if (count == 0) first | |
else { | |
val step = count / 2 | |
if (xs(first + step) < x) loop(first + step + 1, count - step - 1) |
class UnionFind: | |
"""Weighted quick-union with path compression. | |
The original Java implementation is introduced at | |
https://www.cs.princeton.edu/~rs/AlgsDS07/01UnionFind.pdf | |
>>> uf = UnionFind(10) | |
>>> for (p, q) in [(3, 4), (4, 9), (8, 0), (2, 3), (5, 6), (5, 9), | |
... (7, 3), (4, 8), (6, 1)]: | |
... uf.union(p, q) |
(ns tnoda.pe10) | |
(defn- sieve | |
"Returns an array of primes below len. Retrieved from | |
https://github.com/tnoda/tnoda.math.prime." | |
[^long len] | |
(let [n len | |
not-prime (doto (boolean-array n) | |
(aset 0 true) | |
(aset 1 true)) |
;;; mell.el --- MELL Emacs Lisp Library | |
;; | |
;; AUTHOR: Hiroyuki Komatsu <komatsu@taiyaki.org> | |
;; LICENCE: GPL2 | |
;; $Id: mell.el,v 1.4 2003/03/18 03:34:45 komatsu Exp $ | |
;; Version: 1.4.0 | |
;; | |
;; ------------------------------------------------------------ | |
;; XEmacs と FSF Emacs の差異を吸収 |
package main | |
import ( | |
"bufio" | |
"errors" | |
"fmt" | |
"io" | |
"os" | |
"strconv" | |
) |
;;; mon-css-color.el --- Highlight and edit CSS colors | |
;; -*- mode: EMACS-LISP; -*- | |
;;; ================================================================ | |
;; Copyright © 2009, 2010 MON KEY. All rights reserved. | |
;; Copyright © 2008, 2009 Lennart Borgman | |
;; Copyright © 2008 Niels Giesen | |
;;; ================================================================ | |
;; AUTHOR: Niels Giesen |
$ make recipes/helm-ad | |
• Building recipe helm-ad ... | |
emacs --no-site-file --batch -l package-build.el --eval "(let ((package-build-stable nil) (package-build-archive-dir (expand-file-name \"./packages\" pb/this-dir))) (package-build-archive 'helm-ad))" | |
Error reading recipe /Users/tnoda/work/melpa/recipes/helm-ad~: Recipe 'helm-ad~' contains mismatched package name 'helm-robe' | |
;;; helm-ad | |
Fetcher: github | |
Source: tnoda/helm-ad |