The future depends on us. It is up to us to the future of Clarion.
Will this programming language to live long and happy life or dies in oblivion depends on us. If you have to say, do it here in this blog. Welcome!

Read More

Russia Day


Today we are celebrate Russia Day. Actually I don’t know what is this day about. It is a just another holiday for me.

Tags: | No Comments »

Category: General

A New Blog

You can see a new community blog here.

I think that we can create a new forum at clarionlife.net. For example, en-forum.clarionlife.net :) or sv-forum.clarionlife.net. We can :) We have the popular forum for russian community at forum.clarionlife.net. You can see the our forum here (translated with Google).

Tags: , | No Comments »

Category: Clarion7

How To Shrink A Transaction Log In MS SQL 2008

I have a problem when using MS SQL 2008. The recovery model for my database is configured as a “Full“.
I do a full backup of the database every night. I do a transaction log backup every hour. The transaction log file for the two weeks of use has increased to 55Gb. The size of the database that is about 10Gb.

I have truncated the transaction log earlier using the following script:

MS SQL 2000
BACKUP LOG database_name WITH TRUNCATE_ONLY
DBCC SHRINKDATABASE (database_name, 10)

But this script does not work in MS SQL 2008. I found only one way to truncate the transaction log. The essence of the method is that it is necessary switch recovery model from FULL to SIMPLE, and make a truncation of the log.

I do a full backup of the database before performing this operation.

MS SQL 2008
ALTER DATABASE database_name SET RECOVERY SIMPLE
DBCC SHRINKFILE (log_name) WITH NO_INFOMSGS
ALTER DATABASE database_name SET RECOVERY FULL

It works :)

Tags: | No Comments »

Category: SQL

Vacation

I was in a small vacation. Now I am ready to work :)

Tags: | No Comments »

Category: General

Windows Threads

Today I tried to create a thread using Windows API. I always thought that there are no problems. But it turned out that I can not do anything. I can not even use the MESSAGE in the thread procedure. The application always crashes.

Below is the code that creates a new thread and simply increases the value of a variable. It works.

 PROGRAM
 MAP
    MODULE('WinAPI')
      CreateThread(LONG,LONG,LONG,LONG,LONG,LONG),ULONG,PASCAL,NAME('CreateThread')
      memcpy(LONG,LONG,LONG),LONG,RAW,NAME('_memcpy'),PROC
    END
    TThreadProc(LONG lpParameter),PASCAL
 END

Window WINDOW('Caption'),AT(,,129,115),FONT('MS Sans Serif',8,,FONT:regular),GRAY
       BUTTON('Start thread'),AT(4,4,81,18),USE(?OkButton),DEFAULT
       BUTTON('Show results'),AT(4,30,81,18),USE(?CancelButton)
     END

ThreadID LONG
Param    LONG
hThread  ULONG
 CODE
 OPEN(Window)
 DISPLAY
 ACCEPT
    CASE ACCEPTED()
    OF ?OkButton
       hThread = CreateThread(0,0,ADDRESS(TThreadProc),ADDRESS(Param),0,0)
       MESSAGE('Thread handle: ' & hThread)
    OF ?CancelButton
       MESSAGE('Param: ' & Param)
    END
 END

TThreadProc PROCEDURE(LONG lpParameter)
loc:Var LONG
 CODE
 ! MESSAGE('Enter TThreadProc') crashed
 LOOP
    loc:Var += 1
    memcpy(lpParameter,ADDRESS(loc:Var),4)
 END

Tags: | No Comments »

Category: General

We Are Currently Unable To Serve Your Request

SV Blog does not answer about a week. It is permissible for a single developer, but very strange for a stable company.

Tags: | No Comments »

Category: General

Arcadia, Inc.

Arcadia, Inc. is one of the leading Russian offshore software development companies, providing services to international clientele. Arcadia’s software development team is located in St. Petersburg, Russia.
Here you can see the Results of 2008 Year.

Tags: | No Comments »

Category: General

Yes, I am the author :)

You can find my article Locating Records In Hand Coded List Boxes at Clarion Magazine.

Tags: | No Comments »

Category: General

My Comments About A Trees

We use one table to create a tree normally. This table should contain at least two columns. One column is the identifier of the record. The second column is the identifier of the parent record.

Example:

Office
   Lawyer department
      Bob
      John
   Tech department
      Dave
      Michael

 ID ParentID Desc
 1   0       Office
 2   1       Lawyer department
 3   2       Bob
 4   2       John
 5   1       Tech department
 6   5       Dave
 7   5       Michael

If we want to climb up or down the tree, then typically we use a recursion. This works but not effective. This method becomes slow when the table becomes large.

To speed up the movement, you can add an additional field that will contain the path to the first parent. This is a string field. The format you can define yourself.

