Re: [Lazarus] Is there a separate mailing list for Lazarus developers?

2014-01-07 Thread Lukasz Sokol
On 06/01/14 22:33, Juha Manninen wrote:
 On Mon, Jan 6, 2014 at 7:17 PM, Lukasz Sokol el.es...@gmail.com wrote:
[...]

 I think it all works well together with mailing lists and forum.
OK I agree;

 Only PR is almost missing. Linux kernel and other major commercially
 backed projects get much more publicity.
And here...

 Any mailing lists don't help with PR though.
 
...well here I disagree - go see [briefly] https://lwn.net - (one of) their 
editors (semi)regularly
posts interesting topics dug out on lkml. That's 1000s% more press coverage 
than I've ever seen on FPC/Laz.
PR gain is obvious here.

I volunteer(ed) to at least fwd the press releases of FPC/Lazarus to LWN, as 
they have not just
kernel topics in there, AFAICU they cover F(L)OSS in general. I perceive this 
as least-i-can-do 
- even if it doesn't land on main page (yet).

And while there probably exists net-mag(s) for Pascal topics, I don't think we 
should limit ourselves
to announcing just there.


 Juha
 

-L.



--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Using Lazarus for non-graphical apps

2014-01-07 Thread Michael Schnell

On 12/28/2013 10:07 PM, Mark Morgan Lloyd wrote:


Thanks, I'm reading stdin directly with a tight timeout using fpselect 
so it sounds like I should be able to manage something.


This of course requests for a multithreaded application. (i.e. the 
threads that handle the blocking pipes communicate with the main thread 
via TThread.Queue or Application.QueueAsyncCall).


In fact without a GUI binding currently you even can't use TTimer.

Exact,y this is why I am planing to do a active NoGui Widget Type - 
and since not that long I do know how this can be done. :-)


As Michael and Sven state, TThread.Queue, Application.QueueAsyncCall 
depend on checksynchronize() (and TTimer needs a dedicated 
implementation in a new WidgetType, anyway).


-Michael

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Is there a separate mailing list for Lazarus developers?

2014-01-07 Thread Michael Schnell

On 01/05/2014 02:44 AM, Bart wrote:

such as the everlasting Unicode debates,


I feel that main causes of these debates are (1) that the definitions in 
DXE are not nice (at least completely ignoring any portability issues), 
but fpc/Lazarus is forced to follow rather closely whatever Delphi does. 
and (2) that Lazarus only can use what fpc offers and thus Unicode 
awareness was implemented before fpc provided Unicode-Delphi compatible 
Strings, resulting in incompatibility in multiple directions.


Thus nobody to be blamed here.

-Michael


--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Using Lazarus for non-graphical apps

2014-01-07 Thread Mark Morgan Lloyd

Michael Schnell wrote:

On 12/28/2013 10:07 PM, Mark Morgan Lloyd wrote:


Thanks, I'm reading stdin directly with a tight timeout using fpselect 
so it sounds like I should be able to manage something.


This of course requests for a multithreaded application. (i.e. the 
threads that handle the blocking pipes communicate with the main thread 
via TThread.Queue or Application.QueueAsyncCall).


In fact without a GUI binding currently you even can't use TTimer.

Exact,y this is why I am planing to do a active NoGui Widget Type - 
and since not that long I do know how this can be done. :-)


As Michael and Sven state, TThread.Queue, Application.QueueAsyncCall 
depend on checksynchronize() (and TTimer needs a dedicated 
implementation in a new WidgetType, anyway).


Thanks, yes. In practice there will be limited communication between 
backend threads and the frontend console, I think I've managed to 
organise things so that there's effectively a single point of contact 
and the program will be able to run in text mode (i.e. inside something 
like GNU Screen) or with a GUI.


The non-GUI version is a 1Mb binary smartlinked and stripped, which is 
credible for publishing. Haven't a clue what the GUI version will come 
to yet, since I want to embed symbolic debugging and a simulated logic 
analyser which implies pulling in a lot of code.


--
Mark Morgan Lloyd
markMLl .AT. telemetry.co .DOT. uk

