2018-09-26

tklib/tablelist 更新

tklib-spec
tablelist-spec


tablelist 釋出了 6.3 版,所以我更新了 tklib 與 tablelist 的 openSUSE RPM spec。

2018-09-20

tcl-zstd 更新

tcl-zstd


因為 Zstandard 有更新內容,所以我也跟著更新了 RPM spec。在做的過程中,我出現了嚴重的錯誤,我居然誤殺了自己 openSUSE build service 的 Home Project,還好殺完以後 OBS 有做防呆機制,所以使用者如果嘗試建立一個新的,OBS 會提供選項回復 Home Project 的資料。這表示我最近的情況都不在狀態內,我想我可能需要休息一下。

我思考了一下,把另外一個部落格也刪除了,只留下這個部落格。這個部落格以後應該還是會更新吧,我不太確定。

2018/09/21 更新
我復原了另外一個部落格。

2018-09-17

tcl.mqttc v0.4

tcl.mqttc


paho.mqtt.c 的檔案升到 v1.3.0。加入一個 option -version,用來指定 MQTT protocol 的版本(3.1, 3.1.1, 5 以及不指定的就使用預設值,目前確定 MQTT 3.1/3.1.1 是正確的,但是 MQTT 5 還沒有測試。

接下來等 MQTT 5 broker 的部份準備好再測試(如果那個時候我有時間的話),同時如果 paho.mqtt.c 的版本如果有更新,我再更新檔案。

更新:
使用 VerneMQ 測試 Websockets 的部份,確定可以使用,所以我更新了 README.md。


2018/09/18 更新
要支援 MQTT5 的連線需要加入更多的 code,我使用 VerneMQ 測試以後,基本的連線功能看起來 OK,所以我更新了 source code,同時將版本更新到 v0.5。

2018-09-05

MonetDB and SHA224_Update

在 openSUSE 升版到 LEAP 15.0 以後,我發現編譯 MonetDB Mar2018 SP1 成功,但是 MonetDB mapi library 在 load library 使用時載入失敗。一開始出現的是 SHA224_Update undefined,這是 openSSL 的 function,所以我嘗試在 configure 刪除 SHA224_Update 的部份。(更新:按照 MonetDB 的更新記錄,Mar2018 SP1 和 Aug2018 都會有這問題)

然後就出現更奇怪的結果,結果會發生 mnstr_settimeout undefined 的問題。但是這是 MonetDB stream library 的 function,所以有可能 MonetDB 在 mapi library 連結時的設定有問題。

目前還沒有解法。所以 tclmonetdb 會載入 mapi library 失敗,導致無法使用。

使用 nm 檢查 libmapi.so 的情況:
nm -D libmapi.so.10.1.0
                 U block_stream
0000000000213329 B __bss_start
                 U calloc
                 U close
                 U closedir
                 U close_stream
                 U connect
                 U __ctype_b_loc
                 w __cxa_finalize
0000000000213329 D _edata
0000000000213360 B _end
                 U __errno_location
                 U exit
                 U fclose
                 U fflush
                 U fgets
000000000000f5ac T _fini
                 U fopen
                 U __fprintf_chk
                 U fputc
                 U fputs
                 U free
                 U freeaddrinfo
                 U fwrite
                 U gai_strerror
                 U getaddrinfo
                 U gettimeofday
                 U getuid
                 w __gmon_start__
00000000000030e8 T _init
                 U isa_block_stream
                 w _ITM_deregisterTMCloneTable
                 w _ITM_registerTMCloneTable
                 w _Jv_RegisterClasses
                 U malloc
0000000000007f10 T mapi_bind
00000000000080a0 T mapi_bind_numeric
0000000000007fc0 T mapi_bind_var
000000000000a8a0 T mapi_cache_freeup
0000000000008ea0 T mapi_cache_limit
000000000000a7a0 T mapi_cache_shuffle
0000000000008110 T mapi_clear_bindings
00000000000083e0 T mapi_clear_params
00000000000074b0 T mapi_close_handle
000000000000a6a0 T mapi_connect
0000000000007780 T mapi_destroy
0000000000007740 T mapi_disconnect
0000000000006d30 T mapi_error
0000000000006d40 T mapi_error_str
000000000000bf00 T mapi_execute
0000000000006d60 T mapi_explain
0000000000006e20 T mapi_explain_query
0000000000006f00 T mapi_explain_result
000000000000c420 T mapi_fetch_all_rows
000000000000c610 T mapi_fetch_field
000000000000c740 T mapi_fetch_field_len
000000000000ab20 T mapi_fetch_line
000000000000a840 T mapi_fetch_reset
000000000000c390 T mapi_fetch_row
000000000000ad00 T mapi_finish
000000000000d1a0 T mapi_get_active
00000000000070f0 T mapi_get_autocommit
000000000000d090 T mapi_get_dbname
000000000000cc80 T mapi_get_digits
000000000000c870 T mapi_get_field_count
0000000000007060 T mapi_get_from
000000000000d0b0 T mapi_get_host
000000000000d0d0 T mapi_get_lang
000000000000c990 T mapi_get_last_id
000000000000cbe0 T mapi_get_len
000000000000cfd0 T mapi_get_maloptimizertime
000000000000d0f0 T mapi_get_mapi_version
000000000000d100 T mapi_get_monet_version
000000000000d150 T mapi_get_motd
000000000000c9f0 T mapi_get_name
000000000000cdc0 T mapi_get_query
000000000000cf70 T mapi_get_querytime
000000000000ce10 T mapi_get_querytype
000000000000c930 T mapi_get_row_count
000000000000cd20 T mapi_get_scale
000000000000d030 T mapi_get_sqloptimizertime
000000000000cb40 T mapi_get_table
000000000000ce90 T mapi_get_tableid
0000000000007020 T mapi_get_to
00000000000070a0 T mapi_get_trace
000000000000ca90 T mapi_get_type
000000000000d0e0 T mapi_get_uri
000000000000d0c0 T mapi_get_user
000000000000d190 T mapi_is_connected
0000000000007140 T mapi_log
0000000000007d70 T mapi_mapi
00000000000079d0 T mapi_mapiuri
00000000000072e0 T mapi_more_results
00000000000072d0 T mapi_needmore
00000000000073c0 T mapi_new_handle
0000000000007230 T mapi_next_result
0000000000006d50 T mapi_noexplain
0000000000008360 T mapi_param
0000000000008370 T mapi_param_numeric
0000000000008280 T mapi_param_string
0000000000008180 T mapi_param_type
000000000000c010 T mapi_ping
0000000000008570 T mapi_prepare
00000000000084e0 T mapi_prepare_handle
000000000000bf60 T mapi_query
0000000000008d90 T mapi_query_done
000000000000c1d0 T mapi_query_handle
0000000000008b80 T mapi_query_part
0000000000008a90 T mapi_query_prep
000000000000ad70 T mapi_quote
0000000000008a80 T mapi_read_response
0000000000009010 T mapi_reconnect
00000000000086b0 T mapi_release_id
000000000000a6d0 T mapi_resolve
00000000000071e0 T mapi_result_error
0000000000007200 T mapi_result_errorcode
000000000000cf10 T mapi_rows_affected
000000000000a950 T mapi_seek_row
000000000000c130 T mapi_send
00000000000085e0 T mapi_setAutocommit
0000000000008650 T mapi_set_size_header
000000000000c360 T mapi_split_line
000000000000c290 T mapi_store_field
000000000000c090 T mapi_stream_query
0000000000008450 T mapi_timeout
0000000000008750 T mapi_trace
000000000000ad40 T mapi_unquote
0000000000008770 T mapi_virtual_result
000000000000ee20 T mcrypt_BackendSum
000000000000dd30 T mcrypt_getHashAlgorithms
000000000000ee30 T mcrypt_hashPassword
000000000000dd40 T mcrypt_MD5Sum
000000000000ec70 T mcrypt_RIPEMD160Sum
000000000000deb0 T mcrypt_SHA1Sum
000000000000e060 T mcrypt_SHA224Sum
000000000000e280 T mcrypt_SHA256Sum
000000000000e4e0 T mcrypt_SHA384Sum
000000000000e830 T mcrypt_SHA512Sum
                 U MD5_Final
                 U MD5_Init
                 U MD5_Update
                 U memmove
                 U memset
                 U mnstr_destroy
                 U mnstr_errnr
                 U mnstr_error
                 U mnstr_flush
                 U mnstr_init
                 U mnstr_printf
                 U mnstr_read
                 U mnstr_read_block
                 U mnstr_set_byteorder
                 U mnstr_settimeout
                 U mnstr_write
000000000000dbd0 T mo_add_option
000000000000d1b0 T mo_builtin_settings
000000000000d730 T mo_find_option
000000000000dcb0 T mo_free_options
000000000000d5f0 T mo_print_options
000000000000db30 T mo_system_config
                 U opendir
                 U open_wastream
                 U __printf_chk
                 U puts
                 U readdir
                 U realloc
                 U RIPEMD160_Final
                 U RIPEMD160_Init
                 U RIPEMD160_Update
                 U sendmsg
                 U SHA1_Final
                 U SHA1_Init
                 U SHA1_Update
                 U SHA224_Final
                 U SHA224_Init
                 U SHA224_Update
                 U SHA256_Final
                 U SHA256_Init
                 U SHA256_Update
                 U SHA384_Final
                 U SHA384_Init
                 U SHA384_Update
                 U SHA512_Final
                 U SHA512_Init
                 U SHA512_Update
                 U __snprintf_chk
                 U socket
                 U socket_rastream
                 U socket_wastream
                 U __sprintf_chk
                 U sscanf
                 U __stack_chk_fail
                 U stderr
                 U stdout
                 U strcat
                 U strchr
                 U strcmp
                 U strcpy
                 U __strdup
                 U strerror
                 U strlen
                 U strncmp
                 U strncpy
                 U strrchr
                 U strstr
                 U strtod
                 U strtof
                 U strtol
                 U strtoll
                 U strtoul
                 U strtoull
                 U __xstat


修正方法如下:
sed -i 's/WIN32?//g' clients/mapilib/Makefile.ag
sed -i 's/@WIN32_TRUE@//g' clients/mapilib/Makefile.in
sed -i 's/WIN32?//g' common/stream/Makefile.ag
sed -i 's/@WIN32_TRUE@//g' common/stream/Makefile.in
然後需要重新編譯一次就可以產生正確的檔案。


這是因為 MonetDB team 想要避免多次連結的解法而產生的問題。MonetDB team 沒有考慮到,如果有使用者使用 Load Library 的方式載入 MAPI library 使用,就會產生 undefined function 的問題而無法正確載入。

2018-08-27

cmark-gfm and tcl-cmark (cmark-0.28.3.gfm.15)

cmark-gfm-spec
tcl-cmark-spec


cmark-0.28.3.gfm.15 是個不向前相容的版本(Normalised header and define names),所以如果使用這個版本,tcl-cmark 會編譯失敗。而且 cmark-gfm library 的名稱也有變動,所以無法單純在 source code 使用 cmark-gfm 的版本區隔來處理。

我先做了緊急處理,讓 tcl-cmark 加個 patch 以後不會編譯失敗。等原作者發現然後修改以後,再來看要怎麼做進一步處理。

2018-08-16

EMQ/emqttd (Erlang MQTT Broker)

EMQ (Erlang MQTT Broker) is a distributed, massively scalable, highly extensible MQTT message broker written in Erlang/OTP.

在 openSUSE 從 source code 安裝,需要下列的套件:
sudo zypper in erlang erlang-observer

(erlang/otp version 需要 >= R17)

再來是下載 source code 並且編譯:
git clone https://github.com/emqtt/emq-relx.git
cd emq-relx && make

如果要執行的話:
cd _rel/emqttd && ./bin/emqttd console


再來使用 tcl.mqttc 驗證是否可以正確連線,這只是進行簡單的驗證。
Subscribe:
package require mqttc

mqttc client "tcp://localhost:1883" "USERSSub" 1 -cleansession 1 
client subscribe  "MQTT Examples" 1
while 1 {
    if {[catch {set result [client  receive]}]} {
        puts "Receive error!!!"
        break
    }
    if {[llength $result] > 0} {
        puts "[lindex $result 0] - [lindex $result 1]"
        if {![string compare -nocase [lindex $result 1] "Exit"]} {
            break
        }
    }
}
client unsubscribe  "MQTT Examples"
client close

Publish:
package require mqttc

mqttc client "tcp://localhost:1883" "USERSPub" 1 -timeout 1000
client publishMessage "MQTT Examples" "Hello MQTT!" 1 0
client publishMessage "MQTT Examples" "Exit" 1 0
client close

先執行 Subscribe 的部份,再使用 Publish 發送訊息,確定可以正確執行。

2018-08-08

Apache Rivet transition from svn to git complete

Rivet transition from svn to git complete

The migration from svn is now complete, the svn repository is now read only and every new commit has to be pushed to either GitBox (https://gitbox.apache.org/repos/asf/tcl-rivet.git) or GitHub (https://github.com/apache/tcl-rivet.git)


Apache Rivet 從 SVN 遷移到 Git,而且在 Github 有一個 mirror。

2018-08-01

tDOM 0.9.1

ANNOUNCE: tDOM 0.9.1
下載網址

(更新:我找到更新訊息了,所以有發佈更新訊息)

The most notable changes since the last release are:
- The included expat is now 2.2.5, the most recent expat release.
- An interface to use expat as pull parser (StAX like).
- Some minor options for more control about parsing ([dom parse
  -keepCDATA]) and serialization (asXML -nogtescape
  --noEmptyElementTag).
- A few bug fixes important to whom are bitten by them.


因為下載網址已經放上去檔案了,所以我更新了我自己的 openSUSE RPM spec,將版本更新到 0.9.1。

2018-07-23

TDBC and MariaDB (use MySQL driver)

下面是一個測試程式:
#!/usr/bin/env tclsh

package require tdbc::mysql
tdbc::mysql::connection create db -user root -passwd admin -host 127.0.0.1 -port 3306 -database test

set statement [db prepare {
    SELECT VERSION() as version
}]


$statement foreach row {
    puts [dict get $row version]
}

$statement close

db close


在 openSUSE Leap 15.0 上測試,需要安裝 libmariadb-devel 才能夠正確執行。我的 libmariadb-devel 來源是 http://download.opensuse.org/repositories/server:/database/openSUSE_Leap_15.0/,因為我之前需要安裝跟資料庫有關的軟體,所以有使用這個 repository。

2018-07-10

MAWT - Movie Automation With Tcl

MAWT - Movie Automation With Tcl


MAWT is a Tcl package based on FFmpeg. It provides high level procedures for movie automation with Tcl.

如果要下載的話,可以到 Downloads。

我還沒有自己編譯過,會在 openSUSE 上嘗試是否可以編譯成功。