Jump to content

David Schwartz

Members
  • Content Count

    730
  • Joined

  • Last visited

  • Days Won

    11

David Schwartz last won the day on October 10

David Schwartz had the most liked content!

Community Reputation

223 Excellent

Technical Information

  • Delphi-Version
    Delphi 10.4 Sydney

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. David Schwartz

    What is part of your contiuos integration?

    My last job I built a tool that integrated git into our workflow. Boy did it save a ton of errors and ensured we all did things the same way. It was a kind of "dashboard" that I did my work through. I also integrated a bunch of things that I found myself doing very regularly in my daily tasks. They were all very specific to the work we did, but it was extremely repetitive and automating parts of it made a huge difference. But the biggest benefit was with git, for sure.
  2. David Schwartz

    How do *you* test ?

    I use both approaches. Some bits of code let you take a fairly piecemeal approach, like what you describe. Others require quite a bit of code to be written before you can do much of anything. In the latter situations, I'll often do compiles just to look for typos and missing declarations, but 10.4.2 is quite good at highlighting various things with background parsing. Getting "clean code" that compiles is one thing. Making sure it does what it's supposed to is something else. Sometimes I'll build just enough UI scaffolding to let me play with bits of code as it evolves, but I'm not a fan of "Design for Test" so I don't make independent tests. UI-driven stuff either does what you want or it doesn't. I don't see the need for separate test code. The vast majority of what I do is UI-driven, so I don't even bother with unit tests. They are best for libraries. (I've often wished there was a way to add meta-methods to classes, like test meta-methods that you could add for testing. But often they need to be run at a higher level. Sometimes it makes sense to have integrity tests that check to ensure certain combinations of data members are provided and that nothing is out-of-range, but they'd still be called by higher-level functions. TForms for data entry use let you do this a little with Validate methods.) That said, I'll frequently add treeviews or listviews or memos to let me visualize results as I'm adding things. And sometimes things don't look as nice as I originally thought, so I'll change them.
  3. David Schwartz

    Found and remove unused uses units

    ahh, well then use the Peganza Analyzer Lite. (It used to be called Icarus.) That's what it's for.
  4. David Schwartz

    Found and remove unused uses units

    Just comment out a line then save the file. The ones that are needed will be added at the end. No compilation needed.
  5. David Schwartz

    D11 - A bridge too far.. :-(

    yeah, but they keep paying their annual maintenance. If they'd tell EMBT they won't renew until a better job is being done on fixing the last release instead of just rolling the existing issues forward and then piling on more in the next release, they might actually do something to address this. It has been their SOP for years now!
  6. Is there a ReadBuffer operation? If not, maybe create one that's a function returning True if it read enough data and False otherwise. This way you could use a While loop to step through successive records rather than a for loop that keeps doing a seek each time just to go to the next record. The pointer should already be there, so why keep resetting it each time? Also, it bothers me that your logic uses Exceptions when something isn't found, but maybe it's that serious if data is missing.
  7. Dang, I never noticed that. I've tried everything I could think of but not this. Thanks! But it would still be nice to have a way to get the index corresponding to an iterator position in a list somehow.
  8. I like the second simply because it's shorter. I also wish there was a better mechanism available but suspect it would end up looking rather like a Case statement, sort of like Awk scripts. I don't know why any of these are anti-patterns because the alternative is ugly-patterns that are harder to read and add unnecessary logic. You could change it to a while or repeat...until structure, but they both require an initial probe at the top; while requires some kind of 'get-next' at the bottom of the loop; and repeat...until always seems to need a check near the bottom for make-or-break unless you want to add another variable to the loop test, which always seems redundant to me. This is the problem: you have two independent variables involved: one controls the loop, and the other interupts it if it finds a resolution before the whole sample set has been exhausted, which only improves performance. To be more precise with your expressions, the for loop would contain two tests, one for each variable. This is easy in C/C++ for loops, but not in Delphi/Pascal. Instead, you'd need a while or repeat...until. But as I said, you can only initilize and work with one variable in the for statement in Pascal; again, C/C++ makes it easy. So Pascal leaves us with a half-assed solution, exemplified by this: var sl := TStringlist.Create; // add a bunch of things with objects to the list ... sl.AddObject( aString, someObject ); // this deceptive call makes it look like there's a relationshiop between aString and someObject, // but there actually isn't because they have separate indices! // They DO happen to coincide, however. // Sadly, neither sl[aString] nor sl[aString].Object leads to the corresonding entry in Objects that yields this pair. ... // now find and return an object function findSomething( const aStringArg : string ) : TObject; begin Result := NIL; for var str in sl do if (str = aStringArg) then Exit( sl.Objects[ ??? ]; // oops ... no way to get the corresponding item in Objects! // you are forced to go this way instead for var i := 0 to sl.Count-1 do if (aStringArg = sl[i]) then Exit( sl.Objects[i] ); end; The for...in is a much cleaner way to go, but the fact that the embedded Objects array requires the item's index to access its contents mucks things up. So you need to drag in a separate index just to satisfy that need. You could say this is a fault in the design of TStringlist, but it's a widespread problem. Again, C/C++ solves it nicely by allowing multiple independent variables to be used in a For loop. Perhaps for TStringlists, it would be better if the iterator had a hidden index that could be used to probe into the Objects array: for aStr in sl do if (aStr = sStringArg) then Exit( sl.Selected.$Object ); // Selected would be a new property introduced into the iterator allowing the // Object property to find the index associated with this entry to extract a value So maybe it's a limitation in how Deplhi implements iterators rather than TStringlists (and every other class that has a similar problem).
  9. David Schwartz

    Where are the FD Enterprise Connectors hiding?

    It seems really hard to justify paying nearly the same price for a single "connector" as it costs to maintain Delphi, but if this doesn't even include the ability to distribute software you used it for, then it's a no-brainer. I guess they're more like EMBT in that they make most of their revenues from companies who just keep renewing their license fees every year just so they don't get caught with their pants down at some point because of a decision years earlier to use some of their products.
  10. The Enterprise license includes a bunch of FD Enterprise Connectors from CDATA. I grabbed some for D10.3, but I have not been able to find them for 10.4. (I can't even find the ones for 10.3 now either.) Anybody know where to find them?
  11. David Schwartz

    enable/disable the internet connection?

    Yes, I found an option to do that. But the question was and still is "Is there an API call to do this from a Delphi app" not "is there a windows setting button somewhere that does this". Q: "What's a good pair of boots I can wear at the beach?" A: "The weather is great, so why not just wear flip-flops?!" A: "Crocs are really the best thing to wear at the beach" A: "I prefer going barefoot" A: <photo of toe-socks> A: "My gf hates boots. Here's what she has me wear" <photo attached>
  12. David Schwartz

    enable/disable the internet connection?

    I have no idea what goes on behind the scenes with MacOS, but it does let me say not to install updates and it mostly respects that. Sometimes it does show a little thing that says there's an update and I can click Cancel or Install. Sometimes one of the options is "wait until tomorrow". I don't even like to install MacOS updates. The problem with Windows is it downloads a bunch of files, then it starts running crap in the background and eats up 50% of the CPU for 30-45 minutes, then it tells me there's an update and keeps bugging me about it. I have the updater supposedly disabled. I have searched and shut off everything I've found, and yet it continues to download crap and run that background thing, and then tells me it needs to reboot. I can put it off for a while, but I shut off the VM when I'm not working with it because if the host crashes it can totally screw up the VM if it was open and doing anything. That's part of the reason I shut it off ... because windows is constantly doing background stuff when I'm inactive for 10 minutes or so. Win7 would just sit there and do nothing. Win10 seems to have a bunch of little elves scurrying around constantly doing stuff and there's no way to shut them down. I know how to open the internet panel and drill-down and enable / disable the network interface in Windows. The VM won't let you turn it on or off while it's running -- you actually have to shut off the VM (not just put it to sleep). It's as if you're unplugging the LAN card. Windows will let you delay only so long before it FORCES a reboot on you, whether you want it or not. And frequently it will start a count-down timer that's hidden beneath another window so you can't see it. I've had that happen in the middle of builds. The timer window appears below Delphi when I kicked off a build, and then a little later I saw a popup that said, "Windows is restarting..." and POOF! Then it shows a screen "Windows is updating, do not power down!" and it goes on for 10-15 minutes. I have NEVER had this happen EVER with MacOS or any Apple product. Laptops employers have provided me with do this kind of thing almost weekly. But that's by design. I can't complain about it. But when it's MY machine, I WANT TO BE ABLE TO TELL MICROSOFT AND ITS MINIONS "DO NOT MESS WITH THIS MACHINE!" That seems to be imposible except by shutting off the internet when you're not using it. I just want a little box with an OFF / ON switch for that. You guys are all entitled to your own opinions and your threshold of getting annoyed of being bullied by the OS is whatever it is. I have a lot tolerance for that -- when I'm busy working on something, I don't like to be interrupted by something like a 2-yo that decides to pull the plug on the computer to get your attention. And no, I don't have kids, partly for that reason.
  13. David Schwartz

    enable/disable the internet connection?

    I want a simple form with a button that lets me switch the internet connection on and off. Is there an API call for that? I've got Windows 10 and I HATE IT!!! No matter what I tell it as far as not updating stuff, it just goes along its own merry way and is constantly downloading crap and then telling me, "Oh, sorry, we need to reboot. Back soon! Bye!" I don't use the internet that much, and it's running inside of a VM anyway, so I figure I'll just turn on the ethernet port when I need to reach out, then turn it off when I'm done to keep Gates, er ... gated.
  14. David Schwartz

    PC Specs for Delphi??

    This sounds about right. Doing compiles is like flooring the pedal in your car at a stop light when the light turns green. I run Delphi inside of VirtualBox on my Mac, which has 36GB of RAM, a 6-core i7 CPU, and 2TB of SSD. The odd-numbered cores all go to about 80% when I do a compile that takes more than a few seconds. There's always a "weakest link" no matter how fast everything runs. If you'r CPU isn't saturated, then your RAM or DISK is limiting things to some extent. And who knows what's going on with the GPU during compiles!
  15. David Schwartz

    Are you using Delphi 11 with mainstream projects?

    I always wait for the first "bug-fix update" after each major release before doing anything with it. I'm still having plenty of problems with 10.4.2.
×