[Opinions above are the author's, not those of his employers or colleagues]

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Is there a separate mailing list for Lazarus developers?

2014-01-07 Thread Juha Manninen
On Tue, Jan 7, 2014 at 1:07 PM, Michael Schnell mschn...@lumino.de wrote:
 [...]
 that Lazarus only can use what fpc offers and thus Unicode awareness was
 implemented before fpc provided Unicode-Delphi compatible Strings, resulting
 in incompatibility in multiple directions.

Don't hijack this thread for Unicode please. It is filling too many
thread already.
This thread has NOTHING to do with Unicode.

Juha

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Using Lazarus for non-graphical apps

2014-01-07 Thread Marc Santhoff
On Di, 2014-01-07 at 11:55 +0100, Michael Schnell wrote:
 In fact without a GUI binding currently you even can't use TTimer.

Graeme G. once posted the source of or a link to a unit called
ThreadTimer, in which there is TfpTimer. That one is independant from
LCL.

I don't know if the unit is part of fpc, though.

HTH,
Marc

-- 
Marc Santhoff m.santh...@web.de


--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Using Lazarus for non-graphical apps

2014-01-07 Thread Michael Van Canneyt



On Tue, 7 Jan 2014, Marc Santhoff wrote:


On Di, 2014-01-07 at 11:55 +0100, Michael Schnell wrote:

In fact without a GUI binding currently you even can't use TTimer.


Graeme G. once posted the source of or a link to a unit called
ThreadTimer, in which there is TfpTimer. That one is independant from
LCL.

I don't know if the unit is part of fpc, though.


Yes it is.

Michael.

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Using Lazarus for non-graphical apps

2014-01-07 Thread Michael Schnell

On 01/07/2014 02:05 PM, Marc Santhoff wrote:
Graeme G. once posted the source of or a link to a unit called 
ThreadTimer, in which there is TfpTimer. That one is independant 
from LCL.
Unfortunately it only helps if thread communication (e.g. by 
TThread.Queue) is used to notify the main thread). Hence the problem is 
the same (and addressable by using checksynchronize() with a decent 
timeout).


-Michael

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Using Lazarus for non-graphical apps

2014-01-07 Thread Michael Van Canneyt



On Tue, 7 Jan 2014, Michael Schnell wrote:


On 01/07/2014 02:05 PM, Marc Santhoff wrote:
Graeme G. once posted the source of or a link to a unit called 
ThreadTimer, in which there is TfpTimer. That one is independant from 
LCL.
Unfortunately it only helps if thread communication (e.g. by TThread.Queue) 
is used to notify the main thread). Hence the problem is the same (and 
addressable by using checksynchronize() with a decent timeout).


I think you misunderstand TThread.Queue. It does not notify the main thread.
On the contrary, CheckSynchronize needs to be called in order to let 
TThread.Queue do its work.

Likewise, TThreadTimer works only if CheckSynchronize is called on a regular 
basis in the main thread.

Michael.

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Using Lazarus for non-graphical apps

2014-01-07 Thread Michael Schnell

On 01/07/2014 02:22 PM, Michael Van Canneyt wrote:

I think you misunderstand TThread.Queue. It does not notify the main 
thread.
Yes it does (from the view of the user), when the environment is 
decently crafted (in fact it does the same as TThread.synchronize only 
that the thread does not wait until the mainthread  is finished with 
executing the queued procedure). In the end they call WakeMainThread() 
on that behalf.


On the contrary, CheckSynchronize needs to be called in order to let 
TThread.Queue do its work.
That is exactly what I meant to say. As well TThread.Queue and 
TThread.Synchronize need CheckSynchronize to be called. In fact 
CheckSynchronize needs to be called by the main thread and any queued 
or synchronized procedure in the end is executed by being called from 
withing CheckSynchronize.


(Sorry if I was unclear.)
-Michael

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Using Lazarus for non-graphical apps

2014-01-07 Thread Michael Van Canneyt



On Tue, 7 Jan 2014, Michael Schnell wrote:


On 01/07/2014 02:22 PM, Michael Van Canneyt wrote:

