Recent

Recent Posts

Pages: [1] 2 3 ... 10
1
Databases / Re: Database standards OR Am I doing this right?
« Last post by gidesa on Today at 02:37:56 pm »
Hello, Ms Sql Server, as many dbms, has different types of lock: at row level, at page level, at table level, etc.
The isolation level defines the extension of lock.
For example, with "Serializable" level the db engine locks entirely all tables involved in the logic transaction, so that a second user cannot never change data managed by the first user, until the end of first transaction.
See detailed (and long) description: https://learn.microsoft.com/en-us/sql/relational-databases/sql-server-transaction-locking-and-row-versioning-guide?view=sql-server-ver16
And you have to understand the concept of logic transaction. Simplifying, a transaction contains all db (Zeos) instructions comprised between the  Begin transaction and Commiy (or Rollback if you want to cancel all updates).
In short, the TZConnection component has a property TransactionIsolationLevel that you can set to the 4 possible values, as descripted in previous link.
From another discussion: https://zeoslib.sourceforge.io/viewtopic.php?t=2644 a possible sequence of Zeos instructions:
//At connection:
TransactionIsolationLevel := tiNone;

//At StartTransaction:
TransactionIsolationLevel := tiReadCommited;

// do all select, update, delete, .... on various tables

//At Commit, that is when confirming the updates
Commit;
TransactionIsolationLevel := tiNone;

//Or, at Rollback, that is when you want to cancel the updates,
// for example in case of exception
RollBack;
TransactionIsolationLevel := tiNone;

2
Beginners / Does anyone know why these code cannot be compiled by the fpc?
« Last post by TYDQ on Today at 02:36:08 pm »
Code: Pascal  [Select][+][-]
  1. type efi_guid=record
  2.               data1:dword;
  3.               data2:word;
  4.               data3:word;
  5.               data4:array[1..8] of byte;
  6.               end;
  7. const efi_loaded_image_protocol_guid:efi_guid=($5B1B31A1,$9562,$11D2,($8E,$3F,$00,$A0,$C9,$69,$72,$3B));
It seems have no problem in pascal,why these pascal code cannot be compiled and show the error that Syntax error, "identifier" expected but "ordinal const" found?
3
Networking and Web Programming / Re: Who is Indy mattias?
« Last post by jollytall on Today at 02:27:19 pm »
Thanks, it is like magic. It works.

However, I still do not understand:
- How mattias is hardcoded in so many places?
- How could it work in the past with - I guess the same - Indy10 without adding Interfaces?
What is Interfaces, anyway? Why I never met it before?

Thanks.

4
General / Re: How to: create DLL file for Windows 10 64-Bit Pro
« Last post by TRon on Today at 02:26:53 pm »
Is the point the "definition" ?
Yes.

