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.

Maing 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-18

tclmonetdb v0.4

Homepage


tclmonetdb

About


tclmonetdb is a Tcl extension by using MAPI library to connect MonetDB. I write this extension to research MonetDB and MAPI.

一些說明


  1. Update README.md
  2. Implement param_numeric command

增加一個新的 command param_numeric,並且加入相關的範例到 README.md。我本來在 Github 放了第一個 v0.4,可是我發現範例不夠好,所以更新範例以後清掉 repository,重新建一個新的上去,然後再 release v0.4 版。

2016/02/20 更新:

嗯…… 我發現我更新的範例還是不夠好,所以又清掉 repository,重新建一個新的上去,然後再 release v0.4 版。

2016-02-17

tclmonetdb v0.3.2

Homepage


tclmonetdb

About


tclmonetdb is a Tcl extension by using MAPI library to connect MonetDB. I write this extension to research MonetDB and MAPI.

一些說明


  1. Update README.md
  2. Add port number check in monetdb command

這是一個小更新的版本,增加 monetdb command 參數 port 的檢查。

2016-02-15

tclmonetdb v0.3.1

Homepage


tclmonetdb

About


tclmonetdb is a Tcl extension by using MAPI library to connect MonetDB. I write this extension to research MonetDB and MAPI.

一些說明


  1. Add more check in setAutocommit, param_string, fetch_field, get_field_name and get_field_type command

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

2016-02-13

Tcl/Tk 8.5.19 RELEASED

Tcl core team 釋出了 8.5.19。下面是公告的內容:

The Tcl Core Team is pleased to announce the 8.5.19 releases of the Tcl dynamic language and the Tk toolkit. This is the nineteenth patch release of Tcl/Tk 8.5. More details can be found below. We would like to express our gratitude to all those who submit bug reports and patches. This information is invaluable in enabling us to identify and eliminate problems in the core.

Tcl/Tk 8.5.* have been in release since December 2007. The successor releases Tcl/Tk 8.6.* have been in release since December 2012. Tcl/Tk 8.5 is approaching its End of Life. We expect there to be few additional 8.5.* patch releases, perhaps only one more. If you have not completed migrations from 8.5 to 8.6, that work should increase in priority now. Any blocking issues should be made known to Tcl/Tk developers in the ticket systems.

Where to get the new releases:
------------------------------

Tcl/Tk 8.5.19 sources are freely available as open source from the Tcl Developer Xchange web site at:

http://www.tcl.tk/software/tcltk/8.5.html

This web page also contains additional information about the releases, including new features and notes about installing and compiling the releases. Sources are always available from the Tcl SourceForge project's file distribution area:

http://sourceforge.net/projects/tcl/files/

Binaries for most major platforms will be available from:

http://www.activestate.com/activetcl/downloads

For additional information:
---------------------------

Please visit the Tcl Developer Xchange web site:

http://www.tcl.tk/

This site contains a variety of information about Tcl/Tk in general, the core Tcl and Tk distributions, Tcl development tools, and much more.

Summary of Changes since Tcl/Tk 8.5.18:
--------------------------------------

The following were the main changes in Tcl/Tk 8.5.19. A complete list can be found in the changes file at the root of the source tree. The more complete Timelines of all changes are online

http://core.tcl.tk/tcl/
http://core.tcl.tk/tk/

This is a patch release, so it primarily includes bug fixes and corrections to erratic behavior. Below are only the most notable changes.

