Jump to content

Leaderboard


Popular Content

Showing content with the highest reputation on 03/04/25 in all areas

  1. AI is just a tool. It has its uses. It's not going to do everything. Yes it's over hyped. But that does not mean it has no value. As usual the value lies somewhere in between what the hypers and the doubters say.
  2. All this is grand but at the end I still have to tell the "AI" what to do, then keep correcting it by repeating what I said but with additions and changes and then again go over everything it gave me just to make sure it did it right. That is time I could have spent doing a proper documented design and then coding everything myself. I started coding because I love coding. As such I don't dread spending time to type out code to get stuff done and so I don't need a Artificial Non-Intelligence to do my coding for me. Asking A"N"I for information is like walking a mine field. Numerous times while testing A"N"I it gave me totally incorrect answers based on poor data from the internet or even non-existing functions. There is nothing the A"N"I can tell me that I cannot already learn from people like @PeterBelow, @David Heffernan, @Jim McKeeth, @Darian Miller, @Uwe Raabe, @Anders Melander, @Remy Lebeau, @Dalija Prasnikar, (missed a bunch, I am sure). Most of them have already laid down a rich treasure of knowledge and Delphi wisdom on the internet. Willingness to search and read on my part is required though.
  3. Stefan Glienke

    Namespaces in Spring4d code

    The claim that it compiles faster is bogus - prove me wrong. Most compile time from spring4d comes from generics, which I reported years ago. Also, my suggestion for third-party libraries is to pre-compile them, which removes any dependency on the project options in your project. Currently, Spring4d supports down to XE, and as long as that is the case, I am not putting even more conditionals into the code than there already are.
  4. Programming with AI Assistance Introduction I’ll take a few minutes to explore the current relationship between AI and programming, as of March 4, 2025. AI evolves so rapidly that claims need constant reassessment. A year ago, I argued AIs relied solely on their knowledge base, not internet searches—a point now outdated, as they do both. So, let’s dive into the key question: Can AI fully replace a programmer today or soon? Can AI Replace Programmers? The short answer is no, and here’s why. Claiming AI can replace a programmer assumes it can flawlessly interpret a designer’s or user’s instructions without ambiguity, generate error-free code, and fix mistakes after the fact. It also implies the AI can review and adapt existing code to meet new or corrected requirements as an application evolves. Picture a dialogue with an AI to build a program. It could stretch over days or weeks, requiring constant backtracking to resolve misunderstandings. Each revision would alter the program, spawning fresh errors—something programmers know all too well. Iterations might edge us closer to the goal, but sifting through endless chat logs to spot where communication faltered would be exhausting. Now, suppose we had a tool tailored for this AI interaction, resembling an IDE (Integrated Development Environment). It could let us search and document requirements, track how new ones affect old ones, and perhaps include a UML generator. Sounds helpful, right? Maybe not—it’d likely just pile another layer of complexity onto development, one still reliant on skilled programmers or analysts to feed it. Even if we fed this knowledge into an AI, it’d need deep familiarity with IDEs or command-line tools to produce the final program. More critically, someone must verify the output meets requirements and works—not just compiles cleanly. Maintenance adds further hurdles: when users report issues in production, do we tweak the original requirements and regenerate the code, or prompt the AI to patch its own prior work? It’s a tangled mess, don’t you agree? Those videos touting “code an app with AI, no skills needed” are like ads promising “speak English like a native.” It’s a hollow pitch—you won’t master it without the foundation, though exposure might sharpen your skills. AI as a Programmer’s Ally So, are those videos about coding with AI useful? No. Their makers aim to entertain you (and rake in ad revenue) while flexing their cleverness—not to teach you AI mastery. Their business would dry up if they did. But here’s a better question: Can AI boost a programmer’s performance? Absolutely, without a doubt. Practical AI Techniques AI won’t replace us—it empowers us. Here’s how I use it daily: Setup: I keep profiles on key AIs—Grok, GPT, DeepSeek, Mistral—ready in browser tabs that auto-open. Even if I rarely touch the last two, they’re there when needed. Function Generation: For standalone functions with clear inputs and outputs, I ask the AI to draft them. Early results may not compile, but they give me a head start. With practice, I’ve honed prompts to get working, compilable code on the first go. Bug Hunting: When my code has a sneaky bug, I pass it to the AI with a description of the unwanted behavior. It often pinpoints the fix. HTML Cleanup: Hand-edited HTML can turn into a cryptic mess. When it’s unreadable, I hand it to the AI to refine and flag errors—a real time-saver. Instant Help: The F1 key once gave contextual IDE help; now I ask the AI for explanations on terms, classes, or functions. It delivers detailed answers and examples, often tailored to my project if we’ve been chatting. Documentation: Most coders dread documenting modules, yet it’s vital for maintenance—the costliest phase of software life. I task the AI with it, specifying depth and skipping obvious lines or pseudocode comments. Performance Tweaks: Facing a bottleneck? The AI can estimate runtimes from source code alone and suggest optimizations—no execution needed. Unit Tests: Tedious, repetitive unit tests are perfect for AI. Give it a controller interface, and it churns out tests fast, ensuring reliability even after changes or integrations. REST Integration: Beyond chat, I’ve built REST interfaces in my programs to query the AI directly with precise prompts, embedding its responses into the app. For example, I use a Stub program to generate varied test data (e.g., JSON arrays of names, split by nationality or location) instead of relying on monotonous random lists. It’s efficient and spares me manual coding. Mastering these techniques—especially REST-driven data generation—lets you apply AI creatively in client projects. The possibilities far exceed this article’s scope, but paired with the next approach, they’ll transform you into a sharper developer. Beyond the Technical: Prospective Thinking AI shines beyond pure coding tasks in what I call "prospective interactions." Before starting a project, I weigh my options—techniques, code structure—and consult the AI. I list my alternatives, and it reasons through the best path, explaining why. I don’t always follow it, but it clarifies my choices. Better yet, I’ll ask it for fresh angles I hadn’t considered. That’s when coding becomes exhilarating—you shift from a technical grinder to a creative problem-solver. That’s the real power of AI as a programming partner.
  5. Stefan Glienke

    Namespaces in Spring4d code

    To avoid repeating the unit throughout the source code, you can declare an alias at the top and only explicitly put the unit name there. That, however, only works for non-generic types and consts. I wish it would also work for generics and routines.
  6. The constant attempts of people pushing the AI narrative is exhausting and it is getting old. How many more irrelevant places in life do we have to inject AI into? It seems similar to the IoT fad. Why do I need to have my fridge tell me what it has in it? I can lift my lazy butt, open the fridge door and check. Maybe then I will get the strong wiff of something going bad in there and replace it. 😄 OK. Done ranting.
  7. David Heffernan

    Check If File is what he claim to be

    This code would be much better if each check of file header was done with same same code, against a signature declared either in a constant, or maybe in a file that was linked as a resource. This would make the code much cleaner, without so much repetition, and would allow you to extend it very easily.
  8. MartinPe

    Good data grid for VCL and FMX

    Hello, Any good data grid that works with dataset that can soft and filter directly from the grid? Thanks.
  9. Remy Lebeau

    How to clear the TNetHTTPClient.CustomeHeaders ?

    The CustomHeaders property is an indexed property. It is used only to read/write individual headers by name. You are seeing the methods of a single UnicodeString instance. There is no option to clear the whole list using the CustomHeaders property. However, you can use the CustHeaders property instead (not to be confused with the CustomHeaaders property!). It gives you access to the whole list, and it has a Clear() method: nhc->CustHeaders->Clear(); // NOT nhc->CustomHeaders->Clear(), // which does not exist....
  10. Lajos Juhász

    How to clear the TNetHTTPClient.CustomeHeaders ?

    In Delphi it would be: nhc.CustHeaders.Clear;
  11. some one ask in UNIGUI forum about how to check if file is really what the extension "said". does MyFile.DocX is really Word DocX file. Since i Have DMS (Data Management System) and it all about files and document i have a pascal unit just for that. any one how will use it can do with it what he want + i don't take any responsibility for any use of this unit. add the unit to the uses class. call : if IsFileTypeAsClaim('c:\aa\a1.mkv' {full file name and path}) then showmessage('file is ok.') else showmessage('The file is not of the declared type.'); uCheckFileType.pas
  12. Juan C.Cilleruelo

    Programming with AI Assistance: A personal reflection.

    The AI that is giving me the most satisfying responses is, without a doubt, Grok. GPT is excellent, too. I use it through the REST service. It is the most simple to implement. Of course, what I expressed in the post is my personal experience filtered through my capacity to prompt the AI. That is an essential part of the method. If you ask your AI like you ask Google, you are definitively losing your time. I read some books and other documents about AI prompting. If you are looking for a magic collaboration with AI, you only need to wait one year or maybe two. But then you will be out of date. The time to integrate AI within your toolbox is now. Really yesterday, but you can run. Everyone has excuses. But what you need at this moment are reasons. Don't waste your time explaining why not. Do it!
  13. Anders Melander

    Namespaces in Spring4d code

    Well, you said The Unit Scope Names setting helps abstract away implementation details which was what I have been trying to get an explanation of - but never mind. The example I gave with PByteArray is real; I have a core unit which declares TByteArray (of which PByteArray is a pointer to) as array[0..0] while SysUtils declares it as array[0..32767]. Since these two are ambiguous I have to scope my use of PByteArray when both units are used. No problem, SysUtils.PByteArray(some_pointer) doesn't obfuscate the code much. System.SysUtils.PByteArray(some_pointer) however is bit too verbose for my taste. FWIW, I just resolved it with a local type declaration: type PByteArray = System.SysUtils.PByteArray;
  14. Thanks for the quick glance at the subject. I feel it to be important to know which AIs you have tried out though. Especially for the more specific tasks like bug hunting or performance tweaks. A comparison would have been cool, for any of those tasks which AIs shine and which don't.
  15. gkobler

    wuppdi Welcome Page for Delphi 11 Alexandria?

    New Build 31 are available. Also compiled for D11.
  16. Anders Melander

    Namespaces in Spring4d code

    I'm not sure I agree on that. I've just been through a refactoring session where SysUtils was replaced with System.Sysutils which in turn made it necessary to resolve a series of type references as System.Sysutils.PByteArray instead of Sysutils.PByteArray due to a duplicate type declaration. That certainly didn't improve readability.
  17. Kas Ob.

    Blocking hackers

    I never went above 0, for my personal usage and my recommendation for my clients, though some went for extra functionality and paid more. CF free plan is pretty damn good, and it does protect and isolate many if not all of these DoS or DDoS, from their infrastructure capability it is negligible for a site or two. Pretty good damn protection, as you don't even want to care or think about any attacks on all layers up to 5, to understand these and as reminder about layers refer to Wikipedia https://en.wikipedia.org/wiki/OSI_model#Layer_architecture Up layer 3 it is really hard to protect yourself, this involve many raw sockets and very low level networking which even harder on Windows without involving Drivers and Filter Drivers. as for 4 and 5, these are were CF can offload this huge pain in the back to manage, then you will be left with the last two layers 6 and 7, these are absolutely your job to protect against, to explain, if your server miss handling a JSON payload that cause a crash, or freeze .... these are your job as developer to handle and protect against. There is many can be written here, but i hope i gave a good start point to start your own research about these layers how things can go wrong with them, as Denial of Service (Dos) and Distributed DoS (DDoS), can be to deplete server resources or just cause havoc and instability for the service, in this case with Angus, the hackers were using DoS but after blocking by IPs they switched to DDoS, still the attack target itself is not clear for me, is it brute forcing a password or just scraping data or.... this must be handled by Angus, and again most cases need a login, hence session come to play, and delegate this to CF is nice, and please be careful here and don't confuse the session for the HTTP(s) CF established and your server session for logged/not logged aka your own server session, these are two different sessions, but can be combined or in other words co-exist and utilized. It is unlimited, at least from i witnessed, and yes it was wild traffic and CF chewed it like nothing for static/cached/cdn content and for dynamic, yet your server was hidden and relaxing. Also there is these features/APIs like https://www.cloudflare.com/application-services/solutions/api-security/ https://developers.cloudflare.com/api-shield/ You can have a look at these case-studies which i rarely trust or believe in almost even read, but with CF it is true and it is everywhere and doing it job, https://www.cloudflare.com/case-studies/ With that being said about CF, i used OVH and my own server redirections, OVH filtered DDoS attacks up to level 4, my server was free from needing to handle those, and for higher level i didn't use captcha but utilized some redirection, to filter out any bots, see most bots even the sophisticated ones can be fooled or identified by this redirection, redirect to a page on sub domain use your own headers and cookies then return them to another one, if you ever watched what Microsoft does for web Outlook/Hotmail login (it was their standard in not so long past), you will get the idea, though this practice is dying due to cross origin policy on browsers. Anyway, the whole thing of stopping such attacks will comes to identify what is their target, simply put the server/service out of work ? grabbing public data ? grabbing valuable data ? brute forcing to gain access ?.... for each case you need build a solution, But in general such just repeated http requests, CF will filter them out, most of them, see CF does know what each and every IP does and to whom it belongs, so VPN and proxies are the easiest to block. Also i wouldn't suggest to block IP(s) by /24, that is excessive, i always use limit per second per one IP no ranges, and combine it with minutes, the more ip connect and request the more delay to keep blocking and unblock after one hour no matter what, of course if the HTTP server is handling keep-connection right and doesn't trigger the auto block by dropping the connection itself, in other words will not allow HTTP/1.0 and old browsers, these will block them selves. Most valuable tool to identify and block is dynamic cookies, not static ones, for established connection dynamic is good, for new will be handled as suspect under provision, combining these with IP(s), see, let say /24 range so i can allow 255 different cookies for that range and start to block, even go after them all, but if one still having my cookie and updating it consequently then it is fine, but this include keep tracking cookies at least as the server is running, unless the login cookie is kept in DB then the infrastructure is there to expand and track them all.
  18. Anders Melander

    Check If File is what he claim to be

    Bike shedding For example like this: https://github.com/graphics32/graphics32/blob/b45d1108a8f57b66739731e952f81e2636c63abd/Source/GR32.ImageFormats.pas#L386 Example of use: const FileSignaturePNG: AnsiString = #$89#$50#$4e#$47#$0d#$0a#$1a#$0a; FileSignaturePNGMask: AnsiString = #$ff#$ff#$ff#$ff#$ff#$ff#$ff#$ff; ... function TImageFormatAdapterPNG.CanLoadFromStream(AStream: TStream): boolean; begin Result := CheckFileSignature(AStream, FileSignaturePNG, FileSignaturePNGMask); end;
  19. David Heffernan

    Check If File is what he claim to be

    It's funny to see various people posting their own solutions when the original post contains a comprehensive implementation....
  20. dummzeuch

    BIG changes

    I think we should stop feeding the troll.
  21. And if you run into problems with that, see:
×