[Lazarus] Freepascal for web

2021-09-25 Thread Santiago A. via lazarus
Not sure if this question should go for fpc-freepascal list or 
fpc-others list.


I'm starting a new project, a simple accounting system, with the data in 
a server in internet. It is an experimental pet project, just to try new 
technologies (new for me). Although it is just an experimental pet 
project, I want to use technologies that allow to scale in the web.


I don't want to do it in PHP (I got enough of it years ago), so I want 
to consider a more advanced language.
First, I thought about something with a python backend, but I've read 
that it doesn't scale well because it doesn't support multithreads.


I am almost decided to node.js in the backend and vue.js in the 
frontend. Node.js is what almost everybody uses and has a lot of 
libraries/modules and future. And vue.js looks powerful and simple with 
a nice learning curve.


But I'm not still happy. Why can't I use a native compiled program for 
the backend?, it should faster, and more robust that any script, 
dynamic, JIT language. Pascal for this is my first thought as it was my 
first love. I'm thinking about a freepascal backend  and vue.js frontend 
, or even a three-tier with json messages between frontend in vue.js and 
server.


Have you any experience in freepascal for web?
Any hints, suggestions or advice?

--
Saludos
Santiago A.

--
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] FPDoc now with Markdown support

2021-01-07 Thread Santiago A. via lazarus

El 05/01/2021 a las 10:47, Michael Van Canneyt via lazarus escribió:


Because people are naturally lazy and prefer easy & simple over strict 
& rich.




But we could chose a language that is easy & simple for when you want to 
do simple things (90% time) and rich when you need to do complex things.
Asciidoc is very easy, but more standarized, and very rich if you need 
to to do complex things.


if markdown is to be used, it should be specified which flavor, not just 
"markdown"

https://github.com/commonmark/commonmark-spec/wiki/Markdown-Flavors

if we are going for markdown (wouldn't be my first choice) I would go 
for Github flavor

https://docs.github.com/en/free-pro-team@latest/github/writing-on-github

Once again, I would prefer Asciidoc

--
Saludos

Santiago A.

--
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] TTimer simple issue

2020-10-27 Thread Santiago A. via lazarus

El 18/10/2020 a las 19:18, Lars via lazarus escribió:

When building a simple TTimer demo I cannot seem to get it working

Any idea what the problem could be if you paste this code into your 
form with a memo?


var
  TimeSpent: integer;

procedure TForm2.Button1Click(Sender: TObject);
var
  i, answer: integer;
begin
  Timer1.enabled := false;
  TimeSpent := 0;
  Timer1.Enabled := true;
  Timer1.interval := 1;
  for i := 0 to 9 do
  begin
    answer := i * answer;
  end;

  memo1.lines.add('time spent: ' + inttostr(timespent));

end;

procedure TForm2.Timer1Timer(Sender: TObject);
begin
  inc(TimeSpent);
end;

It says
time spent: 0
Whereas the time should be a lot.

Regards,
Lars


I don't know what are you trying to do, but if you are trying to find 
out how long it takes certain process, you should try other approach. 
Timer is low precision and it is only fired by events, so you must 
process event's queue.


A first and bad approach:

for i := 0 to 9 do
begin
   answer := i * answer;
   application.processmessages; //<-- process event queue
end;

But this is very not a very efficient way. The best is to get the start 
time, get the end time and subtract.


var
  StartTime,EndTime:TDataTime;
  i, answer: integer;
begin
 StartTime:=now;
 for i := 0 to 9 do
 begin
    answer := i * answer;
 end;
 EndTime:=now;
 memo1.lines.add('time spent: ' + TimeToStr(EndTime-StarTime) );
end;

But TDateTime is not accurate at all if you are measuring short periods 
(milliseconds).


EpikTimer is a component with much better precision.

https://wiki.lazarus.freepascal.org/EpikTimer


--
Saludos

Santiago A.

-- 
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


[Lazarus] FormClose

2020-09-08 Thread Santiago A. via lazarus

Hi:

I recently have read a message where an object was created in the 
FormCreate and was freed in the formClose.  What if the form is not 
freed? I think that the the natural place to free objects created in 
formCreate is FormDestroy.

In fact, I usually follow this pairs
Created in FormCreate, freed in FormDestroy
Created in FormActivate, freed in FormDeactivate
Created in FormShow, freed in FormHide

I seldom use formClose, just to change the default closeAction.  I can't 
see what else is formClose for. Do you use it form any other case?


--
Saludos

Santiago A.

--
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Lazreport variables

