-
Content Count
1209 -
Joined
-
Last visited
-
Days Won
25
Everything posted by Sherlock
-
Is there a Sunday between 2 dates ?
Sherlock replied to Henry Olive's topic in RTL and Delphi Object Pascal
So I just noticed...well, then my code is a bit too simple. 😄 -
Is there a Sunday between 2 dates ?
Sherlock replied to Henry Olive's topic in RTL and Delphi Object Pascal
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. -
Is there a Sunday between 2 dates ?
Sherlock replied to Henry Olive's topic in RTL and Delphi Object Pascal
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/
-
Please support Stack Overflow moderators strike against AI content policy
Sherlock replied to Dalija Prasnikar's topic in Tips / Blogs / Tutorials / Videos
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. -
Please support Stack Overflow moderators strike against AI content policy
Sherlock replied to Dalija Prasnikar's topic in Tips / Blogs / Tutorials / Videos
There goes another enshittification. And we all get to watch it live and in color. -
ChatGPT about the GExperts Uses Clause Manager
Sherlock replied to dummzeuch's topic in Tips / Blogs / Tutorials / Videos
BTT: Just consider that "imaginary" Blog as a To-Do list of improvements -
I have a feeling the specifications have not been clear enough to the folks that answered, because https://stackoverflow.com/questions/76472056/exclude-specific-folder-from-file-search-in-delphi
-
FIY: Sort algorithms found by Deep learning
Sherlock replied to Tommi Prami's topic in Algorithms, Data Structures and Class Design
I read this with mixed feelings. Firstly it's cool, that reinforced learning can come up with "faster sorting" but then... It is kind of irritating, that a code review was not able to find those improvements in "ALPHA DEV swap move". -
Job Offer - 5 Delphi Devs for bit Time Professionals
Sherlock replied to Daniele Teti's topic in Job Opportunities / Coder for Hire
They are the ones that came up with all this...go figure. Back to the 100k/yr example: Everything that has been deducted so far is just taxes. What about social security (healthcare, pension, unemployment)? -
Windows ARM <> Windows x86 Windows ARM in this case is much closer to Android.
-
Please support Stack Overflow moderators strike against AI content policy
Sherlock replied to Dalija Prasnikar's topic in Tips / Blogs / Tutorials / Videos
I keep asking and keep getting responses, and when my questions where unclear or something else was lacking, this was communicated to me in a neutral tone (people who can hear a tone in any written statement are peculiar) and I fixed that. Almost all of my questions have been answered, and I myself have been able to provide an answer too...once or twice. So for me SO is a valuable resource that should not go to waste by allowing fake answers. Just how exactly does that work? Did they hack Stack Exchange to gain mod privileges? And Stack Exchange can't be bothered to check? -
"Does not seem to work" how do you deduce this? Do you see error messages, get unexpected behavior? If so, what are the errors, what behavior do you expect, and what is happening instead of that?
-
I am not blind, I know what he asked. But to just come up with code without perhaps improving the overall style or at least pointing out what is wrong with it just seems careless. But do as you please, if it makes you happy.
-
Why would anyone choose to limit reusability of a method clearly screaming for reusability by arbitrarily dropping a TListbox into the parameter list? TStringlist as a result for a function is just fine, and that can be used to fill TListbox.Items without major surgery. You whip out source code faster than I can think @programmerdelphi2k, but sometimes slowing down and perhaps not propagate code smells to obvious newcomers, seems a wiser choice.
-
What may happen, if uncomplete, unclear advices found ...
Sherlock replied to Rollo62's topic in Network, Cloud and Web
Granted, TCP/IP is not a real end-to-end connection. But the transferring nodes only get encrypted SSL traffic nowadays anyway. So that is a non-issue and has nothing to do with where real hosts and servers are located, and who is operating them. Politicians might be somewhat out of touch with reality, but in this case I am all for the GDPR. -
Definitely! For example I would not enjoy working for some weapons manufacturer. And I have no love for accounting either... I love medical devices, so that's my home. No other job would interest me, no matter what the pay or work environment.
-
Looking for RpShell, RpTable, RpDefine, RpBase, RpSystem
Sherlock replied to georges pletinckx's topic in Windows API
OK, now that is a thing. You had a license back in 2014 and somehow lost it. Perhaps that is a basis to communicate with the folks over at Nevrona. -
Decrement a value by 1 each time a function is called
Sherlock replied to Willicious's topic in Delphi IDE and APIs
Use a different event. Or only count down after a significant amount of frames... -
I split off the very recent semi on topic question to form its own thread to here:
-
Agrred. But with two StringLists whose Items correspond Item by Item there is clearly no room for interpretation. But, lets let the TE clarify... @giomach has either been overwhelmed by the answers or is carefully formulating a response right now.
-
OK, but it should be clear, that for every "C" you will always get a "Pear". Which leads to data hygiene and no use for doubles.