[Lazarus] TPQConnection and float

2016-03-21 Thread Björn Lundin
Hi !
I'm new to Lazarus (since Saturday)
but in the 90:ies id wrote some Turbo Pascal for school and liked it.
However, the last 15 years, I've worked with a system written in Ada
so that is the language I'm fluid in.
But it is close to Pascal.

So - I started to write a form with a tree widget and a graph,
and started go get data from a database to fill the graph with,
depending on the selected node in the tree.
But the values are off with a factor 1.

I wrote a console test program to reproduce it,
and in also gets the floats wrong with a factor 1.

Where should I report this - if this mailing list is not the place?
But perhaps first of all - am I doing something wrong here ?
code below.

Besides this, I am really impressed with Lazarus,
as an IDE.

I've already ordered some books at Amazon.

output as follows:
C:\pg_test_float>test_float.exe
A: 1
B:  1.E+004
C:  2.2000E+004
round(B): 1
round(C): 22000

(Win7 , Postgres 9.4, libpq.dll also 9.4, Lazarus 1.6)

program test_float;
uses
pqconnection,sqldb ;

function CreateConnection: TPQConnection;
begin
  result := TPQConnection.Create(nil);
  result.Hostname := 'some-server';
  result.DatabaseName := 'some-db';
  result.UserName := 'some-user';
  result.Password := 'some-pass;
end;

function CreateTransaction(pConnection: TPQConnection): TSQLTransaction;
begin
  result := TSQLTransaction.Create(pConnection);
  result.Database := pConnection;
end;

function CreateQuery(pTransaction: TSQLTransaction): TSQLQuery;
begin
  result := TSQLQuery.Create(pTransaction.Database);
  result.Database := pTransaction.Database;
  result.Transaction := pTransaction
end;

var
PQConn : TPQConnection;
T  : TSQLTransaction;
Q1, Q2, Q3 : TSQLQuery;

A : LongInt;
B,C : Double;

sSql : String;
begin
  PQConn := CreateConnection ;
  PQConn.Open;
  T := CreateTransaction(PQConn);
  T.StartTransaction;

  Q1 := CreateQuery(T) ;
  sSql := 'create table TEST ( ';
  sSql += 'A integer not null primary key, ';
  sSql += 'B numeric(8,3) not null , ';
  sSql += 'C numeric(15,2) not null ) ';

  Q1.SQL.Text := sSql;
  Q1.ExecSql;

  Q2 := CreateQuery(T) ;
  sSql := 'insert into TEST values (1, 1.0, 2.2)';
  Q2.SQL.Text := sSql;
  Q2.ExecSql;

  Q3 := CreateQuery(T) ;
  sSql := 'select * from TEST order by A';
  Q3.SQL.Text := sSql;
  Q3.Open;
  if not Q3.Eof then begin
A := Q3.FieldByName('A').AsLongint;
B := Q3.FieldByName('B').AsFloat;
C := Q3.FieldByName('C').AsFloat;
Writeln('A: ', A);
Writeln('B: ', B);
Writeln('C: ', C);
Writeln('round(B): ', round(B));
Writeln('round(C): ', round(C));

  end
  else
writeln('Eos');

  Q3.Close;
  T.Rollback;
  Q1.Free;
  Q2.Free;
  Q3.Free;
  T.Free;
  PQConn.Close;
end.


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


Re: [Lazarus] LCL exports CC-licensed icons to every LCL application

2016-03-21 Thread Ondrej Pokorny

On 21.03.2016 10:49, Michael Van Canneyt wrote:

Yes, but that does not tell me which of these icons are silk icons ?
Or are they all silk icons ?


I created a list of LCL icons grouped by license/origin in 
lcl/images/copyright.txt


Ondrej

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


Re: [Lazarus] Raspberry Pi 3 build issues

2016-03-21 Thread Bo Berglund
On Mon, 21 Mar 2016 05:53:05 +, Anthony Walter 
wrote:

>Has anyone here built Lazarus from SVN sources on the Raspberry Pi 3 yet? I
>keep running into various issues. This my latest issue from:

I have done so multiple times and to facilitate installation on a bare
newly installed RPi3 with Raspbian Jessie I created a shellscript file
that does all the work:

http://blog.boberglund.com/install_laz_pi.sh

- Download the file to your RPi3 home directory.
  I guess you can use wget for that...

- Then change the permissions of the file:
  chmod +x install_laz_pi.sh

- Finally start the script as user pi:
  ./install_laz_pi.sh

It will run for quite a while installing all of the build required
modules and downloading both the seed compiler, the svn sources for
fpc 3.0.0 and lazarus 1.6 releases.
Then it installs fpc seed compiler and builds the fpc 3.0.0 release
and finally uses that to build the lazarus ide.
It also creates a start menu entry for Lazarus at the end.

HTH

-- 
Bo Berglund
Developer in Sweden


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


Re: [Lazarus] LCL exports CC-licensed icons to every LCL application

2016-03-21 Thread Denis Kozlov
On 21 March 2016 at 11:46, Ondrej Pokorny  wrote:

>
> I only want to clarify the license information about the LCL because now
> it isn't correct. As I said in the internal email from 20.03.2016 12:36,
> there are 2 possibilities:
> 1.) remove the CC-licensed icons from the LCL
> 2.) change the LCL licensing information everywhere on the wiki and the
> web. E.g. http://wiki.freepascal.org/Lazarus_Faq#Licensing doesn't say
> anything about the used LCL icons.
>
>
Another possibility as already mentioned:
3) Acquire an exception (permission) from icon copyright holders to allow
building applications with LCL without a need to propagate licensing terms
into target applications.

That would be the cleanest solution in my opinion, if possible of course.
If that doesn't work, then the next best solution would be to replace
CC-licensed icons with alternatives. At last, forcing developers into
CC-licensed icons for their application is a significant drawback and
should be avoided at all cost.

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


Re: [Lazarus] LCL exports CC-licensed icons to every LCL application

2016-03-21 Thread Michael Van Canneyt



On Mon, 21 Mar 2016, Juha Manninen wrote:


Ok, I should read the dev-list discussion more carefully.
My head does not work well with licensing details. For free and open
source stuff it feels like a useless extra complication. I understand
it is only me and the reality is more complex. I happily leave this
issue for others to solve.


Don't worry, you're not alone. 
I never understood the need for all these licensing details either.


Michael.

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


Re: [Lazarus] LCL exports CC-licensed icons to every LCL application

2016-03-21 Thread Juha Manninen
Ok, I should read the dev-list discussion more carefully.
My head does not work well with licensing details. For free and open
source stuff it feels like a useless extra complication. I understand
it is only me and the reality is more complex. I happily leave this
issue for others to solve.

Juha

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


Re: [Lazarus] LCL exports CC-licensed icons to every LCL application

2016-03-21 Thread Ondrej Pokorny

On 21.03.2016 12:18, Juha Manninen wrote:

Ondrej, what is the fuzz about icons now?
No author of icons has complained. The famfam icons are free anyway.
Lazarus project acknowledges their origin and thus does not violate
anything.


Correct.



Yes, all applications using LCL must acknowledges them, too, but it
should not be a problem. It is just one line of text somewhere.


Correct, this is not the problem. The problem is that if somebody 
downloads Lazarus, there is no warning about it. So people can easily 
break license terms without even knowing it.




We can emphasize its importance in a ReadMe file or somewhere. No big deal...


This is exactly what I proposed in internal discussion. See my email 
from 20.03.2016 12:36. Why haven't you answered there? The only answers 
I got there were that the CC-licensed icons have to be removed.




For some reason this reminds me of the war against CodeTyphon. Some
people used any excuse to attack them and/or Lazarus developers. It
went out of proportions completely, and the fundamental ideas of open
source were turned upside down in the process.


What is so bad on using public domain icons in an open-source project 
instead of icons covered by a different license that the open-source 
project uses?




Your icon crusade is going out of proportions, too. Are you really
going to break the IDE with an IFDEF?


No.



Does it mean everybody must explicitly acknowledge famfam icons before
he gets a working IDE.


No. I said the IDE can be configured automatically to include famfam 
icons. The discussion is about LCL and not Lazarus.