2020-05-07 Thread Santiago A. via lazarus

El 07/05/2020 a las 05:37, Jesus Reyes A. via lazarus escribió:
En Sun, 03 May 2020 11:03:12 -0500, Santiago A. via lazarus 
 escribió:


Hi:

I want to write a report where even lines are written with no
background and odd lines with a light gray background.
The idea is an memo (MemoBackground) in the background of the
masterData Band that is gray and I set visible or invisible,
according with the line.

I have created a report variable "LineCounter"

In the ColumnHeader band (the report has two columns) I have a Script

Begin
  LineCounter:=0;
end;

In the GorupHeader header I have this script

Begin
  LineCounter:=0;
end;

In the masterData band Script:

begin
  LineCounter:=LineCounter+1;
  MemoBackground.visible:=(LineCounter mod 2 = 0);
end


Probably the easiest way of doing what you want is using an empty memo 
object sized to the extent you want for the background row, any other 
field on the band should be 'above' the background memo (you can just 
select the background memo and press the 'send to bottom' tool 
button), any field on the band should be transparent color. Then edit 
the background memo and use this script:


if [LINE#] mod 2 = 0 then
  FillColor := clGray
else
  FillColor := clWhite;

As written and because the variable Line# starts at 1, the first line 
will be white.


You can apply this method to any existing report as it doesn't require 
modifying the source code of your application.


Regards.

Jesus Reyes A.



Ok I'll try
Nevertheless, that doesn't answer my question: How to use 
"not-predefined" variables. How can I access to the variable lineCounter?



--
Saludos

Santiago A.

-- 
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Lazreport variables

2020-05-03 Thread Santiago A. via lazarus

El 03/05/2020 a las 18:04, Bart via lazarus escribió:

On Sun, May 3, 2020 at 6:03 PM Santiago A. via lazarus
 wrote:


I want to write a report where even lines are written with no background and 
odd lines with a light gray background.

A little bit out of the box thinking :-)

You could add the lines to a TStringGrid (ColCount := 1) and set the
color for the alternating row in OI.


Sorry I haven't understand anything ;-)

TStringGrid? It is a report using LazReport, What has TSringGrid to do 
with LazReport?

What is OI?

--
Saludos

Santiago A.

--
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


[Lazarus] Lazreport variables

2020-05-03 Thread Santiago A. via lazarus

Hi:

I want to write a report where even lines are written with no background 
and odd lines with a light gray background.
The idea is an memo (MemoBackground) in the background of the masterData 
Band that is gray and I set visible or invisible, according with the line.


I have created a report variable "LineCounter"

In the ColumnHeader band (the report has two columns) I have a Script

Begin
 LineCounter:=0;
end;

In the GorupHeader header I have this script

Begin
 LineCounter:=0;
end;

In the masterData band Script:

begin
 LineCounter:=LineCounter+1;
 MemoBackground.visible:=(LineCounter mod 2 = 0);
end

When I prepare the report, I get "Invalid Variant Type Cast"

After debugging a little, I have found LineCounter is undefined when it 
is on the right side of assignment.
When It executes  LineCounter:=0; it assigns to a frVariables, a global 
public var in Unit LR_Class.
But when it tries to get its value it searches en a field "values" of 
TfrReport.


I've also tried

LineCounter:=[LineCounter]+1;

With brackets, the same result. (Not sure what brackets are for in scripts)

Any hint? What am I missing?

--
Saludos

Santiago A.

-- 
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Sorting BufferDataset

2020-04-13 Thread Santiago A. via lazarus

El 13/4/20 a las 13:24, Michael Van Canneyt via lazarus escribió:

The other one is for when you set the indexfields property directly, I
think. 


That solves the my sorting problem!!

No need to create indexes or dropping indexes or changing fields of an 
index. Just leave IndexName blank and play with IndexFieldNames (that in 
fact changes the fields of index ''). and if you set  IndexFieldNames to 
blank it restores the original table order.


That make of TbufDataset a useful component, not a nightmare. It needs 
desperately documentation.


How can I help with doc?


--

Saludos
Santiago A.

--
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Sorting BufferDataset

2020-04-13 Thread Santiago A. via lazarus

El 13/4/20 a las 12:43, Michael Van Canneyt via lazarus escribió:
So, if I want to process the dataset in different orders with 
TbufferDataset, before opening the dataset I must set MaxIndexesCount 
to all the orders I'm going to use.


Yes.



Am I right? Or I have missed something?


You are right.