I think you misunderstand TThread.Queue. It does not notify the main 
thread.
Yes it does (from the view of the user), when the environment is decently 
crafted (in fact it does the same as TThread.synchronize only that the thread 
does not wait until the mainthread  is finished with executing the queued 
procedure). In the end they call WakeMainThread() on that behalf.


WakeMainThread may or may not be implemented. You should not count on that.

Michael.

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Using Lazarus for non-graphical apps

2014-01-07 Thread Mark Morgan Lloyd

Michael Schnell wrote:

On 01/07/2014 03:11 PM, Michael Van Canneyt wrote:
WakeMainThread may or may not be implemented. You should not count on 
that.


Right you are.

If you want to have decent event oriented Pascal programming (i.e. by 
using TThread.Synchronize and/or TThread.Queue for handling the issues 
the OP requested such as doing blocking I/O in Threads),


The OP, i.e. I, did not mention doing any I/O in threads. The question 
was entirely whether TThread.Synchronize was usable in a non-LCL app, so 
that a background thread (emulating a legacy CPU etc.) can notify the 
frontend that significant status has changed (e.g. it's halted due to an 
invalid opcode).


--
Mark Morgan Lloyd
markMLl .AT. telemetry.co .DOT. uk

[Opinions above are the author's, not those of his employers or colleagues]

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] (Source) in hint boxes

2014-01-07 Thread Mark Morgan Lloyd

Mark Morgan Lloyd wrote:

Mattias Gaertner wrote:

On Sun, 05 Jan 2014 10:44:04 +
Mark Morgan Lloyd markmll.laza...@telemetry.co.uk wrote:

When the mouse is hovered over an identifier, a hint box pops up 
showing declaration and associated comment.


Where is this implemented?


What do you search: Popup box or content?