* [TIP 437] New panedwindow options.
* [TIP 440] Implementation identifier: $::tcl_platform(engine).
* Update to Unicode 8.0.
*** POTENTIAL INCOMPATIBILITY ***
* Better memory debug interoperation with extensions.
* Cocoa: wish launches in front. [focus -force] works.
* Revised handling of incomplete multibyte char @ EOF.
*** POTENTIAL INCOMPATIBILITY ***
* Fixed crashes...
- allocation overflow parsing large [expr]essions.
- overflow computing buffer sizes in input translation.
- Cocoa: premature image free.
- [$text index "1.0 display wordstart"]
- [catch {canvas .c -bg #001 -potato}; canvas .d]
- [$text see end] with elided text. (textIndex-25.1)
- embedded window in [text], deletion bound to (textWind-18.1)
- attempt to post a menubar menu (menu-37.1)
- [text] tag redraw (textDisp-9.14)
* Stop hangs in...
- closing unflushed blocking channels.
- OSX notifier.
- notifier mutexes in forking processes.
* New bundled packages
- platform 1.0.14: Cygwin support fix.
* Fix: Win: Permit shared read from linked dirs.
* Fix: error in async input buffer draining via timer events.
* Fix: Alpha channel handling in photo images.
* Fix: "insert wordstart" result in word with multibyte chars.
* Win: [file normalize ~user] get proper directory.
* Extend serial channels to support higher baud rates.
* Many improvements to regexp engine from Postgres.
* Fix: support 64-bit window IDs.
* Fix: [tk_getOpenFile] displays links to directories twice.
* Fix: Many faults in [panedwindow] and [text].
* Fix: Stop [$text delete] acting before start index.
*** POTENTIAL INCOMPATIBILITY ***
* Fix: Make TraverseToMenu safe to call on destroyed window.
* Fix: Make [entry] insertion cursor always visible.
* Fix: Display trailing TAB in entry.
* Fix: double click on lone char in entry.
* Fix: [listbox $path -takefocus 0] steals focus.
* Fix: tag leaks in [text].
* Fix: [text see] misbehavior.
* Fix: Never-mapped [text] performance.
* Fix: Report errors from -textvariable write trace in [entry].
* Fix: initial scrollbar width.
* Fix: event not received by scrollbar.
* Update: MSVC 14+: semi-static UCRT support.



還不知道 8.6.x 是不是會釋出一個新的版本。

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 公告的時候,我到底該怎麼處理才是比較好的處理方式?

tclmonetdb v0.3

Homepage


tclmonetdb

About


tclmonetdb is a Tcl extension by using MAPI library to connect MonetDB. I write this extension to research MonetDB and MAPI.

Implement commands


monetdb HANDLE ?-host HOST? ?-port PORT? ?-user username? ?-passwd password? ?-dbname DBNAME?
HANDLE reconnect
HANDLE is_connected
HANDLE ping
HANDLE getAutocommit
HANDLE setAutocommit autocommit
HANDLE query SQL_String
HANDLE prepare SQL_String
HANDLE param_string field_number SQL_type string
HANDLE clear_params
HANDLE execute
HANDLE fetch_reset
HANDLE fetch_row
HANDLE fetch_row_list
HANDLE fetch_row_dict
HANDLE fetch_field field_number
HANDLE get_field_count
HANDLE get_row_count
HANDLE rows_affected
HANDLE get_field_name field_number
HANDLE get_field_type field_number
HANDLE get_query
HANDLE get_columns
HANDLE close_handle
HANDLE close


一些說明


  1. Add ping command
  2. Update README.md

這是生日快樂版。嗯…… 其實是我發現我在 README.md copy & paste 的過程中忘了改關鍵字,所以一直修改 README.md 的一個版本。

為了避免我自己回憶起來這部份很瞎的情況,我還特地刪掉 Github 上的 repository 再重新建一個新的

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 尋找資料時看到的,我覺得很有趣,所以記錄一下。

2016-02-01

tclmonetdb v0.2

Homepage


tclmonetdb

About


tclmonetdb is a Tcl extension by using MAPI library to connect MonetDB. I write this extension to research MonetDB and MAPI.

Implement commands


monetdb HANDLE ?-host HOST? ?-port PORT? ?-user username? ?-passwd password? ?-dbname DBNAME?
HANDLE reconnect
HANDLE is_connected
HANDLE getAutocommit
HANDLE setAutocommit autocommit
HANDLE query SQL_String
HANDLE prepare SQL_String
HANDLE param_string field_number SQL_type string
HANDLE clear_params
HANDLE execute
HANDLE fetch_reset
HANDLE fetch_row
HANDLE fetch_row_list
HANDLE fetch_row_dict
HANDLE fetch_field field_number
HANDLE get_field_count
HANDLE get_row_count
HANDLE rows_affected
HANDLE get_field_name field_number
HANDLE get_field_type field_number
HANDLE get_query
HANDLE get_columns
HANDLE close_handle
HANDLE close

一些說明


  1. Add param_string/clear_params command
  2. Fix some commands give Tcl_WrongNumArgs wrong parameters

我發現提示輸入錯誤參數的地方有一些沒寫好,我會發現是因為今天實作 param_string 與 clear_params 二個命令,在測試的時候發現我沒填好,所以這次也一起修正了,希望我有全部都修正完畢。

所以版本我升到 v0.2 了。

2016/02/02 更新:
param_string 我在 code 裡有檢查傳進來的 string(也就是第三個參數)是不是 NULL 或者是長度小於 1 的字串(而且還直接返回 TCL_ERROR 結束),但是我記得有些地方可能會需要空值,這樣我就不確定我的實作是不是正確的。目前先維持有檢查的版本好了。