Probably we should at least now offer the possibility to delete 
indexes, and
I am not sure the MaxIndexesCount is still needed. 


At least it is used.

If you create the indexes before opening the dataset, MaxIndexesCount is 
automatically updated to hold your indexes plus the two default indexes.


But in an active dataset, you can't call addindex more than 
MaxIndexesCount, and being aware that two slots are used by two default 
indexes. You may get "The maximum amount of indexes is reached."


By the way. I got "The maximum amount of indexes is reached." and I went 
mad trying to find where I was creating two indexes. Was I calling 
addindex twices before and I wasn't aware?. Finally I looked at the code 
and when you call addindex, it creates two indexes: 'DEFAULT_ORDER' and 
''. What are those two phantom indexes for? I couldn't find any 
documentation about





--

Saludos
Santiago A.

-- 
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


[Lazarus] Sorting BufferDataset

2020-04-13 Thread Santiago A. via lazarus

Hello:

I'm trying to sort a TBufferDataset by several criteria, and I'm a 
little confused.


There is no sort method, so I decided to use indexes, but I have a lot 
of doubts.


When you close the TBufferDataset, all the data is cleaned.

TbufferDataset has a MaxIndexesCount that limits the number of indexes. 
By default this property is intialized to 2, and two indexes are created 
and used by default as soon as you call addIndex. So you must call 
addIndex before opening the table, or set MaxIndexesCount to at least 3 
in order to be able to add an index with the table active. (you can't 
close the table to add new index or you'll lost data).


There is no way to drop a single index, and there is no way to change 
the index fields on the fly, you must call clearIndexes. And to call 
clearIndexes, before you must close the dataset, and so loose data. Am I 
right?


So, if I want to process the dataset in different orders with 
TbufferDataset, before opening the dataset I must set MaxIndexesCount to 
all the orders I'm going to use.


Am I right? Or I have missed something?

By the way, What does the index option "ixNonMaintained" mean?

--
Saludos
Santiago A.

--
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


[Lazarus] Generate InsertSQL, UpdateSQL, DeleteSQL

2020-04-08 Thread Santiago A. via lazarus

Hello:

I have a TSQLQuery with a SQL string like this "select * from 
manyFieldsTable" and I want to write a custom updateSQL, but I don't 
want to start from scratch, from an empty script.  I want to start from 
the automatically generated updateSQL statement that TSQLQuery generates 
when you leave the UpdateSQL script blank.


Is there any way I can get the automatically generated updateSQL 
statement, edit it and set the UpdateSQL property?



Saludos
Santiago A.

--
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Close all menu item ?

2020-03-23 Thread Santiago A. via lazarus

El 23/03/2020 a las 10:55, Ondrej Pokorny via lazarus escribió:

On 23.03.2020 10:23, Michael Van Canneyt via lazarus wrote:
"Close all" in the file menu does not close the project inspector 
(and, I

suppose, the project)

Is this by design ? I'm asking because in Delphi 'Close all' really 
closes "all".


Hello,

yes this difference is by design. To close the project in Lazarus IDE 
you have to execute Project -> "Close Project" from the menu. File -> 
"Close all" closes all open editors.

Maybe the texto should be "Close all editors", then



Ondrej




--
Saludos

Santiago A.

--
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Get the number of pages in a pdf file

2019-06-16 Thread Santiago A. via lazarus

El 15/06/2019 a las 13:56, Graeme Geldenhuys via lazarus escribió:

On 14/06/2019 6:19 pm, Rogério Martins via lazarus wrote:

Is there a function for read info about a pdf file ?  I need to know the
number of pages in a given pdf file.

I don't know of a Object Pascal library you can you, but there is an
alternative. The PDF fromat is a mixture of text and binary. You can
search for text as follows:

/Type /Pages
/Count 45

After the "/Type /Pages" there should be a "/Count " line which
contains the page count. Hope that helps.

It is not completely reliably.
I used to search "/Type /Pages", but a day I couldn't find it, after 
digging a little in the PDF, I discovered that the number of pages was 
stored in a compressed stream.  PDF can sore any data in a compressed 
stream and they decided to compress page information. And since then I 
have begun to find it more frequently.  I suppose that once you have the 
frame work to compress stream, why not compress everything. I can't see 
what are the advantages of compressing a few bytes, but it's there.


Now I try to search "/Type /Pages" and if I can't find it I call a 
external utility "pdftk"


--
Saludos

Santiago A.

--
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Yes another reason to run Linux

2019-06-05 Thread Santiago A. via lazarus

El 05/06/19 a las 09:04, Dejan Boras via lazarus escribió:
Not to defend MS, but those "ads" can be disabled, and he needs to 
change his default lock screen background. But, the reason I use 
(mostly) Linux over Windows is that FPC and Lazarus projects build and 
compile a lot faster on Linux :D


This a little off-topic. Better for FPC-Others
I can't find any excuse for Microsoft. The fact is that they have turn 
computers into TVs with commercials but instead of shows/series/movies 
they have software and instead of audience they have users, and instead 
of commercials "ads" and datamining.

When did computers world go wrong?

--
Saludos

Santiago A.

--
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


[Lazarus] TDBNavigator enabled buttons

2018-11-26 Thread Santiago A. via lazarus

Hello:

I'm working with lazarus (Win32, 2.0 Rc2 + ZeosLib)

When a not-readonly dataset is in browse state, all the buttons in 
navigator are enabled except post and cancel. When dataset enters in  
edit or insert mode,  post and cancel are enabled and only edit button 
is disabled. I expected that while you are editing or inserting, all 
buttons except post and cancel would be disabled. I think I remember 
that delphi worked that way (I'm not sure, too many years ago). Anyway, 
Is there any option in navigator, or dataset, or datasource or anywhere 
to get such behavior, that is, disable all buttons except post and cancel?



--
Saludos

Santiago A.

--
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Trying FPDebug

2018-11-22 Thread Santiago A. via lazarus

El 22/11/18 a las 11:08, Joost van der Sluis via lazarus escribió:

Op 22-11-18 om 11:00 schreef Santiago A. via lazarus:


I would like to fiddle a little with FPdebug, but I'm a little 
confused. I have lazarus 1.8.4 on window 7 32 bits


I have installed the next packages

FpDebug 0.0
lazdebuggerfp


- Once you have installed lazdebuggerfp you have to go to the 
IDE-options. (not the package or project options, but the IDE-options)

- Then select 'Debugger' on the left
- Select 'FpDebug internal Dwarf-debugger (beta)' on the right

Then you're done. Note that you have to select an executable, but this 
executable is never used by FpDebug, so you can leave it on 'gdb'.


Ok. Thanks. I was puzzled looking for a FpDebug Executable.

By the way, I see "FpDebug internal Dwarf-debugger (alpha)". An (Alpha) 
version, not (beta) version as you said. Is there a newer version, a 
(beta), or did you mean (alpha)?


--
Saludos

Santiago A.

--
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


[Lazarus] Trying FPDebug

2018-11-22 Thread Santiago A. via lazarus

Hello:

I would like to fiddle a little with FPdebug, but I'm a little confused. 
I have lazarus 1.8.4 on window 7 32 bits


I have installed the next packages

FpDebug 0.0
lazdebuggerfp

But that is not enough, it is still using GDB. isn't it? I have tried to 
install lazdebuggerfpdserver, but it needs baselinux and I am in win32.


any tutorial or howto?

--
Saludos

Santiago A.

--
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Exception handling in Linux?

2018-10-26 Thread Santiago A. via Lazarus

El 25/10/18 a las 18:46, Bo Berglund via Lazarus escribió:

I am working on a port of a Windows Win32 command line program (Delphi
2007) to Linux Ubuntu 18.04 64bit.

I am almost done now and my tests show that the basic functionality
works as intended.
But I am not sure about the exception handling at all...

In my code I have many instances of:
try
   some code block
except
   on E: Exception do
   begin
 LogDebug('Exception in module : ' + E.Message;
   end
end;

Now when testing I have experienced that Lazarus trows up an exception
dialog when code inside such a construct is running (it typically
comes from some Indy10 operation). When I hit Continue I expect the
code to run the except block but it does not.
There are no log messages concerning the exception

So I wonder if this is a difference between Windows and Linux or some
missing configuration setting on my part?


Do you get that exception dialog when you run the executable out of the 
IDE environment?


I mean, maybe the exception is handled inside indy10, so it is not 
propagated to the level of your except block. My theory is that the 
exception dialog is raised by Lazarus environment whenever an exception 
is raised, handled or not, and if you click "continue", then Indy10 
handles it.


--
Saludos

Santiago A.

--
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Runtime error: INCLOCKED (BUG)

2018-05-11 Thread Santiago A. via Lazarus
El 29/04/2018 a las 19:38, Vojtěch Čihák via Lazarus escribió:
>
> Hi,
>
>  
>
> I changed line 7:
>
>  
>
> TElement = record
>
>       strr: String;
>
>   end;
>
>   TList = array[0..1] of TElement;  //HERE
>
>   Plist = ^TList;   
>
>  
>
> and demo works. Simply, static and dynamic arrays are not the same.
>
> AFAIR, dynamic array is just pointer while static array are data.
>
> I guess someone else will give you more detailed answer.
>


Yes, but I think that it should be considered a FPC bug

  TList = array of TElement;
  Plist = ^TList;

  TSetting = record
  list: Plist;
  end;

const
  _List: array [0..1] of TElement = (
  (strr: 'a'),
  (strr: 'b'));

  _Settings: array [0..0] of TSetting = ( 
  (list: @_List)); //  <=== This line should rise a compiler error.
You are asigning a pointer to an static array to a pointer to a dynamic
array.

---
You could add a type cast of the pointer to Plist

  _Settings: array [0..0] of TSetting = ( 
  (list: Plist(@_List) ));

You explicitly tell the complier to bypass type check, it is up to deal
with this potential dangerous




>  
>
> V.
>
> __
> > Od: Valdas Jankūnas via Lazarus
> > Komu: Lazarus@lists.lazarus-ide.org
> > Datum: 29.04.2018 18:16
> > Předmět: [Lazarus] Runtime error: INCLOCKED
> >
>
>
> type
>   TElement = record
>       strr: String;
>   end;
>   TList = array of TElement;
>   Plist = ^TList;
> .
>
> Why I getting that error? Something wrong with records and constant
> initialization?
>
> My system is: Linux 4.13.0-39-generic #44-Ubuntu SMP Thu Apr 5
> 14:25:01 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
> FPC (from SVN): 3.1.1 [2018/02/21] for x86_64
> -- 
>   Valdas Jankūnas
> -- 
> ___
> Lazarus mailing list
> Lazarus@lists.lazarus-ide.org
> https://lists.lazarus-ide.org/listinfo/lazarus
>
>

-- 
Saludos

Santiago A.

-- 
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Cool IDE add-on idea

2018-04-24 Thread Santiago A. via Lazarus
El 23/04/2018 a las 17:53, Santiago A. via Lazarus escribió:
> Time ago I read that interviews to developers after tests show
> consistently that shortcuts are faster, and clock consistently shows
> that mouse is faster.

http://www.asktog.com/TOI/toi06KeyboardVMouse1.html

We’ve done a cool $50 million of R & D on the Apple Human Interface. We
discovered, among other things, two pertinent facts:

  * Test subjects consistently report that keyboarding is faster than
mousing.
  * The stopwatch consistently proves mousing is faster than keyboarding.

This contradiction between user-experience and reality apparently forms
the basis for many user/developers’ belief that the keyboard is faster.

from
https://www.itworld.com/article/2826902/enterprise-software/7-days-using-only-keyboard-shortcuts--no-mouse--no-trackpad--no-problem-.html

"I watch numerous times a day as colleagues take their hands from the
keyboard, reach for the mouse, and either (1) click in the next field of
a form and recommence typing, or (2) click 'Submit.' It'd take a lot
more than $50 mil worth of research to convince me that (1) tab and (2)
enter are not faster. "

And a little more modern:

https://blog.codinghorror.com/revisiting-keyboard-vs-the-mouse-pt-1/

First, understand that this is a very old quote. In 1989 (apple quote),
the current desktop operating systems were Windows 2.0, DOS 4.0, and Mac
System 6. The "people new to the mouse"

---
Well, this off- topic was a little tongue in tech in the cheek.
Nevertheless, I don't think memorizing a lot of shortcuts is always
superior to a toolbar click.



-- 
Saludos

Santiago A.

-- 
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Cool IDE add-on idea

2018-04-23 Thread Santiago A. via Lazarus
El 14/04/2018 a las 17:47, Graeme Geldenhuys via Lazarus escribió:
> That's an excellent way to learn shortcuts - which ultimately should
> make you work faster (at least that is normally true for developers).

off-topic

http://dl.acm.org/citation.cfm?id=1978942.1979351=DL=GUIDE=231586142=80641087

http://facweb.cs.depaul.edu/sjost/csc423/examples/anova/efficiency.pdf

These studies show that the most efficient is toolbar; second, keyboard
shortcuts; third, second level menu option. With the objection that
shortcuts needs a lot of practice to be better than menu.

Time ago I read that interviews to developers after tests show
consistently that shortcuts are faster, and clock consistently shows
that mouse is faster. The theory that explains this cognitive dissonance
is that while using shortcuts your brain works in the program and in
remembering shortcuts, but with mouse, you brains stops working to do
visual action. The feeling is that with shortcut your brain is always
humming, but with mouse you feel you have a lot of interruptions. But
the fact is that the time you spend thinking the combinations and typing
it is longer than moving the mouse.

Conclusion: Good toolbars and a few well known shortcuts.

-- 
Saludos

Santiago A.

-- 
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Test this please

2018-03-26 Thread Santiago A. via Lazarus
El 26/03/2018 a las 6:22, Anthony Walter via Lazarus escribió:
> Hey guys. I wrote this web tool a while ago which emulates a desktop
> application in a few ways and wanted some feedback.
>
> http://storage.codebot.org
>
> login: tester
> password: funkytown
>
> The tool is a private cloud file server application. People will be
> able to get the source and configure it on their web server so that
> they can backup/share/transfer files to themselves or among friend.
> The admin account can manage users, their rights, and storage limits.
>
> What I've tried to do with this app is emulate a desktop application a
> bit, which might be similar to a desktop app written with Lazarus.
>
> Features:
>
> You can drag and drop files or click to browse for uploads. Large
> uploads can be resumed if you close the page before the upload
> completes. Uploads can be paused and resumed.
>
> The selection in file list can be navigated with up down and page up
> down arrow keys. Shift multi selects both with the mouse and keyboard.
> Control can toggle select on individual items.
>
> Some files including video and audio can be viewed. It has code for
> http stream allowing seeking to positions in large video files without
> the need to download. Multi select can be used to create play lists.
> If you select a group of songs, then open the song and play it will
> continue playing the next song when the current song is done.
>
> Enter selects items/ Function keys F2 renames inline, F3 search
> filters, F4 gives the option to turn sharing on/off (works with
> multiselect). File columns can be sorted.
>
> The front end code was written using my own typescript library.
>
> Any feedback would be appreciated.
>
>
Nice interface.

Some points:

Wrong password doesn't gives an error, simple ignores it no "Invalid
user or password".

Downloading videos is not posible. When I tried to reproduce it I got an
error "No compatible video mime format", Maybe my browser fault, but
couldn't dowload it either.

I suppose this is realtaed to freepascal some way. Isn't it?


-- 
Saludos

Santiago A.

-- 
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] SQLdb_Tutorial3 error

2018-03-13 Thread Santiago A. via Lazarus
El 13/03/2018 a las 11:30, Rik van Kekem via Lazarus escribió:
> Op 13-03-2018 10:43 schreef Santiago A. via Lazarus:
>> My point is if I'm missing some package, or the dll should be in other
>> path, or a hint how to dig and debug deeper, beacuse I can't debug into
>> open.
> No, the SQLite3.dll and your DB should be sufficient.
>
> Could you include your .ini file and your SQLite db?
>
> Normally the firebird employee database is in
> C:\Program Files\Firebird\Firebird_2_5\examples\empbuild\EMPLOYEE.FDB
> (which you can copy to another location so you can access it)
>
> But for SQLite you'll need to create your own DB with the correct
> table and content.
>
> Rik

Thanks. Finally it works. I created the table employee and set the full
path of the file.

Nevertheless, it looks that sqlite3 is a little... well... sending
SIGSEGV is not a valid error, "cant' find file", "table doesn't exits"
etc would be much better.

I would like to dig a little and try to improve error detection. Is
there any way I can debug into open?. I've tried compiling Lazarus IDE
with debug, but skips over "open" call. What should I compile in debug
mode to parse FQuery.open?


-- 
Saludos

Santiago A.

-- 
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] SQLdb_Tutorial3 error

2018-03-10 Thread Santiago A. via Lazarus
El 09/03/2018 a las 10:41, Santiago A. via Lazarus escribió:
> El 08/03/2018 a las 20:42, leledumbo via Lazarus escribió:
>>> Any hint?
>> Code please. Zipped project directory (use Publish Project feature) is OK if
>> single file example is not possible.
> I will zip it, but sure you have it. The code is one of the examples
> installed with the standard lazarus 1.8.0
>
> In windows: \examples\database\sqldbtutorial3\
>
> Error in mainform.pas line 221, using sqlite connector

Any suggestion of what could be wrong? Where to look?
Any hint?
-- 

Saludos

Santiago A.

-- 
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


[Lazarus] SIGSEGV executing SqlDb

2018-01-10 Thread Santiago A. via Lazarus
Hello:

--
 TestDb.Open;
 sqlScript1.Execute; // ==> SIGSEGV
--
It uses SQLlite3 connector. No matter what are the contents of the
script I get "External: SIGSEGV" and jumps to debug assembler with a lot
of ??. I can't enter step by step into function, or check anything.,
I only get SIGSEGV.
The SQL3lite.dll is in the executable directory and in the lazarus.exe
directory.
I have installed the package "sqlite3laz" v 0.4.
I have changed the SqlScript by an SQLQuery, the same error

I have attached the form. This is the first time I try to work with
SQldb and probably I'm doing something stupid or missing something
evident, but I can't see what. Nevertheless SIGSEGV is not very
informative. Any hint?

Lazarus V.1.8.0
FPC 3.0.4
SVN: 56594
i386-win32/win64
Runing on windows 7



-- 
Saludos

Santiago A.

object Form1: TForm1
  Left = 256
  Height = 322
  Top = 128
  Width = 558
  Caption = 'Form1'
  ClientHeight = 322
  ClientWidth = 558
  LCLVersion = '1.8.0.6'
  object Button1: TButton
Left = 129
Height = 25
Top = 181
Width = 75
Caption = 'Button1'
OnClick = Button1Click
TabOrder = 0
  end
  object CabdiariTb: TDbf
FilePath = 'G:\OBJECT\001\'
IndexDefs = <>
ReadOnly = True
TableName = 'CABDIARI.DBF'
TableLevel = 4
FilterOptions = []
left = 22
top = 17
  end
  object LinDiariTb: TDbf
FilePath = 'G:\OBJECT\001\'
IndexDefs = <>
ReadOnly = True
TableName = 'LINDIARI.DBF'
TableLevel = 4
FilterOptions = []
left = 96
top = 17
object LinDiariTbF_ANNOASI: TStringField
  FieldKind = fkData
  FieldName = 'F_ANNOASI'
  Index = 0
  LookupCache = False
  ProviderFlags = [pfInUpdate, pfInWhere]
  ReadOnly = False
  Required = False
  Size = 4
end
object LinDiariTbF_NUMASI: TStringField
  FieldKind = fkData
  FieldName = 'F_NUMASI'
  Index = 1
  LookupCache = False
  ProviderFlags = [pfInUpdate, pfInWhere]
  ReadOnly = False
  Required = False
  Size = 6
end
object LinDiariTbF_FECHASI: TDateField
  FieldKind = fkData
  FieldName = 'F_FECHASI'
  Index = 2
  LookupCache = False
  ProviderFlags = [pfInUpdate, pfInWhere]
  ReadOnly = False
  Required = False
end
object LinDiariTbF_NUMDOC: TStringField
  FieldKind = fkData
  FieldName = 'F_NUMDOC'
  Index = 3
  LookupCache = False
  ProviderFlags = [pfInUpdate, pfInWhere]
  ReadOnly = False
  Required = False
  Size = 12
end
object LinDiariTbF_FECHDOC: TDateField
  FieldKind = fkData
  FieldName = 'F_FECHDOC'
  Index = 4
  LookupCache = False
  ProviderFlags = [pfInUpdate, pfInWhere]
  ReadOnly = False
  Required = False
end
object LinDiariTbF_CUENTA: TStringField
  FieldKind = fkData
  FieldName = 'F_CUENTA'
  Index = 5
  LookupCache = False
  ProviderFlags = [pfInUpdate, pfInWhere]
  ReadOnly = False
  Required = False
  Size = 10
end
object LinDiariTbF_IMPORTE: TFloatField
  FieldKind = fkData
  FieldName = 'F_IMPORTE'
  Index = 6
  LookupCache = False
  ProviderFlags = [pfInUpdate, pfInWhere]
  ReadOnly = False
  Required = False
  MaxValue = 0
  MinValue = 0
  Precision = 2
end
object LinDiariTbF_DH: TStringField
  FieldKind = fkData
  FieldName = 'F_DH'
  Index = 7
  LookupCache = False
  ProviderFlags = [pfInUpdate, pfInWhere]
  ReadOnly = False
  Required = False
  Size = 1
end
object LinDiariTbF_OBSERLIN: TStringField
  FieldKind = fkData
  FieldName = 'F_OBSERLIN'
  Index = 8
  LookupCache = False
  ProviderFlags = [pfInUpdate, pfInWhere]
  ReadOnly = False
  Required = False
  Size = 50
end
object LinDiariTbF_CONCILIA: TBooleanField
  FieldKind = fkData
  FieldName = 'F_CONCILIA'
  Index = 9
  LookupCache = False
  ProviderFlags = [pfInUpdate, pfInWhere]
  ReadOnly = False
  Required = False
  DisplayValues = 'True;False'
end
object LinDiariTbF_LIBROIVA: TStringField
  FieldKind = fkData
  FieldName = 'F_LIBROIVA'
  Index = 10
  LookupCache = False
  ProviderFlags = [pfInUpdate, pfInWhere]
  ReadOnly = False
  Required = False
  Size = 1
end
object LinDiariTbF_TIPOCOD: TStringField
  FieldKind = fkData
  FieldName = 'F_TIPOCOD'
  Index = 11
  LookupCache = False
  ProviderFlags = [pfInUpdate, pfInWhere]
  ReadOnly = False
  Required = False
  Size = 1
end
object LinDiariTbF_CODPERSO: TStringField
  FieldKind = fkData
  FieldName = 'F_CODPERSO'
  Index = 12
  LookupCache = False
  ProviderFlags = [pfInUpdate, pfInWhere]
  ReadOnly = False
  Required = False
  Size = 6
end
object LinDiariTbF_NUMIVA: TStringField
  FieldKind = fkData
  

Re: [Lazarus] Who is using Object Pascal in production?

2017-12-05 Thread Santiago A. via Lazarus
El 29/10/2017 a las 11:23, Samuel Herzog via Lazarus escribió:
>
>
> A) a way to give a whole project from one developer to another
> developer. (no fiddeling around with missing
> packages/components/paths/environment-path).
>     e.g. a Menu-Option "Export-Project" which creates a bundle with
> all necessary files)
> B) Examples that work out of the box. ( when I choose examples in
> Lazarus, half of them do not work).
> C) Beginner Videos.
D) A debugger that can debug TStringList.text and other properties with
getter.

