Leaderboard
Popular Content
Showing content with the highest reputation on 05/05/23 in all areas
-
ANN: New DNS and (C)LDAP Clients for FPC in mORMot 2
Arnaud Bouchez posted a topic in Delphi Third-Party
We just introduced in our Open Source mORMot 2 framework two client units to access DNS and LDAP/CLDAP servers. You can resolve IP addresses and services using DNS, and ask for information about your IT infrastructure using LDAP. There are not so many working and cross-platform OpenSource DNS and LDAP libraries around in Delphi or FPC, especially compatible with the latest MS AD versions. And none was able to use Kerberos authentication, or signing/sealing, AFAIK. Last but not least, its DNS and CLDAP server-auto-discovery feature is pretty unique. Please see https://blog.synopse.info/?post/2023/04/19/New-DNS-and-(C)LDAP-Clients-for-Delphi-and-FPC-in-mORMot-2 🙂 -
Why does a stack overflow cause a VCL application to terminate?
Remy Lebeau replied to Der schöne Günther's topic in RTL and Delphi Object Pascal
Makes sense why it would fail. A stack overflow means there is no more stack space available to push new data onto. In x86, all of those extra function calls are going to keep trying to push data onto the call stack. Eventually something has to give way. Moral of the story - don't overload the call stack in the first place! -
UInt64 -> TArray<Byte> -> shift bits
Stefan Glienke replied to o815's topic in Algorithms, Data Structures and Class Design
Don't bother and simply use BigInteger from https://github.com/rvelthuis/DelphiBigNumbers (or rather https://github.com/TurboPack/RudysBigNumbers which seems to be the maintained fork) - it most likely has all operations that you need -
Hello, is ready to download and test the wrapper around the Opencv version 4.6 C++ API . This is the more recent Opencv stable version. The old pure C API misses all the functions implemented only as C++ classes, starting from the Machine Language module (ML), that was present since the Opencv v 1.0 . Note: from v 2.4 onwards the old C API is always present, although no more officially supported. This version of Opencv, among many other things, has a Deep Neural Network (DNN) module, capable of load and use the most common neural net formats: Tensorflow, Torch, Caffe, Darknet, ONNX. The wrapper supports this, of course, and has many improvements compared to my precedent wrapper for Opencv v 2.4.31 . All suggestions are welcome. On Github: https://github.com/gidesa/ocvWrapper46 Thanks Giando
-
Why does a stack overflow cause a VCL application to terminate?
Attila Kovacs replied to Der schöne Günther's topic in RTL and Delphi Object Pascal
Perhaps it's because x64 parameters are stored in registers instead of on the stack. Could you check the assembly code and add more parameters to see if x64 fails as well? -
I have followed instructions from Embarcadero support and it is now working. I still had to run the installer twice becuase it found a previous trial license even though I had deleted it.
-
The new Community edition cannot be installed from ISO in any way. Moreover, they don't provide a link to the ISO for the CE's users, only a link to the online installer.
-
Scalable. Useful for about boxes. Enjoy! Powered By Delphi 11.3 H150.svg
-
FCM with Kastri - how to send multiple messages (multicast)
Dave Nottage replied to Alin's topic in Network, Cloud and Web
Thanks! It's much easier to have each of the devices subscribe to a topic using the SubscribeToTopic method, and simply send the push notification using a topic, rather than multiple tokens. If you really do want to base it on individual tokens, see: https://firebase.google.com/docs/cloud-messaging/js/device-group It's in Javascript, however something similar could be constructed in Delphi. -
Assign KeyDown function to btnClick
Remy Lebeau replied to Willicious's topic in Delphi IDE and APIs
-
Poor image quality with DrawBitmap when destination is smaller than source
Anders Melander replied to XylemFlow's topic in FMX
Btw, I don't know if the following is relevant to what you're doing: https://blog.grijjy.com/2021/01/14/shader-programming/ -
@xorpas maybe some like this... Invalidate informs the form that its entire surface needs to be repainted. Calling Invalidate can prevent flicker caused by a series of partial repaints. There is no performance penalty for calling Invalidate multiple times before the form is actually repainted. implementation {$R *.fmx} var LImageWidthOriginal, LImageHeightOriginal: single; LFontSizeScale : single = 1; // init value procedure TForm1.Button1Click(Sender: TObject); begin Image1.Align := TAlignLayout.None; // Image1.Size.Width := 200; Image1.Size.Height := 200; LFontSizeScale := (Image1.Width * Image1.Height) / (LImageWidthOriginal * LImageHeightOriginal); // Invalidate; // re-do form canvas end; procedure TForm1.Button2Click(Sender: TObject); begin Image1.Align := TAlignLayout.None; // Image1.Size.Width := 500; Image1.Size.Height := 600; LFontSizeScale := (Image1.Width * Image1.Height) / (LImageWidthOriginal * LImageHeightOriginal); // Invalidate; // re-do form canvas end; procedure TForm1.Button3Click(Sender: TObject); begin Image1.Align := TAlignLayout.Client; // LFontSizeScale := (Image1.Width * Image1.Height) / (LImageWidthOriginal * LImageHeightOriginal); end; procedure TForm1.FormCreate(Sender: TObject); begin // 3º - first run Image1.WrapMode := TImageWrapMode.Stretch; LImageWidthOriginal := Image1.Size.Width; LImageHeightOriginal := Image1.Size.Height; end; procedure TForm1.Image1Paint(Sender: TObject; Canvas: TCanvas; const ARect: TRectF); var LRectText : TRectF; LImagePoint: TPointF; begin // 4º - first run LImagePoint := Image1.AbsoluteToLocal(PointF(Image1.Position.x + 10, Image1.Position.Y + 10)); LRectText := TRectF.Create(LImagePoint.x, LImagePoint.Y, Image1.Width, Image1.Height); // Canvas.Fill.Color := TAlphaColorRec.Yellow; Canvas.Font.Size := LFontSizeScale * 20; Canvas.FillText(LRectText, 'Hello World', false, 1, [], TTextAlign.Leading, TTextAlign.Leading); end; procedure TForm1.Image1Resize(Sender: TObject); begin // 1 º - first run end; procedure TForm1.Image1Resized(Sender: TObject); begin // 2 º - first run end; end.
-
Just set the buttons Default property to true, it will then automatically "click" when the user presses Enter/Return and the active control does not handle the key itself. No code needed...
-
I think the issue is with BitmapScale. With the code below I get the text in the right position. procedure TForm1.Button1Click(Sender: TObject); var ARect: TRectF; s: string; begin with Image1.Bitmap do begin Canvas.Font.Family := 'Arial'; Canvas.Fill.Color := TAlphaColorRec.Black; ARect.Top := 200; ARect.Left := 100; ARect.Width := 105; ARect.Height := 50; s := 'hellow Fmx'; Canvas.BeginScene; Canvas.Clear(TAlphaColorRec.White); // canvas.textout(20,20,'hellow Fmx'); Canvas.FillText(ARect, s, false, 1, [], TTextAlign.Leading, TTextAlign.Leading); Canvas.EndScene; SaveToFile('testBmp.png'); end; end; procedure TForm1.FormCreate(Sender: TObject); begin Image1.Bitmap.SetSize(Round(Image1.Width), Round(Image1.Height)); Image1.Bitmap.BitmapScale := 1; end;
-
Integrate with OpenAI's ChatGPT API seamlessly from Delphi. Features Easily access the GPT API from a single class Supports both GPT3 and GPT4 models API key can be read from ChatGPTApiKey environment variable if defined Automatically sanitizes input to minimize errors Ability to define proxy settings Adjust personality response with a precision range of 0-1, from precise to creative Stream responses just like in the ChatGPT web interface Usage Get your API Key: https://platform.openai.com/account/api-keys Define environment variable ChatGPTApiKey and assigned your API key. You may have to reboot your machine for it to take effect. // Basic example showing how to query ChatGPT uses AskChatGPT; var LChat: TAskChatGPT; begin LChat := TAskChatGPT.Create; try // set chat params LChat.Model := GPT3; // use the GPT3 model, or GPT4 for the GPT4 model LChat.Creative := 1; // 0-1, 0 being most percise and 1 being most creative // ask question LChat.Question := 'What is Delphi?' // print question PrintLn('Q: %s', [LChat.Question]); // process and print response if LChat.Process then PrintLn('A: %s', [LChat.Response]); finally LChat.Free; end; end; Media Download https://github.com/tinyBigGAMES/AskChatGPT
-
Contributing to projects on GitHub with Subversion
Cristian Peța replied to dummzeuch's topic in Tips / Blogs / Tutorials / Videos
I think your last statement here: "We've spent today testing Fork and GitKraken and landed on GitKraken Pro due to the issue tracker integrations and built in GitFlow support - which really simplify doing proper branching for features, fixes and releases. " -
Can you try with the latest version V15.1.6 please? As I wasn't able to reproduce it at will, I cannot be sure to actually have fixed it.