Jump to content

Leaderboard


Popular Content

Showing content with the highest reputation on 02/03/23 in all areas

  1. I had to try it, @Attila Kovacs Lars Fosdal: write a poem about clouds in old norse My bad for imprecise instructions as it wrote a poem about "clouds in old norse" rather than about "clouds" in old norse. Lars Fosdal: på gammelnorsk So I asked it to translate it to old norse - and albeit I am not 100% fluent, it is mostly understandable and looks credible. I fed finally fed that to Google Translate, which identified it as Icelandic - and that language is indeed closely related to Old Norse. Not perfect, but not half bad either. It can be a fantastic tool, that can create even more fantastic bullshit unless you are careful with your parameters and your proof reading.
  2. I did end up using JSON - simply because it's easier to parse I have made a start on this - https://github.com/VSoftTechnologies/DPackGen Example definition file. It's modelled on how I did the package spec files for my packag manager project (which I really need to get back to!) - so I was able to copy/pasta a lot of the code or at least borrow the design of the definition parsing and package generation. Supporting XE2-11.x I uses templates, you can define more than one if a compiler version needs different settings. I might also look at allowing templates to inherit from another template, so if a template only needs to change a few settings it can be a bit less verbose. Note that you don't have to use the template, you can define all the settings on the targetPlatform - just remove the template property and fill in the rest of the props like in the template - but using templates reduces verbosity. { definitionSchemaVersion: 0, name : "VSoft.MessagingR", packagesFolder: ".\\packages", projectGUID: "{8FF7EA44-009F-4370-BDA2-3C30D26F6FC9}", frameworkType : "VCL", packageType : "Runtime", targetPlatforms : [ { compiler : "XE2", platforms : "Win32, Win64", template : "default" }, { compiler : "XE3", platforms : "Win32, Win64", template : "default" }, { compiler : "XE4", platforms : "Win32, Win64", template : "default" }, { compiler : "XE5", platforms : "Win32, Win64", template : "default" }, { compiler : "XE6", platforms : "Win32, Win64", template : "default" }, { compiler : "XE7", platforms : "Win32, Win64", template : "default" }, { compiler : "XE8", platforms : "Win32, Win64", template : "default" }, { compiler : "D10.0", platforms : "Win32, Win64", template : "default" }, { compiler : "D10.1", platforms : "Win32, Win64", template : "default" }, { compiler : "D10.2", platforms : "Win32, Win64", template : "default" }, { compiler : "D10.3", platforms : "Win32, Win64", template : "default" }, { compiler : "D10.4", platforms : "Win32, Win64", template : "default" }, { compiler : "D11", platforms : "Win32, Win64", template : "default", libSuffix : "%compilerVersion%" } ], templates : [ { name : "default", libSuffix : "%compilerVersion%", folderNameTemplate: "Rad Studio %Compiler% %CompilerCodeName%", descriptionTemplate: "VSoft.Messaging Runtime for Delphi %Compiler%", files : [ ".\\src\\VSoft.Messaging.pas", ".\\src\\VSoft.Messaging.Internal.pas", ".\\src\\VSoft.Messaging.Dispatchers.pas", ".\\src\\VSoft.Messaging.Channel.pas" ], requires : [ "rtl" ], dpkOptions: [ "{$R *.res}", "{$IFDEF IMPLICITBUILDING This IFDEF should not be used by users}", "{$ALIGN 8}", "{$ASSERTIONS ON}", "{$BOOLEVAL OFF}", "{$DEBUGINFO ON}", "{$EXTENDEDSYNTAX ON}", "{$IMPORTEDDATA ON}", "{$IOCHECKS ON}", "{$LOCALSYMBOLS ON}", "{$LONGSTRINGS ON}", "{$OPENSTRINGS ON}", "{$OPTIMIZATION OFF}", "{$OVERFLOWCHECKS OFF}", "{$RANGECHECKS OFF}", "{$REFERENCEINFO ON}", "{$SAFEDIVIDE OFF}", "{$STACKFRAMES ON}", "{$TYPEDADDRESS OFF}", "{$VARSTRINGCHECKS ON}", "{$WRITEABLECONST OFF}", "{$MINENUMSIZE 1}", "{$IMAGEBASE $400000}", "{$DEFINE DEBUG}", "{$ENDIF IMPLICITBUILDING}", "{$DESCRIPTION '%description%'}", "{$LIBSUFFIX '%LIBSUFFIX%'}", "{$RUNONLY}", "{$IMPLICITBUILD OFF}" ] } ] } I used my package manager to install the dependencies (JsonDataObjects, Spring4D.Base & VSoft.CommandLineParser) so if you want to build it you would need to grab those projects from github/bitbucket and update the search paths. DPK generation mostly works - need to figure out how to deal with forms/frames. DPROJ generation is a work in progress - not there yet - the dproj format is not trivial to generate due to config inheritance etc. Hopefully I will find some time over the weekend to work on it and get it to a usable state. I need to flesh out the properties for the TargetPlatform/Template for things like search paths, namespace prefixes, output paths etc. BTW I have not made any provisions for generating CBuilder packages - I guess that can come later if someone wants to work on it - I don't have a need for it so not likely to do it myself.
  3. TheOnlyOne

    Need a "Delphi programming guideline"

    I mean, this colleague as a person if not a bad guy. He fell behind with his Delphi skills it is true, but on the other hand our boss allocated in the last hour only 2 hours for discussions and refactoring. What's the point is knowing Delphi if you are not allowed to use it. Any decent project owner would know that any code needs refactoring and payment for technical debt. If the owner does not know, he should at least hire a project leader. We don't have this role. They call it that we "have a flat management organigram". Anyway, even if the work was easy in this company, I decided to move away from it.
  4. That is great, because YAML - Yikes Awful Markup Language
  5. Fr0sT.Brutal

    A book about Object Pascal Style Guide

    You can create a visual presentation - show support complexity (and thus productivity, possibility of errors, etc) with old code and shorter new one, list bugs that could've been avoided with new arch, benchmarks that show speedup if speed is of value... IOW, try to sell your boss an upgrade 🙂 Coders are weak sellers usually but it's the only way
  6. Stefan Glienke

    IsValidDate fails after the Year 9999

    Planet of the Firemonkeys?
  7. angusj

    SVG buttons in VCL or FMX

    https://github.com/EtheaDev/SVGIconImageList
  8. Maybe a little offtopic, but ...
  9. Actually it's probably not that much work to create a package generator - the hardest part will be creating the definition schema. Something like this (YAML) schemaVersion: 0.1 package: name: VSoft.MessagingR compilerVersions: XE2-11 libSuffix: %compilerVersion% packagesFolder: .\packages folder-template: Rad Studio %ProductVersion% %CodeName% platforms : Win32, Win64 files: - .\src\VSoft.Messaging.pas - .\src\VSoft.Messaging.Internal.pas - .\src\VSoft.Messaging.Dispatchers.pas - .\src\VSoft.Messaging.Channel.pas requires: - rtl compilerOptions : | {$R *.res} {$IFDEF IMPLICITBUILDING This IFDEF should not be used by users} {$ALIGN 8} {$ASSERTIONS ON} {$BOOLEVAL OFF} {$DEBUGINFO ON} {$EXTENDEDSYNTAX ON} {$IMPORTEDDATA ON} {$IOCHECKS ON} {$LOCALSYMBOLS ON} {$LONGSTRINGS ON} {$OPENSTRINGS ON} {$OPTIMIZATION OFF} {$OVERFLOWCHECKS OFF} {$RANGECHECKS OFF} {$REFERENCEINFO ON} {$SAFEDIVIDE OFF} {$STACKFRAMES ON} {$TYPEDADDRESS OFF} {$VARSTRINGCHECKS ON} {$WRITEABLECONST OFF} {$MINENUMSIZE 1} {$IMAGEBASE $400000} {$DEFINE DEBUG} {$ENDIF IMPLICITBUILDING} {$DESCRIPTION 'VSoft.Messaging Runtime for %ProductVersion%'} {$LIBSUFFIX '%LIBSUFFIX%'} {$RUNONLY} {$IMPLICITBUILD OFF} The idea being there would be a bunch of built in variables like CompilerVersion, ProductVersion etc that can be sprinkled in the template and then replaced when the dproj/dpk files are generated. Obviously there is more to add to the above, like output folders, configs etc.. but it should be pretty simple to build on it. I'll make a start and chuck it up on github, open to suggestions on the definition schema. I'll probably use https://github.com/neslib/Neslib.Yaml for the yaml parser (haven't tried it yet though).
  10. https://markwschaefer.medium.com/20-entertaining-uses-of-chatgpt-you-never-knew-were-possible-3bc2644d4507 Some more applications https://marketplace.visualstudio.com/items?itemName=DanielSanMedium.dscodegpt&ssr=false VSCode extension that uses Subj to generate comments or query code snippets
  11. Tom Chamberlain

    Need a "Delphi programming guideline"

    Do not waste your time, find a new job and leave them in the past. Got reprimanded once for replacing 2000+ lines of code looking for values by doing 'if Edit1.Value = x' on about 200 edit boxes basically named Edit1, Edit2, Edit3..Edit200 on a form (don't ask), just a huge cut-paste, change the component name procedure. I reduced it to about 10 lines using FindComponent in a loop producing the same results. I walked out of that job in less than 1 month after I figured out they (staff and management) refused to learn anything new. Do not suffer fools.
  12. Fr0sT.Brutal

    A book about Object Pascal Style Guide

    Only Hercules could clean up Augeas stables but even he cheated.
  13. omnibrain

    Need a "Delphi programming guideline"

    Honestly, it would be best if you started looking for a new job. You coworkers don't care. Your boss doesn't care. It works for them (for now), but it will crush you.
  14. Mike Torrettinni

    Manage overloaded IfThen functions

    @Clément This is my quick setup: type IIF = class class function _<T>( aCond : boolean; aTrue : T; aFalse : T ) : T; end; class function IIF._<T>( aCond : boolean; aTrue : T; aFalse : T ) : T; begin if aCond then Result := aTrue else Result := aFalse; end; procedure TForm2.FormCreate(Sender: TObject); var i: integer; s: string; c: TVirtualStringTree; begin i := IIF._<integer>(i=1, 1, 2); s := IIF._<string>(i=1, '1', '2'); c := IIF._<TVirtualStringTree>(i=1, vst1, vst2); end; Do you have a recommendation on better naming?
  15. Stefan Glienke

    Manage overloaded IfThen functions

    https://en.wikipedia.org/wiki/Principle_of_least_astonishment And now imagine some compiler that turns that into proper code with as little conditional jumps as possible: https://godbolt.org/z/KqhKnx
  16. Anders Melander

    Manage overloaded IfThen functions

    I think I'll put that on a t-shirt: "Hope - Helping Delphi survive since 1996"
  17. Andrea Magni

    Alphabet Index for navigation on ListView?

    Hi, is the listview bound to a dataset or manually filled? In the first case I would try to locate the next record in your dataset and have the listview sync'ed automatically. But probably you are in the second case (manually filled list). You can either find a way to build your index while filling the list (a sorted list may be useful here) so that you can let items be shown in the list following one sorting and yet have a second structure where you can find the next item and the corresponding listviewitem (or index). HTH Andrea
×