Re: [Lazarus] Debian (Sid): fpc 3.0.0+dfsg-2 cannot compile lazarus trunc
Am 01.02.2016 um 18:47 schrieb Mattias Gaertner: On Mon, 1 Feb 2016 18:20:59 +0100 John Landmesserwrote: Is this the new FPC 3.0.0 from Debian unstable? Mattias -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus yes it's from unstable ( sid ) -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] change Font on TButton do not work?
On 1/31/16, Josef Schniederwrote: > But the button caption is unchanged. It appears an "A" instead of "*". > I tested the Font in Libreoffice and it works well. > > any idea? Turn of themes. Bart -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Free Pascal and Lazarus learning center
On 01/31/2016 11:10 PM, Anthony Walter wrote: Thanks for the idea Bo. I'll put it near the top of my queue. +1 IMHO the knowledge about the (great) thread Features of Lazarus are by far not spread wide enough. The "lesson" should include: - Motivation for the usage of threads: - - long winding calculations - - blocking sockets and other hardware / system interface - - exploiting multi-core hardware - Different programming Paradigms for Main Thread and Worker Threads - - Main thread: Event driven (never sleep ! ) - - one-shot Worker threads - - cyclic Worker Thread - - - "wake up" e.g. by blocking interfaces,TEvent or CriticalSection - - - polling with sleep (trading performance against latency) - Worker Thread to Main Tread Events: - - TTherad.Synchonize - - TThread.Queue - - Application.ProcessMessages (IMHO less important since we have TThread.Queue in FPC 3.x) - - using "Event data transport classes" to be used as an argument of TThread.Queue - Data integrity - - "Thread safe" - - CriticalSection - - TThreadList - Creating a Thread pool to prevent overhead for creating and destroying worker threads. - Advanced: - - Threads and DLL/so ... -Michael -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] change Font on TButton do not work?
I modified the font: First the encoding was "symbol" -> problem as described (it doesn't matter, when i change the charset) than copy the chars, so that the encoding is "UnicodeBmp" -> problem is solved The solution for me is to modify the font. best regards Josef Am 01.02.2016 um 11:18 schrieb Bart: On 1/31/16, Josef Schniederwrote: But the button caption is unchanged. It appears an "A" instead of "*". I tested the Font in Libreoffice and it works well. any idea? Turn of themes. Bart -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Tutorial Video: Getting Started
On Mon, 1 Feb 2016 05:43:15 -0500 Anthony Walterwrote: > I've posted a tutorial video, which is the first in a series, titled > "Getting Started". It's available for viewing here: > > http://www.getlazarus.org/learn/tutorials/start/ > > Additional tutorial videos with progressively more advanced subject matter > will be posted to the tutorials section regularly. Up next will be a brief > introduction to the Lazarus IDE. It says "Lazarus Learing Center" in the title. Mattias -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
[Lazarus] Tutorial Video: Getting Started
I've posted a tutorial video, which is the first in a series, titled "Getting Started". It's available for viewing here: http://www.getlazarus.org/learn/tutorials/start/ Additional tutorial videos with progressively more advanced subject matter will be posted to the tutorials section regularly. Up next will be a brief introduction to the Lazarus IDE. -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Tutorial Video: Getting Started
Dang it. Correction coming pronto. On Mon, Feb 1, 2016 at 5:59 AM, Mattias Gaertnerwrote: > On Mon, 1 Feb 2016 05:43:15 -0500 > Anthony Walter wrote: > > > I've posted a tutorial video, which is the first in a series, titled > > "Getting Started". It's available for viewing here: > > > > http://www.getlazarus.org/learn/tutorials/start/ > > > > Additional tutorial videos with progressively more advanced subject > matter > > will be posted to the tutorials section regularly. Up next will be a > brief > > introduction to the Lazarus IDE. > > It says "Lazarus Learing Center" in the title. > > Mattias > > -- > ___ > Lazarus mailing list > Lazarus@lists.lazarus.freepascal.org > http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus > -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Debian (Sid): fpc 3.0.0+dfsg-2 cannot compile lazarus trunc
On Mon, 1 Feb 2016 18:20:59 +0100 John Landmesserwrote: > Does anybody else has issues with Debians fpc 3.0.0+dfsg-2 Is this the new FPC 3.0.0 from Debian unstable? > fpc 3.0.0+dfsg-2 hangs on ..linking Mattias -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Free Pascal and Lazarus learning center
Michael, if you or anyone with commit rights feels comfortable adding a derived thread class (TSimpleThread) with the features I've described to the classes unit, then I'll post my implementation to mantis as a patch. -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Free Pascal and Lazarus learning center
On Mon, 01 Feb 2016 13:53:30 +0100, Michael Schnellwrote: >On 02/01/2016 12:47 PM, Bo Berglund wrote: >> Blocking sockets is where I am now... >So Porting AsyncPro would be a great exercise :-) !!! > >This is an exceptionally useful tool, great open source code once done >by a professional tea, but done in a Windows-only and outdated way (not >using TThread.Queue, but Windows messages and "procedure... message" >instead. Mending this and using decently portable blocking Socket and >Com-Port (TTY) components would do the trick. Ouch! Now you seem to have found my old thread where I was asking about AsyncPro. I used that in Delphi including the variation that uses TCP/IP rather than COM: as transport layer. I used it, without really having to understand what was going on behind the scenes... But as you say it is Windows-only... And very complex to hack into as well. So I turned to Indy10 now since I don't need serial, but have to handle the blocking sockets in a scenario similar to event driven handling I will watch this! :) -- Bo Berglund Developer in Sweden -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Free Pascal and Lazarus learning center
On 02/01/2016 12:47 PM, Bo Berglund wrote: Blocking sockets is where I am now... So Porting AsyncPro would be a great exercise :-) !!! This is an exceptionally useful tool, great open source code once done by a professional tea, but done in a Windows-only and outdated way (not using TThread.Queue, but Windows messages and "procedure... message" instead. Mending this and using decently portable blocking Socket and Com-Port (TTY) components would do the trick. -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Free Pascal and Lazarus learning center
On Mon, 1 Feb 2016, Anthony Walter wrote: Just a bit of information, my Cross.Codebot library has threading built in to the socket protocol implementations, so with regards to explaining it I could just show the source code or I could write it a again just to demonstrate. With regards to complexity, I never define a new thread class, which is the typical way most people think about working with threads in Free Pascal. Instead I have one thread class defined in my System unit, and you pass it your execute method along with an optional status handler. Your execute is called, the thread object is freed for you automatically, and you don't need to declare a new type. [snip] procedure TDownloadForm.DownloadClick(Sender: TObject); begin if FThread <> nil then Exit; FThread := TSimpleThread.Create(Download, DownloadStatus, DownloadComplete); end; This mechanism could easily be added as class static methods to TThread itself. It would make life easier for many simple cases. Class Procedure TThread.Spawn(MyProcedure,OnStatus,OnTerminate : TThreadProcedure); static; Or "ExecuteInThread" instead of "Spawn". Would you care to enter this as a feature request ? Michael. -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Free Pascal and Lazarus learning center
Michael, My implementation adds an optional Status property to a thread, which then necessitates an instance. When Status is written (that's the optional part) in a background thread its value is copied temporarily to a private field, then the thread invokes Synchronize. Before your status changed handler is notified, the thread instance copies the temporary status back to the property read field. With this type of arrangement it's possible to update the Status property in a background thread while the user interface might be reading from it. The net result is that setting Status in the background thread causes the user interface thread to receive a notification where it can do whatever it wants with Status. Examples: show a percentage complete, show steps being worked on, show bytes transferred, or whatever you dream up. -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Free Pascal and Lazarus learning center
On Mon, 1 Feb 2016, Anthony Walter wrote: Michael, if you or anyone with commit rights feels comfortable adding a derived thread class (TSimpleThread) with the features I've described to the classes unit, then I'll post my implementation to mantis as a patch. I feel comfortable with this :-) I wouldn't have proposed it otherwise :) Michael. -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Tutorial Video: Getting Started
It could have been worse: "Lazarus Leering Center" :-) Michael. On Mon, 1 Feb 2016, Anthony Walter wrote: Dang it. Correction coming pronto. On Mon, Feb 1, 2016 at 5:59 AM, Mattias Gaertnerwrote: On Mon, 1 Feb 2016 05:43:15 -0500 Anthony Walter wrote: I've posted a tutorial video, which is the first in a series, titled "Getting Started". It's available for viewing here: http://www.getlazarus.org/learn/tutorials/start/ Additional tutorial videos with progressively more advanced subject matter will be posted to the tutorials section regularly. Up next will be a brief introduction to the Lazarus IDE. It says "Lazarus Learing Center" in the title. Mattias -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Tutorial Video: Getting Started
Fixed. Thanks for catching that. :) -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Free Pascal and Lazarus learning center
On Mon, 01 Feb 2016 11:21:45 +0100, Michael Schnellwrote: >On 01/31/2016 11:10 PM, Anthony Walter wrote: >> Thanks for the idea Bo. I'll put it near the top of my queue. >> >+1 > >IMHO the knowledge about the (great) thread Features of Lazarus are by >far not spread wide enough. I could not agree more! I have been programming Delphi since 1996 and only very occationally used TThread objects. So I have totally forgotten now how it was done. (I am now retired so I don't have access to my old work code anymore) > >The "lesson" should include: > > - Motivation for the usage of threads: > - - long winding calculations > - - blocking sockets and other hardware / system interface Blocking sockets is where I am now... Got some help from Remy Lebeau concerning running a TIdTcpClient object in a TThread descendant because its methods are blocking. But his solution is based on TThread and TEvent new functionality existing in Delphi XE5 but not in Delphi 2007 or FreePascal 3.0 So I am essentially stuck anyway since I would like it to be a portable solution Delphi <=> FreePascal This is anyway why I proposed the thread section here, believing that if I don't know enough to use it properly there are for shure a whole bunch others that share this predicament -- Bo Berglund Developer in Sweden -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Free Pascal and Lazarus learning center
Just a bit of information, my Cross.Codebot library has threading built in to the socket protocol implementations, so with regards to explaining it I could just show the source code or I could write it a again just to demonstrate. With regards to complexity, I never define a new thread class, which is the typical way most people think about working with threads in Free Pascal. Instead I have one thread class defined in my System unit, and you pass it your execute method along with an optional status handler. Your execute is called, the thread object is freed for you automatically, and you don't need to declare a new type. procedure TDownloadForm.DownloadComplete(Thread: TSimpleThread); begin FThread := nil; // Invoked in the user interface thread // Check Thread.Cancelled here end; procedure TDownloadForm.DownloadStatus(Thread: TSimpleThread); begin // Invoked in the user interface thread // Do something with Thread.Status here end; procedure TDownloadForm.Download(Thread: TSimpleThread); begin // Download here in a thread // Set Thread.Status := SomeString to sync status updates with the UI // FThread.Cancel cancels the thread // Throw exception cancels the thread end; procedure TDownloadForm.DownloadClick(Sender: TObject); begin if FThread <> nil then Exit; FThread := TSimpleThread.Create(Download, DownloadStatus, DownloadComplete); end; -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Free Pascal and Lazarus learning center
On 02/01/2016 03:00 PM, Bo Berglund wrote: And very complex to hack into as well. If I can provide any help., please let me know. So I turned to Indy10 now Not a good idea IMHO, Indy is exceptionally complex. -Michael -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Free Pascal and Lazarus learning center
Am 01.02.2016 13:54 schrieb "Michael Van Canneyt": > > > > On Mon, 1 Feb 2016, Anthony Walter wrote: > >> Just a bit of information, my Cross.Codebot library has threading built in >> to the socket protocol implementations, so with regards to explaining it I >> could just show the source code or I could write it a again just to >> demonstrate. >> >> With regards to complexity, I never define a new thread class, which is the >> typical way most people think about working with threads in Free Pascal. >> Instead I have one thread class defined in my System unit, and you pass it >> your execute method along with an optional status handler. Your execute is >> called, the thread object is freed for you automatically, and you don't >> need to declare a new type. >> > > [snip] > > >> procedure TDownloadForm.DownloadClick(Sender: TObject); >> begin >> if FThread <> nil then >>Exit; >> FThread := TSimpleThread.Create(Download, DownloadStatus, >> DownloadComplete); >> end; > > > This mechanism could easily be added as class static methods to TThread > itself. It would make life easier for many simple cases. > > Class Procedure TThread.Spawn(MyProcedure,OnStatus,OnTerminate : TThreadProcedure); static; > > Or "ExecuteInThread" instead of "Spawn". > > Would you care to enter this as a feature request ? Current Delphis have something similar for anonymous functions already, so we should use the same name, but with "of object" procvars instead (note: the resulting thread class will be TAnonymousThread). Regards, Sven -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Free Pascal and Lazarus learning center
Sven, What's the current road map look like for closures? Is it even on the radar? If so, and if no major work has been done on it yet, an improved syntax would go a long way in usability. -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Free Pascal and Lazarus learning center
Am 01.02.2016 16:18 schrieb "Anthony Walter": > > Sven, > > What's the current road map look like for closures? Is it even on the radar? If so, and if no major work has been done on it yet, an improved syntax would go a long way in usability. Someone is working on them and a prototype exists (look in fpc-devel's archive for December). Now the code only needs to be cleaned up. In my head I already play around with a shorter/nicer syntax at least for expressions (thus lambda expressions ;) ), but most ideas rely on type inference which I'm very reluctant to add, because that's something that's not part of the sprit of Pascal. Regards, Sven -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
[Lazarus] Debian (Sid): fpc 3.0.0+dfsg-2 cannot compile lazarus trunc
Does anybody else has issues with Debians fpc 3.0.0+dfsg-2 Downgraded to fpc 2.6.4 to compile Lazarus trunc again! My system: Lazarus 1.7 r1.5 FPC 2.6.4 x86_64-linux-gtk 2 ( Misleading information here, its Revision 51468 ) fpc 3.0.0+dfsg-2 hangs on ..linking ok, thats Debian related, but I'm just curious -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus