Jump to content

David Schwartz

Members
  • Content Count

    1237
  • Joined

  • Last visited

  • Days Won

    25

Everything posted by David Schwartz

  1. David Schwartz

    Type within a class

    If I understand what you're saying, I think it's a big problem that renders Google practically useless if you don't know the proper term to use, or if there even is one. You can give a code sample to google and ask, "what is this?" and you'll probably get a bunch of gibberish that does not include what you're looking for. ChatGPT might do a better job. But if you don't know what something is called, it's hard to ask anybody anything about it. Telling someone to RTFM isn't helpful b/c they don't even know what to look for. Case in point: where can you find the entire set of % parameters that can be used in a Format statement? if you go to the Help topic for Format, it doesn't say. You have to find a link buried in commentary to bring up that info. I still don't know what they're actually called.
  2. David Schwartz

    How do I know if the click is an actual user click ?

    I have a var in the form class named 'ignore_this' and set it to true before doing something that will fire an event automatically that I want ignored, then set it false afterwards, and I put "if ignore_this then Exit;" at the top of the event handler. Sometimes there's so much stuff like that in the OnFormCreate that I just have a 'creating_form' variable that's set True at the top and False at the bottom of OnFormCreate so event handlers can get bypassed.
  3. David Schwartz

    Testing zlib compression in Delphi

    It has been a while since I used these, but they work as intended. They let you compress and decompress a string or chunk of data in memory or a stream. It's not a "zip file" with a directory b/c ... what would it put in the directory if. say, there were 30 strings you were compressing? It takes a chunk of data and either compresses it or decompresses it. If you don't know the length of the uncompressed data, then it needs to figure it out. But chances are it's either quite small (ie, the overhead needed to figure it out is minimal) or you're going to save uncompressed size in your data record along with the compressed data so you know how much data it's going to take when it's uncompressed. Maybe think of it the same way as encoding and decoding data to/from Base64, only in that case the sizes are easy to calculate. I don't find any of this puzzling. Including the reference to ChangeFileExt -- although when I started using it (going back to DOS days), I thought it was odd that it assumed the dot '.' was part of the extension. But over time, it makes more sense that way so you can say ChangeFileExt( fn, '' ) to remove it AND the dot to get the BaseName that doesn't include the dot either. Coming from the c / Unix world, extensions are superflous, like in Macs (which are Unix-based), so it was weird to me that DOS (and later Windows) depended upon them to identify file types. In Unix, everything has some kind of file header in it, and there's even a command (file <filename>) that does a really good job of figuring out what type of file something is by reading a chunk of bytes from the beginning of the file. I think *nix allows file extensions simply as a courtesy to DOS / Windows, but doesn't hold them as having any significance. When I first started working with Unix in the mid-80s, file names rarely had extensions on them as they simply weren't needed. However, things that transformed an input file to a different format output file did tend to use an extension, so a C source file had a .c extension; the output of the cpp command (rarely used to save files) used a .cpp extension; the output of the c compiler used a .o extension. But the output of the linker used no extension. In fact, just typing a filename on the command line would run it using whatever it needed: it could run as an executable, or via sh, bash, ksh, csh, etc, if it was a shell script; and so on. Unix just figured it out, and totally ignored any extension that might be present. AFAIK, Linux systems still do that today. I suppose it just depends on your background? DOS and Windows still have a lot of vestiges hanging around from their Unix roots. (I just never figured out why DOS used backslashes instead of forward slashes in file paths, other than simply to look different. In Unix, backslashes are used universally as an escape character. Also, single and double quotes (' vs. ") are interpreted differently in a lot of contexts, unlike in DOS and Windows where they're typically equivalent.)
  4. David Schwartz

    PaxCompiler

    TMS has a scripting tool.
  5. David Schwartz

    Type within a class

    Delphi supports nested types. This binds the type name TIterateAction to TDataContainer in case anybody wants to refer to it outside of TDataContainer class. Usually I see nested types declared as Private, which basically means they're intended for the exclusive use of that class, as nobody outside of the class can even see them.
  6. David Schwartz

    How do I upgrade an old 2007 project ?

    I had a lot of problems with D2009, so I stuck with D2007 until D2010 came out. But D2010 was also where they introduced generics, so it bridges two major inflection points in the language.
  7. I just got this from somebody who claims to have found my resume somewhere. This is pretty much the same as every other job req I've been seeing for the past few years. Other than mentioning Delphi, I have no clue what skills they are looking for, or even what the application domain is. And since they client is asking for 3-5 years of experience, I cannot imagine them hiring someone with even 10 years of experience. Why is this guy even sending this to someone like me? I'm guessing they're just harvesting resumes. I don't know about anybody else, but after 40 years, my resume doesn't change a whole lot from one year to the next. I can't cover more than 10 years without making it too long; sadly, the projects I worked on in the 90's were the most fun but nobody wants to hear about things I did when they were kids. So there's not much in an updated resume that's they don't already have, maybe one or two more lines about my latest endeavors. One red-flag to me is the CMMI Level 3. This means you're not changing any line of code that isn't tied back to a change request somewhere in Jira. --------------------------------------------------------- Hi, Hope you are doing great. My name is Naga Devi and I work for Ameriinfo Inc. I have come across your impressive credentials from one of the job boards and wanted to check your availability. If you are available, I have included a job description below and would appreciate your response along with your latest resume, best number, and a time to connect. If you are not interested or the job is not suitable, please accept my apology and I request your support with references. Position: Delphi Developer Location: Remote The Challenge: The Delphi multi-tiered Desktop Application Developer supports the client’s mission by developing quality software within a structured and mature software development life-cycle environment, preferably an agile development environment. This position works closely with the customer and team members, especially the Functional Analyst, SQA (Software Quality Assurance), and other developers to ensure that modifications and enhancements to existing software and development of new software products provide efficient and effective solutions for the customer. The applicant for this position will be involved in all aspects of application development, including analysis, requirements documentation, design, development and test site deployment and issue tracking and resolution. The applicant will work closely and take direction from the lead Delphi Developer and the Project Manager. Required Education: Bachelor’s (or higher) in Computer Science or similar field of study with an application development focus preferred. Required Years of Experience: 3 years, or 5 years of additional relevant experience may be substituted for education Responsibilities: • Designing, developing, testing, deploying software. • Defect resolution and issue tracking. • Development of new functionality and modification to existing applications. • Participating in agile development life-cycle to include daily scrum calls, sprint planning and build planning. • Assisting and working with other Delphi developers as well as Mumps developers. • Work in Jira to track and update status on work activities. Minimum Qualifications: • The applicant must possess written and verbal communication skills required to work with team members and assist with documentation to include but not limited to software documentation, work activities, issue tracking, technical manuals, and other work processes. • Has high standards, results oriented, and a commitment to delivering high quality production time • Although rarely required, applicants must also be willing to travel occasionally. • Preferred Qualifications: • 6+ months of experience working with VistA integration development. • Prior experience working with tools such as Jira, Service Now and GitHub • CMMI (Capability Maturity Model Integration) Maturity Level 3, ISO (International Organization for Standardization) 9001:2015 or 9001:2001, and ITIL experience a plus
  8. David Schwartz

    Delphi job req I just got

    Thankfully, my days of working for large corporations with their policies aimed at micromanaging programmer activities are over. I don't have an issue with Traceability. What i have an issue with is when you're working for a company and they put you through a few days of formal training in something like Agile that goes through things in detail, then you get back to your project and are told things aren't really the way you were taught. Such as, while Development owns the Backlog, Developers aren't allowed to write up Change Tickets or submit anything into the Backlog, only the Client is, and that requires a detailed documentation of the errors and how to reproduce them. Which is fine unless the errors are not reproducible because of existing bugs that the Client won't ever see, but Devs can and do find them. We're hired as "experts" and then managed like monkeys. I'm done with it. Got my own stuff to play with now. 🙂
  9. David Schwartz

    Delphi job req I just got

    I found an exact copy of this same job req on LinkedIn from someone else. The real client is Booze-Allen-Hamilton (or whatever their name is these days) and it's for the VA, who probably wrote the copy itself. I used to work for a company on a similar project.
  10. I've got this file I'm trying to attach to a POST request in TMS WEB Core as follows: procedure TFile.Upload(AAction: string); var f: TJSHTMLFile; fd: TJSFormData; ptrProgress, ptrComplete, ptrError, ptrAbort: pointer; begin f := FileObject; fd := TJSFormData.new; fd.Append('file1',f); <-------- the file is Base64 encoded FReq := TJSXMLHttpRequest.new; . . . event handler assignments . . . FReq.Open('POST',AAction, true); FReq.Send(fd); end; procedure TFile.Upload(AAction: string); var f: TJSHTMLFile; fd: TJSFormData; ptrProgress, ptrComplete, ptrError, ptrAbort: pointer; begin f := FileObject; fd := TJSFormData.new; fd.Append('file1',f); <-------- FReq := TJSXMLHttpRequest.new; . . . event handler assignments . . . FReq.Open('POST',AAction, true); FReq.Send(fd); end; This is using javascript under the hood. It's being put into a JSFormData object, which is being imported from a standard JS file. I have this code in a PHP script to receive it: $fn = $destinationFolder . $_GET['filename']; $data = base64_decode($_FILES['file1']); <------- $file = fopen($fn, 'w'); fwrite($file, $data); fclose($file); It _seems_ to be getting uploaded, but it's not getting delivered. My web console debugger shows this: First, that attachment looks empty. Or maybe the file itself is attached separately. I don't know. Does this look correct for a JS upload like this? Second, is $_FILES['file1'] the right way to refer to it on the server side in PHP? Would it be the same in, say, Python?
  11. David Schwartz

    is this a valid, complete JSFormData attachment?

    The Mystery has been SOLVED!!! <?php // a lot of safety and security checks go here, along with the folder: $destinationFolder = 'dest/folder/goes/here/'; $data = file_get_contents( $_FILES['file1']['tmp_name'] ); $fn = $destinationFolder . $_FILES['file1']['name']; $file = fopen($fn, 'w'); fwrite($file, $data); fclose($file); http_response_code(200); echo 'File ' . $_FILES['file1']['name'] . ' uploaded to: ' . $fn; ?> file_get_contents apparently tells the client to send the file to the server (this script) and it gets saved into $data, which is done in another thread or session or something, because it does not appear as part of the upload payload with the request. It boiled down to getting just two lines of code correct!
  12. as I said: "... and proceed from there" It's in a new folder so there shouldn't be any initial conflict. But you always have to rename a new project and the initial unit(s), right?
  13. I've seen apps hang on disconnecting from DBs. I've never known why, tho. Is there an unterminated transaction that's waiting to time-out, perhaps?
  14. Check out what TMS Software has -- they have been going nuts adding features to their mapping components.
  15. You could always just create a dummy project with the settings you want and save it into a folder (or zip file). Then for a new project, copy or unzip the folder into a new one, then go into the new folder, open the project, and proceed from there. It'll take you about 5 seconds.
  16. Do you have the option enabled to scan for memory leaks when it terminates? Or some memory manager that does that itself?
  17. I'd run a test by creating a folder with 50,000 files in it with random names and a dozen different images just to take up space. have the names in a list and just make random requests and see what your performance is like. Personally, I'd hash the names and then set up subfolders based on the first letter and split them up that way. They'd be much small collections and I suspect accessing them would be faster than dumping them all into one folder. Keep in mind that the file system is itself a form of database. It typically organizes things in the order they're added. It has index files that can accelerate lookups, but if the names are all similar, like abcd##### where the ##### part is a 5-digit code, they may all be in alphabetical order anyway (assuming the number is incremented each time one is added.) If they names are hashed, then they're going to be fairly random. Linux is generally faster then Windows for large folders. But I'd hate to have to open a WIndows file explorer for the folder with all of these files in it!
  18. David Schwartz

    How do I upgrade an old 2007 project ?

    First I'd try upgrading it to D2010. Get it working there with Unicode characters and deal with other problems that may arise. The next step would be 10.3. Either way, you're going to need to install the libraries for the desired verion first. Upgrading gives you an opportunity to see what's missing and what you'll need to upgrade from vendors before proceeding (if anything). But keep in mind that a D7 app was targeting Win XP. Windows is four major releases beyond that, and lots of things have been deprecated if not eliminated. A lot things might not work as expected. Pay close attention to compiler hints and warnings.
  19. David Schwartz

    TFruit class moved to component

    Ahh, you're probably right. Thanks for clarifying that.
  20. David Schwartz

    TFruit class moved to component

    There are a few books on the subject of building components. The Bad News is ... they're all from the 90's. The Good News is ... very little has changed. I'm familiar with all of them except the last one. If you like print books, grab one of these at a cheap price and it'll teach you most of what you'll need to know. The link above is from Embt and can help you fill in the gaps. NOTE: These are Amazon affiliate links because they're really easy to get. I found prices lower on eBay, although there may have been shipping costs as well. Delphi Component Design by Danny Thorpe https://amzn.to/3K2hzwm (I don't know why this book is so frigging expensive everywhere, maybe b/c Danny is no longer with us. It's an excellent book and worth grabbing a copy if you can get one cheap.) Developing Custom Delphi Components: Master the Art of Creating Powerful Delphi Software Components by Ray Konopka https://amzn.to/44jMe09 Visual Developer Developing Custom Delphi 3 Components: Master the Art of Creating Powerful Delphi 3 Software Components by Ray Konopka https://amzn.to/3NN4J68 Programming Delphi Custom Components by Fred Bulback https://amzn.to/3Q0Nn8G I think there's also a book by Ray Litchke. I'm not sure if I spelled his name right or not, and I couldn't find anything.
  21. David Schwartz

    support for login / auth for web apps

    I had a call today with the guys from deScope about using their login / auth service with my TMS WEB Core app. It's very flexible and it has a ton of features. https://www.descope.com/ I was looking at Memberful, as they have something similar plus they also do member management and billing. But they don't have any way to add custom fields to the user profile that can be hidden from the UI, which seems really strange. I was told they just don't see a need for it. Nothing like listening to your users, eh? And they only allow a few custom fields to be added. descope lets you add any number of custom fields to the user records. And they make it super-easy to include multiple ways of letting users login, including email/pwd; sms to your phone; finger-print, facial recognition, and several social media site logins. Their platform also lets you create "flows" where you can use a drag-n-drop designer to map out actions and results to define different logic flows. It's very flexible. Does anybody know of any others?
  22. David Schwartz

    support for login / auth for web apps

    Great points, Wagner. I guess we're talking about different levels of integration here. it's possible to build something like descope on top of Sphinx, and then expand it to do what Memberful does as well, and even go beyond that. I'm sure that descope's target customers aren't low-level programmers, given that they have built a visual drag-n-drop "no-code" designer for people to use. There is an API that can be used to do whatever you'd need, but it also gives access to the things created in the Flows editor. Memberful is also a "no-code" solution with an API, but their API is much simpler and maps more directly to what the main UI presents. I'd love to see more examples of higher-level "no-code" integrations for Delphi users. Embt has funded the development of complete applications that are available in GetIt for free, but those are rather extreme examples at the other end of the spectrum. Two examples that come to mind are Mitov's no-code designer that integrates into the IDE, as well as what TMS has done with WEB Core that also integrates into the IDE. The TMS Diagram Studio, Workflow Studio, and Query Studio (maybe others) are also likely candidates: they have both a design-time no-code aspect, as well as a run-time aspect that can deliver a no-code solution to users. Other than most report-writing tools, nothing else comes to mind off-hand that fit this paradigm. I suspect there are some examples out there ... anybody have any ideas? Note that descope and Memberful are both viable "no-code" businesses with a growing user base. Adding such logic on top of something like Sphinx would need to have a way to work independently of Delphi to fit into the "no-code" market. What neither descope nor Memberful offer is the ability to interface with them at a much lower level, which is what a Delphi foundation might offer. (It doesn't mean they'd have to offer source code, just more low-level control.) But it can also be argued that descope's API offers this level of support already, which allows Delphi to be used anyway.
  23. David Schwartz

    Hosting a console in a Delphi Application

    See if this helps: https://www.dropbox.com/s/rbslh6vrzyxio43/RedCon.pas?dl=0 It's from D5 era, so it might need some touching-up.
  24. Someone asked me recently if there are any REST frameworks for Delphi that run on Linux? I know TMS XData doesn't (yet). Are there any that do?
  25. David Schwartz

    Delphi REST frameworks that run on Linux?

    Well, however you want to describe it, my only real concern is that it's now possible to target services for linux hosts now. That's a Good Thing. 🙂
×