Jump to content

Leaderboard


Popular Content

Showing content with the highest reputation on 02/04/19 in all areas

  1. 3 points
    It is never a good idea to increment the size by one. See this blog post: Extending arrays But otherwise: yes, you are being too pedantic. If this is in a tight loop, you might think of profiling which is faster, otherwise, it doesn't really matter. FWIW, I would do it like this (after Delphi XE7, IIRC): NewRecord.SomeField := SomeValue; // etc... MyArray := MyArray + [NewRecord]; No need for SetLength, Len or High
  2. 2 points
    People have actually asked for blame as a feature, that's why I included it back then in delphisvn (before it became Version Insight). I find it useful myself to see who committed which lines and also when. This piece of metadata can be useful when trying to understand a code base and its evolution.
  3. 1 point
    Define "fail". For German language settings it returns a comma, which is probably correct in most cases. If the choice is either comma or point, the algorithm can be adapted to that. Otherwise the task is just not fully defined for all inputs. So what would you call a correct result when the decimal separator is not part of the string?
  4. 1 point
    function GuessDecimalSeparator(const Value: string): Char; { assumes that the decimal separator is the last one and does not appear more than once } var idx: Integer; begin idx := Value.LastIndexOfAny(['.', ',']); // possible decimal separators if (idx >= 0) then begin Result := Value.Chars[idx]; if Value.CountChar(Result) = 1 then Exit; end; Result := FormatSettings.DecimalSeparator; // Default end;
  5. 1 point
    I would add a little more safety anyway, to ensure that you' in a number at all, e.g. like _s[i-1].IsSpace or _s[i-1].IsDigit _s[i+1].IsSpace or _s[i-1].IsDigit and probably if you find the first dot in a new number, just analyse this number until the end. I assume this would give a little more stable results, to avoid things like "a,b,c,d" counting wrong.
  6. 1 point
    AFAIK this is not a feature of the official Delphi IDE, but rather a plugin from Uwe Schuster that is no longer supported for recent Delphi version. Correct me if I am wrong as I love live blame very much, but can't use it except for Delphi XE.
  7. 1 point
    A new development snapshot of IDEFixPack is available. This fixes the usage of a SSE 4.1 CPU instruction ("ptest") in a code block that only checked for SSE 2. This bug caused older CPUs to throw 0xC000001D "illegal instruction" exception. IDEFixPackD103RegDev.7z fastdccD103vDev.7z
  8. 1 point
    Thanks for your answer. I was so sure of having all freeing that ... I got a doubt while reading again your OTL book, not finding "the missing point" in my implemntation of OTL. And. Finally, I found some memory Leak from an external DLL that I did not covered. So, now, it seems that I have no more troubles. Sorry for disturbing the forum for a so "typical" issue. To answer your question, I'm "playing" with a big database of daily evoluting datas (macro economics). So, as an example, the main first calcs needs more or less 7 days x 24 hours to do it with my hardware configuration ; the daily recalcs tooks more or less at least 1 hour ; and that with OTL use, and SQL engine and so with very various and tested (mesured) optimizations. So OTL is the right answer for me to improve my hardware and reduce time consuming. And I have to say OTL is really a great solution to use. Thanks.
  9. 1 point
    GiT - don't waste your time on anything else. Lots of client choices, but most all it has such broad community support.
  10. 1 point
    Bitbucket is a great versioning system based on git. You can have 5 users for free, so you can always give it a try. It works well with Sourcetree as a client. It,s also easy to integrate with Jira.
  11. 1 point
    Sorry, the code is so tightly coupled with our private code, it would take some time to decouple the pieces. We may do a blog article on this in the future on our site, blog.grijjy.com. The approach we took is to use the example ITestRunner that are included with Delphi samples and just intercept the test results and send them over the wire. You could use almost any communication library to send them, or even log them locally if you want to avoid that step.
  12. 1 point
    SourceForge had a time with technical problems (not only with svn), and it took them quite a while to sort them, but they are now back to being reliable and fast. During that time I moved many of my open source projects to OSDN (which started off as a SourceForge clone). They are also quite good. Also, github offers svn access to git repositories. It works for simple cases. My most treasured feature of svn - externals - is not supported though. But of course these are mostly for open source projects. I would not use a cloud service for proprietary sources at all.
  13. 1 point
    1. Because they have full control and can do with it what suits their needs the best 2. Dogfooding 3. They also have IDE for Mac - Fire (and that was first one they wrote - AFAIK when they started that project there was no VS for Mac) - Water is just Windows variant to prove cross-platform viability of their approach 4. Here we were talking about VSCode that fits nicely for some things (not VS), but still is resource hungry Electron app. I don't know about Water, but Fire is native Mac application - which means fast. 5. When it comes to VS itself and VS being so nice... I don't know. Last time I used it it was dog slow comparing to Delphi IDE (around XE time). 6. Having plugins for various IDEs can be nice and certainly is good place to start when you are just starting - but nothing beats fully dedicated IDE under your control.
  14. 1 point
    If VS is so great, then why RemObjects create Water - their own IDE for Windows?
  15. 1 point
    I prefer Subversion as it is very easy to use (with TortoiseSVN) and easy to manage in closed environment with its centralized repository storage. Git has its nice features but they are not for everyone, and its distributed nature complicates things. Anyway, here is a very good tutorial how to install a Git server to play with, maybe it can help to make the right choice. TortoiseGIT client is also available.
  16. 1 point
    I'm using Git Extensions as a GUI at work, in Version 2.x though as the 3.0 is rather new and I like to wait at least one minor version.
  17. 1 point
    I also use Gitkraken as my Git UI. Never been disappointed by it.
  18. 1 point
    I would suggest Git or Mercurial. Mercurial is a bit easier to learn and most of the time prevents you from shooting yourself in the foot. TortoiseHg works great and fast. Git is more powerful, but has steeper learning curve And I still have to find Windows Git client that actually works. On Mac SourceTree works fine, on Windows not so much - slow beyond description.
  19. 1 point
    As I am still looking for a usable GIT client that matches the ease of the TortoiseHG workbench, I should probably evaluate SourceTree again.
  20. 1 point
    Using classes just for the sake of using classes can be nice exercise in futility. I have to admit that I haven't paid close attention to this post and I have been reading it rather superficially, so it is possible that I missed some piece. But from your original post I don't see any compelling reason why you should switch to classes. Especially if you don't feel comfortable with them and don't really see the point. Main advantage of classes over records is polymorphism. If you don't have the use case for it, then records will do. Also, one small note - you are holding your records in dynamic array, and those are allocated on the heap, not on stack. Only the few bytes of your global record holder would sit on stack. And overall, class based solution would use more memory than record based one. That does not mean that you should not learn more about the classes, but trying to learn on wrong use case will make things harder not easier. You should learn about classes with examples where they really show their advantage and then you will be able to understand them better.
  21. 1 point
    You, Sir, are a scholar and a drinker of fine ales.
  22. 1 point
    When you eat something, you need to prepare it (maybe cook it, or order it, or unwrap it), then you need to clean up afterwards. When you get in your car to go somewhere, you need to start it up; when you arrive at your destination, you need to shut it off. When you walk into a room, you may need to open the door and perhaps turn on a light; when you leave, you may need to shut the light off and close the door. Most things in life require some kind of setup, then you do something, then you clean up after yourself. Tell me it really bothers you having to deal with this constantly in your life ... or if you're like most people, you don't ever give any of it a second thought. Objects work the same way. The fallacy in your logic (and people who claim to dislike creating and freeing things) is that just because there's nothing named "constructor" or "destructor" that you're not initializing things first and cleaning up afterwards. Variables often need to be initialized and cleaned-up, regardless of their scope. By default, the compiler clears out globals automatically for you by setting them to zero, but it's risky to depend on default behaviours like that from your environment. Constructors are simply methods used for INITIALIZING an object's state. They're usually just a bunch of assignment statements. They may also create other objects required inside of the object. Simple objects that don't inherit from a parent class with a constructor that needs to be called don't need constructors. Destructors are for cleaning up when you're finished using the object. For simple classes, they're often not necessary. But if you allocate anything from the heap within the class, then they're required if you want to avoid memory leaks. However, it's a good practice to always have constructors and destructors defined, even if they're empty. And if they ARE empty, the compiler optimizes them out. The nice thing about them is they're called automatically, unlike your existing code that needs to be called explicitly. So don't tell me you dislike creating things! Classes with constructors and destructors require less code than what you're doing now ... guaranteed. Even if you're working with a bunch global variables, any nontrivial application has code that initializes groups of related variables, and breaks them down when you're finished. One of the biggest hurdles functional programmers need to overcome when learning OOP is that all of those global variables need to be collected into closely-related groups, and those groups are called "classes". Then you move the code that's already there that's used to initialize those variables into the class' constructor, and any code that's already there for cleaning up into the class' destructor. Then you want to hide the variables themselves ("encapsulation") by defining properties so if the underlying implementations change, you don't have to change every single place they're referenced. Trust me ... after you've been using OOP principles correctly for a while, it becomes second-nature, and you'll wonder how you managed to keep your sanity dealing with everything splattered all over the place with no organization whatsoever.
  23. 1 point
    A new development snapshot of IDE Fix Pack for 10.3 Rio is available. The Win64 (DCC64) and Android (DCCAARM) compiler patches should now work as excepted. Changes: Added: Support for Delphi 10.3 Rio Added: Fix for TStringList.IndexOfName bug (RSP-21633) Added: Fix for access violoation in the Welcomepage JScript9.dll binding Added: TCustomListBox.ResetContent is skipped if the handle isn't created yet Added: DFM Streaming optimizations Added: FillChar uses Enhanced REP MOVSB/STOSB cpu feature if available for large sizes. Added: Enabled CPU LOCK string assignment optimization for local variables Added: -Oe (experimental optimizations) and -x-cgo compiler option extension (Remove of some unneccessary push/pop operations) Added: Expression Evaluator allows array access to pointers even if the type wasn't declared with {$POINTERMATH ON} Added: New compiler option extensions: -x--compileonly, -x--reslist, -x--depfile, -x--unitstats Added: More performance optimization for the DCC64 compiler Added: TStringBuilder.SetLength optimization [RSP-19178] Added: TStrings.GetDelimitedText optimization Fixed: Packages with duplicate units may not have caused a fatal compiler error. IDEFixPackD103Reg64.7z fastdccD103vDev.7z
  24. 1 point
    You probably mean VersionInsight and VersionInsight+ Sherlock
  25. 1 point
    The way to deal with this is to have a function return a string whenever possible, that way it is clear in the calling code that `S` is being overwritten. Never output the same managed type of data that you allow as input in a var or out parameter. function y(const input: string; out Success: boolean): string; begin Result:= input + '1'; // end; status:= x(S,S); //Looks harmless S:= y(S, status); //The danger is clearly visible in the calling code Alternatively he compiler could issue a warning when a const parameter is also passed as a var/out parameter. also this code does not make a whole lot of sense: if x(S,S) then .... ////^^^^^ ////hiding dangerous -work- stuff with side-effects in an if statement. You should never do unconditional work inside an if statement. That's too unexpected.
×