And as a consequence how your code calls that routine (e.g. what parameters (types) you pass it).
5
General / Re: How to: create DLL file for Windows 10 64-Bit Pro
« Last post by paule32 on Today at 02:15:29 pm »
it is a little bit hard to follow the postings from 440bx.
Is the point the "definition" ?
6
General / Re: How to: create DLL file for Windows 10 64-Bit Pro
« Last post by KodeZwerg on Today at 02:08:54 pm »
You're missing the whole point.
After reading I do agree you.
7
Unix / Re: A fairly simple sound solution?
« Last post by paweld on Today at 01:46:11 pm »
8
Graphics / Re: Demoscene The Champs Cracktro
« Last post by KodeZwerg on Today at 01:45:18 pm »
Here are some copperbars :D
Code: Pascal  [Select][+][-]
  1. unit uMain;
  2.  
  3. {$mode objfpc}{$H+}
  4.  
  5. interface
  6.  
  7. uses
  8.   Classes, SysUtils, Forms, Controls, Graphics, Dialogs, ExtCtrls,
  9.   BGLVirtualScreen, BGRAOpenGL, BGRABitmap,
  10.   BGRABitmapTypes, BGRAGradientScanner;
  11.  
  12. type
  13.   TCopperBar = packed record
  14.     Gradient: TBGRACustomGradient;
  15.     Y: Integer;
  16.     Size: Integer;
  17.     IsAdd: Boolean;
  18.   end;
  19.   TCopperBars = array of TCopperBar;
  20.  
  21. type
  22.  
  23.   { TForm1 }
  24.  
  25.   TForm1 = class(TForm)
  26.     BGLVirtualScreen1: TBGLVirtualScreen;
  27.     Panel1: TPanel;
  28.     Timer1: TTimer;
  29.     procedure BGLVirtualScreen1Redraw(Sender: TObject; BGLContext: TBGLContext);
  30.     procedure BGLVirtualScreen1Resize(Sender: TObject);
  31.     procedure FormClose(Sender: TObject; var CloseAction: TCloseAction);
  32.     procedure FormShow(Sender: TObject);
  33.     procedure Timer1Timer(Sender: TObject);
  34.   strict private
  35.     FCB: TCopperBars;
  36.     FMaxBars: Integer;
  37.   private
  38.     procedure ReleaseCB;
  39.     procedure GenerateCB(const AMaxBars: Integer);
  40.   public
  41.   end;
  42.  
  43. var
  44.   Form1: TForm1;
  45.  
  46. implementation
  47.  
  48. {$R *.lfm}
  49.  
  50. { TForm1 }
  51.  
  52. procedure TForm1.BGLVirtualScreen1Redraw(Sender: TObject;
  53.   BGLContext: TBGLContext);
  54. var
  55.   i: Integer;
  56.   sy: Integer;
  57. begin
  58.   for i := High(FCB) downto Low(FCB) do
  59.     for sy := 0 to FCB[i].Size do
  60.       begin
  61.         if FCB[i].IsAdd then
  62.           Inc(FCB[i].Y)
  63.         else
  64.           Dec(FCB[i].Y);
  65.         if FCB[i].Y < BGLContext.Canvas.ClipRect.Top then
  66.           FCB[i].IsAdd := True;
  67.         if FCB[i].Y > BGLContext.Canvas.ClipRect.Height then
  68.           FCB[i].IsAdd := False;
  69.         BGLContext.Canvas.FillRect(0, FCB[i].Y, BGLContext.Canvas.ClipRect.Width, Succ(FCB[i].Y), FCB[i].Gradient.GetColorAtF(sy));
  70.         if FCB[i].IsAdd then
  71.           BGLContext.Canvas.FillRect(0, FCB[i].Y - FCB[i].Size, BGLContext.Canvas.ClipRect.Width, Succ(FCB[i].Y - FCB[i].Size), FCB[i].Gradient.GetColorAtF(FCB[i].Size - sy))
  72.         else
  73.           BGLContext.Canvas.FillRect(0, FCB[i].Y + FCB[i].Size, BGLContext.Canvas.ClipRect.Width, Succ(FCB[i].Y + FCB[i].Size), FCB[i].Gradient.GetColorAtF(FCB[i].Size - sy));
  74.       end;
  75. end;
  76.  
  77. procedure TForm1.BGLVirtualScreen1Resize(Sender: TObject);
  78. begin
  79.   ReleaseCB;
  80.   GenerateCB(FMaxBars);
  81. end;
  82.  
  83. procedure TForm1.FormClose(Sender: TObject; var CloseAction: TCloseAction);
  84. begin
  85.   ReleaseCB;
  86.   CloseAction := caFree;
  87. end;
  88.  
  89. procedure TForm1.FormShow(Sender: TObject);
  90. begin
  91.   Randomize;
  92.   GenerateCB(10);
  93.   Timer1.Interval := 50;
  94.   Timer1.Enabled := True;
  95. end;
  96.  
  97. procedure TForm1.Timer1Timer(Sender: TObject);
  98. begin
  99.   BGLVirtualScreen1.Repaint;
  100. end;
  101.  
  102. procedure TForm1.ReleaseCB;
  103. var
  104.   i: Integer;
  105. begin
  106.   for i := High(FCB) downto Low(FCB) do
  107.     begin
  108.       FCB[i].Size := 0;
  109.       FCB[i].Y := 0;
  110.       FCB[i].IsAdd := False;
  111.       FCB[i].Gradient.Free;
  112.       FCB[i].Gradient := nil;
  113.     end;
  114. end;
  115.  
  116. procedure TForm1.GenerateCB(const AMaxBars: Integer);
  117. var
  118.   i: Integer;
  119.   Y: Integer;
  120. begin
  121.   FMaxBars := AMaxBars;
  122.   SetLength(FCB, FMaxBars);
  123.   Y := BGLVirtualScreen1.Height;
  124.   for i := Low(FCB) to High(FCB) do
  125.     begin
  126.       FCB[i].Size := 10;
  127.       Y := Y - (FCB[i].Size);
  128.       FCB[i].Y := Y;
  129.       FCB[i].Gradient := TBGRAMultiGradient.Create([RGBToColor(Random(High(Byte)), Random(High(Byte)), Random(High(Byte))), clBlackOpaque], [0, FCB[i].Size], True, False);
  130.       FCB[i].IsAdd := True;
  131.     end;
  132. end;
  133.  
  134. end.
9
Unix / Re: A fairly simple sound solution?
« Last post by Giorgos on Today at 01:37:13 pm »
THANKS guys for your help!!!   :D

@Handoko:

I already read this topic amongst other similar.
Don't take it wrong, but these posts are 7-8yo.
Linux (unlike Windows) is somewhat  hostile, against older versions or aged software.
Try running binaries, or compile code so old...well...good luck with it!   :D

@ KodeZwerg:

I'll definitely try it, but it isn't what I was looking for.
For an enhanced "Hello World" program, maybe with colorized output (eg. Cyan instead of white letters) and wanting to make a simple sound (just to demonstrate the ability), messing with complex RAD functions, is not really helpful.

THANKS again!!!   :)
10
Databases / Re: Database standards OR Am I doing this right?
« Last post by paweld on Today at 01:07:33 pm »
I use an additional column for this purpose. Example structure:
Code: SQL  [Select][+][-]
  1. CREATE TABLE testtab (
  2.   id NUMERIC IDENTITY(1,1),
  3.     name VARCHAR(50) NOT NULL,
  4.     qty DECIMAL(14,4) NOT NULL,
  5.     price DECIMAL(12,2) NOT NULL,
  6.     description VARCHAR(200) NULL,
  7.     blocked INT NULL, /*is null then if is null then the record is not blocked (not edited) by any user. If it is edited then the field contains the id of the user who is blocking this record*/
  8.     CONSTRAINT pk_testtab PRIMARY KEY clustered (id ASC)
  9. )
Pages: [1] 2 3 ... 10

TinyPortal © 2005-2018