I don't want to fight against Lazarus. I only want to clarify the 
license information about the LCL because now it isn't correct. As I 
said in the internal email from 20.03.2016 12:36, there are 2 possibilities:

1.) remove the CC-licensed icons from the LCL
2.) change the LCL licensing information everywhere on the wiki and the 
web. E.g. http://wiki.freepascal.org/Lazarus_Faq#Licensing doesn't say 
anything about the used LCL icons.


If we decide for (2.) there will be no changes needed. As you can see, I 
haven't done anything yet in any direction, so the discussion is still open.


Ondrej

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


Re: [Lazarus] LCL exports CC-licensed icons to every LCL application

2016-03-21 Thread Juha Manninen
Ondrej, what is the fuzz about icons now?
No author of icons has complained. The famfam icons are free anyway.
Lazarus project acknowledges their origin and thus does not violate
anything.
Yes, all applications using LCL must acknowledges them, too, but it
should not be a problem. It is just one line of text somewhere. We can
emphasize its importance in a ReadMe file or somewhere. No big deal...

For some reason this reminds me of the war against CodeTyphon. Some
people used any excuse to attack them and/or Lazarus developers. It
went out of proportions completely, and the fundamental ideas of open
source were turned upside down in the process.

Your icon crusade is going out of proportions, too. Are you really
going to break the IDE with an IFDEF?
Does it mean everybody must explicitly acknowledge famfam icons before
he gets a working IDE.

Juha

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


Re: [Lazarus] LCL exports CC-licensed icons to every LCL application

2016-03-21 Thread Ondrej Pokorny

On 21.03.2016 11:30, Ondrej Pokorny wrote:
The problem are user-created LCL applications where the author may not 
be aware of this licensing issues. If he is, he can easily include the 
icons by compilingthe IDE with the appropriate define. 


Sorry, I meant LCL: *If he is, he can easily include the icons /(into 
his LCL application)/ by compiling LCL with the appropriate define.


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


Re: [Lazarus] LCL exports CC-licensed icons to every LCL application

2016-03-21 Thread Ondrej Pokorny

On 21.03.2016 11:16, Michael Van Canneyt wrote:

? Will this not cripple the GUI ?


Lazarus IDE GUI or your application's GUI?



I don't want to end up with an empty button when I update my lazarus :)


On 21.03.2016 11:21, Graeme Geldenhuys wrote:

On 2016-03-21 10:16, Michael Van Canneyt wrote:

I don't want to end up with an empty button when I update my lazarus :)

Ondrej did mention they would be removed by IFDEF, so it should be easy
to override that and put them back in place. So I guess it's not too bad.


Correct. The Lazarus IDE can be configured so that it automatically 
includes the Silk icons (because it acknowledges them). The problem are 
user-created LCL applications where the author may not be aware of this 
licensing issues. If he is, he can easily include the icons by compiling 
the IDE with the appropriate define.



On 21.03.2016 11:19, Graeme Geldenhuys wrote:

I can supply a list of icons used in the IDE which I designed myself.


Please do so. Although the priority are LCL icons and not Lazarus icons.

Ondrej

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


Re: [Lazarus] LCL exports CC-licensed icons to every LCL application

2016-03-21 Thread Graeme Geldenhuys
On 2016-03-21 10:16, Michael Van Canneyt wrote:
> I don't want to end up with an empty button when I update my lazarus :)

Ondrej did mention they would be removed by IFDEF, so it should be easy
to override that and put them back in place. So I guess it's not too bad.


Regards,
  - Graeme -

-- 
fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal
http://fpgui.sourceforge.net/

My public PGP key:  http://tinyurl.com/graeme-pgp

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


Re: [Lazarus] LCL exports CC-licensed icons to every LCL application

2016-03-21 Thread Graeme Geldenhuys
On 2016-03-21 10:05, Ondrej Pokorny wrote:
> => Now there is no information about the source of every single LCL 
> icon. So there may be more license problems.

That is where Git's author tracking (not committer) would have come in
useful. ;-)


