Re: [fpc-pascal] Underscores in numerical literals - grouping
Now we're getting into the field of personal preferences, and EVERYONE and their neighbor on the internet is going to defend their personal preferences like a rabid dog over a piece of meat. Looking at a screen all day long, comfortably, is ultimately up to the person sitting in the chair at that computer. For email, variable width fonts are alright (Although I've now changed that in gmail so I read email in a fixed-font family). For code, fixed font, terminal/consolas/system fonts for me, end of story, and if the IDE doesn't support it, I remove the IDE and look at something else. Taking another font that is variable width, and pretends to be monospace still irritates me, and is a distraction. The goal of the developer is to setup the IDE so that they are comfortable using it for long periods of time, and use the system effectively. All these 'toys' that people write are fine, but, claiming that fixed font is of ancient ways, although true, has exactly zero bearing on the effectiveness of the development process. You're not going to write a better function because you're not using Arial. This whole discussion is going towards discussing the "standards" of some web forum software forcing their tables to be a max of 1024 pixels wide, leaving a whack of white space, for the purpose of "readability". I'm a very strong opponent to it. I hate it. On my 2560x1440 screen, no text scaling, those sites look absolutely ridiculous when my browser is full screen. I have browser plugins that change the formatting on the tables/divs/CSS that change those sites around so I can view the way I want to, not the way they THINK is best for me. On Tue, Nov 22, 2016 at 5:05 AM, Graeme Geldenhuys < mailingli...@geldenhuys.co.uk> wrote: > I'm fully aware than the idea of using proportional fonts for coding or > most text editor work sounds alien - simply because that is how it was > done for decades. But times have changed, some editors have advanced, > some editors have implemented more intelligent ways of working with text > and fonts - opening up more possibilities to use better looking fonts. > Eclipse and IntelliJ IDEA (surprisingly both implemented in Java - > coincidence or not) has raised the bar considerably when it comes to > intelligent text (source code) management. Both Eclipse and MS Visual > Studio support Elastic Tabstop plugins too. > > ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Underscores in numerical literals - grouping
heh.. Not really, as GMail uses variable width fonts by default. ;) Imma gunna feex dat. On Mon, Nov 21, 2016 at 11:05 AM, Jürgen Hestermann < juergen.hesterm...@gmx.de> wrote: - > function FileCompareName (Datei1,Datei2 : PFileTyp) : SizeInt; > function FileCompareDate (Datei1,Datei2 : PFileTyp) : SizeInt; > function FileCompareSize (Datei1,Datei2 : PFileTyp) : SizeInt; > - > > much more than a non-aligned: > > - > function FileCompareName (Datei1,Datei2 : PFileTyp) : SizeInt; > function FileCompareDate (Datei1,Datei2 : PFileTyp) : SizeInt; > function FileCompareSize (Datei1,Datei2 : PFileTyp) : SizeInt; > - > ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Underscores in numerical literals - grouping
I like the concept, but, if I'm using a constant that goes beyond the millions, I'd add a comment to what the number is in US format, and tag on what exactly it means, or make the variable name itself mean something. Because reading const maxLongint = $7fff; or const maxLongint = 2147483647; is a bit of a pain, I agree. That said, underscores aren't what I'd use. I love the idea of the IDE (ANY IDE, not just Pascal based) doing some kind of code highlight for large numbers. Something simple, like underlining every other group of 3 in large numbers, or every other hex pair, or every 8 binary set. As for the mono-spaced, no, not ridiculous. If memory serves me correct, I believe you're as old-school as I am when it comes to code (My teeth cut on Vic-20), but I've always preferred mono-spaced fonts in my IDE versus variable width, JUST on the primary basis of legibility of the code itself, ignoring the 'gravy' of lining up text within the code. I always terminal/system/consolas, even in Notepad/PSPad. I barely tolerate variable width font in GMail as I can't change the font easily (But you've sparked an idea >:] ). Figuring out if I'm using a capital I versus a lower l versus a | is quite annoying (Capital EYE versus lower ELL versus pipe). Most of the apps I write (for myself) are list based, or require special formatting are typically fixed width as aligning text is much easier, and I don't have to code special considerations for W and 1 width differences. Forget about the form UI, but even lining up variable declarations and definitions, procedure, function declarations within classes, much easier with fixed width. On Mon, Nov 21, 2016 at 9:46 AM, Graeme Geldenhuys < mailingli...@geldenhuys.co.uk> wrote: > I don't know about you, but I like this idea implemented in Java 7 and > later. > > http://jasdhir.blogspot.co.uk/2016/11/using-underscores-in-literals.html > > > I always find it hard to read long numeric literals. > > > Alternatively, without needing compiler changes, the IDE's and > programmer editors should become more clever in how they display source > code (think Elastic Tabstops), and automatically display numeric > literals with slight increase in [render] spacing between certain number > groups. Binary literals could be grouped every eight digits, whereas Hex > could be grouped every 4 and Decimals every 3 digits. The age old rule > of programmer source code always being in a mono-spaced font is > ridiculous for this day and age. > > Regards, > Graeme > > ___ > fpc-pascal maillist - fpc-pascal@lists.freepascal.org > http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal > ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] what is the possible cause of EPrivilege Privileged instruction ?
If you can, change the app so that it'll also output what parameters and calls are being passed in as well. Drop in a debug statement or two on entrance and exit to any and all functions within the thread. Then keep an eye on the logs. Check this thread on Stack Overflow; http://stackoverflow.com/questions/89607/what-is-a-privileged-instruction On Wed, Oct 26, 2016 at 11:57 AM, Dennis wrote: > I have a multi threaded program which executes a list of tasks in real > time. > It is difficult to debug with a debugger on this program (since debugging > will pause the execution which will be messy for this application). > > So, I log the exceptions to a log file and I found this exception: > EPrivilegePrivileged instruction > > What could possibly raise this exception? > > My program is win 32 from Lazarus 1.7 FPC 3.1.1 > and running on Win 7 64 bit. > > thanks in advance. > > Dennis > ___ > fpc-pascal maillist - fpc-pascal@lists.freepascal.org > http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal > ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Free Delphi 10.1 Berlin Starter Edition
Other than that one option page being blank, the app runs and installs fine under a brand new VM of Win7 Pro without SP1. Going to check to see if applying SP1 fixes that one option form though. On Wed, Aug 24, 2016 at 8:25 AM, Felipe Monteiro de Carvalho < felipemonteiro.carva...@gmail.com> wrote: > On Wed, Aug 24, 2016 at 2:12 PM, Ralf Quint wrote: > > Negative. I downloaded and installed it just fine on Windows 8.1/64... > > Anyone knows if Windows 7 would also work? > > -- > Felipe Monteiro de Carvalho > ___ > fpc-pascal maillist - fpc-pascal@lists.freepascal.org > http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal > ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Free Delphi 10.1 Berlin Starter Edition
FULLY understanding that this forum is for FPC and not Delphi/Embarcadero, has anyone installed Berlin, gone into Tools> Options> Environment Options> Form Designer and see NO OPTIONS show up? Stuff like the grid size, the toggling the Embeded Designer, etc should be here but I get no options. That particular form option screen is completely blank, and I'm not sure why. ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Free Delphi 10.1 Berlin Starter Edition
Nice. Thanks. Pretty much gave up on Delphi due to costs. For a single developer who doesn't make money off his programs, this'll be nice. Side note: So, as *none* of you know, I recently moved from "Tech Support" to another position within the company I work for. I look at what Berlin offers, one of their pics on a cell phone is "Tech Support Meeting". Sent a shiver down my spine. On Tue, Aug 23, 2016 at 8:23 AM, Marcos Douglas wrote: > > On Tue, Aug 23, 2016 at 6:43 AM, Maciej Izak wrote: > >> Hi, >> >> finally we have simple way to test new syntax to improve FPC quality / >> $MODE DELPHI without spending $ on Delphi :) >> >> Probably limited time offer: >> >> https://www.embarcadero.com/products/delphi/starter/promotional-download >> > > Thank you! I didn't know that. > > Best regards, > Marcos Douglas > > ___ > fpc-pascal maillist - fpc-pascal@lists.freepascal.org > http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal > ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Single threaded application on multicore CPU
Everything has a cost. But swapping CPU threads isn't as costly as a fried CPU. Keeping the CPU cool at all costs is better than having a hotspot on the die which COULD damage the heat sink. The computing cost of swapping CPUs is probably close to zero. Your CPU only has so much on-die memory that it has to push things out CONSTANTLY to on board RAM, so there may be a time when your CPU (Not the Operating System) has zero knowledge of your application. When your OS takes the information back to the CPU, the OS will look at the particularities of CPU (Heat, load, in use, etc) and specify which CPU will get the task. On Wed, Jun 22, 2016 at 4:19 AM, LacaK wrote: > Thanks. It gives sense to me. > But moving thread from one core to another has any nonzero cost, does not ? > (So I wonder that CPU does that also when time for thread completion is > not so much big ... so temperature of CPU does not increase so much) > > -Laco. > > > ___ > fpc-pascal maillist - fpc-pascal@lists.freepascal.org > http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal > ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Sqldb - How to pass an array of values as a param to be used with SQL IN operator?
The problem with that Tony is that the the bind might make :myparam a string, so you'll be doing a 1-integer to 1-string comparison, which won't give you any results. Essentially you'll be asking for a list of results whos field is equal to "1,2,3,4", not a list of results in which the field in question contains the numbers 1, or 2, or 3, or 4. At OP Due to the nature of the bind mechanism, you won't be able to do it this way. The only way you'll be able to do that is with your program doing string substitution instead of doing the bind. Since you're dealing with integers only, you'll just need to make sure that every entry you're substituting for is actually an integer. On Sun, Apr 10, 2016 at 10:01 AM, Tony Caduto wrote: > Did you try putting quotes around the param ID in the sql query? > in(":myparam") > I am guessing it's the commas that are the problem. > > Sqlite will accept double qoutes as will MySQL postgres will not though. > On Apr 10, 2016 7:40 AM, "leledumbo" wrote: > >> > But until now i havent figured a way to pass an array of values (mostly >> integers) to be used with IN operators. >> >> That, unfortunately, is not possible. It's a DBMS limitation, >> parameterized >> values are actually passed as is to DBMS. So there's nothing you can do >> unless you can convince DBMS maintainer to implement it. >> >> > Is there a way to accomplish this? >> >> No other way than direct formatting for now. >> >> >> >> >> -- >> View this message in context: >> http://free-pascal-general.1045716.n5.nabble.com/Sqldb-How-to-pass-an-array-of-values-as-a-param-to-be-used-with-SQL-IN-operator-tp5724873p5724874.html >> Sent from the Free Pascal - General mailing list archive at Nabble.com. >> ___ >> fpc-pascal maillist - fpc-pascal@lists.freepascal.org >> http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal >> > > ___ > fpc-pascal maillist - fpc-pascal@lists.freepascal.org > http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal > ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] EDatabaseError on SELECT
Nevermind... Ninja'd. On Wed, Feb 10, 2016 at 10:36 AM, Stephen Chrzanowski wrote: > Did you output the iSQL string to a console or a text file or even a > message box to verify that what you're passing in is actually what you > expect? > > If the engine is coming back with a problem "Near Select" then there is > something wrong either before the string, or after Select. GetTableName > may be returning something the query isn't expecting. > > On Wed, Feb 10, 2016 at 10:00 AM, Felipe Monteiro de Carvalho < > felipemonteiro.carva...@gmail.com> wrote: > >> Result in sqlite3 console: >> >> sqlite> SELECT * FROM "Header_0" WHERE ID=0; >> 0|0|0|0|18| >> >> -- >> Felipe Monteiro de Carvalho >> ___ >> fpc-pascal maillist - fpc-pascal@lists.freepascal.org >> http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal >> > > ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] EDatabaseError on SELECT
Did you output the iSQL string to a console or a text file or even a message box to verify that what you're passing in is actually what you expect? If the engine is coming back with a problem "Near Select" then there is something wrong either before the string, or after Select. GetTableName may be returning something the query isn't expecting. On Wed, Feb 10, 2016 at 10:00 AM, Felipe Monteiro de Carvalho < felipemonteiro.carva...@gmail.com> wrote: > Result in sqlite3 console: > > sqlite> SELECT * FROM "Header_0" WHERE ID=0; > 0|0|0|0|18| > > -- > Felipe Monteiro de Carvalho > ___ > fpc-pascal maillist - fpc-pascal@lists.freepascal.org > http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal > ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] New feature: IfThen() intrinsic
Mostly code readability, but, I've been writing my own functions to do that kind of thing for years. Same with the BETWEEN function. On Mon, Feb 1, 2016 at 1:03 AM, Ralf Quint wrote: > On 1/31/2016 7:14 AM, Vojtěch Čihák wrote: > >> >> Hi, >> >> what is difference in produced assembler between ifthen(); and classic if >> - then - else? >> >> >> +1 > > I don't really see how this is different from properly writing if ... > then ... else... either... :-\ > > Ralf > > --- > This email has been checked for viruses by Avast antivirus software. > https://www.avast.com/antivirus > > > ___ > fpc-pascal maillist - fpc-pascal@lists.freepascal.org > http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal > ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Documentation example error
I looked at the example, and it isn't compilable by my eye ball, however, the idea I think is to replace that not found class def'n with something you already know about. You could possibly just replace it with a tedit or tlistbox or something. On Mon, Jan 25, 2016 at 11:32 AM, Michael Van Canneyt < mich...@freepascal.org> wrote: > > > On Mon, 25 Jan 2016, Graeme Geldenhuys wrote: > > Hi, >> >> I was always under the impression that the examples included in the FPC >> documentation should be compilable examples. >> >> Looking at the following example code included with the GenEnumName() >> documentation, it will not compile because TMyTestObject is undefined. >> >> http://www.freepascal.org/docs-html/rtl/typinfo/getenumname.html >> >> >> If my assumption about compilable examples are correct, I'll be happy to >> supply a patch to fix it. >> > > They should definitely be compilable. > > I do not check this regularly, though :/ > > > Michael. > > ___ > fpc-pascal maillist - fpc-pascal@lists.freepascal.org > http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal > ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal