-
Content Count
1198 -
Joined
-
Last visited
-
Days Won
24
Posts posted by Sherlock
-
-
Just out of curiosity: What kind of software are you developing and what kind of customers do you have, that causes them to check if your software runs on a more or less early beta of iOS? Most customers I know of, don't care about the installed iOS version and aren't even aware of impending new ones.
-
Considering most of the installers known to me don't care about this particular issue, I would weigh cost against benefit and end up letting it go. But then again, I'm not nearly as ambitious as I used to be 10 years ago.
-
It does support POSIX and macOS, so perhaps iOS as well. I am afraid Android is not officially supported though. So perhaps for mobile devices you could go Indy.
-
Well, usually a new iOS version strangely precedes a new Delphi release. I would not count on anything other than the beta of said release to maybe fix that issue beforehand.
-
-
Hi 😉
So over here I found one thread concerning System.Net.Socket. Sadly there is no use of AsyncCallback in there:
But it looks pretty straight forward to me: implement either callback event handler or method and use that as a parameter for BeginReceive. What is your code so far, and where do you get errors/are you stuck?
-
-
I wonder what Embarcadero would call a procedure with a return type...
Has anyone created a ticket yet?
-
It's a shame this thread slipped into a gender debate unnoticed. Sorry about that.
BTT:
- 1
-
Not to be "that guy" but, um... it would seem my initial dates where indeed ISO 8601 formatted. So my guess now is that the DUnitX used in D11.3 is more than two years old?
-
OK, so it's a locale settings issue. Apparently the DUnitX tests do something to the date format, that catch this. As soon as I use my native german date format, it works. Hrmpf
[TestCase('Test Do-Sa', '22.06.2023 17:44:23.456, 24.06.2023 17:44:23.456, 0')]
And @Der schöne Günther I will do just that then. Thank you!
-
As the title says, I'm having trouble with running a unit test to test dates. So here is my test:
[TestFixture] TMyTestClass = class public [Test] // Test with TestCase Attribute to supply parameters. [Test] [TestCase('Test Thu-Sat', '2023-06-22 17:44:23.456, 2023-06-24 17:44:23.456, 0')] [TestCase('Test Thu-Sun', '2023-06-22 17:44:23.456, 2023-06-25 17:44:23.456, 1')] procedure Test(const AValue1: TDateTime; const AValue2: TDateTime; const AExp: Integer); end; procedure TMyTestClass.Test(const AValue1, AValue2: TDateTime; const AExp: Integer); begin Assert.IsTrue(Unit34.CheckForDates(AValue1, AValue2) = AExp); end;
Now when I run this it alwas behaves as though the dates are not translated correctly. And sure enough the debugger says both AValues are 1899. When I run DUnitXs own Test - specifically the DUnitX.Tests.Example.pas the date there gets translated just fine. And the keen eye might notice the same time in my code as in DUnitXs...I copied and only changed the date. What am I doing wrong?
-
9 minutes ago, mvanrijnen said:needs a check for friday-monday
oh, darnit!
-
@mvanrijnen Ooh, that is cool. And easy enough to convert to Delphi:
Quotefunction CheckForSundays(StartDate, EndDate: TDateTime): Integer; begin // (DaysBetween(D2, D1) div 7) + ifthen(DayOfTheWeek(D1)=daySunday,1,0) ) + ifthen(DayOfTheWeek(D2)=daySunday,1,0) Result := (DaysBetween(EndDate, StartDate) div 7) - IfThen(StartDay = EndDay, 1, 0); Result := Result + IfThen(DayOfWeek(StartDate) = 1, 1, 0); Result := Result + IfThen(DayOfWeek(EndDate) = 1, 1, 0); end;
IfThen being in System.Math and DaysBetween in System.DateUtils.
Edith has fixed extra sundays counted.
-
Just now, Uwe Raabe said:BTW, despite the title says, according to the examples in his post the OP seems to be more interested in the number of Sundays instead of just their existence.
So I just noticed...well, then my code is a bit too simple. 😄
-
uses System.DateUtils; function CheckForSunday(StartDate, EndDate: TDateTime): Boolean; var StartDay: Integer; EndDay: Integer; begin Result := Daysbetween(StartDate, EndDate) >= 7; if not Result then begin StartDay := DayofWeek(StartDate); EndDay := DayofWeek(EndDate); if (StartDay <= EndDay) then begin Result := (1 >= StartDay) and (1 <= EndDay) end else Result := True; end; end;
OK, how does this look? I do have the assumption though, that StartDate lies before EndDate, saving one or two comparison steps.
-
Well SysUtils has a nifty function called DayOfWeek. It returns Integers between 1 and 7 where 1 is Sunday and Saturday is 7. The rest is simple.
You might try @Lajos Juhász AI quote, or may get even shorter code by checking if 1 is in the range between StartDate and EndDate.
-
Definitely not XCode 15 😞
-
I'm stuck on Monterey, because my MacBook is from late 2015. But I'm still quite happy with it.
-
Voted.
I guess noone uses shortcuts anymore. Especially FMX applications tend to be distributed for Android or iOS. No shortcuts there...only gestures and taps. So this might really be an oversight due to lack of use.
-
Oh, but hold your horses, because MDI will get a lot of attention in the upcoming release: https://blogs.embarcadero.com/whats-coming-in-delphi-and-cbuilder-libraries/
-
I'm pretty sure any Army employing women as fighter pilots has put them through the same tests and training as men, it would be recklessly stupid otherwise. That said, I am still convinced that the strongest man is stronger than the strongest woman. As can be seen in sports - athletics specifically. But our line of work is not really physically challenging, is it? Lets just concentrate on that.
-
-
BTT: Just consider that "imaginary" Blog as a To-Do list of improvements
Replacement for TBits?
in RTL and Delphi Object Pascal
Posted
@Rollo62Consider the amount of data processed at CERN according to https://home.web.cern.ch/science/computing they process more than 30PB a year. Another example may come from Astrophysics' EHT with enormous data https://eventhorizontelescope.org/technology gathered simultaneously all over the world and then correlated in Bonn and at MIT. Off the top of my head just two examples with really high volume data. I learned not to question the why...the who might be interesting though, if the OP may reveal it.
In the end 300 Billion Bits are a mere 37,5 Gigabytes, BTW.