-- 
Saludos

Santiago A.

-- 
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] How to make debugging ignore exceptions?

2017-06-24 Thread Santiago A. via Lazarus
El 24/06/2017 a las 0:14, Bo Berglund via Lazarus escribió:
The problem is that the debugger always stops on the
> exceptions making the debugging impossible (they happen with 10 ms
> intervals).
When I run into a program that raises a lot of exceptions in a loop, I
think that I'm doing something wrong, I have missed some check or data
sanitation in the loop. Exceptions are for exceptional cases. I mean,
errors or unexpected cases. A case that happens each 10 ms is not an
error or an exceptional case, it's one of the usual cases, and it must
be handled by the natural flow of the program in a structured way.
Raising continuously exceptions is not only an annoyance for debugging,
but a performance problem. Exceptions may be expensive.

For example, if you are going to process a file with lines that are
integers and alphanumeric strings, and you want to sum only the
integers, instead of

sum:=0;
While not eof(f) do begin
  readln(f,Line);
  try
num:=StrToInt(Line);   
sum:=sum+num;
  except
  end 
end; 

you should use

sum:=0;
While not eof(f) do begin
  readln(f,Line);
  val(num,Line,code);
  if code=0 
 then Sum:=Sum+num;
  end;
end;

I don't know the FTcpComm component. Isn't there a way to check first if
that annoying exception is going to be raised?. Probably there are
functions like "IsReadDataReady" and "isSerWriteReady", so you can avoid
a lot of exceptions

if FTcpComm.IOHandler.IsReadDataReady() then begin
  FTcpComm.IOHandler.ReadBytes(Buf, BufLen, false);
  if (Length(Buf) > 0) and isSerWriteReady(FOmH) then
  begin
SerWrite(FComH, Buf[0], Length(Buf));
SetLength(Buf, 0);
  end;
end;

Or with several retries in loops with a sleep.

-- 
Saludos

Santiago A.

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


Re: [Lazarus] Quick Video: A Web Application

2017-04-20 Thread Santiago A. via Lazarus
El 19/04/2017 a las 17:09, Anthony Walter via Lazarus escribió:
> Thank you all for the feedback and discussion. From me, the
> implementer and designer, I can say the most difficult part of
> creating this project, and in most projects, is not the actual
> programming. It's the creation of the user interface design. Choosing
> and creating a layout, and deciding on css values. That by far took
> more time than the actual code, and I'm sure that part could be vastly
> improved.
Of course, GUIs are massive time consuming. Have you ever create a form
by hand in runtime?

That is what RAD and GUI designers were created for ;-)

I'm afraid that the world is still waiting for a good GUI designer for web.

-- 
Saludos

Santiago A.
s...@ciberpiula.net

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