Jump to content

All Activity

This stream auto-updates     

  1. Yesterday
  2. David Schwartz

    How to edit a config file

    Perhaps I'm beating a dead horse here, but I'm going to go out on a limb and guess you're fairly new to the programming game, based on this statement. Please allow me to fill in some blanks for you. An "INI file" has a particular structure to it, and it's not dependent on the filename or its extension. Whomever wrote your code originally decided to use the INI file format to store the data, and also decided to use a .cfg extension on the filename. These are totally arbitrary choices. Back when INI files were first used, they did all tend to have .ini file extensions, but it's unnecessary. DOS introduced the use of "standard" file extensions and INI files were one such standard usage. Windows followed suit, as it as built on top of DOS. (CP/M probably also used INI files.) Today, most people would choose a JSON file structure for a config file format. It would NOT be named .json nor .ini, but .cfg could very well be used. Linux employs a LOT of config files, and they may be .config (NOT 'xyz.config' but just .config), xyz.conf, or even xyz.cf. Some are in a loose INI format, some are CSV, some are JSON, and many are whatever format the author decided to use. My point here is that you're thinking that a "configuration file" is always going to use some standard format -- that's simply not the case. There's no standard way to interpret a file with a .cfg extension. But most files with a .ini extension are very likely to use the INI file format. Putting JSON data in a file with a .ini extension would be deceptive. And I'd say most files that contain JSON data do not use a .json file extension; it's just not a common practice. (When DOS came along, file extensions were not used very much in other environments other than as 'hints' of sorts. But DOS used them to make it easier to know what a given file contained. So a .INI file always employed an INI file format; likewise, files with .txt, .doc, .ws, .wp, .obj, .lib, .exe, .com, and other extensions all had the same types of contents and could be opened with a specific tool. But .tmp is one that's used for any kind of temporary file, regardless of what the format of data in them might be.) Linux does not make any assumptions about what format the data in a file might be based on given its file extension. Mac is based on Unix, and does not care either. On the other hand, Windows itself does. People who write apps with Delphi ... not always. So use the file extension as a guide towards what the internal file format might be, but don't bet your life on it.
  3. I was a little offended as thought I had an acceptable easy going personality but 12.1 IDE seems to not agree !!!! Anyone else struck this error message "Personality 'Default.Personality' is not supported ? Ok would just pop up again, then had to Task Manager stop it, second restart worked alright that time.
  4. David Schwartz

    Set form in read only mode

    Sorry, you're quite confused here. On the TPageControl / TRzPageControl, the "pages" are TTabSheet types. They are NOT TPanel types. That's why TTabSheet.Enabled turns the tabs on and off -- it's to hide/show the TABSHEET (including its TAB). Not what's on it. You can drop a TPanel / TRzPanel on a tabsheet and then set it's Enabled property to get the desired effect without all the other rigamarole. Be sure to set the panel's Alignment to Client so it fill the entire tabsheet. Iterating over a TPageControl / TRzPageControl lets you access the Pages array property, which is an array of TTabSheet. I don't think that's what you want. From a more global perspective, there are typically two or three different forms I recommend for handling CRUD actions on DB records: one is for entering NEW record data; one is for VIEWING / EDITING an existing record's data; and a third one is to confirm DELETING a record. I won't go into detail here as to why, but after you've dealt with this a few hundred times, you'll understand why. Yes, you can only use ONE form, but the amount of logic needed to handle all three cases can get crazy. (If you just need to work with one single record, then you can do all of the CRUD stuff on one form. But when you introduce computed fields, lookup fields, child records listed on the form, and other common stuff, you will quickly find yourself going nuts trying to get everything to work on one single form for all possible cases. For me, it's easier to just make two or three distinct forms. The Delete can be a simple confirmation dialog. And record viewing / retrieval can be done with the Edit form, just make the fields read-only for viewing and enable them for editing when the user enables Edit mode.)
  5. David Schwartz

    Delphi and "Use only memory safe languages"

    This is an interesting example. Off-by-one errors are extremely common, especially when you first start programming. Over time, you learn to prevent them. Considering Delphi: Given this declaration: var ary[10] : char; str[10] : string; One might be tempted to write: for var i := 0 to 10 do ary[ i ] := ''; and similarly for var i := 0 to 10 do str[ i ] := ''; The first loop would blow up when i = 10, and the second would blow up when i = 0. And the compiler would fail to flag either as a possible problem. A smarter programmer might write: for var i := Min(ary) to Max(ary) do ary[ i ] := ''; for var i := Min(str) to Max(str) do str[ i ] := ''; But the safest way is to use this syntax (when it makes sense): for var ch in ary do xyz(ch); for var ch in str do xyz(ch); There are other variations that can attract off-by-one errors (while ... do, repeat ... until, etc.) that the compiler is helpless to do anything about. What's needed is a syntactical way to totally AVOID such off-by-one errors in the first place. Well, the for ... in syntax is the safest, but it's not valid in some use cases -- like if you want to initialize the contents of the array, because it yields a value, not an index. Some languages have the ability to let you say "foreach ..." or "for ... each ...", but that's still a decade away from showing up in Delphi, if it ever will. So we're left to use far less efficient libraries to provide these common-sense solutions, or just go bare-knuckle and let the cards fall where they may. There are plenty of ways to make the language "safer" in many such respects, but if nobody is willing to actually make the compiler changes needed then it's a wasted discussion.
  6. Delphi can already use Xcode 15. The biggest issue at the moment is debugging with iOS 17 (or higher) devices, which is a problem regardless of Xcode version. Debugging on devices with iOS 16.x still works using Xcode 15. A secondary issue is this one: a problem if your app needs to link to 3rd party binaries that were built with Xcode 14 or higher.
  7. David Schwartz

    Delphi and "Use only memory safe languages"

    Sorry, but while GC might address SOME issues, it's hardly a panacea. There's a memory manager you can link into Delphi that lets you turn on things that scan for stuff and flag things that turn up, both in real-time and when the program quits. There are syntactically correct expressions that Delphi will compile without any hints or warnings that are deadly. Most of them are hangovers from old TurboPascal days that haven't been addressed, mostly because the code they allowed is not used today.
  8. Brian Evans

    ...cannot contact a domain controller..

    Check the Info tab in the FireDAC Connection Editor after trying to connect. As well not sure what you mean by: "I've set up a Windows credential that seems to work"
  9. David Schwartz

    Delphi and "Use only memory safe languages"

    Uh, no, it's the TSA that PREVENTS you from carrying weapons onto planes! TSA is there to PROTECT PEOPLE FROM THEIR OWN STUPID IDEAS. One of them that some people make is, "the only SAFE plane is one where EVERYBODY is armed!" In the computing field, that would be like saying, "We don't need the language or compiler to protect us from bad coding practices because ... WE KNOW WHAT WE'RE DOING! Code reviews and compiler checks (both compile-time and run-time) are like the TSA of software dev teams. Yet in my experience, they're all talk and no walk -- that is to say, I may have participated in two or three code reviews in the past 20 years, only because they were mandatory for some reason or other. We had agile demos every sprint, but NOBODY ever looked at the code. (One project I worked on briefly was required by the client to do regular code reviews as part of their Agile process. But most of the time was spent listening to a lecture by someone followed by people commenting on the funky variable names and how the code itself was structured. There was no effort to look at the code's logic itself. I don't consider these "code reviews" since they never uncovered anything meaningful. Like, what if TSA never found any guns even when they were planted? That has happened at some airports, to be sure.) As I've mentioned elsewhere, at one place I worked, I found over 100 instances of bugs in the code of a large software product that stemmed from 8 erroneous coding patterns that were spread throughout the code using a copy-and-paste coding practice employed by the original programmer. I wrote up a paper documenting them and sent it to the team and my management team. Then I set up a code review meeting to discuss my findings in detail and Management cancelled it with a note saying we were too busy working on a deadline to get distracted with this "nonsense". I tried everything I could think of, and was eventually kicked to the curb because they just didn't want anybody to know about this crappy code. And these guys claimed they were totally committed to climbing this latter of ISO 900x, CMMI, and other high-level certifications to show they had it on the ball.) And, oh, BTW, these errors were all due to memory faults that were mostly "invisible" to not just the compiler, but human readers. They had been in the code for over a decade at that point, causing all sorts of weird and unpredictable errors to show up. Their extensive test suites were unable to detect them. Exactly the things we're talking about here. Where's TSA when you need them? Programmers all like to think we're smart and are capable of writing great code that "breaks the rules" SAFELY -- even those considered "unsafe". The problem isn't now, but what might happen later on down the road? How many incidents turned up when compilers switched from 16-bit code to 32-bit code, and hand optimizations using pointers broke? Ditto for 32-bit to 64-bit code. How many people have the presence of mind to add conditional compiler statements there -- WHEN THEY WROTE THE CODE -- that raise a compiler warning when something they DID think of actually breaks the code LATER? Better yet, how many things did they NOT think of? The older and more experienced you are, the more likely you are to think of more situations to be guarded against, right? But that's just one set of eyes. How many people actually DO participate in regular code reviews and DO look at stuff like this?
  10. Beantreeze

    ...cannot contact a domain controller..

    BTW, I'm using Delphi 12 Athens on Windows 11 on my laptop.
  11. Hello - I recently received a new laptop at work, and, for security purposes, the laptop and my credentials are in a different AD tree than my SQL Server. My laptop is under USDA.net, and the SQL Server is in the tree for the University where our offices are located. I've set up a Windows credential that seems to work, as I can connect my laptop to the SQL Server using SSMS, and I successfully set up a DataSource in ODBC using the 'ODBC Driver 18 for SQL Server'. I just have to make sure that the 'Trust Server Certificate' box is checked. However, when I place & test an TFDConnection to my SQL Server in Delphi, I'm receiving the message: The system cannot contact a domain controller to service the authentication request. Please try again later. To mimic the 'Trust Server Certificate' setting, I've added TrustServerCertificate=yes to the ODBCAdvanced setting in the FireDAC Connection Editor. [I get a '...certificate chain not trusted...' error when I omit that]. The connection seems to work for everything except FireDAC, and I'm at a loss as to what to do next. Any ideas?
  12. JonRobertson

    ActionList Editor: New Standard Action...

    Works for me as well in 11.3.
  13. Lajos Juhász

    ActionList Editor: New Standard Action...

    I can confirm that it does work.
  14. Eric Bonilha

    Firemonkey 3d Measurement Units

    Hello Sorry if this is a stupid question, but I was wondering, when using Firemonkey 3d objects in a scene, what is the measurement unit of object positions and dimensions? I see for example, I can create a TPlane and set a width of 10 and height of 10, but that doesn't mean anything for me if it doesn't translate to a real measurement unit like meters? In my case, I want to create a plane (lets say, a floor) that is 10x10 meters (in real world measurements) and place a camera object that is 4.5 meters high. How would I translate this measurement unit to whatever unit FMX 3d uses? Thanks
  15. PeterPanettone

    ActionList Editor: New Standard Action...

    BTW, can anyone confirm this: The 'NewStandard Action...' command keyboard shortcut Ctrl+Ins does not work! The command is executed only after clicking on its menu item with the mouse!
  16. msohn

    ActionList Editor: New Standard Action...

    I've seen the problem for a long time, I'd guess since around D7. But with DevExpress installed it takes less than 10 seconds to show (D11.2 with rather slow equipment), so it never really bothered me enough to report this. Since action registration allows you to specify a class descending from TDataModule for default properties and images, it might make a big difference if and how a 3rd party uses that feature. Who knows, maybe the relevant data modules are created multiple times every time the dialog is shown.
  17. Uwe Raabe

    ActionList Editor: New Standard Action...

    Perhaps they aren't working with standard actions either?
  18. Thanks. I've worked around it by declaring FileSig.arrSig as a fixed array, e.g: array [0..4] of byte, then I can set the const array using padding where necessary e.g. arrSig: ($00, $01, $02, $00, $00); By adding a SigLength to the FileSig type I will know what padded bytes I can remove when I come to using the array.
  19. ULIK

    ActionList Editor: New Standard Action...

    Curious, this problem is not restricted on Delphi 12 Athens, You can also see it on (at least) Delphi 11.3 Alexandria. It not necessary to install all that 3rd party libraries. Just DevExpress or ImageEN should be enough to see a relevant delay when opening standard actions. This makes me wonder why none of that vendors have already reported this to Embarcadero.
  20. PeterPanettone

    ActionList Editor: New Standard Action...

    The new Quality Portal makes a clean impression. However, I would like to insert small screenshot images inside the Description section in addition to the separate image section.
  21. Lars Fosdal

    ActionList Editor: New Standard Action...

    The new QP doesn't support voting and I cannot see a benefit in sharing this. Well, sharing allows discovery, and those that are affected can add a comment?
  22. baka0815

    TIdHTTPWebBrokerBridge: Require TLS

    I'm using a TIdHTTPWebBrokerBridge and therefore assigning OnCommandGet (via TIdHTTPWebBrokerBridgeAccess) or OnCommandOther didn't do anything, those events never happen. What works for me is assigning OnConnect as in the link posted and to check if it's a TLS handshake and therefore setting PassThrough. In the OnAction-event of the WebModule-Actions I then check if I wanted to have a TLS connection and return a 400 statuscode with a message that encryption is required. Is that a feasible way or am I holding it the wrong way up?
  23. Sherlock

    ActionList Editor: New Standard Action...

    I'm guessing this is one of the shortcomings of Jira Service Manager vs. Jira. I considered the option to vote for a call a good thing too.
  24. PeterPanettone

    ActionList Editor: New Standard Action...

    Here is a more detailed screenshot including several libraries: https://app.screencast.com/xEiAJWWcxiL2M
  25. PeterPanettone

    ActionList Editor: New Standard Action...

    Is it not possible to support individual reports? Why has this possibility been removed from the Quality Portal?
  1. Load more activity
×