-
Content Count
3504 -
Joined
-
Last visited
-
Days Won
115
Everything posted by Lars Fosdal
-
take a look to this REST API Server
Lars Fosdal replied to RDP1974's topic in Network, Cloud and Web
Still wondering WHY I should spend time looking at it? -
How do you open the files with regards to sharing?
-
Binary size, how-to make it smaller?
Lars Fosdal replied to Wil van Antwerpen's topic in General Help
Ok, that explains it until the next time I've forgotten about it. Thanks, @Dalija Prasnikar 🙂 -
Binary size, how-to make it smaller?
Lars Fosdal replied to Wil van Antwerpen's topic in General Help
I agree. They are the bread and butter of most apps. Still, it makes you wonder why the linker cannot eliminate more of the unused stuff. -
Apache Module with TDataSet Needs Wait Cursor
Lars Fosdal replied to corneliusdavid's topic in Network, Cloud and Web
Can it be reproduced in a miniature example, using only direct FireDAC calls? Are you sure there is no exception handling or error eating inside your library routines?- 15 replies
-
- firedac
- waitcursor
-
(and 3 more)
Tagged with:
-
Binary size, how-to make it smaller?
Lars Fosdal replied to Wil van Antwerpen's topic in General Help
Turn off RTTI if you can. -
Apache Module with TDataSet Needs Wait Cursor
Lars Fosdal replied to corneliusdavid's topic in Network, Cloud and Web
If you explicitly - without conditions - use the FireDAC.ConsoleUI.Wait unit in the project: Can you describe any errors you may get? If no errors - can you identify which call that fail? The connect or the query?- 15 replies
-
- firedac
- waitcursor
-
(and 3 more)
Tagged with:
-
Apache Module with TDataSet Needs Wait Cursor
Lars Fosdal replied to corneliusdavid's topic in Network, Cloud and Web
What happens if you include the console version unconditionally?- 15 replies
-
- firedac
- waitcursor
-
(and 3 more)
Tagged with:
-
Apache Module with TDataSet Needs Wait Cursor
Lars Fosdal replied to corneliusdavid's topic in Network, Cloud and Web
Have you tried adding this to your uses clause? {$ifdef Console} FireDAC.ConsoleUI.Wait, {$else} FireDAC.FMXUI.Wait, FireDAC.Comp.UI, {$endif}- 15 replies
-
- firedac
- waitcursor
-
(and 3 more)
Tagged with:
-
A Curious Inheritance Problem... what pattern solves it?
Lars Fosdal replied to David Schwartz's topic in RTL and Delphi Object Pascal
My workaround for generic classes is a non-generic base class. The challenge is always how to wrap stuff in such a way that you can get done what you need get done with the methods and properties defined in the abstract base class. I.e. Keep the T stuff out of the methods as far as possible. Rough example... type TxQuery = class abstract protected function GetSQL: TStrings; virtual; abstract; function GetDataSet: TDataSet; virtual; abstract; public constructor Create; virtual; // doesn't really need to do anything but exist procedure Execute; virtual; abstract; property SQL: TStrings read GetSQL; property DataSet: TDataSet read GetDataSet; end; TxQuery<T: TFDDataSet> = class(TxQuery) private FiQuery: T; protected // overrides property iQuery: T read FiQuery write FiQuery; public // overrides constructor Create; override; // initialize the T stuff end; TxQueryClass = class of TxQuery; -
OmniPascal: Auto-Implementation of methods not working
Lars Fosdal replied to Der schöne Günther's topic in Delphi Third-Party
Perhaps file an issue here: https://bitbucket.org/Wosi/omnipascalissues/issues -
File Copy implementation with Progress Callback
Lars Fosdal replied to Tommi Prami's topic in Algorithms, Data Structures and Class Design
BTW: Did you try CopyFileEx? https://docs.microsoft.com/en-us/windows/win32/api/winbase/nf-winbase-copyfileexa -
File Copy implementation with Progress Callback
Lars Fosdal replied to Tommi Prami's topic in Algorithms, Data Structures and Class Design
DoCopy calls WinAPI.Windows function CopyFile; external kernelbase name 'CopyFileW'; So, your guess is good as mine... -
File Copy implementation with Progress Callback
Lars Fosdal replied to Tommi Prami's topic in Algorithms, Data Structures and Class Design
Callstack? -
File Copy implementation with Progress Callback
Lars Fosdal replied to Tommi Prami's topic in Algorithms, Data Structures and Class Design
The silent flag for the shell copy makes it run nicely in services and console apps - but yeah... no progress callback. LOL at the last comment 😄 -
File Copy implementation with Progress Callback
Lars Fosdal replied to Tommi Prami's topic in Algorithms, Data Structures and Class Design
Edit: Doh - as always I misread the original post... You wanted a callback for progress, I offered a progress bar 😛 Off to top up the coffee mug... I use the native Windows one. It deals well with UNC paths, access rights, network glitches, etc. In addition, I touch up the target file date to ensure it matches the original file date. Code was yanked from a utility unit, so there may be missing or superfluous units or functions. uses System.SysUtils, WinAPI.Windows, WinAPI.mmSystem, Winapi.ShlObj, Winapi.ShellApi, Winapi.ShFolder; function ShellFileOperation(const hHandle: THandle; const aSourceFiles: string; aTargetDirectory: string; aFunc:UInt; aFlags: FileOp_Flags; ProgressText:String):Integer; var shellinfo: TSHFileOpStruct; rc: Integer; begin FillChar(ShellInfo, SizeOf(ShellInfo), 0); shellinfo.wnd := hHandle; shellinfo.wFunc := aFunc; shellinfo.fFlags := aFlags; shellinfo.pFrom := PChar(aSourceFiles+#0); shellinfo.pTo := PChar(aTargetDirectory+#0); if ProgressText <> '' then shellinfo.lpszProgressTitle := pChar(ProgressText) else Shellinfo.lpszProgressTitle := pChar('Copying'); rc := SHFileOperation(shellinfo); if (rc = 0) and shellinfo.fAnyOperationsAborted then rc := -1; Result := rc; end; function FileCopyProgress(const SourceFile, TargetFile: String; const ProgressText: String; const AppWinHandle: THandle; const Silent:Boolean): Boolean; var rc : Integer; Flags: UInt; aDate: TDateTime; awh: hWnd; begin FileAge(SourceFile,aDate); Flags := FOF_NOCONFIRMATION OR FOF_FILESONLY OR FOF_ALLOWUNDO; if Silent then begin Flags := Flags OR FOF_SILENT OR FOF_NOERRORUI OR FOF_NOCONFIRMMKDIR; awh := 0; end else awh := hWnd(AppWinHandle); rc := ShellFileOperation(awh, SourceFile, TargetFile, FO_COPY, Flags, ProgressText); DebugOut('ShellFileCopy ' + SourceFile + ' -> ' + TargetFile + ' returns rc='+IntToStr(rc)); Result := (rc = 0); if Result then begin Sleep(250); FileSetDate(TargetFile, DateTimeToFileDate(aDate)); end; end; -
Spring4D 2.0 sneak peek - the evolution of performance
Lars Fosdal replied to Stefan Glienke's topic in Tips / Blogs / Tutorials / Videos
Interesting read. About avoiding RTTI as much as possible - how is this achieved? Edit: Or rather - what tradeoffs were necessary to eliminate the RTTI dependencies? -
Introducing Spring.Benchmark - a port of Google benchmark
Lars Fosdal replied to Stefan Glienke's topic in Tips / Blogs / Tutorials / Videos
Isn't that basically the same message as the one that Herb Sutter presented years ago (2007)? “Machine Architecture: Things Your Programming Language Never Told You” Slides: https://nwcpp.org/talks/2007/Machine_Architecture_-_NWCPP.pdf -
https://developer.apple.com/xcode-cloud/ You'll still need a Mac, but you don't need to own every Apple device.
-
virtualization VMWare Workstation PRO vs MS Hyper-V
Lars Fosdal replied to Drewsky's topic in Delphi IDE and APIs
The VMware thing popped up in my feed. My gut reaction was to bring it forward. I agree - PS Remoting has risks. But - if an intruder is already inside the domain - you are already in trouble. We only allow it for some specific domain users and it is explicitly enabled for specific machines. The initiating host must be inside the domain. -
virtualization VMWare Workstation PRO vs MS Hyper-V
Lars Fosdal replied to Drewsky's topic in Delphi IDE and APIs
VMware users, patch now! https://www.bleepingcomputer.com/news/security/attackers-are-scanning-for-vulnerable-vmware-servers-patch-now/ -
https://google-developer-training.github.io/android-developer-phone-sms-course/Lesson 2/2_p_sending_sms_messages.html Has SMS access been enabled for the app in the Android settings? Also, best practices: https://stackoverflow.com/questions/32814922/why-does-android-ignore-read-sms-permission
-
Ref.1: The as operator is a checked typecast. Let's say that you have a method that takes a TObject as parameter aInstance. The difference between a simple typecast and a checked typecase is that var Unchecked := TMyClass(aInstance); will never complain, while var Unchecked := aInstance as TMyClass; will raise an exception if aInstance is not a TMyClass Also see the is operator which can be used to validate the type before the cast. if aInstance is TMyClass then (aInstance as TMyClass).SomeTMyClassMethod;
-
Fast Pos & StringReplace for 64 bit
Lars Fosdal replied to Tom de Neef's topic in Algorithms, Data Structures and Class Design
MIT license is no limit in use. -
Are there any experiences with www.experts-exchange.com ?
Lars Fosdal replied to Rollo62's topic in General Help
Most of the experts there seem to be self-appointed.