2016-02-25

tcl-lmdb v0.3.3

檔案放置網頁


tcl-lmdb - Tcl interface to the Lightning Memory-Mapped Database

About


This is the Lightning Memory-Mapped Database (LMDB) extension for Tcl using the Tcl Extension Architecture (TEA).

LMDB is a Btree-based database management library with an API similar to BerkeleyDB. The library is thread-aware and supports concurrent read/write access from multiple processes and threads. The DB structure is multi-versioned, and data pages use a copy-on-write strategy, which also provides resistance to corruption and eliminates the need for any recovery procedures. The database is exposed in a memory map, requiring no page cache layer of its own. This extension provides an easy to use interface for accessing LMDB database files from Tcl.

Main Change

  • Update README.md
  • Improve dbi_handle drop command behavior when del_flag equals 1. If del_flag equals 1, delete dbi_handle command.
  • Add more check in env_handle open -mode option
  • Improve dbi_handle drop command option check
  • Improve dbi_handle del command option check

一些說明


這是一個小更新的版本,增加了一些 command option 的檢查。然後 dbi_handle drop 的行為有一點改變,當 del_flag 設為 1,會將 dbi_handle command 也一起刪除。

2016-02-23

Building Tcl/Tk with MSYS2 (for x86_64)

下載並且安裝 MSYS2 以後,首先先更新 MSYS2 的核心套件:

pacman -Sy
pacman --needed -S bash pacman pacman-mirrors msys2-runtime

然後離開 MSYS2-shell 再重啟,並且在安裝其它的套件之前使用下面的命令:

pacman -Su

離開 MSYS2-shell 再重啟,就有一個基本可用的 MSYS2-shell。

安裝必要的套件:

pacman -S base-devel mingw-w64-x86_64-toolchain

如果要一起裝 (i686 and x86_64),使用下面的:

pacman -S base-devel mingw-w64-i686-toolchain mingw-w64-x86_64-toolchain

到這裡就安裝完需要的檔案。然後把 Tcl 8.6.4 的 source code 放在 /src/tcl,Tk 8.6.4 的 source code 放在 /src/tk,使用下面的 script 來編譯:

#!/bin/sh
mkdir -p /src
mkdir -p /opt/tcl
mkdir -p /build/tcl
mkdir -p /build/tk
[ -e /src/tcl ] && {
    cd /build/tcl
    /src/tcl/win/configure --prefix=/opt/tcl --enable-64bit --enable-threads && make && make install && {
        [ -e /src/tk ] && {
        cd /build/tk
        /src/tk/win/configure --prefix=/opt/tcl --enable-threads --with-tcl=/build/tcl \
            && make && make install
        }
    }
}

如果是使用 MSYS2 在 Windows 平台上編譯 64 位元的 Tcl/Tk,要加 --enable-64bit,不然會在 zlib 連結的時候失敗。

tclConfig.sh and Ubuntu

最近安裝 Ubuntu 14.04 (for x86_64) 的 VM,所以也安裝了內建的 Tcl/Tk 8.6 來觀察檔案位置。不同的 Linux distribution 讓人困擾的地方就是安裝的地方可能會有一些小差異。目前 Ubuntu 能夠安裝的版本是 8.6.1。

tclConfig.sh,  tclooConfig.sh  和 tkConfig.sh 被 Ubuntu 使用連結的方式放一份在 /usr/lib,而與 openSUSE 放置 64 位元與 32 位元的方式不同,Ubuntu 的應該是這樣:

64 位元 -> /usr/lib
32 位元 -> /usr/lib32

測試安裝 tcllib 1.18 的結果,預設會安裝在 /usr/lib/tcllib1.18。

還有一些 pure tcl 的部份放在 /usr/share/tcltk,舉例來說,如果安裝 tdbc::sqlite3,就會有下面的檔案:
/usr/share/tcltk/tcl8/8.6/tdbc/sqlite3-1.0.0.tm

2016-02-21

tcl-lmdb v0.3.2

檔案放置網頁


tcl-lmdb - Tcl interface to the Lightning Memory-Mapped Database

About


This is the Lightning Memory-Mapped Database (LMDB) extension for Tcl using the Tcl Extension Architecture (TEA).

