

FredS
Members-
Content Count
424 -
Joined
-
Last visited
-
Days Won
4
Everything posted by FredS
-
The format is \\<server>\<share>\<path> Admin shares can be accessed with <drive letter>$. After taking a closer look at what you are doing, why would 'c:' be a valid path inside a share?
-
OK, sAppName := '\\192.168.1.35\F-TestServer\C:\TestArea\Testfile.Tips'; should be sAppName := '\\192.168.1.35\F-TestServer\C$\TestArea\Testfile.Tips';
-
Some very old versions of Delphi had this issue, simple fix was to use: function MyFileExits(FileName: string): boolean; var SearchRec: TSearchRec; begin if (FindFirst(FileName, faAnyFile, SearchRec) = 0) then begin SysUtils.FindClose(SearchRec); Result := True; end else Result := False; end;
-
Modified your code to get a better look at the difference. Both Executed in Berlin 10.1.2 Ideally #1 should reach a higher WorkerThreadCount during its two minutes of execution but still the same with Rio. #3 may be an issue (also in Rio), imagine running a pile of low intensity tasks first then executing something that loads Data Modules, Databases and whatnot.. starting at the same count you left off could cause out of memory issues unless dealt with (not tested). #4 IMO is handled better in Berlin, the AverageCPUUsage delegates the Pool to drop below MinLimitWorkerThreadCount. ** RIO System.Threading unit, modified to compile in Berlin #1 Slow increase, never reached full ActiveTask Count 00:02:13.8790372 AverageCPUUsage: 35 WorkerThreadCount: 34 MinLimitWorkerThreadCount: 4 #2 Increased to 58 immediately, holds appropriate AverageCPUUsage 00:01:11.9777749 AverageCPUUsage: 90 WorkerThreadCount: 58 MinLimitWorkerThreadCount: 50 #3 Starts off with #2 WorkerThreadCount and holds appropriate AverageCPUUsage 00:01:11.8997475 AverageCPUUsage: 89 WorkerThreadCount: 58 MinLimitWorkerThreadCount: 4 #4 Does NOT hold appropriate AverageCPUUsage 00:01:35.0015869 AverageCPUUsage: 100 WorkerThreadCount: 99 MinLimitWorkerThreadCount: 99 ** Berlin System.Threading unit, modified with RSP fixes only #1 Slow increase, never reached full ActiveTask Count 00:02:13.9110588 AverageCPUUsage: 34 WorkerThreadCount: 34 MinLimitWorkerThreadCount: 4 #2 Increased to 58 immediately, holds appropriate AverageCPUUsage 00:01:11.4247095 AverageCPUUsage: 89 WorkerThreadCount: 59 MinLimitWorkerThreadCount: 50 #3 Starts off with #2 WorkerThreadCount and holds appropriate AverageCPUUsage 00:01:11.6894449 AverageCPUUsage: 88 WorkerThreadCount: 59 MinLimitWorkerThreadCount: 4 #4 Drops appropriately below MinLimitWorkerThreadCount to keep AverageCPUUsage 00:01:21.0234632 AverageCPUUsage: 88 WorkerThreadCount: 78 MinLimitWorkerThreadCount: 99 program Project2; {$APPTYPE CONSOLE} uses WinApi.Windows, System.SysUtils, System.Diagnostics, System.Threading, System.Classes, System.TimeSpan; var SW : TStopWatch; ActiveTasksTicks : Int64; const SleepMs = 100; SleepCycles = 333; HighPrime = 100 * 1000; function IsPrime(const Value: Integer): Boolean; {$REGION 'History'} // 18-Jul-2018 - From a Parallel Task example {$ENDREGION} var Test, k: Integer; begin if Value <= 3 then IsPrime := Value > 1 else if ((Value mod 2) = 0) or ((Value mod 3) = 0) then IsPrime := False else begin IsPrime := True; k := Trunc(Sqrt(Value)); Test := 5; while Test <= k do begin if ((Value mod Test) = 0) or ((Value mod (Test + 2)) = 0) then begin IsPrime := False; break; { jump out of the for loop } end; Test := Test + 6; end; end; end; procedure TestParallel; var TaskArray: array [1..100] of ITask; Ticks : Int64; i : integer; begin for I := Low(TaskArray) to High(TaskArray) do TaskArray[I] := TTask.Create(procedure var s, p: integer; Succeeded : Boolean; {* GetActiveTasks *} function GetActiveTasks: integer; var i : integer; begin Result := 0; for i := Low(TaskArray) to High(TaskArray) do if (TaskArray[i].Status = System.Threading.TTaskStatus.Running) then begin Inc(Result); end; end; begin for s := 1 to SleepCycles do begin Ticks := ActiveTasksTicks; if (Ticks + TTimeSpan.TicksPerSecond) < SW.ElapsedTicks then begin System.AtomicCmpExchange(ActiveTasksTicks, SW.ElapsedTicks, Ticks, Succeeded); if Succeeded then begin Write(#13 + Format('ActiveTasks: %3.d, CPU: %3.d%%', [GetActiveTasks, TThreadPoolStats.Current.CurrentCPUUsage])); end; end; Sleep(SleepMs); for p := 1 to HighPrime do isPrime(p); end end).Start; TTask.WaitForAll(TaskArray); end; procedure TestTasks(AMinWorkerThreads : integer); var TPS : TThreadPoolStats; begin ActiveTasksTicks := 0; SW := TStopWatch.StartNew; TThreadPool.Default.SetMinWorkerThreads(AMinWorkerThreads); TestParallel; Write(#13 + StringOfChar(' ', 72)); WriteLn(#13 + SW.Elapsed.ToString); TPS := TThreadPoolStats.Default; WriteLn('AverageCPUUsage: ', TPS.AverageCPUUsage); WriteLn('WorkerThreadCount: ', TPS.WorkerThreadCount); WriteLn('MinLimitWorkerThreadCount: ', TPS.MinLimitWorkerThreadCount); WriteLn; end; begin TestTasks(TThread.ProcessorCount); TestTasks(50); TestTasks(TThread.ProcessorCount); TestTasks(99); ReadLn; end.
-
getit Can't reinstall package when previous was installed, new installed, then old removed
FredS replied to Mr. E's topic in General Help
Good solution here -
Same as before.. I see a bunch of bugs that occur on every first release of a new version, so no way is any of that run through any kind of testing. Throughout the year bugs reported outstrip bugs solved by anywhere from 5-8:1 As was explained by another poster, we don't know the actual bugs on the internal system. Yet have become Alpha testers for new releases. Obediently posting bugs that where posted before because of internal testing failure. With the CE edition new releases are quickly evaluated and bugs are reported, my bet is that by the 30 day mark we will be close to equal on this chart: 30 Day Summary The thing is, there are some brilliant Delphi users, and when your read some of those Quality Central reports they come with ways to reproduce and in some cases needed code changes.. yet aren't implemented, sometimes for years.. Draw your own conclusion, your mileage may vary..
-
Nothing like a little 'Lipstick' 🙂
-
Sure, but your clients will understand that the most important part of developing is the new skins 🙂
-
Speed up reading multiple text files
FredS replied to dummzeuch's topic in RTL and Delphi Object Pascal
Ignore -
That whole scenario becomes unusable if you RDP into a VM.. essentially they broke something that was working instead of fixing stuff that's been broken for years..
-
Never, I use Beyond Compare, hook up to both registry trees and copy/merge at will. BC even allows me to alter the paths after I copy. Been using that since Seattle.
-
Removing the package via 'Component>Install Packages' then adding it back worked for me.
-
Fair enough, of course Berlin works fine, at least after implementing a 'Clean' strategy I stumbled upon.
-
Normally I just leave things as they are because pushing a string gets really boring. But in this case I'd like to clear a couple of things up, perhaps I'm not grasping the 'whole'.. Other than a few milliseconds lost by the compiler, is there any penalty in the final code? Because I can't time it, I have spent a bit of effort on that and I see no issues. If that is the case then this whole cyclical issue falls right along with using 'with' doesn't it ? I mean try and get a DX based project out the door without using 'with'.. We can't really have interface cyclical units because the compiler barks, yet we can't have implementation cyclical units because of CodeInsight? What came first cyclical re-engineering cult or CodeInsight not working?
-
Right, so a real project does that because it was put together RAD style where code reuse is king. Wasn't the motto on the Delphi 2 box/sleeve: Encapsulate and Reuse.. Reminds me of my favorite solutions: Reinstall Windows Recreate the dproj file Recreate the Whole Project Rewrite using loose coupling so CodeInsight even comes up ErrorInsight, 'Don't use that'.. Reinstall the IDE How come Andy could fix a good chunk of that without source and for free with IDE Fix Pack?
-
Yeah, because EMBT doesn't have access to redundant servers? Or perhaps not ones that have an up to date certificate..
-
Right, so the easiest thing for me was to find their Github sources and use those instead of GetIt will do the same because time is money. But you can't do that for CodeSite and that didn't show up in Rio GetIt at all yesterday..
-
For..to..step in Delphi
FredS replied to Primož Gabrijelčič's topic in Tips / Blogs / Tutorials / Videos
From Marco: Stepping through Values in a Delphi for Loop There has been a recent request to add to for loop in the Object Pascal language the ability to add a step, that is an increment different from one. Here is an alternative implementation using a for..in loop and a custom enumerator. -
No idea, I've moved back to Berlin when it became clear using Tokyo was a waste of time.
-
Had to use this to install Raize in Tokyo myself.. https://stackoverflow.com/questions/32740940/how-to-reset-the-download-when-the-getit-package-manager-fails
-
New in 10.3: Improvements to the Options dialogs
FredS replied to David Millington's topic in Delphi IDE and APIs
I don't see the 'Information for <project>' dialog in that list. Surely this dialog is important, it supplies a list of all packages required without going through the parsing spiel documented in the help file but is missing the 'Copy' feature.. -
Managing Version Information Across Builds
FredS replied to Nathan Wild's topic in Delphi IDE and APIs
There is " Set Project Versioninfo " from DDevExtensions 2.84 -
I just tried that and it failed in a complex unit. When I move that out into a simple demo it works with INLINE but otherwise fails. So now I have a MAP file showing me that all these methods are in the EXE even though they have been turned INLINE, while the simplistic demo works. I have used the INC file which is used in the complex unit in the simple one and still all works. So at best we can say this works only sometimes.. surely a reason for bloated EXEs..
-
You can override the form's Loaded method. At that point the values of the control will be those stored in the DFM.