* * *

Recent Posts

Pages: [1] 2 3 ... 10
General / Re: TFPTimer memory leak
« Last post by GetMem on Today at 08:18:20 am »
The leak is easily reproducible, but if you increase the interval from 33 to 100 the leak is gone, so something fishy is happening inside TFPTimer. Anyways here is a workaround, which does not leak at my side even with a small interval:
Code: Pascal  [Select]
  1. unit Unit1;
  3. {$mode objfpc}{$H+}
  5. interface
  7. uses
  8.   Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs,
  9.   fptimer;
  11. type
  13.   { TForm1 }
  15.   TForm1 = class(TForm)
  16.     procedure FormCloseQuery(Sender: TObject; var CanClose: boolean);
  17.     procedure FormCreate(Sender: TObject);
  18.     procedure FormDestroy(Sender: TObject);
  19.   private
  20.     FCanClose: Boolean;
  21.     Driver: TFPTimer;
  22.     procedure DriverOnTimer(Sender: TObject);
  23.     procedure DriverOnStopTimer(Sender: TObject);
  24.   public
  26.   end;
  28. var
  29.   Form1: TForm1;
  31. implementation
  33. {$R *.lfm}
  35. { TForm1 }
  37. procedure TForm1.FormCreate(Sender: TObject);
  38. begin
  39.   Driver := TFPTimer.Create(Self);
  40.   Driver.Interval := 33;
  41.   Driver.OnTimer := @DriverOnTimer;
  42.   Driver.OnStopTimer := @DriverOnStopTimer;
  43.   Driver.Enabled := True;
  44. end;
  46. procedure TForm1.FormCloseQuery(Sender: TObject; var CanClose: boolean);
  47. begin
  48.   Driver.OnTimer := nil;
  49.   Driver.Enabled := False;  
  50.   CanClose := FCanClose;
  51. end;
  53. procedure TForm1.FormDestroy(Sender: TObject);
  54. begin
  55.   Driver.Free;
  56. end;
  58. procedure TForm1.DriverOnTimer(Sender: TObject);
  59. begin
  60.   Caption := TimeToStr(Now);
  61. end;
  63. procedure TForm1.DriverOnStopTimer(Sender: TObject);
  64. begin
  65.   FCanClose := True;
  66.   Close;
  67. end;
  69. end.
Cocoa / Re: TStatusbar OnDrawPanel not firing
« Last post by skalogryz on Today at 08:15:07 am »
this comes from Cocoa WS sources:
Code: Pascal  [Select]
  1.     //todo: add a method for OwnerDraw Panels support
feel free to bug report.
LCL / Re: VirtualTreeView help needed for arm architecture
« Last post by GetMem on Today at 07:39:22 am »
Can somebody test the attached patch on arm(qt5)?
Cocoa / Re: TStatusbar OnDrawPanel not firing
« Last post by wp on Today at 07:33:34 am »
This code is working correctly on Win (10) and Lazarus (gtk2 and qt). Do you call Statusbar.Invalidate?

BTW, in order to show progress of some action in the statusbar, I normally use a TProgressbar and set its parent to the Statusbar. The statusbar is normally hidden and shown only while the observed process runs.

General / Re: TFPTimer memory leak
« Last post by OkobaPatino on Today at 07:32:44 am »
Checked your idea jamie and didn't solve the problem.
Third party / Re: LazProfiler (beta)
« Last post by Pascal on Today at 05:50:38 am »
Third party / Re: LazProfiler (beta)
« Last post by Pascal on Today at 05:49:53 am »
>>Anyone else getting a list index out of bounds?
Yes. I have "List index 82 out of bounds" with https://github.com/zamtmn/zcad project

Fine! I'll have a look.
Hi valdir.marcos,

Thanks for the links, I've went through these threads you suggested and actually - there are even more questions than answers for me after reading them. Maybe I will try to explain more what is on my mind and what is my experience so far.

I have experience with REST, but not with Delphi (or Lazarus). I have couple of years of experience with Delphi, but it was a couple of years ago when I've moved to Java, and then went to some cloud platform development. As for Lazarus - I've made a mid-sized project in Lazarus couple of months ago, but it was not related to REST, or even not related to networking at all, just a plain desktop app. So I have never created an app that would do similar things in Delphi or Lazarus. Therefore, as you can see, I'm not a noob when it comes to REST, JSON etc, however, I've only implemented such code (both clients and servers) with technologies other than Lazarus/FPC.

What I need to have (and what I don't need):

1. I only need to have REST client (I don't need the server, at least that's what I think right now).
2. I want to avoid the steep learning curve that some of the suggested component packages have. Most preferably, I'd like to use the standard component/packages/units if possible.
3. I want to be able to connect to a REST endpoint (HTTPS support is required).
4. I want to be able to easily manage the HTTP headers (to pass credentials, session Ids, security tokens etc depending on the cloud service provider security settings).
5. I want to be able to pull the data, preferably in a bulk approach (it is supported by the REST service).
6. For all of the the above - I think can it can be even done via simple HTTP(S) request. But maybe there is some simple wrapper library?
7. I want to be able to deserialize JSON (or SOAP) content from HTTP REST response of the source endpoint. But it should be done with some kind of abstract approach, because there is no fixed data structure. This means I don't need any ORM, because I think that there is no option to persist the results from the source endpoint in any temporary (local or remote) database. I only need to push it into the twin REST destination endpoint. Most probably I would store the parts of the JSON/SOAP responses representing individual records (or record batches) in a text files, because I will upload them into the destination REST endpoint using the very same format.

I'm not very familiar with the "standard" units/components provided with FPC/Lazarus (I mean these related to networking, JSON, etc.).
I'm looking forward to some hints what to pick or where to look for being able to do the implementation of a simple proof of concept.
And, BTW, I don't speak Portuguese or Spanish. English only (and Polish as my first language).
Android / Re: Android Module Wizard
« Last post by jmpessoa on Today at 04:29:34 am »

Hi  abssistemas!

Attached is a new java template ..... 

Put this [unzipded!] "jTCPSocketClient .java" file in the  folder  "..... \java\lamwdesigner" of the LAMW framework ...

re-open your project and make a new build .... etc ....

I just inserted some "debug" tags...

Please,  keep this:


and test the "SendBytes"  ......

for debug,  "OnBytesReceive"  will try report  only 2  jbytes ....

"0" and "0"


"-1" and "-1"

of course, the bytes reported by your system...

You can report your test here...

Thank you!
Ported from Delphi/Kylix / Re: Porting TChessBrd from Delphi
« Last post by vferia on Today at 03:45:54 am »
Thanks for the reply. Actually, I have written a FEN parser and have tested it hhttp://analysis.cpuchess.com/ere. What really needed to know is to how to input the FEN notation into TChessBrd so that the engine can be utilized to analyze the game.
Pages: [1] 2 3 ... 10


Get Lazarus at SourceForge.net. Fast, secure and Free Open Source software downloads Open Hub project report for Lazarus