Skip to content

Instantly share code, notes, and snippets.

@kencoba
kencoba / Scenario1.scala
Created July 10, 2014 14:51
The code after first Iteration [Mame night(2014/7/10)](http://www.mamezou.com/event/mn_20140710.html)
package iteration.first
import java.util.Date
object Scenario1 {
def main(args: Array[String]) = {
var p = new Parkarea(3)
var t1 = p.checkin
var t2 = p.checkin
@kencoba
kencoba / file0.scala
Created May 19, 2014 08:58
[Scala]Excelシートに入力する式を生成する ref: http://qiita.com/kencoba/items/fb04159213502b36f418
def expression(cells:List[String], rows:Int) = {
val ors = cells.map(c => c + rows + "=\"?\"," + c + rows + "=\"\"").mkString(",")
val corrects = cells.map(c => c + "$1").mkString(",")
val answers = cells.map(c => c + rows).mkString(",")
"IF(OR(" + ors + "),\"?\",IF(AscStr" + cells.size + "(" + answers + ")=AscStr" + cells.size + "(" + corrects + "),\"o\",\"x\"))"
@kencoba
kencoba / CCS-2.ss
Created May 16, 2014 01:10
A model of Cruise Control System with SyncStitch.
((:version . 0) (:type . :syncstitch-model)
(:definitions (:type . :text)
(:text ";Definitions----------------------------------"
"(define-event engineOn)" "(define-event engineOff)" ""
"(define-event on)" "(define-event off)" "(define-event resume)" ""
"(define-event brake)" "(define-event accelerator)" ""
"(define-event clearSpeed)" "(define-event recordSpeed)"
"(define-event enableControl)" "(define-event disableControl)" ""
"(define-event speed)" "" "(define-event setThrottle)" ""
"(define-channel is-ss (x)" " '((engineOn)(engineOff)))" ""
@kencoba
kencoba / FileList.vbs
Created May 9, 2014 02:34
Listing files in a directory recursively.
Option Explicit
Sub FileList()
Dim Files As Variant
Files = GetFilePathList("c:\Samples", "*.pdf")
Range(Cells(1, "A"), Cells(UBound(Files, 2), "B")) _
= Application.WorksheetFunction.Transpose(Files)
End Sub
@kencoba
kencoba / file0.txt
Created May 9, 2014 02:25
[Excel VBA] get the list of file path. ref: http://qiita.com/kencoba/items/257309594537cac823df
Option Explicit
Sub FileList()
Dim Files As Variant
Files = GetFilePathList("c:\Samples", "*.pdf")
Range(Cells(1, "A"), Cells(UBound(Files, 2), "B")) _
= Application.WorksheetFunction.Transpose(Files)
End Sub
@kencoba
kencoba / ToPDF.vbs
Created May 8, 2014 07:45
[Excel VBA]Continuous Integration for MS-Office Documents with Excel VBA
Option Explicit
' 2014/05/08 Kenichi Kobayashi
'
' # Prepare
'
' Before you run the VBA macro, make worksheet as below.
' |target directory|target filename|destination directory|destination filename| options|
'
' ## Options for Word
@kencoba
kencoba / file0.txt
Created May 8, 2014 07:39
[Excel VBA]Continuous Integration for MS-Office Documents with Excel VBA ref: http://qiita.com/kencoba/items/173ecb737ca053168ede
Option Explicit
' 2014/05/08 kencoba
Public Sub ToPDF()
Dim i As Integer
i = 2
With Worksheets("Sheet1")
;; User behaviors
;; -----------------------------
;; Behaviors are stored as a set of diffs that are merged together
;; to create the final set of functionality that makes up Light Table. You can
;; modify these diffs to either add or subtract functionality.
;;
;; Behaviors are added to tags, objects with those tags then automatically gain
;; whatever logic the behavior imparts. To see a list of user-level behaviors,
;; start typing a word related to the functionality you want in between the square
;; brackets (e.g. "theme").
@kencoba
kencoba / CodeFormat.vb
Created May 4, 2014 13:35
Formatting source code on Word document.
Sub PPCode()
ActiveDocument.Select
Dim codelines As Paragraphs
Set codelines = Selection.Paragraphs
Selection.Copy
Dim lines As Long
@kencoba
kencoba / file0.txt
Last active September 12, 2020 07:53
[Word VBA]ソースコードをフォーマットする ref: https://qiita.com/kencoba/items/900fed871298868e8ad4
Sub PPCode()
ActiveDocument.Select
Dim codelines As Paragraphs
Set codelines = Selection.Paragraphs
Selection.Copy
Dim lines As Long