Example:

 ID ParentID Path          Desc
 1   0       .1.           Office
 2   1       .1.2.         Lawyer department
 3   2       .1.2.3.       Bob
 4   2       .1.2.4.       John
 5   1       .1.5.         Tech department
 6   5       .1.5.6.       Dave
 7   5       .1.5.7.       Michael

“Path”-field helps to easily and quickly identify all the children of the selected record. You should have the index for this field of course. You can create triggers that will automatically build the “Path”-field.

But it turned out that the definition of the parent of choosed record is too slow. So I found another way. The method is that you must add additional table, which contains all the parents’ IDs to the upper level for each record.

I have read about this method about two years ago and used it on a large SQL-tables.

 Table                               Additional Table
 ID ParentID Desc                     ID  ParentID
 1   0       Office                   1      0
 2   1       Lawyer department        2      1
 3   2       Bob                      2      0
 4   2       John                     3      2
 5   1       Tech department          3      1
 6   5       Dave                     3      0
 7   5       Michael                  4      2
                                      4      1
                                      4      0
                                      5      1
                                      5      0
                                      6      5
                                      6      1
                                      6      0
                                      7      5
                                      7      1
                                      7      0

You can move up and down on the table more quickly. This method is suitable for tps-tables and for SQL. You must create an indexes of course. For SQL you can create triggers that will fill in the additional table. The additional table may also contain additional fields, for example, the “Level”-field.

Tags: | No Comments »

Category: General

How To Define A Cluster Size In Windows

You can create a text file containing a one letter.
That means that the size of this file is 1 byte.
You can see the properties of this file in Explorer.
There are two properties:
- “Size” which displays the 1 byte
- “Size on disk” which displays the cluster size (for example 4096 bytes).

Tags: | No Comments »

Category: General

Victory Day

Today we celebrate Victory Day. This is a special day for all people. Everyone in our country remembers that day, despite the fact that it has been for many years ago.

Tags: | No Comments »

Category: General

How To Reorganize All Indexes On MS SQL 2008

To transfer data, I made a backup of the database and just restored it to the new server. The speed of execution of queries has become much lower than on the old server.

I decided that it was necessary to rebuild all indexes in the database. You can do this using Management Studio. In this case, you will need to do this operation for each table. I have about 400 tables in the database. Therefore, it takes a long time.

I wrote a small script that performs these operations. I have updated statistics and clean the cache plans for queries at the end.


USE database_name

DECLARE @TableName varchar(255)
DECLARE @SqlQ      char(260)

DECLARE TableCursor CURSOR FOR
SELECT table_name FROM information_schema.tables WHERE table_type = 'base table'

OPEN TableCursor

FETCH NEXT FROM TableCursor INTO @TableName
WHILE @@FETCH_STATUS = 0
BEGIN
  SET @SqlQ = 'ALTER INDEX ALL ON ' + @TableName +
' REBUILD WITH (FILLFACTOR = 90, SORT_IN_TEMPDB = ON,STATISTICS_NORECOMPUTE = ON);'
  EXEC (@SqlQ)
  SET @SqlQ = 'ALTER INDEX ALL ON ' + @TableName + ' REORGANIZE'
  EXEC (@SqlQ)
  FETCH NEXT FROM TableCursor INTO @TableName
END
CLOSE TableCursor

DEALLOCATE TableCursor
go

exec sp_msforeachtable 'update statistics ?'
go

dbcc freeproccache
go

Tags: | No Comments »

Category: SQL

My Regular Work

I work for a large trading company. The company has about 10 shops selling home appliances in the city of Khabarovsk and two stores in other cities. The company has a division to develop software for their corporate needs. There are 5 programmers. I am engaged in the development and support programs for trade and services.

A week ago we got a new server. Now we transfer the program to a new MS SQL Server 2008. Previously, we have worked with MS SQL Server 2000. At first glance, the new server is running twice as fast:) But I think that there is still a lot of work.

Tags: | No Comments »

Category: General

The template for menu

Today I started work on a template for the menu. I usually make it quickly. But now I have decided that I will spend considerable time for writing a template. I think that I will slightly rewrite the template for the context menu and the toolbar, so that all these templates were able to work together.

In product xXPFrame I redraws the standard menu. In CFC-menu I decided that I will build menu again. This means that you have to create all the menus again. And I understand that this is a bad thing. Therefore, I decided to start work on the template with the possibility of implementing the import of existing menus.

The template contains only one button, which allows you to import an existing menu to the template. I am importing the structure of the menu, the names of items and icons. I do not know the way to import actions that are performed by pressing the menu item.

Read the rest of this entry »

Tags: , | No Comments »

Category: General

MS SQL Field Box 2.0 source (Clarion 7)

You can download the MS SQL Field Box source here.
You must also install the CFC Library 2.5 and register the templates that are included in the library (cfc_templates.tpl, DEBUG.TPL, dp_class.tpl).
I think that the class for working with ADO is that it’s worth a look.

Tags: , , | 1 Comment »

Pages: 1 2 3 ... 113