LMDB is a Btree-based database management library with an API similar to BerkeleyDB. The library is thread-aware and supports concurrent read/write access from multiple processes and threads. The DB structure is multi-versioned, and data pages use a copy-on-write strategy, which also provides resistance to corruption and eliminates the need for any recovery procedures. The database is exposed in a memory map, requiring no page cache layer of its own. This extension provides an easy to use interface for accessing LMDB database files from Tcl.

Main Change

  • Update source code to LMDB 0.9.70 with extra fixes from github. ITS#7992 Fix memleak in prev change (on Windows platform)
  • Update README.md
  • CURSOR get command add options: -get_multiple and -next_multiple
  • Fix CURSOR del command option issue. Give -nodupdata correct option check
  • env_handle set_mapsize/set_maxreaders/set_maxdbs/sync command option add more check

一些說明


這是一個小更新的版本,增加了一些 command option 的檢查。

再來是重新加入 tests 目錄到 source code,並且加進最基本的 test cases。 

2016-02-20

Tclunqlite v0.2.6

檔案放置網頁


Tclunqlite

About


This is the UnQLite extension for Tcl using the Tcl Extension Architecture (TEA).

UnQLite is a in-process software library which implements a self-contained, serverless, zero-configuration, transactional NoSQL (Key/Value store and Document-store) database engine. This extension provides an easy to use interface for accessing UnQLite database files from Tcl.

Main Change

  1. Update README.md
  2. Update DBNAME config command Tcl_WrongNumArgs string
  3. Replace Tcl_GetString to Tcl_GetStringFromObj


說明


這是一個小更新的版本,把 DBNAME config 的錯誤提示文字改成比較正確的版本,並且把Tcl_GetString 更換為使用 Tcl_GetStringFromObj。

再來是重新加入 tests 目錄到 source code,並且加進最基本的 test cases。

2016-02-19

Parse simple XML data

<?xml version="1.0" encoding="UTF-8"?>
<file expr="files_152f8d105f3" name="Test.pptx" oid="123456"
  size="29651" vault="MainVault" version="1.5.1"/>

用 tDom 拿資料:

package require tdom

set xmldata {<?xml version="1.0" encoding="UTF-8"?>
<file expr="files_152f8d105f3" name="Test.pptx" oid="123456"
  size="29651" vault="MainVault" version="1.5.1"/>}

set doc [dom parse $xmldata]
set root [$doc documentElement]
set expr [$root getAttribute expr]
set name [$root getAttribute name]
set oid [$root getAttribute oid]
set size [$root getAttribute size]
set vault [$root getAttribute vault]
set version [$root getAttribute version]

不知道有沒有更簡短的寫法,看到 comp.lang.tcl 有人問自己做的練習。


PS:
如果不知道 attributes,要先取得列表,可以使用:

set attrs [$root attributes]

2016-02-04

Tcllib 1.18

ANNOUNCE: Tcllib 1.18 (comp.lang.tcl)


Overview
========
18 new packages in 14 modules
32 changed packages in 22 modules
24 internally changed packages in 18 modules
357 unchanged packages in 97 modules
438 packages, total in 126 modules, total


所以 Tcllib 釋出了 1.18 版。

2016-02-03

Tcltaglib v0.5 and Tclqrencode v0.3

主要的 code 都沒變,只是進版了。

Tcltaglib

  • Use Tcl_TranslateFileName() to handle filename

這樣檔名就可以不用寫絕對路徑,而可以處理像是 ~  開頭的路徑方式。這樣子在使用上會比較方便,所以版本被我進版成為 v0.5。


Tclqrencode 

這次稍微整合 libqrencode 的一些 source code 上的新增說明,然後更新以後版本被我進版成為 v0.3。

(* 其實和 v0.2 一樣,只是 libqrencode source code 一些地方多加空白和說明)

因為 Tclqrencode 連結到 libpng,理論上是有被影響到(因為我還在網頁上放了 libpng 的相關檔案)。然而我困惑的地方是如果像 libpng 這樣發出 Vulnerability Warning 公告的時候,我到底該怎麼處理才是比較好的處理方式?

2016-02-02

Detecting the Tcl implementation in use

Tcler' wiki: Detecting the Tcl implementation in use

參考連結:
TIP #440: Add engine to tcl_platform Array


在 Tcler's wiki 尋找資料時看到的,我覺得很有趣,所以記錄一下。