> I probably will remove all the icons from the LCL with a conditional 
> IFDEF and the icons will be added back only if license information about 
> them is known and documented in the LCL sources and matches the LCL license.

If it comes to that, please post a message in the mailing list. I can
supply a list of icons used in the IDE which I designed myself. Not
many, but a few. It's been a long time though, so I unfortunately don't
have my original The Gimp files any more.



Regards,
  - Graeme -

-- 
fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal
http://fpgui.sourceforge.net/

My public PGP key:  http://tinyurl.com/graeme-pgp

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


Re: [Lazarus] LCL exports CC-licensed icons to every LCL application

2016-03-21 Thread Michael Van Canneyt



On Mon, 21 Mar 2016, Ondrej Pokorny wrote:


On 21.03.2016 10:49, Michael Van Canneyt wrote:

Yes, but that does not tell me which of these icons are silk icons ?

Yes, this is also a problem.


Or are they all silk icons ?


No, they are not all form silk. Lazarus developers haven't been strict about 
icon usage both in LCL and Lazarus IDE and so there is no information about 
the source of every particular icon.


I can say for sure that there are buttons from Silk. E.g. button icons 
(subdir buttons) are from the Silk package.
The cursor icons seem to be copied from Delphi (at least cur_21.cur) - I 
don't know how these are licensed.
I don't know the source of the dialog icons (subdir dialogs) - maybe Tango 
(?).


=> Now there is no information about the source of every single LCL icon. So 
there may be more license problems.


I probably will remove all the icons from the LCL with a conditional IFDEF 
and the icons will be added back only if license information about them is 
known and documented in the LCL sources and matches the LCL license.


? Will this not cripple the GUI ?

I don't want to end up with an empty button when I update my lazarus :)

Michael.

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


Re: [Lazarus] LCL exports CC-licensed icons to every LCL application

2016-03-21 Thread Ondrej Pokorny

On 21.03.2016 10:49, Michael Van Canneyt wrote:

Yes, but that does not tell me which of these icons are silk icons ?

Yes, this is also a problem.


Or are they all silk icons ?


No, they are not all form silk. Lazarus developers haven't been strict 
about icon usage both in LCL and Lazarus IDE and so there is no 
information about the source of every particular icon.


I can say for sure that there are buttons from Silk. E.g. button icons 
(subdir buttons) are from the Silk package.
The cursor icons seem to be copied from Delphi (at least cur_21.cur) - I 
don't know how these are licensed.
I don't know the source of the dialog icons (subdir dialogs) - maybe 
Tango (?).


=> Now there is no information about the source of every single LCL 
icon. So there may be more license problems.


I probably will remove all the icons from the LCL with a conditional 
IFDEF and the icons will be added back only if license information about 
them is known and documented in the LCL sources and matches the LCL license.


Ondrej

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


Re: [Lazarus] LCL exports CC-licensed icons to every LCL application

2016-03-21 Thread Michael Van Canneyt



On Mon, 21 Mar 2016, Ondrej Pokorny wrote:


On 21.03.2016 10:05, Michael Van Canneyt wrote:
Can you please be a bit more specific ? Which silk icons are exported 
exactly ?


It depends what units you use in your LCL application. Please see the 
"lcl/images" folder. All icons that are used by the LCL are located there.


See e.g.
lcl\images\lcl_grid_images.bat => lcl\lcl_grid_images.res => linked into the 
LCL in Grids.pas with {$R lcl_grid_images.res}.

lcl\images\buttons\build.bat => btn_icons.res => buttons.pp
etc etc.

You can also check the final executable with a resource viewer what icons are 
exported into your application.


Yes, but that does not tell me which of these icons are silk icons ?
Or are they all silk icons ?

Michael.

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


Re: [Lazarus] LCL exports CC-licensed icons to every LCL application

2016-03-21 Thread Ondrej Pokorny

On 21.03.2016 10:17, Graeme Geldenhuys wrote:

On a similar note, the URL listed in the "About -> Acknowledgements" for
Tango icons are invalid. I get a "Forbidden - permission denied error"
in my web browser.


