Jump to content

mvanrijnen

Members
  • Content Count

    489
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by mvanrijnen

  1. Hello, I just had to work on a project for the first time in D11.3, it uses TRestclient against the MSGRaph API. Now i'm getting error 12029, probably some TLS problem, anyone got a quick solution? Tried, .SecurityProtocols := [TLS12, TLS13] etc. not working Running on Windows 11 (21H2), updating to 22H2 right now.
  2. pff found it, there was a proxy server forced in debug mode.
  3. During the Execute of the post to get the token. 'https://login.microsoftonline.com/[clientname].onmicrosoft.com/oauth2/v2.0/token'
  4. mvanrijnen

    search between two dates

    I always use DateOf when assigning a TDate to a date field in a sql query. It's sometimes hard to know if somehow a time part was added to a date value. So just to be sure i do a lot of: (especially when the TDate field/param is in a SQL select statement) procedure DoMyUpdate(const AMyDateParameter : TDate); begin qry.ParamByName('MyDateParameter').AsDate := DateOf(AMyDateParameter); ... end; or if needed (eg in a loop) extract the Date value outside the loop: procedure DoMyUpdate(const AMyDateParameter : TDate); var myRealDateVar : TDate; begin myRealDateVar := DateOf(AMyDateParameter); while i<cnt do begin .... .... qry.ParamByName('MyDateParameter').AsDate := myRealDateVar; inc(i); ..... end;
  5. mvanrijnen

    Is there a Sunday between 2 dates ?

    working on it:) (wait for a batchjob to finish 🙂 so, can play around) UWE's method seems okay though
  6. mvanrijnen

    Is there a Sunday between 2 dates ?

    needs a check for friday-monday
  7. mvanrijnen

    Is there a Sunday between 2 dates ?

    Yes, just experiented in Excel 🙂 pseudo: (DaysBetween(D2, D1) div 7) + ifthen(DayOfTheWeek(D1)=daySunday,1,0) ) + ifthen(DayOfTheWeek(D2)=daySunday,1,0) hmz, one off in some cases. pseudo (2): sundaycount := (DaysBetween(D2, D1) div 7); if (DayOfTheWeek(D1)=daySunday) or (DayOfTheWeek(D2)=daySunday) then sundaycount = sundaycount + 1; back to the drawing board 🙂
  8. mvanrijnen

    Delphi REST frameworks that run on Linux?

    MARS is also (according to: MARS-Curiosity REST Library - Delphi-PRAXiS [en] (delphipraxis.net)) compatible with linux, it seems to work on all Delphi targets so.
  9. mvanrijnen

    Delphi REST frameworks that run on Linux?

    Things like: * RadServer * MARS
  10. Yes would be nice if they changed this to store it at project level. Would like to see this for the debug watches also.
  11. Yes on the last dutch Delphi event from EMB (via Bransten) this was said to. Also they said that EMB is busy with an update so existing MDI apps will still run & function correctly. (i think they gonna implement the parts which MS dropped). see also":
  12. mvanrijnen

    Delphi / TCP/IP Server

    besides the threadsafety and the question if this is the best solution, probably your memo is getting "full", try to limit the total lines in the memo to for example max. 1000lines, and do the update between beginupdtae and endupdate. With which intensivity the clients send data )(e,.g. 100 times per second)? function TFServer.cliInfoMessage(info: TMemo; send, msg: string): Boolean; begin TThread.Queue(nil, procedure begin info.lines.BeginUpdate(); try info.Lines.Append('/' + send + '/' + msg); while info.lines.count>1000 do info.lines.delete(0); finally info.lines.EndUpdate(); end; end); result := true; end;
  13. mvanrijnen

    Delphi / TCP/IP Server

    I'm reasonably sure that you can accomplish this with Indy. You have multiple clients sending data to a single indy server i assume? Maybe you have some memory problems, not correct handling incoming connections and or data?
  14. Would be a possibility for the parts that don't touch/need our BL indeed.
  15. Still running production with the DEV Console, we are (for sure 90%) moving away from RadServer, It gives us no pro's/extra's only problems and con's. We're looking at something like MARS to develop our (micro)services.
  16. mvanrijnen

    File Search

    @programmerdelphi2k I believe the findclose needs to be executed when the findfirst succeeds, otherwise not.
  17. mvanrijnen

    File Search

    and if you stay with the findfirst/findnext solution, do not forget the findclose 🙂
  18. mvanrijnen

    File Search

    TStringDynArray, i believe its defined in the unit "System.Types". you call this function for example with: FindFilesWithPatttern('C:\MyFolder', '*.sys'); // get all the .sys files FindFilesWithPatttern('C:\MyFolder', 'myfile.txt'); // get the myfile.txt file(s) (maybe for your example u should use an overload of the TDIrectory.GetFiles method which also recurs over the (sub)folders. the line: files := TDirectory.GetFiles(directoryPath, filePattern); you change in: files := TDirectory.GetFiles(directoryPath, filePattern, TSearchOption.soAllDirectories); for that. As said before by someone else, a filemask can also be a full filename.
  19. mvanrijnen

    File Search

    The "ChatGPT" solution: Question: uses System.SysUtils, System.IOUtils; procedure FindFilesWithPattern(const directoryPath, filePattern: string); var files: TStringDynArray; fileName: string; begin try files := TDirectory.GetFiles(directoryPath, filePattern); for fileName in files do Writeln(fileName); except on E: Exception do Writeln('An error occurred: ' + E.Message); end; end; Explanation from ChatGPT:
  20. mvanrijnen

    File Search

    Why not use (in unit System.IOUtils), TDirectory.GetFiles(), see: System.IOUtils.TDirectory.GetFiles - RAD Studio API Documentation (embarcadero.com) (i think it's better to use those functions because you do not know how to use findfirst/next etc correctly)
  21. mvanrijnen

    File Search

    Why not use (in unit System.IOUtils), TDirectory.GetFiles(), see: System.IOUtils.TDirectory.GetFiles - RAD Studio API Documentation (embarcadero.com)
  22. mvanrijnen

    MAP2PDB - Profiling with VTune

    Just a quick question is the 16Mb limit still valid for the tool? i keep getting: "Cannot locate debugging information for file `D:\Data\company\Delphi\Projects\SVN\appname4\Clients\appname\Win32\Debug\appname.exe'. Cannot match the module with the symbol file `D:\Data\company\Delphi\Projects\SVN\appname4\Clients\appname\Win32\Debug\appname.pdb'. Make sure to specify the correct path to the symbol file in the Binary/Symbol Search list of directories." While the .pdb is there. (i replaced the msdia dll) works, replaced the wrong msdia.dll 🙂
  23. Just trying to put the first tests for using MARS to our testserver, getting this from the BitDefender there: "Malware: DeepScan:Generic.EmotetK.D02D57D4 File Path: C:\Program Files (x86)\Company\myservicename.exe" We the only one with this problem? anyone a solution? (except white listing all the coming executables)
  24. The result of the "console" version of that file (original is a service): VirusTotal - File - 7f7461788afdcbf62851b388ae8078fb96f1536897891beaa424b83acb4c0a37 so somehow it seems like a combination of using MARS in a service, combined with some of our own stuff 🙂 Here is the MARS Helloworld example, result: https://www.virustotal.com/gui/file/81b5df036d3e194d2275bafc50a40830d585f4fa86d05e185bb2d4277796ec5f?nocache=1 end as last, a simple helloworld (writeln), console result: VirusTotal - File - a0011e091fca526d855541185805f8a28c2cb5543b42c32241edd091b4fc1dfe
  25. Yes, its a false positive, we have like few hundred delphi compiled executables, here's the virustotal link: VirusTotal - File - 871ae239973e56fe9e62ee15bff3cdaec454871c0948db71c1241bca9315477d But ok, it's not a common thing for programs including MARS. thats what i wanted to know.
×