Content I think, but possibly also the popup if this is where final 
formatting is done. What I'm hoping to do is add a flag so that it only 
appears once in each box. Also my understanding (from previous 
discussion which I can't find) is that at present (Source) is a 
placeholder for a link so I was thinking about experimenting with a 
slightly more compact bit of Unicode.


Does anybody have any thoughts on this please?

--
Mark Morgan Lloyd
markMLl .AT. telemetry.co .DOT. uk

[Opinions above are the author's, not those of his employers or colleagues]

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] (Source) in hint boxes

2014-01-07 Thread Martin Frb

On 07/01/2014 15:27, Mark Morgan Lloyd wrote:

Mark Morgan Lloyd wrote:

Mattias Gaertner wrote:

On Sun, 05 Jan 2014 10:44:04 +
Mark Morgan Lloyd markmll.laza...@telemetry.co.uk wrote:

When the mouse is hovered over an identifier, a hint box pops up 
showing declaration and associated comment.


Where is this implemented?


What do you search: Popup box or content?


Content I think, but possibly also the popup if this is where final 
formatting is done. What I'm hoping to do is add a flag so that it 
only appears once in each box. Also my understanding (from previous 
discussion which I can't find) is that at present (Source) is a 
placeholder for a link so I was thinking about experimenting with a 
slightly more compact bit of Unicode.


Does anybody have any thoughts on this please?



The content, if I get your question right, is provided by codetools, and 
comes from:

- Sourcecode
- comment in source
- fpdoc

The formatting, I am not sure, but the final output depends, on if you 
have IProTurboDsgn installed or not. Though on GTK the IPro can cause 
crashes.


for IPro the content is html. Not sure if codetool does that or 
something else.
It may be that without IPro the html version is just stripped of the 
html tags. (not sure)



--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Using Lazarus for non-graphical apps

2014-01-07 Thread Michael Schnell

On 01/07/2014 04:16 PM, Paul Breneman wrote:


So please share what you can.  Thanks!


Right now I am too busy with completely unrelated things to do the 
planned active NoGui Widget Type :-( .


I just can provide some thoughts and offer to reply to any questions if 
anybody wants to get on that task.


The basics are (now) rather clear to me:

 - The stuff needs to be appropriately integrated in the WidgetType 
selection mechanism Lazarus provides.


 - The stuff needs to be appropriately integrated in the Project 
Source mechanism Lazarus provides.


 - You need to do (at least) a TApplication class and a TTimer class

 - Any not GUI related stuff in TApplicartion should work as expected 
(.ExeName, Callback-events, QueueAsyncCall ) should work as expected


 - WakeMainThread needs to be implemented according to the OS we 
compile for.


 - After the initialization a main loop is executed that calls 
CheckSynchronize with an appropriate timeout (see below)


 - to do a really simple TTimer class my idea is:
 - - calculate the common denominator (but rounding to an appropriate 
minimum aka Granularity) of any instanciated TTimers' Time settings

 - - use that value as Timeout in CheckSynchronize.
 - - in the main loop, count a global timer and call TTimer Events as 
appropriate (if timer mod Timer[i].TimeSpec = 0, with Timer[i].TimeSpec 
:= Timer[i].Time div Granularity)

 - - The Granularity should be a property the user can set.


I did a testing program that checks the multiple means of main thread 
notification with multiple Widget Types.


If there is a new Widget Type I would modify the program to work with 
same and provide it for testing the WidgetType


-Michael

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Using Lazarus for non-graphical apps

2014-01-07 Thread Michael Schnell

On 01/07/2014 04:25 PM, Mark Morgan Lloyd wrote:


The OP, i.e. I, did not mention doing any I/O in threads.


He said: I'm reading stdin directly with a tight timeout

IMHO, the Pascal way of handling such task is using a thread.

-Michael

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Using Lazarus for non-graphical apps

2014-01-07 Thread Mark Morgan Lloyd

Michael Schnell wrote:

On 01/07/2014 04:25 PM, Mark Morgan Lloyd wrote:


The OP, i.e. I, did not mention doing any I/O in threads.


He said: I'm reading stdin directly with a tight timeout

IMHO, the Pascal way of handling such task is using a thread.


That's in the main code, not a background thread, and I have good 
reasons for wanting to do it like that.


The question was whether I could still use TThread.Synchronize for 
background threads, which do not in this particular case need a 
significant amount of OS interaction.


--
Mark Morgan Lloyd
markMLl .AT. telemetry.co .DOT. uk

[Opinions above are the author's, not those of his employers or colleagues]

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


[Lazarus] Getting and setting the x numbered word in a sentence

2014-01-07 Thread Richard Mace
Hi,
Is there an existing routine in Lazarus that will get and set effectively
the x numbered word in a sentence without actually knowing what the actual
word is?
E.g with the string the cat sat on the mat
You could say replace word 3 with string stood so the result would be a
string which was  the cat stood on the mat even though you didn't know
that the 3rd word was originally sat?
Hope that makes sense :)
Thanks
Richard
--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] (Source) in hint boxes

2014-01-07 Thread Mark Morgan Lloyd

Martin Frb wrote:

On 07/01/2014 15:27, Mark Morgan Lloyd wrote:

Mark Morgan Lloyd wrote:

Mattias Gaertner wrote:

On Sun, 05 Jan 2014 10:44:04 +
Mark Morgan Lloyd markmll.laza...@telemetry.co.uk wrote:

When the mouse is hovered over an identifier, a hint box pops up 
showing declaration and associated comment.


Where is this implemented?


What do you search: Popup box or content?


Content I think, but possibly also the popup if this is where final 
formatting is done. What I'm hoping to do is add a flag so that it 
only appears once in each box. Also my understanding (from previous 
discussion which I can't find) is that at present (Source) is a 
placeholder for a link so I was thinking about experimenting with a 
slightly more compact bit of Unicode.


Does anybody have any thoughts on this please?



The content, if I get your question right, is provided by codetools, and 
comes from:

- Sourcecode
- comment in source
- fpdoc

The formatting, I am not sure, but the final output depends, on if you 
have IProTurboDsgn installed or not. Though on GTK the IPro can cause 
crashes.


for IPro the content is html. Not sure if codetool does that or 
something else.
It may be that without IPro the html version is just stripped of the 
html tags. (not sure)


I don't appear to have turbopoweriprodsgn installed on any systems, and 
removing the turbopoweripro package doesn't appear to change anything.


Possibly

  CommentStr:=ExtractCommentContent(CommentCode.Source,CommentStart,
NestedComments,true,true,true);
  if CommentStr  '' then
Result:=Result+'span class=comment'+TextToHTML(CommentStr)
  +' ('+SourcePosToFPDocHint(CodeXYPos^,'Source')+')'
  +'/spanbr'+LineEnding;

etc. in ide/codehelp.pas. If so that gives me something to get my teeth 
into.


(* The irritating thing is when a comment has *)
(* been boxed in like this, which results in  *)
(* spurious (Source) markers in the hint. *)

--
Mark Morgan Lloyd
markMLl .AT. telemetry.co .DOT. uk

[Opinions above are the author's, not those of his employers or colleagues]

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Getting and setting the x numbered word in a sentence

2014-01-07 Thread K. P.
Not exactly - but it is trivially simple to write your own using

http://lazarus-ccr.sourceforge.net/docs/rtl/strutils/extractwordpos.html

Cheers,
Kai

Date: Tue, 7 Jan 2014 18:04:53 +
From: richard.m...@gmail.com
To: lazarus@lists.lazarus.freepascal.org
Subject: [Lazarus] Getting and setting the x numbered word in a sentence

Hi,

Is there an existing routine in Lazarus that will get and set effectively the x 
numbered word in a sentence without actually knowing what the actual word is?

E.g with the string the cat sat on the mat

You could say replace word 3 with string stood so the result would be a 
string which was  the cat stood on the mat even though you didn't know that 
the 3rd word was originally sat? 


Hope that makes sense :)

Thanks

Richard



--
___
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] Getting and setting the x numbered word in a sentence

2014-01-07 Thread Howard Page-Clark

On 07/01/2014 18:04, Richard Mace wrote:

Hi,
Is there an existing routine in Lazarus that will get and set
effectively the x numbered word in a sentence without actually knowing
what the actual word is?
E.g with the string the cat sat on the mat


If word delimiters are consistently all the same character (as in your 
example) you can press a stringlist into service:


function ReplaceNthWord(const aPhrase: string; const aReplacement: 
string; aWordIndex: integer): string;


var sl: TStringList;

begin
Result:='';
if Length(aPhrase)=0 then Exit;
sl:=TStringList.Create;
try
  sl.Delimiter:=' ';
  sl.DelimitedText:=aPhrase;
  if (aWordIndex  0) and (aWordIndex = sl.Count) then
sl[Pred(aWordIndex)]:=aReplacement;
  Result:=sl.DelimitedText;
finally
  sl.Free;
end;
end;


--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Is there a separate mailing list for Lazarus developers?

2014-01-07 Thread Juha Manninen
On Tue, Jan 7, 2014 at 11:12 AM, Lukasz Sokol el.es...@gmail.com wrote:
 ...well here I disagree - go see [briefly] https://lwn.net - (one of) their 
 editors (semi)regularly
 posts interesting topics dug out on lkml. That's 1000s% more press coverage 
 than I've ever seen on FPC/Laz.
 PR gain is obvious here.

Agreed, that would be important and part of the PR.
The key word however was dug. Those people must do lots of digging
and editorial work.


 I volunteer(ed) to at least fwd the press releases of FPC/Lazarus to LWN, as 
 they have not just
 kernel topics in there, AFAICU they cover F(L)OSS in general. I perceive this 
 as least-i-can-do
 - even if it doesn't land on main page (yet).

In addition to what Martin wrote:
We would need a person who digs and digests information and then publishes it.
The info is in many places: in mailing lists, in wiki pages for new
features and announcement, in SVN commit history, ... and in
developers' heads.
I would say the most abundant source of info is the SVN commit
history. Developers are following it. Sometimes a new feature found
there is commented by others, sometimes not, but everybody follows it
more or less.
That info could be collected, digested and published by someone.

If you want to try, please go ahead.
Like in all contributions, if developers see this work has substance,
they start to support it for sure.
It means you could ask missing pieces directly from developers and get answers.
Even access to devel mailing list could be given, but as I wrote
earlier it does not help much.

Regards,
Juha

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus