Monday, October 28, 2013

Bug in QIBASE (Qt 5.1.1) always returns 00:00:00.000 as time part of TIMESTAMP

Bug in QIBASE (Qt 5.1.1) always returns 00:00:00.000 as time part of TIMESTAMP


Unfortunately QIBASE driver have bug in Qt versions 5.1.0 and 5.1.1. When you trying to retrieve any TIMESTAMP value you'll have 00:00:00.000 as time part of TIMESTAMP.

To test this you can execute something like this:

select current_timestamp as dts from rdb$database

This query will return current time stamp on server which have Firebird/Interbase installed.

You will get 00:00:00.000 as time part of result :(

Thursday, October 17, 2013

Fun with QSerialPort

Fun with QSerialPort

As we know, we can use QSeialPort to communicate with devices via RS232/RS485 or via virtual COM ports (I recommend to use devices based on MCP2200 not on FT232, because they are cheaper :) )

Many years ago I used a PComm.dll (as I know, it developed by MOXA) to work with COM ports from my applications written in C++/Delphi (in Windows). Later I found QSerialDevice library for Qt. But now, as I told before, we can use QSerialPort directly from Qt version 5.1 and higher.

Wednesday, October 16, 2013

Parsing big log file

Parsing big log file

1. Task

Task: I have big text file (which have size approx 2 GiB) and want to parse it. I want to find each entry of word "exception" and then print this line and next 9 lines. Also, this 10 lines can contain string:
 "stuff at begin of line At procedure '%PROCEDURE_NAME%' many many symbols in end of line" where words "At procedure" exists in the text constantly and %PROCEDURE_NAME% is text which I also want to find (without quotes if possible :) ).

So, let's try to solve this task :)