あとパッケージ類も、最新のバージョンではなかったりする。
今のところkbs.tclでは自動的にダウンロードができない(fossil.exeを使えばよいのだが。) 一時的な回避策として、ローカルウェブサーバを立ててダウンロードさせる必要があった。
def accum(n, x, y) | |
t,s=STDIN.gets.split.map(&:to_i) | |
case t | |
when 1 | |
x+=s | |
when 2 | |
y+=s | |
when 3 | |
sum=x+y | |
x=x-s*x/sum |
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
proc reformat {tclcode {pad 4}} { | |
set lines [split $tclcode \n] | |
set out "" | |
set continued no | |
set oddquotes 0 | |
set line [lindex $lines 0] | |
set indent [expr {([string length $line]-[string length [string trimleft $line \ \t]])/$pad}] | |
set pad [string repeat " " $pad] | |
foreach orig $lines { |
proc read_inifile_section_names {f} { | |
set sections {} | |
set ch [open $f r] | |
while {[gets $ch line] != -1} { | |
if {[regexp {^\[(.+)\]$} $line -> section]} { | |
lappend sections $section | |
} | |
} | |
close $ch | |
return $sections |
using System; | |
using System.Linq; | |
using System.Runtime.InteropServices; | |
using System.IO; | |
namespace TestGetPrivateProfileSectionNames | |
{ | |
public class Program | |
{ | |
[DllImport("kernel32.dll")] |
#! /bin/sh | |
## | |
# @file kbs.tcl | |
# Kitgen Build System | |
# @mainpage | |
# @synopsis{kbs.tcl ?-option? .. ?command? ..} | |
# | |
# For available options and commands see help() or type './kbs.tcl help'. | |
# Online documentation can be found at http://wiki.tcl.tk/18146 | |
# |
あとパッケージ類も、最新のバージョンではなかったりする。
今のところkbs.tclでは自動的にダウンロードができない(fossil.exeを使えばよいのだが。) 一時的な回避策として、ローカルウェブサーバを立ててダウンロードさせる必要があった。
set d [dict create] | |
set str1 "abcdefghijklmnopqrstuvwxyz" | |
for {set i 0} {$i < 10000} {incr i} { | |
set str2 [format "${str1}%4d" $i] | |
set ary($i) $str2 | |
dict set d $i $str2 | |
} | |
proc test1 {_ary} { |
proc stringfy_version {bin} { | |
binary scan $bin s4 v | |
foreach {fv2 fv1 fv4 fv3} $v break | |
set fv "$fv1.$fv2.$fv3.$fv4" | |
return $fv | |
} | |
proc binary_version {v} { | |
foreach {fv1 fv2 fv3 fv4} [split $v .] break | |
binary format s4 [list $fv2 $fv1 $fv4 $fv3] |