[Lazarus] Micro Focus buys Borland Software
Hi: Micro Focus buys Borland Software for $75 million http://www.infoworld.com/t/mergers-and-acquisitions/micro-focus-buys-borland-software-75-million-484 Embarcadero, Micro Focus...broken in pieces and sold. What a sad end for a company that once had a great and revolutionary product. Santiago A. s...@ciberpiula.net ___ Lazarus mailing list Lazarus@lazarus.freepascal.org http://www.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] read text file in lazarus
Hello: I have made my two cents benchmark. Two small programs (just FPC file, without Lazarus). one with LoadFromFile and one with readln(file,-..). For small files, the LoadFromFile is faster. For big files, readln way is faster (in my system, for over 150K files, old-fashioned becomes faster). The bigger the file is, the better readln way is. I must admit that I was a little puzzled, I thought that readln way would always be faster because I thought: They do the same, read a file, but the Tstringlist must do more work to handle the class and allocate memory. But they don't do the same, LoadFromFile loads the file from disk in big blocks, the bigger the systems allows. On the other hand, readln, reads only until it finds an EOL (well I suppose the operating system reads a minimum size of block and caches a little), so it send many I/o/ commands, one per line. In the old days I used to do a similar trick using blockread. I suppose that when the file is bigger, the overhead of allocating and deallocating memory is bigger. So the conclusion: For many cases, loadFromFile is faster. Even when it's not faster it may be better because it makes many tasks easier. My complain was that when Dians asked about how to read a text file, the right answer should had been showing both ways. In fact, I pushed the benchmark to the limit with 1Gb file. readln program processed the file, but TStringList popped an out of memory. But that was not the big problem, the problem was that with TStringlist, for a minute, the system turned almost irresponsive, while, with readln, I didn't notice anything. Having things in memory is a good idea many times, particularly if you must read data several times you waste a lot of time reading from disk, but we also must be aware that memory is a valuable resource. When we use memory we are punishing the rest of processes running in our system. I know I am not showing a secret, but I am afraid we are forgetting it,... we don't balance pros and cons anymore, we just grab the memory. Very true! Just curious, how do you know how much memory an application uses? Preferably a Linux and Windows method. Does the 'heaptrc' unit do that? eg: TStringList vs Old Fashioned TextFile Both CLI test programs loaded the same sample text file and simply does a writeln() for each line of the sample text file and then quits. The sample text file is 26.4KB in size. ___ Lazarus mailing list Lazarus@lazarus.freepascal.org http://www.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] read text file in lazarus
Hello: I am astonished. It breaks my heart, I am crying: Nobody has even mentioned the old-fashion classic Pascal way for reading a text file. Traitors. ;-) Loading a text file in a TStringList with LoadFromFile method is a good option, it is easy, it is simple and you can access to any line whenever you want. But, Why to load the whole file in memory if you only need to process the lines sequentially from the beginning to the end (particularly if it is a big file)? Procedure ReadThisFile(FileName:string); var f:TextFile; OneLine:string; begin assignFile(f,FileName); reset(f); while not eof(f) do begin readln(f,OneLine); // do whatever you want with OneLine, for example write it on the output writeln(OneLine); closefile(f); end; PD: well, at least Borland Pascal way. I think standard Pascal uses text, assign and close instead of TextFile, AssignFile and Closefile Santiago A. ___ Lazarus mailing list Lazarus@lazarus.freepascal.org http://www.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Delphi wxWidget plugin for Lazarus
Michael Van Canneyt escribió: On Tue, 31 Mar 2009, svaa wrote: Hello: By the way, Watching the demo I can see that Lazarus compiles (or complies and links) very slow compared to codegear. And it is just hello world program. I have always felt the Lazarus was a little slow, but this demo has shown it clearly. In codegear, the click run pops a progress message for an instant and displays the application running, in Lazarus he has to wait several seconds to see the form running. Do you have any clue of such a difference of performance? This is a FAQ since day 1, I think :-) Delphi works with the compiler in-memory, as a DLL. Lazarus has an external compiler, and often the compiler even calls an external linker. This is a price you pay for a cross-platform solution. It is a very good clue :-). Besides this, I suppose gdb executable is nice beast as well. It is an acceptable price. I wish designing webs and writing javascript for cross-browser solution were as cheap. You, lazarus' developers, have proved that Linux and win32 are more compatible than Firefox and IE. Santiago A. ___ Lazarus mailing list Lazarus@lazarus.freepascal.org http://www.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] About try blocks
Felipe Monteiro de Carvalho escribió: This thread would be better located at one of the Free Pascal mailling lists. What is the proper Free Pascal mailling list? where can I subscribe to post a message? Santiago A. ___ Lazarus mailing list Lazarus@lazarus.freepascal.org http://www.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] GPL'ed projects and closed-sourced tools
In Ada language forum they have had many times this discussion. The following are the constant conclusions: Dynamic linking has nothing to do with GPL. If DLLs are GPL and you use them, you must grant access to the source of DLL, not to the full project. Static linking of GPL tools require you to publish the final product as GPL, and grant access to the sources of the full project. Generics are an specific problem. In Ada language generic libraries in GNAT have a special licence GGPL, (or something like that) to allow use them in propietary projects. Well, it had a special licence, they have turned into GPL, so, due Ada uses generics for everything, that makes impossible to use GNAT for non-GPL projects. Santiago A. ___ Lazarus mailing list Lazarus@lazarus.freepascal.org http://www.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Doing work in FormActivate
Gabor Boros escribió: Hi, A simple test case: procedure TForm1.FormActivate(Sender: TObject); begin Caption:=FormatDateTime('hh:mm:ss',Now); end; With Delphi the form's caption show the first activation time and with Lazarus the caption changed when switch to other application and switch back etc.. I don't say Delphi is correct but after working many years with Delphi this thing is strange for me. I think he is right, if you switch of application in delphi, the onActivate event is not fired. Besides the first activate, the onActive event is fired when you show modal forms that are hidden, it's fired also when stayOnTop and mdiChild forms are unfocused and get the focus. But not when the switch of application (unless you bring to front a form when the application gets the focus again). The onShow only works, besides the first activate, when you hide and show a form. However, I have always found this behavior stranger or at least incomplete. I have always missed a onFirstActivate event. Most times I use onFormActivate to init some controls depending upon variables set by the caller between the create and the activate, most of this action must be done just one time, not each time it loses and gets the focus again. The problem is so usual that I have even made standard the use of a variable fFirstActivate that can be found is in many of my forms. It wouldn't be a bad idea to add onFirstActivate although it breaks delphi compatibility a little. Santiago A. ___ Lazarus mailing list Lazarus@lazarus.freepascal.org http://www.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Terminal window, workaround
Hello: I've decide to use the this work around. I write to filetext and in a terminal I use tail -f file. It lets me stop in a breakpoint from the IDE and watch in the terminal the current value with a writeln. It's not the best, but it works for what I need. May be later I will learn how to use the gdb from command line. By the way, I thought gdb was unable to display Pascal variables, but if gdb is able to display the value of any variable in Pascal, what's the problem of Lazarus's IDE in displaying the value? It uses gdb as debugger backend. doesn't it? Regards Santiago Amposta around svaa wrote: Hello: I have 0.9.26 on Ubuntu 7.10. I am writing a GUI program, since debugger has problems to check the values of variables, I want to output debug data with writeln but I can't get a terminal with if it is not console application. How can I get a to have the GUI program running and a terminal window also? Regards Santiago A. ___ Lazarus mailing list Lazarus@lazarus.freepascal.org http://www.lazarus.freepascal.org/mailman/listinfo/lazarus ___ Lazarus mailing list Lazarus@lazarus.freepascal.org http://www.lazarus.freepascal.org/mailman/listinfo/lazarus ___ Lazarus mailing list Lazarus@lazarus.freepascal.org http://www.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Terminal window, workaround
Felipe Monteiro de Carvalho escribió: The IDE shows the values. Set a breakpoint and then move the mouse over the variable names in the code. It will show you their value at that point as a tooltip. Not always. Bugs #12522 and #12111 At least in Linux. Regards Santiago A. ___ Lazarus mailing list Lazarus@lazarus.freepascal.org http://www.lazarus.freepascal.org/mailman/listinfo/lazarus
[Lazarus] Terminal window
Hello: I have 0.9.26 on Ubuntu 7.10. I am writing a GUI program, since debugger has problems to check the values of variables, I want to output debug data with writeln but I can't get a terminal with if it is not console application. How can I get a to have the GUI program running and a terminal window also? Regards Santiago A. ___ Lazarus mailing list Lazarus@lazarus.freepascal.org http://www.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] [joke] Explanation about the Lazarus logo
What's that animal? It's not a cheetah or a cat. I think it could be some kind of feline baby, perhaps a baby lynx. Damien Gerard escribió: http://cdn.ugoto.com/pictures/the_end_of_the_chase-53b.jpg Sorry I found it funny :) -- Damien Gerard [EMAIL PROTECTED] La raison de la bouffe est toujours la meilleure. ___ Lazarus mailing list Lazarus@lazarus.freepascal.org http://www.lazarus.freepascal.org/mailman/listinfo/lazarus ___ Lazarus mailing list Lazarus@lazarus.freepascal.org http://www.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Work around Ubuntu dependences 0.9.26
Hello: Raistware [EMAIL PROTECTED] ha escrito: Can you post a mini-how-to for the people without enought free time? I don't know where that stuff must be written. But I have attached a bash script to remove the dependence. I just cleaned up a little the script I used to do some try and error. I hope it helps It needs two parameters: the directory where the original debian package is, and the name of file of the new package. When the script finishes you get a warning homepage field, or something like that. Don't worry, I think that the original package added a non-standard field that is ignored. If you run it without parameters, it will display a short help. Now you can install the package you have just generated. Although I have tested it, I am not very used to write bash scripts. Nevertheless, you needn't to run it as root, so if I have made a mistake it won't hurt ;-). Regards Santiago A. svaa escribió: Hello: I have unpacked lazarus-ide_0.9.26-0_i386.deb, removed the dependence on libglib1.2ldbl, packed again and installed it with no problem. Everything seems to work fine. Regards Santiago A. Thank you! chglazpkg.sh.gz Description: GNU Zip compressed data ___ Lazarus mailing list Lazarus@lazarus.freepascal.org http://www.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Ubuntu dependences 0.9.26
Graeme Geldenhuys escribió: I'm running Ubuntu 7.10 and have no issues running the latests Lazarus - though I always use the one from the subversion repository, not a .deb release. I have the following apt packages installed, libgtk1.2, libgtk1.2-common, libgtk1.2-dev, libglib1.2, libglib1.2-dev I used Synaptic and searched for libglib1.2ldbl but don't have such a package in any of the repositories. So I have no clue what that package does or why it's needed. Regards, - Graeme - I have researched a little and I have understood this: Take it every thing with a grain of salt, I am not an expert in linux, and I don't know if I have misunderstood the versions of packages. libglib.1.2.9 was just one package for GTK widget, but after release 1.2.9, libglib got split in two packages: libgtk for visual widgets, and libglib for auxiliary-non-visual functions like hash , lists etc. It seems that ubuntu for 7.10 hasn't libglib.1.2.9 and ubuntu 8.04 has renamed libglib.1.2.9 to libglib1.2ldbl. I don't know what standard debian distro has done. So a lazarus may use libglib.1.2.9 (renamed as libglib1.2ldbl for ubuntu 8.04, but not available in 7.10) xor libgtk.=1.2.10 and libglib =1.2.10 Does lazarus really need the old lib (I think from 2001)? if it doesn't, the old package libglib1.2ldbl could be removed from dependences. If lazarus needs old packages as well (to link with gtk1?) then the package should to implement the xor function. (can deb packages do such thing?) or have two lazarus deb version. Ones again, I'm not very sure about versions or what lazarus could need the old libs for. Reagards Santiago A. ___ Lazarus mailing list Lazarus@lazarus.freepascal.org http://www.lazarus.freepascal.org/mailman/listinfo/lazarus
[Lazarus] disabled vs readonly TDatetimeEd
Hi: (Just a little off topic about TDatetimeEd) After deep thoughts about how I use readonly and enabled;-) I have Concluded this: enabled:=false Invisible readonly:=true Label Enabled When I set a control to enabled:=false, it's because i think the user shouldn't see or care about that control. A common use is speedbuttons . Some times depending upon some selection, some controls have no sense, i.e.some checks or radio buttons disable other controls. For all purposes those controls could be invisible. Why do I disable them instead of setting visible:=false? Most times because there would be a lot of ugly blank spaces (or in autoaligns would move other controls, confusing the user), some times because I'm waiting some data before letting the user fill the disabled controls, and it's not bad to let user see whats going on. Readonly I could say that most times I should use a label but I am too lazy. I have made a form to input data, and I want to reuse the same form to display the data. Some times there are controls that I want dynamically set to readonly, contrary to disable the controls, the information shown is relevant for the user, but I don't want him to change it. The only difference with a label is that it looks like a control, so the user knows that in some circumstances he could change the data. That is what I want to do, but things are not always that easy and clear . When there are controls readonly and not readonly in a form, they look the same so it's confusing for the user. To prevent this, sometimes I change the background to the form's backgound, others I replace it dynamically with label, other times I don't set it readonly but when the user tries to change it I pop message saying why he can't change it. I have seen (but I don't like) chekbuttons disabled, because they must be checked or unchecked compulsorily. I think it is not a good idea, if it is disabled the user could skip it as irrelevant. Of course, it would be handy a way to show clearly that it is not editable. Unfortunately, most GUI lack of such concept, so we would have to come out with something new, that is seldom a good idea when talking about interfaces. If it is not a very clear metaphor instead of helping the user we will confuse him. Just my 0.10 cents. Santiago A. ___ Lazarus mailing list Lazarus@lazarus.freepascal.org http://www.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Opinions required on what the ReadOnly property should do for LCL controls.
Hello: For me there is no doubt. When I set a control as readonly, I expect that the user won't be able to change it at all. In fact, years ago I hacked rxlib to avoid pop a list when they where readonly. Particulary if they are attached to a database, it's confusing for the user to change it clicking the button but updating nothing. The downside is that they won't be able to show the calendar, but I think it is better than confusing user. If the popped calendar could show clearly that is not changeable, it would be the best, but a low priority enhacement. By the way, when I say TDateTimeEdit, I mean any control with a combo etc. Anyhow, if you want people see that a control is not usable, it is better to assign enable:=false. The pity of disabled controls it that they are not easily readable. Sometimes I think that there should be three colors to inform the user of the state of the control: enabled, disabled and readonly. Long time ago I played with the idea of changing the Dataware controls to have a yellow background when they where not editable (because they were readonly or because the TDatasource was not autoedit or because the underlaying table was readonly.) Just my 0.25 cents. Reagards Santiago A. There's a discussion going on about TDateTimeEdit.ReadOnly in Mantis report 10861. It's not a technical discussion, it's more about what ReadOnly should and shouldn't do. See. http://bugs.freepascal.org/view.php?id=10861 The list is probably a better place to discuss this, so please read the report and give your opinion here. Regards, Gerard. ___ Lazarus mailing list Lazarus@lazarus.freepascal.org http://www.lazarus.freepascal.org/mailman/listinfo/lazarus ___ Lazarus mailing list Lazarus@lazarus.freepascal.org http://www.lazarus.freepascal.org/mailman/listinfo/lazarus