Jump to content

Leaderboard


Popular Content

Showing content with the highest reputation since 04/13/24 in Posts

  1. Anders Melander

    TListview and TImage Pixalated Image

    Maybe you should think a bit more about that. Ideally until it is no longer a mystery. What possible reason could there be for that limit? The 16x16 default is a big clue...
  2. Your TImageList seems to contain 16x16 pixels images. That's why it is pixelated. Use the same size - in pixels - as the source image.
  3. shineworld

    Do you need an ARM64 compiler for Windows?

    We bought industrial Iot licence version for 45 to 89€ depending by number an type of cores. W10 1908 version. It works very fine. I in will prepare a video next week.
  4. I reported the issue to Embarcadero privately and they are looking into it.
  5. TValue has no implicit casting rule for integer -> enum - thus it raises the invalid cast exception because you are passing an Integer to SetValue which gets implicit put into a TValue which gets transported further. It later does a type/cast check against the actual type of the property and fails. See TValue.Cast or TValue.TryCast and the Conversions matrix for more details. I mentioned this many times: TValue is not Variant - it only supports implicit type casts that also the language supports and Integer to Enum type and vice versa is not directly assignable. procedure SetEnumProp(Instance: TObject; const PropName: string; const Value: string); var c: TRttiContext; t: TRttiType; p: TRttiProperty; typInfo: PTypeInfo; enumValue: Integer; v: TValue; begin t := c.GetType(Instance.ClassInfo); p := t.GetProperty(PropName); typInfo := p.PropertyType.Handle; enumValue := GetEnumValue(typInfo, Value); v := TValue.FromOrdinal(typInfo, enumValue); p.SetValue(Instance, v); end;
  6. FreeDelphiPascal

    Delphi and "Use only memory safe languages"

    obj := TObject.Create; FreeAndNil(obj); FreeAndNil(obj); ------------------------------ On SO somebody wrote an example like this to prove how unsafe Delphi is: s: String; i: Integer; begin s:= 'four'; for i:= 1 to 1138 do begin write( s[i] ); // What will it access after i=4? end; end; At one point, we should stop talking about how safe the programming language is and start talking about how "unsafe" is the programmer 🙂 🙂
  7. Nigel Thomas

    Looking for a couple of good "starter" Delphi books

    Don't get hooked up on just books. There is a lot of useful visual material on the Net that is targeted at Delphi beginners. Embarcadero's Helpful Resources for New Users has some good links to both books and visual resources.
  8. Elliot Hillary

    DelphiLint v1.0.0 released!

    We're excited to announce the release of DelphiLint v1.0.0, a free and open-source static analyzer and linter for the Delphi IDE! DelphiLint is powered by SonarDelphi, our Delphi analyzer for the SonarQube code quality platform that scans entire codebases with more than 120 different rules. With DelphiLint, the feedback loop is shortened - it allows you to analyze individual files within your editor and correct problems before they're even checked in. GitHub: https://github.com/integrated-application-development/delphilint Release: https://github.com/integrated-application-development/delphilint/releases/tag/v1.0.0 Features Analyze one or more files on demand View detected issues, descriptions, and rationale inline in the Delphi IDE Two analysis modes: Standalone - run analyses entirely locally with a default set of active rules Connected - connect to a SonarQube instance, allowing for Fetching of active rules and configuration from the server's configured quality profiles Suppression of issues that have been resolved in past analyses Usage of the server's version of SonarDelphi Uses the same rules and configuration files as SonarDelphi, making configuration easy for projects that already use SonarDelphi for code quality DelphiLint supports RAD Studio for Delphi 11+. Feedback and contributions are welcome!
  9. FreeDelphiPascal

    Delphi and "Use only memory safe languages"

    Nice post David S! I had recently to fix a bug in a program that was sending wrong financial reports to a governmental financial institution (equivalent to RSI in America) for 18 years. After 18 years, somebody observed the problem. It ended up that there was not only one bug, like 15. Nobody ever observed the other 14 instances where data was wrong. I was told to shut up and move on. Also, nobody cared that my new program was running 100x faster than the previous one. I told them that probably there were another 100 bugs in there (pascal-like code, no objects, thousands of warnings and hints - at least, there were no pointers!). They wouldn't let me rewrite the program. They said, it now it works, let it as it is. So people, don't blame Delphi for not being totally memory-safe. It is mostly the programmer that dictates the safety of a language. I guess the programmer that wrote that program in Delphi would be able to sneak in some calamities like this also in a language like Rust. __________ Also, many people complained about buffer overflow here. Turn on the damn Range and Overflow checking. It will catch a good bunch of those overflows - unless the devil thought you to use pointers all over the place.
  10. I can't tell you which Xcode version is required for the PA-Server of Delphi 12. But here's what I did to make any* PA-Server work with any* Xcode (* well within bounds naturally, I made PAServer of Delphi 11.2 work with Xcode 15.3). Make a copy of PAServer-xyz.app (I used ~/Developer, i.e. below my home directory) In Terminal, remove the signature with "codesign --remove-signature PAServer-xyz.app" cd into "PAServer-xyz.app/Contents/MacOS/lldb/lib/python3.<whatever>" change the symbolic link Python to point to your Xcodes current python: "sudo ln -hfs /Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/Current/Python3 Python" run the modified PAServer (sign it again with your own certificate if desired) The "Current" in that Xcode path is a handy symbolic link - and makes me wonder why PAServer doesn't make use of it.
  11. Whatever you program in Delphi, compared with most other languages, it will stay RAD and you can focus on you actual problem instead for example fighting how to put things on the screen. It takes the Online department, with Node, Javascript and pumping JSON files through the internet, with three developers (backend, frontend and HTML/CSS designer) about one week for one screen. They calling Delphi old fashioned while I look to their source and problems as if they still live in the 1980's.
  12. PeterBelow

    Delphi and "Use only memory safe languages"

    Consequent use of interface references (with rerf counting for lifetime control) instead of object references avoids that problem completely.
  13. Lars Fosdal

    Delphi and "Use only memory safe languages"

    Ref := ItemProvider.Grab(ItemId); // or Ref := ItemProvider.GrabForChange(ItemId); try // do stuff finally ItemProvider.Drop(Ref); end; ItemProvider can do the allocation and loading, as well as the disposal. If there is parallell use, it can secure against readers/other writers, have a keep-alive in cache period, etc. In theory, with the "smart pointer" trick, you could even do away with the try/finally.
  14. Dalija Prasnikar

    Delphi and "Use only memory safe languages"

    If you really need to have multiple references to an object, then use interfaces and ARC to manage lifetime. If not, then you will have to invent similar mechanism for managing the lifetime.
  15. Anders Melander

    Delphi Low-code No-code?

    Again? What was old is new again - except my jokes.
  16. Dave Nottage

    working with iOS island

    Same thing happened to me re Ios Island 🙂 Following the live activities link leads to: https://developer.apple.com/documentation/ActivityKit/displaying-live-data-with-live-activities Which talks about using Widget Extensions, which are yet to be possible in Delphi, however there's a slim chance that the extension can "talk" to Delphi code: https://blog.grijjy.com/2018/11/15/ios-and-macos-app-extensions-with-delphi/ I have very little optimism about the possibility
  17. I've searched 2 hours long for an answer: - What is the main difference between OpenSSL 3.0.x / 3.1.x / 3.2.x / 3.3.x ? Here is what I've found: The main difference is the support time vs. speed issues vs. new features. 3.0 was reported to be slow, but it will get the longest support (LTS): 2026-09-07 3.1 is a "middle solution", much faster but shorter support: 2025-03-14 3.2 is currently the recommended version, (but it has shorter support time than the LTS): 2025-11-23 1.1.1, 1.1.0, 1.0.2, 1.0.0 and 0.9.8 are now out of support and should not be used 3.3 is only at alpha state yet.
  18. Lars Fosdal

    DelphiLint v1.0.0 released!

    My workmachine is not quite JRE free, due to IBM ACE. But in general, I don't install Java apps if I can avoid it.
  19. Stefan Glienke

    DelphiLint v1.0.0 released!

    However, it might not be permitted to do so in corporate environments.
  20. Finally got some time to get back to my project and completed the goal. Thanks for the hints @Remy Lebeau. Here are the results if anyone needs the hack without modifying TSSLWSocketServer class: procedure TMainForm.SSLServerClientCreate(Sender: TObject; Client: TWSocketClient); var mConn: TClient; begin mConn := Client as TClient; mConn.OnDataAvailable := SSLServerDataAvailable; mConn.mTest := False; end; procedure TMainForm.SSLServerClientConnect(Sender: TObject; Client: TWSocketClient; Error: Word); var mConn: TClient; begin mConn := Client as TClient; mConn.SSLEnable := False; end; procedure TMainForm.SSLServerDataAvailable(Sender: TObject; ErrCode: Word); var mConn: TClient; mPeek: TBytes; mData: String; begin mConn := Sender as TClient; if not mConn.mTest then begin // first read SetLength(mPeek, 2); mConn.PeekData(mPeek, 2); mConn.mTest := True; if (mPeek[0] = 22) and (mPeek[1] = 3) then begin // client hello SetLength(mPeek, 0); mConn.SSLEnable := True; mConn.SSLContext := SSLContext; mConn.AcceptSSLHandshake; Exit; end; SetLength(mPeek, 0); end; mData := mConn.ReceiveStr; end; The only thing I'm worried about is memory leak due to not reading connected socket after data available call. At some point I had experience of that issue in another project. Regards.
  21. Lars Fosdal

    Migrating projects from Delphi to .Net

    My advise would be to write a few test apps in .NET before you start your migration. Learn how to do databases, files, classes, interfaces, OS and UI. Understand the new paradigms before you try to csharpify Delphi code, so that you know how things work in C# and what you need to change from Delphi. Sadly, UI is still much more work in .NET compared to all the "freebies" in Delphi - and there are several flavours. WinForms, WPF, MAUI, ASP.NET, Blazor. You need to find the one that suits the needs for your app. You will most likely find yourself wanting to acquire some third party UI controls. For any complex Delphi app, you are not looking at a migration, but a rewrite.
  22. Dave Nottage

    Unable To Install Android Apk Under Developer Mode Via USB

    Uninstalling the original app would have had the same effect. If you find you need to add that attribute, please refer to:
  23. Its available under All Android 64 Bit, and should be under Release Android 64 Bit as well Did you switch in both Android 32 and 64 to the Application Store ? Did you provide in the Project options provisioning the requred data and verified it ?
  24. Rethinking Delphi Floating Point Control Register Management.pdf
  25. rvk

    TWebBrowser + dynamic JS question

    You might want to dial down the sarcasme. I'm trying to help you here and with that attitude I'm feeling less and less inclined to do so. With my example I retrieved your search result and got this (this is a snippet just to show you the content is there). <div class="I6vAHd h5RoYd ads-creative">Dr. Lazer is a <b>Baltimore Dentist</b> Dedicated To Quality <b>Dental</b> Care. Financing Available. Patient Focused <b>Dentistry</b>. Top <b>Baltimore Dentists</b>. Advanced Training. Services: Cosmetic <b>dentistry</b>, General <b>dentistry</b>, Porcelain veneers, Teeth whitening, <b>Dental</b> implants, Cosmetic dentures, <b>Dental</b> crowns.</div><ul class="OkkX2d"><li><a class="V0MxL" onmousedown="return google.f[this.getAttribute('data-mousedown')](this)" ontouchstart="return google.f[this.getAttribute('data-touchstart')](this)" href="https://www.cosmeticdentistbaltimore.com/our-office/ed-lazer-dds/?TrackNum=410-753-2005" data-ved="2ahUKEwj7o4KsiIPkAhVEJlAKHYQZDhMQpigoAHoECA8QBA" data-touchstart="bez1fd" data-mousedown="LmvwCb" data-arwt="//www.googleadservices.com/pagead/aclk?sa=L&ai=DChcSEwia64isiIPkAhVH5HcKHQCGCzoYABABGgJlZg&ohost=www.google.com&cid=CAASE-RoDCdUQXMX66yba6ZIKqfKGC0&sig=AOD64_0RkT0b2u8xR9l7_LEQw9VUouKjzQ&adurl=&rct=j&q=">Meet Dr. Ed Lazer</a></li><li><a class="V0MxL" onmousedown="return google.f[this.getAttribute('data-mousedown')](this)" ontouchstart="return google.f[this.getAttribute('data-touchstart')](this)" href="https://www.cosmeticdentistbaltimore.com/for-patients/special-offers/?TrackNum=410-753-2005" data-ved="2ahUKEwj7o4KsiIPkAhVEJlAKHYQZDhMQpigoAXoECA8QBQ" data-touchstart="bez1fd" data-mousedown="LmvwCb" data-arwt="//www.googleadservices.com/pagead/aclk?sa=L&ai=DChcSEwia64isiIPkAhVH5HcKHQCGCzoYABACGgJlZg&ohost=www.google.com&cid=CAASE-RoDCdUQXMX66yba6ZIKqfKGC0&sig=AOD64_2gU3L1cLsoIxMZDy60AJIwH1-G4w&adurl=&rct=j&q=">Special Offers</a></li><li><a class="V0MxL" onmousedown="return google.f[this.getAttribute('data-mousedown')](this)" ontouchstart="return google.f[this.getAttribute('data-touchstart')](this)" href="https://www.cosmeticdentistbaltimore.com/smile-gallery/?TrackNum=410-753-2005" data-ved="2ahUKEwj7o4KsiIPkAhVEJlAKHYQZDhMQpigoAnoECA8QBg" data-touchstart="bez1fd" data-mousedown="LmvwCb" data-arwt="//www.googleadservices.com/pagead/aclk?sa=L&ai=DChcSEwia64isiIPkAhVH5HcKHQCGCzoYABADGgJlZg&ohost=www.google.com&cid=CAASE-RoDCdUQXMX66yba6ZIKqfKGC0&sig=AOD64_0Eq9nb4XnF90RRE1Ik35kT7kFBQQ&adurl=&rct=j&q=">Smile Gallery</a></li><li><a class="V0MxL" onmousedown="return google.f[this.getAttribute('data-mousedown')](this)" ontouchstart="return google.f[this.getAttribute('data-touchstart')](this)" href="https://www.cosmeticdentistbaltimore.com/request-appointment/?TrackNum=410-753-2005" data-ved="2ahUKEwj7o4KsiIPkAhVEJlAKHYQZDhMQpigoA3oECA8QBw" data-touchstart="bez1fd" data-mousedown="LmvwCb" data-arwt="//www.googleadservices.com/pagead/aclk?sa=L&ai=DChcSEwia64isiIPkAhVH5HcKHQCGCzoYABAEGgJlZg&ohost=www.google.com&cid=CAASE-RoDCdUQXMX66yba6ZIKqfKGC0&sig=AOD64_2N4qM3fV1hZgFsH22ko3zEIjVzFQ&adurl=&rct=j&q=">Schedule Appointment</a></li><li><a class="V0MxL" onmousedown="return google.f[this.getAttribute('data-mousedown')](this)" ontouchstart="return google.f[this.getAttribute('data-touchstart')](this)" href="https://www.cosmeticdentistbaltimore.com/contact/?TrackNum=410-753-2005" data-ved="2ahUKEwj7o4KsiIPkAhVEJlAKHYQZDhMQpigoBHoECA8QCA" data-touchstart="bez1fd" data-mousedown="LmvwCb" data-arwt="//www.googleadservices.com/pagead/aclk?sa=L&ai=DChcSEwia64isiIPkAhVH5HcKHQCGCzoYABAFGgJlZg&ohost=www.google.com&cid=CAASE-RoDCdUQXMX66yba6ZIKqfKGC0&sig=AOD64_0sMvnrhd-h49qKlc3LKos0K2h67w&adurl=&rct=j&q=">Contact Us</a></li></ul></li><li class="ads-ad" data-hveid="CBAQAA" data-bg="1"><div class="ad_cclk"><a id="n1s0p2c0" style="display: none;" href="https://www.googleadservices.com/pagead/aclk?sa=L&ai=DChcSEwia64isiIPkAhVH5HcKHQCGCzoYABAGGgJlZg&ohost=www.google.com&cid=CAASE-RoDCdUQXMX66yba6ZIKqfKGC0&sig=AOD64_38aJbvxP_v7qoqtk0s9Byp6f8NQw&rct=j&q=&ved=2ahUKEwj7o4KsiIPkAhVEJlAKHYQZDhMQ0Qx6BAgQEAE&adurl="></a><a class="V0MxL r-ieStqovnU5rk" id="vn1s0p2c0" onmousedown="return google.arwt(this)" ontouchstart="return google.arwt(this)" href="https://www.aspendental.com/dentist/md/dundalk/1401-merritt-blvd" jsl="$t t-r1glFWqNI5A;$x 0;"><h3 class="sA5rQ">Official Aspen Dental | Affordable dentistry‎</h3><br><div class="ads-visurl"> You see that text: Dr. Lazer is a <b>Baltimore Dentist</b> Dedicated To Quality <b>Dental</b> Care. Financing Available. Is that what you are after? (this is from the outerHTML) Yes, it's riddled with javascript and lots of tags. But it's valid HTML with the content provided on screen of the user. If it's not, please provide some text that you did expect. BTW, You do need to read out outerHTML in WebBrowser1DocumentComplete() because the javascript needs time to run. But I assumed you already knew this.
×