This isn't a real problem because Tango icons are public domain and thus 
no acknowledgement is needed. Furthermore the German wikipedia page 
https://de.wikipedia.org/wiki/Tango_Desktop_Project shows the same URL 
Lazarus uses. So I suspect the problem is on the Tango's site and not 
Lazarus'.


Onrej

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


Re: [Lazarus] LCL exports CC-licensed icons to every LCL application

2016-03-21 Thread Graeme Geldenhuys
On a similar note, the URL listed in the "About -> Acknowledgements" for
Tango icons are invalid. I get a "Forbidden - permission denied error"
in my web browser.

Regards,
  - Graeme -


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


Re: [Lazarus] LCL exports CC-licensed icons to every LCL application

2016-03-21 Thread Ondrej Pokorny

On 21.03.2016 10:05, Michael Van Canneyt wrote:
Can you please be a bit more specific ? Which silk icons are exported 
exactly ?


It depends what units you use in your LCL application. Please see the 
"lcl/images" folder. All icons that are used by the LCL are located there.


See e.g.
lcl\images\lcl_grid_images.bat => lcl\lcl_grid_images.res => linked into 
the LCL in Grids.pas with {$R lcl_grid_images.res}.

lcl\images\buttons\build.bat => btn_icons.res => buttons.pp
etc etc.

You can also check the final executable with a resource viewer what 
icons are exported into your application.


Ondrej

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


Re: [Lazarus] LCL exports CC-licensed icons to every LCL application

2016-03-21 Thread Michael Van Canneyt



On Mon, 21 Mar 2016, Ondrej Pokorny wrote:


Corresponding issue report: http://mantis.freepascal.org/view.php?id=29869

Every LCL application includes icons (at least) from the famfamfam (Silk icon 
set) that are licensed under Creative Commons Attribution 2.5/3.0 license.
As a result every LCL application that does not acknowledge them, breaks the 
CC license.
LCL is advertised as "(L)GPL licensed with static linking exception", which 
is not true because the LCL includes CC-licensed icons.


The Lazarus team will solve the issue for 1.6.2. We'll try to get a license 
exception for LCL applications. If we don't get this exception all 
CC-licensed icons will be removed from the LCL and will be replaced by 
public-domain icons.


For now, please take into consideration that your LCL application must 
acknowledge the Silk Icon Set http://www.famfamfam.com/lab/icons/silk/ .


Can you please be a bit more specific ? 
Which silk icons are exported exactly ?


Michael.

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


[Lazarus] LCL exports CC-licensed icons to every LCL application

2016-03-21 Thread Ondrej Pokorny

Corresponding issue report: http://mantis.freepascal.org/view.php?id=29869

Every LCL application includes icons (at least) from the famfamfam (Silk 
icon set) that are licensed under Creative Commons Attribution 2.5/3.0 
license.
As a result every LCL application that does not acknowledge them, breaks 
the CC license.
LCL is advertised as "(L)GPL licensed with static linking exception", 
which is not true because the LCL includes CC-licensed icons.


The Lazarus team will solve the issue for 1.6.2. We'll try to get a 
license exception for LCL applications. If we don't get this exception 
all CC-licensed icons will be removed from the LCL and will be replaced 
by public-domain icons.


For now, please take into consideration that your LCL application must 
acknowledge the Silk Icon Set http://www.famfamfam.com/lab/icons/silk/ .


Ondrej

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


Re: [Lazarus] Aarch64 as CPU target for RPi3 with Linux as OS

2016-03-21 Thread Michael Schnell

On 03/18/2016 05:59 PM, Alfred wrote:

Hello,
I would like to inform you that Lazarus / FPC runs smooth on an 
Odroid-C2 under aarch64 (arch linux).
Proof: 
https://drive.google.com/file/d/0B96fg3TpL5RDWnJiMUwyQ21hM00/view?usp=sharing

GREAT !!!

Many thanks for the good work !!!

+1 !

-Michael

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


Re: [Lazarus] Raspberry Pi 3 build issues

2016-03-21 Thread Anthony Walter
It would seem the issue is related to running without enough of memory. I
decreased my GPU/RAM split, rebooted to text mode, and "make all"'ed on
Lazarus successfully.
--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus